openvswitch vlan_mode and native vlans

2,734 views
Skip to first unread message

anton

unread,
Jul 21, 2016, 8:37:35 PM7/21/16
to ganeti
Hi,

i have instance network interface configured like this:

gnt-instance modify --net 0:vlan=.29:10:20:30 instance

...
  NICs:
    - nic/0:
      MAC: aa:00:00:4c:22:e2
      IP: None
      mode: openvswitch
      link: switch0
      vlan: .29:10:20:30
      network: None
      UUID: e2b0ada7-6904-4062-bc43-0c0e9cfb8868
      name: None
...

so, i'm expecting vlan_mode=native-untagged on corresponding tap interface, but vlan_mode is clear and traffic does not pass through interface... 

ovs-vsctl list port tap5
_uuid               : cea62234-6777-4787-8307-d0fedaa7514d
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [51b4b9df-4a10-420c-9a9d-3a619642e81d]
lacp                : []
mac                 : []
name                : "tap5"
other_config        : {}
qos                 : []
statistics          : {}
status              : {}
tag                 : 29
trunks              : [10, 20, 30]
vlan_mode           : []

what i do wrong? ))

Thanks a lot

candlerb

unread,
Jul 22, 2016, 7:15:51 AM7/22/16
to ganeti
You'll need to include:
* ganeti version
* openvswitch version
* OS version
...if you want anyone to be able to reproduce this or fix it.

Looking at the ovs documentation, I agree with you:

If vlan_mode is blank then it will default to "access" or "trunk". It's not 100% clear which it will choose in your case, i.e. when both "tag" and "trunks" are non-empty.

I also agree that "native-untagged" is what you want.

Can I suggest you try manually changing the port to "native-untagged" and see if traffic flows over both untagged and tagged VLANs. If so then you can raise a ticket to get it fixed.

Alternatively, see if you can make a patch yourself. I see code in both lib/backend.py (ConfigureOVS, which only adds ports), and in tools/net-common.in:

    # From gnt-instance man page vlan should be either .VLAN_ID or VLAN_ID
    ACPORT=${VLAN%%:*}  # remove any trunk info
    [ -n "$ACPORT" ] && ovs-vsctl set port $INTERFACE tag=${ACPORT#.}
    # Set up trunk port
    # From gnt-instance man page vlan should be :VLAN_ID[:VLAN_ID2..]
    TRUNKS=${VLAN#.*:}  # remove any access info
    [ -n "$TRUNKS" ] && ovs-vsctl set port $INTERFACE trunks=${TRUNKS//:/,}

I think this looks to be the place you'd set the mode if both ACPORT and TRUNKS are set.

Regards,

Brian.
Reply all
Reply to author
Forward
0 new messages