Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1252534

Summary: VDSM overwrites ovirtmgmt bridge configuration with wrong parameters
Product: [Retired] oVirt Reporter: jniederm
Component: vdsmAssignee: Ido Barkan <ibarkan>
Status: CLOSED NOTABUG QA Contact: Gil Klein <gklein>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6CC: bazulay, bugs, danken, ecohen, gklein, jniederm, lsurette, mgoldboi, rbalakri, ycui, yeylon, ylavi
Target Milestone: ---   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: network
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-03 09:09:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vdsm.log
none
vds capabilities after restart
none
ifcfg-ovirtmgmt after restart
none
logs.zip
none
netconf.zip none

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.