Bug 1269175

Summary: nic removed from bond can not be bound to another bond
Product: [oVirt] vdsm Reporter: Marcin Mirecki <mmirecki>
Component: SuperVDSMAssignee: Marcin Mirecki <mmirecki>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.14.0CC: bazulay, bugs, mburman, mmirecki, mmucha, ykaul, ylavi
Target Milestone: ovirt-4.0.0-alphaFlags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 4.17.999   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt 4.0.0 alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:59:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marcin Mirecki 2015-10-06 14:08:17 UTC
Description of problem:
In host setup networks dialog:
When a nic is removed from a bond and added to a new bond, an error is shown: "Error while executing action HostSetupNetworks: Interface already in use"

Steps to Reproduce:
1. Create a bond with 3 slaves. Submit
2. Open setupnetworks dialog.
3. Remove one nic from the bond.
4. Use this nic to create another bond
5. Submit -> Error

Comment 1 Marcin Mirecki 2015-10-13 10:00:39 UTC
Stacktrace:
Traceback (most recent call last):
  File "/usr/share/vdsm/supervdsmServer", line 111, in wrapper
    res = func(*args, **kwargs)
  File "/usr/share/vdsm/supervdsmServer", line 218, in setupNetworks
    return setupNetworks(networks, bondings, **options)
  File "/usr/share/vdsm/network/api.py", line 899, in setupNetworks
    _handleBondings(bondings, configurator, in_rollback)
  File "/usr/share/vdsm/network/api.py", line 646, in _handleBondings
    destroyOnMasterRemoval='remove' in attrs)
  File "/usr/share/vdsm/network/models.py", line 279, in objectivize
    mtu, _netinfo)
  File "/usr/share/vdsm/network/models.py", line 268, in _objectivizeSlaves
    (nic, nicVlans or nicNet or nicBond))
ConfigNetworkError: (24, u'nic ens11 already used by bond0')

Comment 2 Barak 2015-10-15 07:49:30 UTC
Marcin, Alona, is the problem in the engine logic or vdsm ?

Comment 3 Dan Kenigsberg 2015-11-23 10:51:46 UTC
*** Bug 1283528 has been marked as a duplicate of this bug. ***

Comment 4 Marcin Mirecki 2015-12-16 13:52:54 UTC
This happened because removing, editing and adding of slaves to a bond was done bond by bond, so if a nic was added to a bond which was handled before the bond from which the nic was removed the operation failed. 
Example: 
bond0: nic0, nic1 => nic2, nic3 
bond1: nic2, nic3 => nic0, nic1 
In this situation first bond0 is processed: nic0 and nic1 will be removed, but nic2 and nic3 can not yet be removed as they are part of bond1 (validation fails). Processing of bond1 will introduce errors, as nic2 and nic3 will be removed (already assigned to bond0), which will in effect reset their ifcfg files, and cause the previous attachment to bond0 to be undone.

Comment 5 Michael Burman 2016-04-10 12:36:48 UTC
Verified on - 4.0.0-0.0.master.20160404161620.git4ffd5a4.el7.centos and vdsm-4.17.999-900.giteba4b25.el7.centos.noarch

Comment 6 Sandro Bonazzola 2016-07-05 07:59:25 UTC
oVirt 4.0.0 has been released, closing current release.