Bug 1119182

Summary: [SetupNetworks] fails to remove a network over an arbitrarily-named vlan device
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: GeneralAssignee: Marcin Mirecki <mmirecki>
Status: CLOSED WONTFIX QA Contact: Michael Burman <mburman>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: bazulay, bugs, danken, gklein, mgoldboi, osvoboda, rbalakri, srevivo, ylavi
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: vdsm-4.17.0-1198.git6ede99a Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-01 09:59:32 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:
Attachments:
Description Flags
supervdsm log
none
Logs
none
screenshots none

Description Michael Burman 2014-07-14 08:38:28 UTC
Created attachment 917702 [details]
supervdsm log

Description of problem:
[SetupNetworks] fails when removing an unmanaged network over an arbitrarily named vlan.
"Error while executing action Setup Networks: Network is currently being used"
but the network is not being is use. 

Version-Release number of selected component (if applicable):
 oVirt Engine Version: 3.5.0-0.0.master.20140629172257.git0b16ed7.el6 

How reproducible:
always 

Steps to Reproduce:
1. Create VLAN entity with name on the host: ip link add dev vlan10 link eth1 name vlan10 type vlan id 10
2.Attache the vlan to bridge: brctl addbr br_vlan10; brctl addif br_vlan10 vlan10
3.For the Engine detect the new bridge, need to:  Write the following to a file called my_net.xml
    <network>
      <name>vdsm-br_vlan10</name>
      <uuid>a2de77bc-4618-4ec5-a37a-f8f2dbdf91c9</uuid>
      <forward mode='bridge'/>
      <bridge name='br_vlan10'/>
    </network>

then do: saslpasswd2 -a libvirt 1
    virsh net-define my_net.xml
    virsh net-autostart vdsm-br_vlan10
    virsh net-start vdsm-br_vlan10

4. In setupNetwork remove the VLAN network - (X to remove)

Actual results:
can't remove unmanaged network-operation canceled, cause network in use.

Expected results:
should be able to remove the VLAN network(unmanaged network), cause the network is not in use.

Additional info:

Comment 1 Dan Kenigsberg 2014-07-14 15:29:25 UTC
In bug 999975 we were asked to tolerate arbitrarily-named vlan devices, not to be able to manipulate them (as requested here).

I like the idea of supporting the removal of such networks, but this new request should not block ovirt-3.5. If an admin created the network from the commandline, he should be able to remove it from there, too.

Comment 3 Michael Burman 2015-07-30 12:48:31 UTC
Tested and failed qa on - 3.6.0-0.0.master.20150726172446.git65db93d.el6 and
vdsm-4.17.0-1198.git6ede99a.el7.noarch
vdsm-4.17.0-1201.git7ba0684.el7.noarch

Followed all steps from Description, after step 4, although is seems like unmanaged network was successfully removed, it's actually wasn't, because vdsCaps still report this network after sending setup networks call:

'vlan10': {'addr': '',
                            'cfg': {'BOOTPROTO': 'none'},
                            'dhcpv4': False,
                            'dhcpv6': False,
                            'gateway': '',
                            'iface': 'enp6s0',
                            'ipv4addrs': [],
                            'ipv6addrs': ['fe80::221:5eff:fe3f:deb2/64'],
                            'ipv6gateway': '::',
                            'mtu': '1500',
                            'netmask': '',
                            'vlanid': 10}}

vlan10': {'name': 'vlan10',
                              'rx': '0',
                              'rxDropped': '0',
                              'rxErrors': '0',
                              'rxRate': '0.0',
                              'sampleTime': 1438260269.598827,
                              'speed': '1000',
                              'state': 'up',
                              'tx': '140',
                              'txDropped': '0',
                              'txErrors': '0',
                              'txRate': '0.0'},



 35: vlan10@enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 00:21:5e:3f:de:b2 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::221:5eff:fe3f:deb2/64 scope link 
       valid_lft forever preferred_lft forever


- right after approving the removal of the unmanaged network(x) via SetupNetworks, the Interface is changing his state to down, via UI it looks like network still attached to NIC.
After setting the Interface up, network still attached to NIC.

- When entering the SN dialog window, i don't see the network attached to NIC.

Attaching logs.

Comment 4 Michael Burman 2015-07-30 12:50:26 UTC
Created attachment 1057662 [details]
Logs

Comment 5 Michael Burman 2015-07-30 12:52:05 UTC
Created attachment 1057663 [details]
screenshots

Comment 6 Ido Barkan 2015-09-16 11:16:40 UTC
I have done this on 4.17.2-134.git2ce4f73.el7 (no engine involved):

$ ip link add dev dummy_10 type dummy

$ ip link add dev vlan10 link dummy_10 name vlan10 type vlan id 10

$ brctl addbr br_vlan10

$ brctl addif br_vlan10 vlan10

$ vim my_net.xml

$ cat my_net.xml
<network>
  <name>vdsm-br_vlan10</name>
  <uuid>a2de77bc-4618-4ec5-a37a-f8f2dbdf91c9</uuid>
  <forward mode='bridge'/>
  <bridge name='br_vlan10'/>
</network>

$ virsh net-define my_net.xml
Network vdsm-br_vlan10 defined from my_net.xml

$ virsh net-autostart vdsm-br_vlan10
Network vdsm-br_vlan10 marked as autostarted

$ virsh net-start vdsm-br_vlan10
Network vdsm-br_vlan10 started

$ virsh -r net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 ;vdsmdummy;          active     no            no
 vdsm-br_vlan10       active     yes           yes

caps reports the interfaces+networks (as it should)

$ vdsClient -s 0 getVdsCaps
bridges = {'br_vlan10': {'...
networks = {'br_vlan10': {'...
nics = {'dummy_10': {'...
vlans = {'vlan10': {'...

Now lets delete the network:

$ vdsClient -s 0 setupNetworks networks='{br_vlan10:{remove:True}}'
Done

$ brctl show
bridge name	bridge id		STP enabled	interfaces
;vdsmdummy;		8000.000000000000	no

$ virsh -r net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 ;vdsmdummy;          active     no            no

now the bridge and the network are gone and so is reported by caps.

$ vdsClient -s 0 getVdsCaps
bridges = {}
networks = {}
nics = {'dummy_10': {'...
vlans = {'vlan10': {'...

Comment 7 Michael Burman 2015-09-16 11:44:34 UTC
Engine should be involved here, it's part of the bug ^^
I guess then it should be handled on the engine side then. Bug is still relevant.
Thanks

Comment 8 Barak 2015-10-07 13:23:24 UTC
Per comments 6 & 7 it looks like the issue is on the engine side

Comment 9 Sandro Bonazzola 2016-05-02 09:57:03 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 10 Yaniv Lavi 2016-05-23 13:18:19 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 11 Yaniv Lavi 2016-05-23 13:25:07 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 12 Dan Kenigsberg 2016-06-01 09:59:32 UTC
I really wanted to clean this up, but we simply do not have the resources to look into that. Let us reopen if a customer complains about this awkward situation.