Description of problem: switching rhevm network to different NIC throws exception NETWORK_ATTACH_ILLEGAL_GATEWAY Version-Release number of selected component (if applicable): oVirt Enterprise Virtualization Engine Manager Version: 3.1.0_0001-9.el6ev How reproducible: 100% Steps to Reproduce: Steps to Reproduce: 1.Hosts -> your host (in maintenance) -> Setup Hosts network 2.Drag rhevm network to some different NIC (e.g. em2) -> click the pencil icon of the interface where you dragged rhevm network a)change Boot Protocol to DHCP b)click OK 3. click OK Actual results: In UI "Error: dell-r210ii-05: The default gateway should be set only on engine network" appears in engine.log 2012-05-11 15:27:28,506 WARN [org.ovirt.engine.core.bll.SetupNetworksCommand] (ajp--0.0.0.0-8009-7) [64cf69c8] CanDoAction of action SetupNetworks failed. Reasons:NETWORK_ATTACH_ILLEGAL_GATEWAY, Expected results: rhevm interface should be switched with no error Additional info: my NIC em2 is placed in different VLAN and differnt IP subnet than NIC em1, however I do not believe that affected rhevm behavior
Created attachment 583853 [details] screenshot
Created attachment 583854 [details] vdsm.log + engine.log
I believe the problem is with DHCP configuration on mgmt network. Is it reproduce when changing to STATIC after moving mgmt network (instead of DHCP)?
Yes it does reproduce with static as well. Please see attached screenshots with error and another screenshot with settings I put in. engine.log 2012-05-14 08:57:11,711 WARN [org.ovirt.engine.core.bll.SetupNetworksCommand] (ajp--0.0.0.0-8009-2) [34ef2a6f] CanDoAction of action SetupNetworks failed. Reasons:NETWORK_ATTACH_ILLEGAL_GATEWAY,
Created attachment 584261 [details] screenshot of static IP input
Created attachment 584262 [details] screenshot of error with static IP
It happend because the old nic doesn't clean its default gateway attribute. The engine throws an error if there is a nic with default gateway attribute and it is not management. The old nic has no networks, so there is no reason to check if it is management and to check its default gateway. I fixed it in the webadmin, now the old nic cleans its default gateway. But I think it also should be fixed in the engines side.
The ui fix is in commit 85b42bb19dccfb75607b55313f87bb898d31ca6c
I don't think any change should be done on backend side: The validation on backend verifies that gateway shouldn't be provided for any interface which isn't the management network. When attempting same scenario with rest-api - the error doesn't occur due to the fact rest doesn't send gateway to the previous nic (user responsibility to remove it): before sending setupnetworks request: <action> <host_nics> <host_nic id="0640fe2d-b462-4057-a1a8-afcc4469e551"> <name>eth0</name> <network id="3fc2f39e-6a3a-4dd6-8ffa-b2cf4550f1b9"/> <mac address="b4:99:ba:11:11:11"/> <!-- the gateway attribute should be removed after assigning the management network to new interface--> <ip gateway="10.11.11.11" netmask="255.255.252.0" address="10.22.22.22"/> <boot_protocol>static</boot_protocol> <bridged>true</bridged> </host_nic> <!-- the new nic to be attached with management network --> <host_nic id="d2cfb266-6065-4cec-9d04-251659f444bd"> <name>eth5</name> <mac address="78:ac:c0:aa:aa:aa"/> <ip netmask="" address=""/> <boot_protocol>none</boot_protocol> <status> <state>down</state> </status> <bridged>false</bridged> </host_nic> </host_nics> </action> the input for the request (moving management network from eth0 to eth5: <action> <host_nics> <host_nic id="0640fe2d-b462-4057-a1a8-afcc4469e551"> <name>eth0</name> <mac address="b4:99:ba:11:11:11"/> <!-- the gateway attribute should be removed after assigning the management network to new interface--> <ip netmask="255.255.252.0" address="10.22.22.22"/> <boot_protocol>static</boot_protocol> <bridged>false</bridged> </host_nic> <!-- the new nic to be attached with management network --> <host_nic id="d2cfb266-6065-4cec-9d04-251659f444bd"> <name>eth5</name> <mac address="78:ac:c0:aa:aa:aa"/> <network id="3fc2f39e-6a3a-4dd6-8ffa-b2cf4550f1b9"/> <ip netmask="" address=""/> <boot_protocol>dhcp</boot_protocol> <bridged>true</bridged> </host_nic> </host_nics> <check_connectivity>true</check_connectivity> <connectivity_timeout>50</connectivity_timeout> </action>
Problem mentioned in bug is solved, but it is not possible to switch RHEVM network to different NIC, followuo in bug #BZ843081