Bug 820989 - [RHEVM] [backend] switching rhevm network to different NIC throws exception NETWORK_ATTACH_ILLEGAL_GATEWAY
Summary: [RHEVM] [backend] switching rhevm network to different NIC throws exception N...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Moti Asayag
QA Contact: Martin Pavlik
URL:
Whiteboard: network
Depends On: 843081
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-11 13:52 UTC by Martin Pavlik
Modified: 2016-02-10 19:55 UTC (History)
8 users (show)

Fixed In Version: si11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 20:03:45 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


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

Description Martin Pavlik 2012-05-11 13:52:17 UTC
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 13:53:55 UTC
Created attachment 583853 [details]
screenshot

Comment 2 Martin Pavlik 2012-05-11 13:56:17 UTC
Created attachment 583854 [details]
vdsm.log + engine.log

Comment 3 Avi Tal 2012-05-12 06:38:21 UTC
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 07:03:44 UTC
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 07:04:38 UTC
Created attachment 584261 [details]
screenshot of static IP input

Comment 6 Martin Pavlik 2012-05-14 07:05:48 UTC
Created attachment 584262 [details]
screenshot of error with static IP

Comment 7 Alona Kaplan 2012-06-19 14:46:49 UTC
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 14:48:32 UTC
The ui fix is in commit 85b42bb19dccfb75607b55313f87bb898d31ca6c

Comment 9 Moti Asayag 2012-07-11 14:47:36 UTC
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 07:59:28 UTC
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.