Bug 1223457 - unable to add new VLAN when using net_persistence=ifcfg
Summary: unable to add new VLAN when using net_persistence=ifcfg
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: 3.6
Hardware: All
OS: Linux
urgent
high
Target Milestone: ---
: 3.5.3
Assignee: Petr Horáček
QA Contact: Meni Yakove
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-20 14:42 UTC by Daniel Lupescu
Modified: 2019-07-16 11:33 UTC (History)
12 users (show)

Fixed In Version: vdsm-4.16.18-1.el6ev
Clone Of:
Environment:
Last Closed: 2015-06-15 08:38:48 UTC
oVirt Team: Network
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 41337 0 master MERGED network/models: check unified persistence only when it exists Never
oVirt gerrit 41338 0 master MERGED net tests: skip test_setupNetworks_on_external_bond Never
oVirt gerrit 41349 0 master ABANDONED network: check for bridge changes only if unified persistence is used Never
oVirt gerrit 41366 0 ovirt-3.5 MERGED network/models: check unified persistence only when it exists Never
oVirt gerrit 41367 0 ovirt-3.5 MERGED net tests: skip test_setupNetworks_on_external_bond Never

Description Daniel Lupescu 2015-05-20 14:42:12 UTC
Description of problem:
Unable to add new VLAN to bonded interface when /etc/vdsm/vdsm.conf has net_persistence = ifcfg

Version-Release number of selected component (if applicable):
vdsm-4.16.14-0.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. vdsm configured with net_persistence = ifcfg
2. Create new VLAN tagged network
3. Under "Setup Host Networks" try to add the new VLAN to a host via drag-and-drop

Actual results:
VLAN is not added - vdsm log throws the following error:
::supervdsmServer::106::SuperVdsm.ServerCallback::(wrapper) Error in setupNetworks
Traceback (most recent call last):
  File "/usr/share/vdsm/supervdsmServer", line 104, in wrapper
    res = func(*args, **kwargs)
  File "/usr/share/vdsm/supervdsmServer", line 224, in setupNetworks
    return setupNetworks(networks, bondings, **options)
  File "/usr/share/vdsm/network/api.py", line 693, in setupNetworks
    implicitBonding=True, _netinfo=_netinfo, **d)
  File "/usr/share/vdsm/network/api.py", line 209, in wrapped
    return func(*args, **kwargs)
  File "/usr/share/vdsm/network/api.py", line 315, in addNetwork
    netEnt.configure(**options)
  File "/usr/share/vdsm/network/models.py", line 169, in configure
    self.configurator.configureBridge(self, **opts)
  File "/usr/share/vdsm/network/configurators/ifcfg.py", line 86, in configureBridge
    bridge.port.configure(**opts)
  File "/usr/share/vdsm/network/models.py", line 133, in configure
    self.configurator.configureVlan(self, **opts)
  File "/usr/share/vdsm/network/configurators/ifcfg.py", line 92, in configureVlan
    vlan.device.configure(**opts)
  File "/usr/share/vdsm/network/models.py", line 207, in configure
    self.name in self.configurator.runningConfig.bonds and
AttributeError: 'Ifcfg' object has no attribute 'runningConfig'


Expected results:
VLAN is added to host

Additional info:
Using vdsClient to add the VLAN has the same result.

Issue seems to be in /usr/share/vdsm/network/configurators/ifcfg.py, line 61:

class Ifcfg(Configurator):
    # TODO: Do all the configApplier interaction from here.
    def __init__(self, inRollback=False):
        self.unifiedPersistence = \
            config.get('vars', 'net_persistence') == 'unified'
        super(Ifcfg, self).__init__(ConfigWriter(self.unifiedPersistence),
                                    inRollback)
        if self.unifiedPersistence:
            self.runningConfig = RunningConfig()

The runningConfig object is not instantiated when not using unified persistence.

A workaround is possible by removing the last condition.

Comment 1 Dan Kenigsberg 2015-05-20 15:16:35 UTC
This regression was introduce by the backport of https://gerrit.ovirt.org/#/q/I4d3ed2b45d618d404bb340100ca07bc57b2f1136

Comment 2 ernest.beinrohr 2015-06-01 15:27:39 UTC
I am having very similar problems, probably the same source. My stack trace is different however, I'm attaching it therefore:

Thread-14::DEBUG::2015-06-01 17:26:44,925::BindingXMLRPC::1133::vds::(wrapper) client [192.168.100.22]::call setupNetworks with ({'ovirtmgmt': {'vlan': '90', 'ipaddr': '192.168.100.26', 'netmask': '255.255.255.0', 'mtu': '1500', 'bonding': 'bond0', 'STP': 'no', 'bridged': 'true', 'gateway': '192.168.100.1', 'defaultRoute': True}, 'br1070': {'bonding': 'bond0', 'vlan': '1070', 'STP': 'no', 'bridged': 'true', 'mtu': '1500'}, 'br200': {'bonding': 'bond0', 'vlan': '200', 'STP': 'no', 'bridged': 'true', 'mtu': '1500'}, 'br192': {'bonding': 'bond0', 'vlan': '192', 'STP': 'no', 'bridged': 'true', 'mtu': '1500'}, 'br154': {'bonding': 'bond0', 'vlan': '154', 'STP': 'no', 'bridged': 'true', 'mtu': '1500'}}, {}, {'connectivityCheck': 'true', 'connectivityTimeout': 120}) {} flowID [3ca7aae2]
Thread-13::DEBUG::2015-06-01 17:26:44,927::BindingXMLRPC::1140::vds::(wrapper) return ping with {'status': {'message': 'Done', 'code': 0}}
Thread-14::ERROR::2015-06-01 17:26:47,655::BindingXMLRPC::1152::vds::(wrapper) unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/rpc/BindingXMLRPC.py", line 1136, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/rpc/BindingXMLRPC.py", line 554, in setupNetworks
    return api.setupNetworks(networks, bondings, options)
  File "/usr/share/vdsm/API.py", line 1398, in setupNetworks
    supervdsm.getProxy().setupNetworks(networks, bondings, options)
  File "/usr/share/vdsm/supervdsm.py", line 50, in __call__
    return callMethod()
  File "/usr/share/vdsm/supervdsm.py", line 48, in <lambda>
    **kwargs)
  File "<string>", line 2, in setupNetworks
  File "/usr/lib64/python2.6/multiprocessing/managers.py", line 740, in _callmethod
    raise convert_to_error(kind, result)
AttributeError: 'Ifcfg' object has no attribute 'runningConfig'

Comment 3 Petr Horáček 2015-06-02 09:31:43 UTC
But this is from vdsm.log, right? Could you provide output of supervdsm.log (the error part will be sufficient)? Thanks!

Comment 4 ernest.beinrohr 2015-06-02 10:50:36 UTC
Traceback (most recent call last):
  File "/usr/share/vdsm/supervdsmServer", line 104, in wrapper
    res = func(*args, **kwargs)
  File "/usr/share/vdsm/supervdsmServer", line 224, in setupNetworks
    return setupNetworks(networks, bondings, **options)
  File "/usr/share/vdsm/network/api.py", line 693, in setupNetworks
    implicitBonding=True, _netinfo=_netinfo, **d)
  File "/usr/share/vdsm/network/api.py", line 209, in wrapped
    return func(*args, **kwargs)
  File "/usr/share/vdsm/network/api.py", line 315, in addNetwork
    netEnt.configure(**options)
  File "/usr/share/vdsm/network/models.py", line 169, in configure
    self.configurator.configureBridge(self, **opts)
  File "/usr/share/vdsm/network/configurators/ifcfg.py", line 86, in configureBridge
    bridge.port.configure(**opts)
  File "/usr/share/vdsm/network/models.py", line 133, in configure
    self.configurator.configureVlan(self, **opts)
  File "/usr/share/vdsm/network/configurators/ifcfg.py", line 92, in configureVlan
    vlan.device.configure(**opts)
  File "/usr/share/vdsm/network/models.py", line 207, in configure
    self.name in self.configurator.runningConfig.bonds and
AttributeError: 'Ifcfg' object has no attribute 'runningConfig'

Comment 5 Michael Burman 2015-06-03 11:45:55 UTC
Tested and verified on - 3.5.3-1.3.el6ev
with rhel 7.1 vdsm-4.16.18-1.el7ev.x86_64

and
rhel 6.7 vdsm-4.16.18-1.el6ev.x86_64

Comment 6 Sandro Bonazzola 2015-06-15 08:38:48 UTC
This is an automated message.
oVirt 3.5.3 has been released on June 15th 2015 and should include the fix for this BZ. Moving to closed current release.


Note You need to log in before you can comment on or make changes to this bug.