Skip to content

Conversation

@robhoes
Copy link
Member

@robhoes robhoes commented Feb 21, 2019

…nabled

The function destroy_existing_vlan_bridge is called from Bridge.create if
the bridge to be created is for a VLAN. The purpose is to get rid of any
existing bridge for the same VLAN but with a different name. This was not
working properly if case the enic workaround is in place, and the Linux bridge
backend is used.

The main use of this is installing a host with the management interface on a
VLAN, where early in the host boot process, xcp-networkd creates a temporary
bridge for the VLAN, called xentemp. This is because xcp-networkd does not
yet know the final name of the VLAN bridge, which is determined later by xapi.
When firstboot scripts run, a VLAN is created through xapi, with a new bridge
name that is meant to replace the xentemp bridge.

For example, for VLAN 123, the output of brctl show would be like this after
xcp-network has started:

bridge name        bridge id                STP enabled       interfaces
xenbr0             8000.0cc47ae6872c        no                eth0
xentemp            8000.0cc47ae6872d        no                eth0.123

The desired state after the firstboot scripts run is:

bridge name        bridge id                STP enabled       interfaces
xenbr0             8000.0cc47ae6872c        no                eth0
xapi0              8000.0cc47ae6872d        no                eth0.123

Now, the problem occurred when running on a Cisco UCS host, with the "enic
workaround" enabled. What happens then, is that not the eth0, but a VLAN0
device eth0.0 is added to the "parent" bridge xenbr0:

bridge name        bridge id                STP enabled       interfaces
xenbr0             8000.0cc47ae6872c        no                eth0.0
xentemp            8000.0cc47ae6872d        no                eth0.123

The function destroy_existing_vlan_bridge did not take this into account. It
is fixed by push the call to this function further down into Bridge.create,
below the point where the enic workaround has been dealt with. It turned out
easier to split the function into separate OVS and Linux bridge versions.

Signed-off-by: Rob Hoes [email protected]

…nabled

The function `destroy_existing_vlan_bridge` is called from `Bridge.create` if
the bridge to be created is for a VLAN. The purpose is to get rid of any
existing bridge for the same VLAN but with a different name. This was not
working properly if case the enic workaround is in place, and the Linux bridge
backend is used.

The main use of this is installing a host with the management interface on a
VLAN, where early in the host boot process, xcp-networkd creates a temporary
bridge for the VLAN, called `xentemp`. This is because xcp-networkd does not
yet know the final name of the VLAN bridge, which is determined later by xapi.
When firstboot scripts run, a VLAN is created through xapi, with a new bridge
name that is meant to replace the `xentemp` bridge.

For example, for VLAN 123, the output of `brctl show` would be like this after
xcp-network has started:

    bridge name        bridge id                STP enabled       interfaces
    xenbr0             8000.0cc47ae6872c        no                eth0
    xentemp            8000.0cc47ae6872d        no                eth0.123

The desired state after the firstboot scripts run is:

    bridge name        bridge id                STP enabled       interfaces
    xenbr0             8000.0cc47ae6872c        no                eth0
    xapi0              8000.0cc47ae6872d        no                eth0.123

Now, the problem occurred when running on a Cisco UCS host, with the "enic
workaround" enabled. What happens then, is that not the eth0, but a VLAN0
device eth0.0 is added to the "parent" bridge xenbr0:

    bridge name        bridge id                STP enabled       interfaces
    xenbr0             8000.0cc47ae6872c        no                eth0.0
    xentemp            8000.0cc47ae6872d        no                eth0.123

The function `destroy_existing_vlan_bridge` did not take this into account. It
is fixed by push the call to this function further down into `Bridge.create`,
below the point where the enic workaround has been dealt with. It turned out
easier to split the function into separate OVS and Linux bridge versions.

Signed-off-by: Rob Hoes <[email protected]>
@robhoes
Copy link
Member Author

robhoes commented Feb 21, 2019

Hint: it is best to review the diff with whitespace suppressed.

@robhoes robhoes merged commit 946a967 into xapi-project:master Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants