mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
Otherwise bridges can end up with a generated MAC address using Nicira OID which has an impact when using DHCP on that devices. tests/interface-reconfigure.at updated by Ben Pfaff. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -653,8 +653,8 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration
|
|||||||
--with-iface --if-exists del-port eth2
|
--with-iface --if-exists del-port eth2
|
||||||
--may-exist add-br xenbr2
|
--may-exist add-br xenbr2
|
||||||
--may-exist add-port xenbr2 eth2
|
--may-exist add-port xenbr2 eth2
|
||||||
|
set Bridge xenbr2 other-config:hwaddr="00:15:17:a0:29:80"
|
||||||
br-set-external-id xenbr2 network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
|
br-set-external-id xenbr2 network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
|
||||||
set Interface xenbr2 MAC="00:15:17:a0:29:80"
|
|
||||||
/sbin/ifup xenbr2
|
/sbin/ifup xenbr2
|
||||||
/sbin/update-issue
|
/sbin/update-issue
|
||||||
Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
|
Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
|
||||||
@@ -716,8 +716,8 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration
|
|||||||
--with-iface --if-exists del-port eth3
|
--with-iface --if-exists del-port eth3
|
||||||
--may-exist add-br xenbr3
|
--may-exist add-br xenbr3
|
||||||
--may-exist add-port xenbr3 eth3
|
--may-exist add-port xenbr3 eth3
|
||||||
|
set Bridge xenbr3 other-config:hwaddr="00:15:17:a0:29:81"
|
||||||
br-set-external-id xenbr3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
|
br-set-external-id xenbr3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
|
||||||
set Interface xenbr3 MAC="00:15:17:a0:29:81"
|
|
||||||
--if-exists del-br xapi3
|
--if-exists del-br xapi3
|
||||||
--may-exist add-br xapi3 xenbr3 123
|
--may-exist add-br xapi3 xenbr3 123
|
||||||
br-set-external-id xapi3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
|
br-set-external-id xapi3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
|
||||||
@@ -801,8 +801,8 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration
|
|||||||
--with-iface --if-exists del-port bond0
|
--with-iface --if-exists del-port bond0
|
||||||
--fake-iface add-bond xapi1 bond0 eth0 eth1
|
--fake-iface add-bond xapi1 bond0 eth0 eth1
|
||||||
set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
|
set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
|
||||||
|
set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
|
||||||
br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
||||||
set Interface xapi1 MAC="00:22:19:22:4b:af"
|
|
||||||
/sbin/ifup xapi1
|
/sbin/ifup xapi1
|
||||||
action_up: bring up bond0
|
action_up: bring up bond0
|
||||||
/sbin/ifconfig bond0 up
|
/sbin/ifconfig bond0 up
|
||||||
@@ -882,8 +882,8 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
|
|||||||
--with-iface --if-exists del-port bond0
|
--with-iface --if-exists del-port bond0
|
||||||
--fake-iface add-bond xapi1 bond0 eth0 eth1
|
--fake-iface add-bond xapi1 bond0 eth0 eth1
|
||||||
set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
|
set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
|
||||||
|
set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
|
||||||
br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
||||||
set Interface xapi1 MAC="00:22:19:22:4b:af"
|
|
||||||
--if-exists del-br xapi2
|
--if-exists del-br xapi2
|
||||||
--may-exist add-br xapi2 xapi1 4
|
--may-exist add-br xapi2 xapi1 4
|
||||||
br-set-external-id xapi2 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
br-set-external-id xapi2 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
|
||||||
|
|||||||
@@ -297,6 +297,10 @@ def configure_datapath(pif):
|
|||||||
vsctl_argv += ['# add physical device %s' % iface]
|
vsctl_argv += ['# add physical device %s' % iface]
|
||||||
vsctl_argv += ['--', '--may-exist', 'add-port', bridge, iface]
|
vsctl_argv += ['--', '--may-exist', 'add-port', bridge, iface]
|
||||||
|
|
||||||
|
vsctl_argv += ['# configure Bridge MAC']
|
||||||
|
vsctl_argv += ['--', 'set', 'Bridge', bridge,
|
||||||
|
'other-config:hwaddr=%s' % vsctl_escape(db().get_pif_record(pif)['MAC'])]
|
||||||
|
|
||||||
vsctl_argv += set_br_external_ids(pif)
|
vsctl_argv += set_br_external_ids(pif)
|
||||||
vsctl_argv += ['## done configuring datapath %s' % bridge]
|
vsctl_argv += ['## done configuring datapath %s' % bridge]
|
||||||
|
|
||||||
@@ -337,10 +341,6 @@ def set_br_external_ids(pif):
|
|||||||
vsctl_argv += ['--', 'br-set-external-id', pif_bridge_name(pif),
|
vsctl_argv += ['--', 'br-set-external-id', pif_bridge_name(pif),
|
||||||
'network-uuids', ';'.join(xs_network_uuids)]
|
'network-uuids', ';'.join(xs_network_uuids)]
|
||||||
|
|
||||||
vsctl_argv += ['# configure MAC']
|
|
||||||
vsctl_argv += ['--', 'set', 'Interface', pif_ipdev_name(pif),
|
|
||||||
'MAC=%s' % vsctl_escape(dprec['MAC'])]
|
|
||||||
|
|
||||||
return vsctl_argv
|
return vsctl_argv
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -374,6 +374,8 @@ class DatapathVswitch(Datapath):
|
|||||||
vsctl_argv += c
|
vsctl_argv += c
|
||||||
extra_ports += e
|
extra_ports += e
|
||||||
|
|
||||||
|
dpname = pif_bridge_name(self._dp)
|
||||||
|
|
||||||
if pif_is_vlan(self._pif):
|
if pif_is_vlan(self._pif):
|
||||||
# XXX this is only needed on XS5.5, because XAPI misguidedly
|
# XXX this is only needed on XS5.5, because XAPI misguidedly
|
||||||
# creates the fake bridge (via bridge ioctl) before it calls us.
|
# creates the fake bridge (via bridge ioctl) before it calls us.
|
||||||
@@ -382,7 +384,7 @@ class DatapathVswitch(Datapath):
|
|||||||
# configure_datapath() set up the underlying datapath bridge.
|
# configure_datapath() set up the underlying datapath bridge.
|
||||||
# Stack a VLAN bridge on top of it.
|
# Stack a VLAN bridge on top of it.
|
||||||
vsctl_argv += ['--', '--may-exist', 'add-br',
|
vsctl_argv += ['--', '--may-exist', 'add-br',
|
||||||
bridge, pif_bridge_name(self._dp), pifrec['VLAN']]
|
bridge, dpname, pifrec['VLAN']]
|
||||||
|
|
||||||
vsctl_argv += set_br_external_ids(self._pif)
|
vsctl_argv += set_br_external_ids(self._pif)
|
||||||
|
|
||||||
@@ -392,6 +394,11 @@ class DatapathVswitch(Datapath):
|
|||||||
vsctl_argv += ["# reconfigure ipdev %s" % ipdev]
|
vsctl_argv += ["# reconfigure ipdev %s" % ipdev]
|
||||||
vsctl_argv += ['--', 'add-port', bridge, ipdev]
|
vsctl_argv += ['--', 'add-port', bridge, ipdev]
|
||||||
|
|
||||||
|
if ipdev != dpname:
|
||||||
|
vsctl_argv += ['# configure Interface MAC']
|
||||||
|
vsctl_argv += ['--', 'set', 'Interface', pif_ipdev_name(self._pif),
|
||||||
|
'MAC=%s' % vsctl_escape(dprec['MAC'])]
|
||||||
|
|
||||||
self._vsctl_argv = vsctl_argv
|
self._vsctl_argv = vsctl_argv
|
||||||
self._extra_ports = extra_ports
|
self._extra_ports = extra_ports
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user