Bug 1252534 - VDSM overwrites ovirtmgmt bridge configuration with wrong parameters
Summary: VDSM overwrites ovirtmgmt bridge configuration with wrong parameters
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: 3.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.6.0
Assignee: Ido Barkan
QA Contact: Gil Klein
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-11 15:58 UTC by jniederm
Modified: 2016-02-10 19:37 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-03 09:09:24 UTC
oVirt Team: Network
Embargoed:


Attachments (Terms of Use)
vdsm.log (49.86 KB, text/plain)
2015-08-11 16:03 UTC, jniederm
no flags Details
vds capabilities after restart (9.49 KB, text/plain)
2015-08-11 16:04 UTC, jniederm
no flags Details
ifcfg-ovirtmgmt after restart (173 bytes, text/plain)
2015-08-11 16:05 UTC, jniederm
no flags Details
logs.zip (45.00 KB, application/zip)
2015-09-03 08:37 UTC, jniederm
no flags Details
netconf.zip (1.25 KB, application/zip)
2015-09-03 08:40 UTC, jniederm
no flags Details

Description jniederm 2015-08-11 15:58:40 UTC
Description of problem:
VDSM rewrites ovirtmgmt file during the boot with configuration that doesn't match the one previously set using "vdsClient 0 setupNetworks".

Version-Release number of selected component (if applicable):
Name        : vdsm
Version     : 4.17.0
Release     : 1240.git487a19e.fc22

How reproducible:
100%

Steps to Reproduce:
1. (stop ovirt engine if it is running)
on the host:
2. delete '# Generated by VDSM version ...' header from /etc/sysconfig/network-scripts/ifcfg-ovirtmgmt if present
3. $ sudo vdsClient -s 0 setupNetworks 'networks={ovirtmgmt:{nic:eth0,bootproto:dhcp,blockingdhcp:true,bridged:true,stp:false,defaultRoute:false}}'
4. $ sudo reboot
after the reboot:

Actual results:
ovirtmgmt doesn't have ip address
BOOTPROTO statement is missing from /etc/sysconfig/network-scripts/ifcfg-ovirtmgmt
/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt contains '# Generated by VDSM version' header
'vdsClient 0 getVdsCapabilities' reports intended configuration:
    bridges = {'ovirtmgmt': {'addr': '',
	                     'cfg': {'BOOTPROTO': 'dhcp',


Expected results:
/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt contains statement 'BOOTPROTO=dhcp' and ovirtmgmt interface has ip address

Additional info:
* if 'BOOTPROTO=dhcp' is manually added into ifcfg-ovirtmgmt, it is removed during machine restart

Environment:
Host runs in virt-manager vm
Fedora 22

Comment 1 jniederm 2015-08-11 16:03:12 UTC
Created attachment 1061576 [details]
vdsm.log

Comment 2 jniederm 2015-08-11 16:04:30 UTC
Created attachment 1061577 [details]
vds capabilities after restart

Comment 3 jniederm 2015-08-11 16:05:30 UTC
Created attachment 1061579 [details]
ifcfg-ovirtmgmt after restart

Comment 4 Ido Barkan 2015-09-02 11:17:45 UTC
vdsm restores the last network configuration and marked as 'safe' by the user. This is done via a call to setSafeNetworkConfig. the results are stored under /var/lib/vdsm/persistence/netconf/ . So, after you have restarted, vdsm probably went back to it's prior network definition. If this configuration was incorrect somehow, you would not get an ip.
Btw, if there is not bootproto parameter in the setupNetwork API call, here would not be one in the ifcfg file.

 * would you attach supervdsm.log ?
 * can you add the contents of /var/lib/vdsm/persistence/netconf/ ?

Comment 5 jniederm 2015-09-03 08:37:50 UTC
Created attachment 1069654 [details]
logs.zip

vdsm.log and supervdsm.log of following procedure:
1. system reboot
2. newly booted system with bad network configuration, new configuration set:
DEVICE=ovirtmgmt
TYPE=Bridge
DELAY=0
STP=off
ONBOOT=yes
BOOTPROTO=dhcp
MTU=1500
DEFROUTE=yes
NM_CONTROLLED=no
IPV6INIT=no
3. system rebooted again, it again started with bad configuration

Comment 6 jniederm 2015-09-03 08:40:21 UTC
Created attachment 1069655 [details]
netconf.zip

original content of /var/lib/vdsm/persistence/netconf/ and content of this directory after I set network properly and called 'vdsClient 0 setSafeNetworkConfig'.

Comment 7 Ido Barkan 2015-09-03 09:09:24 UTC
(In reply to jniederm from comment #6)
> Created attachment 1069655 [details]
> netconf.zip
> 
> original content of /var/lib/vdsm/persistence/netconf/ and content of this
> directory after I set network properly and called 'vdsClient 0
> setSafeNetworkConfig'.

as you can see, the original (persisted) rhevm network (under netconf/nets) doesn't have a bootproto:
{
    "nic": "eth0", 
    "STP": "no", 
    "bridged": "true", 
    "mtu": "1500"
}
This is also visible in supervdsm.log:
restore-net::INFO::2015-09-03 04:00:55,353::netconfpersistence::60::root::(setNetwork) Adding network ovirtmgmt({u'nic': u'eth0', u'STP': u'no', u'bridged': u'true', u'mtu': u'1500'})

This line is writtten doing the loading of the persistence from the disk.

Comment 8 jniederm 2015-09-03 09:24:06 UTC
I edited file /var/lib/vdsm/persistence/netconf/nets/ovirtmgmt according documentation of vdsm/network/api.py:setupNetworks in order to look like this:

{
    "nic": "eth0", 
    "STP": "no", 
    "bridged": "true", 
    "mtu": "1500",
    "bootproto": "dhcp",
    "defaultRoute": "true"
}

and now my system boots with proper network configuration. Thank you for guidance.


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