Bug 1443292 - Failed to attach non-mgmt network to host if default route is set
Summary: Failed to attach non-mgmt network to host if default route is set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: future
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ovirt-4.2.0
: ---
Assignee: Martin Mucha
QA Contact: Michael Burman
URL:
Whiteboard:
: 1434087 (view as bug list)
Depends On:
Blocks: 1200963 1445171 1445266
TreeView+ depends on / blocked
 
Reported: 2017-04-19 04:52 UTC by Michael Burman
Modified: 2021-03-11 16:04 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
this was caused by issue of altering default route role in general. Cause: when using UI to alter defaultroute network role it only passes request to update network gaining role, but does not pass request to update network losing role. Consequence: engine does not pass request to vdsm to remove role from network, which to this moment had defaultrote role passing only new netwrok acquiring this role, and vdsm fails, because only one network can have this role. Fix: issue was fixed in HostSetupNetworksCommand by examining current host setting. If role removal is missing among commands, given request is added.
Clone Of:
Environment:
Last Closed: 2017-12-20 11:18:11 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
Logs (936.49 KB, application/x-gzip)
2017-04-19 04:52 UTC, Michael Burman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 76928 0 master MERGED core: setupnetworks for old and new network when updating default route 2017-07-16 15:23:52 UTC
oVirt gerrit 77619 0 None None None 2017-06-16 08:22:36 UTC
oVirt gerrit 80102 0 master POST core: method rename 2017-08-16 14:47:15 UTC
oVirt gerrit 81652 0 master ABANDONED core: fix default route issues in HostSetupNetworksCommand 2017-09-27 08:09:51 UTC
oVirt gerrit 81703 0 master POST core: fix default route issues in HostSetupNetworksCommand 2017-09-13 14:14:39 UTC

Description Michael Burman 2017-04-19 04:52:38 UTC
Created attachment 1272469 [details]
Logs

Description of problem:
Failed to attach non-mgmt network to host if default route is set. 

It's not possible to attach a non-mgmt network that is assigned with the new 'Default_route' role. 

2017-04-19 07:47:40,495+0300 ERROR (jsonrpc/7) [vds] Only a singe default route network is allowed. (API:1473)
Traceback (most recent call last):
  File "/usr/share/vdsm/API.py", line 1470, in setupNetworks
    supervdsm.getProxy().setupNetworks(networks, bondings, options)
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 53, in __call__
    return callMethod()
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 51, in <lambda>
    **kwargs)
  File "<string>", line 2, in setupNetworks
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 773, in _callmethod
    raise convert_to_error(kind, result)
ConfigNetworkError: (21, 'Only a singe default route network is allowed.')

017-04-19 07:47:40,512+03 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand] (default task-8) [2f4da534-65d6-48f2-8301-dfdf8a4a3f87] Failed in 'HostSetupNetworksVDS' method
2017-04-19 07:47:40,526+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-8) [2f4da534-65d6-48f2-8301-dfdf8a4a3f87] EVENT_ID: VDS_BROKER_COMMAND_FAILURE(10,802), Correla
tion ID: null, Call Stack: null, Custom Event ID: -1, Message: VDSM camel-vdsa.qa.lab.tlv.redhat.com command HostSetupNetworksVDS failed: Only a singe default route network is allowed.
2017-04-19 07:47:40,526+03 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand] (default task-8) [2f4da534-65d6-48f2-8301-dfdf8a4a3f87] Error: VDSGenericException: VDSErrorException: Faile
d to HostSetupNetworksVDS, error = Only a singe default route network is allowed., code = 21
2017-04-19 07:47:40,526+03 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand] (default task-8) [2f4da534-65d6-48f2-8301-dfdf8a4a3f87] Exception: org.ovirt.engine.core.vdsbroker.vdsbroker
.VDSErrorException: VDSGenericException: VDSErrorException: Failed to HostSetupNetworksVDS, error = Only a singe default route network is allowed., code = 21

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.0-0.0.master.20170417082636.git8790a6f.el7.centos.noarch
vdsm-4.20.0-633.git09421a2.el7.centos.x86_64

How reproducible:
100

Steps to Reproduce:
1. Create new network and assign it with the new role - 'Default Route' via 'Networks'>Clusters' or 'Clusters'>Networks' 
2. Check that the default route sign no longer exist for the mgmt network(ovirtmgmt)
3. Try to attach the non-mgmt network to host via setup networks

Actual results:
Failed with 'Error while executing action HostSetupNetworks: Illegal Network parameters'

Expected results:
Must work if only one network set as the default route.

Additional info:
Possible to be the cause of the report in bz 1434087

Comment 1 Dan Kenigsberg 2017-04-24 10:21:22 UTC
After your step (2), we know that the host is actually out of sync (though Engine does not show that): the cluster thinks that non-mgmt is the default route network, but on the host - it is still ovirtmgmt.

Could you check the following workaround: make any kind of modification to ovirtmgmt (say, change MTU), and sync the host. This should clear default_route from ovirtmgmt and let you continute to your step (3).

Comment 2 Michael Burman 2017-04-24 10:32:43 UTC
default route still reported in vdsm for ovirtmgmt 

"ovirtmgmt": {
            "ipv6autoconf": true, 
            "addr": "10.35.128.18", 
            "dhcpv6": false, 
            "ipv6addrs": [], 
            "mtu": "1500", 
            "dhcpv4": true, 
            "netmask": "255.255.255.0", 
            "ipv4defaultroute": true, 

"default_route_n": {
            "ipv6autoconf": false, 
            "addr": "", 
            "dhcpv6": false, 
            "ipv6addrs": [], 
            "mtu": "1500", 
            "dhcpv4": false, 
            "netmask": "", 
            "ipv4defaultroute": false,

Comment 3 Martin Mucha 2017-04-25 11:37:09 UTC
additional info:

we have attached mgmt network, and new new_network, which is not attached. Rows in this table are ordered so mgmt network is first, new_network is second (and only this will grant proper order of execution; remember this note, this will likely cause failure in future). Logic then goes like this. First we update mgmt network, removing default route role from it. When we're removing set flag, we will use mgmt network as a replacement. So this will actually move default route from mgmt network back to mgmt network (2 db calls). Then we update new_network, which sets this role to new_network and remove it from mgmt network (another 2 db calls). All of this leads to 2 updates, but not attachment or detachment of network, which drives PropagateLabeledNetworksToClusterHostsCommand not to call setupnetworks at all. This is I believe a bug. (or not? is there case where must not call setupnetwoks in ManageNetworkCluster?) Anyway, in this case we updated db, but did not update hosts.

But lets assume that we ran setupneworks from ManageNetworkCluster. What is expected behavior? new_network is not attached, so it won't define default route on host.

Reason why this fail is, that we are jus attaching new_network, but did not touch old one, meaning, we will sent new network to vdsm and the old one will probably be unchanged.

And finally, this reproduction scenario does not work all the time. Now it works for me, even if I drop host and whole db.


related bugs?: 
• removal of network with default route role, causes system state without network of this role.

Comment 4 Martin Mucha 2017-06-16 09:40:54 UTC
fresh env
create host
create new network
make it default route
open setupnetworks dialog, configure static ip there, attach
———

network was attached, correctly. So I believe that fixing other bugs fix this one as well.

Comment 6 Michael Burman 2017-07-23 12:15:08 UTC
Not pass. Same result.
Tested on 4.2.0-0.0.master.20170721095131.git9f5e90c.el7.centos
and vdsm-4.20.1-218.git1b7671f.el7.centos.x86_64

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/API.py", line 1409, in setupNetworks
    supervdsm.getProxy().setupNetworks(networks, bondings, options)
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 53, in __call__
    return callMethod()
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 51, in <lambda>
    **kwargs)
  File "<string>", line 2, in setupNetworks
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 773, in _callmethod
    raise convert_to_error(kind, result)
ConfigNetworkError: (21, 'Only a single default route network is allowed.')

Comment 7 Michael Burman 2017-07-23 12:28:18 UTC
Please note, that this bug isn't fixed properly. The fix for this bug affecting all relevant bugs for the default route feature.

1) You still can't attach a non-mgmt network as a default route network to the host. As engine believes that we trying to attach 2 networks with default route.
2) Engine reports the management as out-of-sync, default route on host=true, default route in the DC=false. We missing a refresh caps here as well.

Comment 8 Michael Burman 2017-07-23 12:39:38 UTC
When we setting a non-mgmt network with default route role, engine must take an action and send refresh caps for the management network with default route =false and sync all hosts in the cluster. With out it, all the hosts in the cluster will be out of sync and you won't be able to attach a non-mgmt network with default route to any host until the management network will be taken care by the engine. We will always fail as engine will think we trying to attach 2 networks with default route role.

Comment 9 Edward Haas 2017-08-16 07:26:13 UTC
*** Bug 1434087 has been marked as a duplicate of this bug. ***

Comment 10 Michael Burman 2017-09-18 06:06:34 UTC
Verified on - 4.2.0-0.0.master.20170917124606.gita804ef7.el7.centos

Comment 11 Sandro Bonazzola 2017-12-20 11:18:11 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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