Commit 4e1aea8
committed
CA-311211: Fix destroy_existing_vlan_bridge when enic workaround is enabled
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]>1 parent cd5df52 commit 4e1aea8
1 file changed
+39
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
617 | 612 | | |
618 | 613 | | |
619 | 614 | | |
| |||
624 | 619 | | |
625 | 620 | | |
626 | 621 | | |
627 | | - | |
628 | 622 | | |
629 | 623 | | |
630 | 624 | | |
| |||
668 | 662 | | |
669 | 663 | | |
670 | 664 | | |
| 665 | + | |
671 | 666 | | |
672 | 667 | | |
673 | 668 | | |
| |||
696 | 691 | | |
697 | 692 | | |
698 | 693 | | |
| 694 | + | |
699 | 695 | | |
700 | 696 | | |
701 | 697 | | |
| |||
0 commit comments