Change in vdsm[master]: Don't down bonds and nics when adding vlan or resizing
asegurap at redhat.com
asegurap at redhat.com
Tue Aug 13 12:44:01 UTC 2013
Antoni Segura Puimedon has posted comments on this change.
Change subject: Don't down bonds and nics when adding vlan or resizing
......................................................................
Patch Set 7:
(6 comments)
....................................................
File vdsm/netconf/ifcfg.py
Line 102:
Line 103: # Create bond configuration in case it was a non ifcfg controlled bond
Line 104: # Needed to be before slave configuration for initscripts to add slave
Line 105: # to bond.
Line 106: is_ifcfg_controlled = netinfo.getIfaceCfg(bond.name)
Done
Line 107: are_options_applied = bond.are_options_applied()
Line 108: if not is_ifcfg_controlled or not are_options_applied:
Line 109: bridgeName = _netinfo.getBridgedNetworkForIface(bond.name)
Line 110: if bridgeName:
Line 104: # Needed to be before slave configuration for initscripts to add slave
Line 105: # to bond.
Line 106: is_ifcfg_controlled = netinfo.getIfaceCfg(bond.name)
Line 107: are_options_applied = bond.are_options_applied()
Line 108: if not is_ifcfg_controlled or not are_options_applied:
I'd prefer factoring it out when we add the non-downing support to the iproute2 configurator.
Line 109: bridgeName = _netinfo.getBridgedNetworkForIface(bond.name)
Line 110: if bridgeName:
Line 111: bond.master = Bridge(bridgeName, self, port=bond)
Line 112: self.configApplier.addBonding(bond)
Line 105: # to bond.
Line 106: is_ifcfg_controlled = netinfo.getIfaceCfg(bond.name)
Line 107: are_options_applied = bond.are_options_applied()
Line 108: if not is_ifcfg_controlled or not are_options_applied:
Line 109: bridgeName = _netinfo.getBridgedNetworkForIface(bond.name)
I'm not sure I understand. If we take control of it, as we do since we are editing the bond, we should make sure that if it is bridged it keeps being bridged.
Line 110: if bridgeName:
Line 111: bond.master = Bridge(bridgeName, self, port=bond)
Line 112: self.configApplier.addBonding(bond)
Line 113:
Line 116: ifdown(slave.name) # nics must be down to join a bond
Line 117: self.configApplier.addNic(slave)
Line 118: ifup(slave.name)
Line 119:
Line 120: if not is_ifcfg_controlled or not are_options_applied:
We are changing the ifcfg file of the bond in line 112, so we should make those changes be applied.
Line 121: ifdown(bond.name)
Line 122: ifup(bond.name)
Line 123:
Line 124: def configureNic(self, nic, **opts):
....................................................
File vdsm/netmodels.py
Line 78: super(Nic, self).__init__(name, configurator, ipconfig,
Line 79: mtu=max(mtu, netinfo.getMtu(name)))
Line 80:
Line 81: def configure(self, **opts):
Line 82: if not self.vlan or netinfo.operstate(self.name) != 'up':
Done
Line 83: self.configurator.configureNic(self, **opts)
Line 84:
Line 85: def remove(self):
Line 86: self.configurator.removeNic(self)
Line 185: frozenset(slave.name for slave in self.slaves) ==
Line 186: frozenset(netinfo.slaves(self.name))):
Line 187: self.configurator.configureBond(self, **opts)
Line 188:
Line 189: def are_options_applied(self):
Done
Line 190: active_opts = netinfo.bondOpts(self.name)
Line 191: return all(tuple(opt.split('=', 1)) in active_opts for
Line 192: opt in self.options.split(' '))
Line 193:
--
To view, visit http://gerrit.ovirt.org/17491
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id3075a2e65f06416c840c6a98689b77555b22e5d
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Petr Ĺ ebek <psebek at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list