Ondřej Svoboda has uploaded a new change for review.
Change subject: _addNetwork: never try to set mtu=None to an existing bridge
......................................................................
_addNetwork: never try to set mtu=None to an existing bridge
On my EL6 host I tried to configure the 'ovirtmgmt' network manually, so it
becomes a libvirt network (and in this case I would be able to reproduce
a case when a gateway is duplicated by our dynamic source route thread).
vdsClient -s 0 setupNetworks 'networks={ovirtmgmt:{nic:eth0,bootproto:dhcp}}'
The command failed, however (Unexpected exception):
MainProcess|Thread-1000::INFO::2015-02-18
10:55:08,731::api::304::root::(_addNetwork) Adding network ovirtmgmt with
vlan=None, bonding=None, nics=[u'eth0'], bondingOptions=None, mtu=None,
bridged=True, defaultRoute=True,options={u'bootproto': u'dhcp',
'implicitBonding': True}
MainProcess|Thread-1000::DEBUG::2015-02-18
10:55:08,732::ifcfg::460::root::(_persistentBackup) backing up ifcfg-ovirtmgmt:
DEVICE=ovirtmgmt
ONBOOT=yes
TYPE=Bridge
DELAY=0
STP=off
BOOTPROTO=dhcp
MTU=1500
DEFROUTE=yes
NM_CONTROLLED=no
HOTPLUG=no
MainProcess|Thread-1000::DEBUG::2015-02-18
10:55:08,733::utils::623::root::(execCmd) /sbin/ip link set dev eth0 mtu None
(cwd None)
MainProcess|Thread-1000::DEBUG::2015-02-18
10:55:08,738::utils::643::root::(execCmd) FAILED: <err> = 'Error: argument
"None" is wrong: Invalid "mtu" value\n\n'; <rc> = 255
MainProcess|Thread-1000::ERROR::2015-02-18
10:55:14,507::supervdsmServer::108::SuperVdsm.ServerCallback::(wrapper) Error
in setupNetworks
Traceback (most recent call last):
File "/usr/share/vdsm/supervdsmServer", line 106, in wrapper
res = func(*args, **kwargs)
File "/usr/share/vdsm/supervdsmServer", line 203, in setupNetworks
return setupNetworks(networks, bondings, **options)
File "/usr/share/vdsm/network/api.py", line 855, in setupNetworks
logger, _netinfo)
File "/usr/share/vdsm/network/api.py", line 690, in _add_missing_networks
implicitBonding=True, _netinfo=_netinfo, **d)
File "/usr/share/vdsm/network/api.py", line 225, in wrapped
ret = func(**attrs)
File "/usr/share/vdsm/network/api.py", line 328, in _addNetwork
_update_bridge_ports_mtu(net_ent.name, mtu)
File "/usr/share/vdsm/network/api.py", line 246, in _update_bridge_ports_mtu
ipwrapper.linkSet(port, ['mtu', str(mtu)])
File "/usr/lib/python2.6/site-packages/vdsm/ipwrapper.py", line 630, in
linkSet
_execCmd(command)
File "/usr/lib/python2.6/site-packages/vdsm/ipwrapper.py", line 525, in
_execCmd
raise IPRoute2Error(error)
IPRoute2Error: ['Error: argument "None" is wrong: Invalid "mtu" value', '']
Change-Id: Ie92c2257078b7b5971cfc94393d6ad3a8db59850
Signed-off-by: Ondřej Svoboda <[email protected]>
---
M vdsm/network/api.py
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/37899/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 7399593..9f1aae5 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -319,13 +319,14 @@
if bridged and network in _netinfo.bridges:
net_ent_to_configure = net_ent.port
logging.info("Bridge %s already exists.", network)
- # The bridge already exists and we attach a new underlying device to
- # it. We need to make sure that the bridge MTU configuration is
- # updated.
- configurator.configApplier.setIfaceMtu(network, mtu)
- # We must also update the vms` tap devices (the bridge ports in this
- # case) so that their MTU is synced with the bridge
- _update_bridge_ports_mtu(net_ent.name, mtu)
+ if mtu:
+ # The bridge already exists and we attach a new underlying device
+ # to it. We need to make sure that the bridge MTU configuration is
+ # updated.
+ configurator.configApplier.setIfaceMtu(network, mtu)
+ # We must also update the vms` tap devices (the bridge ports in
+ # this case) so that their MTU is synced with the bridge
+ _update_bridge_ports_mtu(net_ent.name, mtu)
else:
net_ent_to_configure = net_ent
--
To view, visit http://gerrit.ovirt.org/37899
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie92c2257078b7b5971cfc94393d6ad3a8db59850
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches