Bug 820989 - [RHEVM] [backend] switching rhevm network to different NIC throws exception NETWORK_ATTACH_ILLEGAL_GATEWAY
[RHEVM] [backend] switching rhevm network to different NIC throws exception N...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Moti Asayag
Martin Pavlik
network
:
Depends On: 843081
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-11 09:52 EDT by Martin Pavlik
Modified: 2016-02-10 14:55 EST (History)
8 users (show)

See Also:
Fixed In Version: si11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:03:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
screenshot (120.85 KB, image/png)
2012-05-11 09:53 EDT, Martin Pavlik
no flags Details
vdsm.log + engine.log (4.97 KB, application/x-gzip)
2012-05-11 09:56 EDT, Martin Pavlik
no flags Details
screenshot of static IP input (131.46 KB, image/png)
2012-05-14 03:04 EDT, Martin Pavlik
no flags Details
screenshot of error with static IP (117.53 KB, image/png)
2012-05-14 03:05 EDT, Martin Pavlik
no flags Details

  None (edit)
Description Martin Pavlik 2012-05-11 09:52:17 EDT
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
Comment 1 Martin Pavlik 2012-05-11 09:53:55 EDT
Created attachment 583853 [details]
screenshot
Comment 2 Martin Pavlik 2012-05-11 09:56:17 EDT
Created attachment 583854 [details]
vdsm.log + engine.log
Comment 3 Avi Tal 2012-05-12 02:38:21 EDT
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)?
Comment 4 Martin Pavlik 2012-05-14 03:03:44 EDT
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,
Comment 5 Martin Pavlik 2012-05-14 03:04:38 EDT
Created attachment 584261 [details]
screenshot of static IP input
Comment 6 Martin Pavlik 2012-05-14 03:05:48 EDT
Created attachment 584262 [details]
screenshot of error with static IP
Comment 7 Alona Kaplan 2012-06-19 10:46:49 EDT
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.
Comment 8 Alona Kaplan 2012-06-19 10:48:32 EDT
The ui fix is in commit 85b42bb19dccfb75607b55313f87bb898d31ca6c
Comment 9 Moti Asayag 2012-07-11 10:47:36 EDT
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>
Comment 10 Martin Pavlik 2012-07-26 03:59:28 EDT
Problem mentioned in bug is solved, but it is not possible to switch RHEVM network to different NIC, followuo in bug #BZ843081

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