Bug 1283812

Summary: local_interface=bond0.120 in undercloud.conf create broken network configuration
Product: [Community] RDO Reporter: Gonéri Le Bouder <goneri>
Component: instack-undercloudAssignee: James Slagle <jslagle>
Status: CLOSED EOL QA Contact: Shai Revivo <srevivo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: LibertyCC: dsneddon, mcornea
Target Milestone: ---   
Target Release: Kilo   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1290568 (view as bug list) Environment:
Last Closed: 2016-05-19 16:02:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1290568    

Description Gonéri Le Bouder 2015-11-20 00:20:44 UTC
Description of problem:

My bond0.120 interface has a VLAN=120 line in the /etc/sysconfig/network-scripts/ifcfg-bond0.120 file. I can ifup/down it manually.

If I declare the line local_interface=bond0.120 in my undercloud.conf, instack-undercloud will use the config.json.template ( https://github.com/openstack/instack-undercloud/blob/master/elements/undercloud-stack-config/config.json.template ) to generate the /etc/os-net-config/config.json as if it was a standard interface.
os-net-config will come later to prepare the br-ctlplane file. To do so, it will regenerate the /etc/sysconfig/network-scripts/ifcfg-bond0.120 file but will miss the VLAN=120 line.

I'm not sure this can easily be fixed, but a notice or an error message would be really useful.


This is my undercloud.conf:
[DEFAULT]
local_ip = 192.168.120.1/24
local_interface=bond0.120
masquerade_network = 192.168.120.0/24
dhcp_start = 192.168.120.5
dhcp_end = 192.168.120.24
network_cidr = 192.168.120.0/24
network_gateway = 192.168.120.1
inspection_iprange = 192.168.120.100,192.168.120.120
[auth]

instack-undercloud will generate:
[root@fv2sah network-scripts]# cat /etc/os-net-config/config.json 
{"network_config": [{"type": "ovs_bridge", "ovs_extra": ["br-set-external-id br-ctlplane bridge-id br-ctlplane"], "name": "br-ctlplane", "members": [{"type": "interface", "name": "bond0.120", "primary": "true"}], "addresses": [{"ip_netmask": "192.168.120.1/24"}]}]}


The bridge member entry is wrong. bond0.120 is a vlan.


The regenerated ifcfg-bond0.120 /etc/sysconfig/network-scripts/ifcfg-bond0.120
# This file is autogenerated by os-net-config
DEVICE=bond0.120
ONBOOT=yes
HOTPLUG=no
NM_CONTROLLED=no
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ctlplane
BOOTPROTO=none

As a result OVS will generate a bogus br-ctlpane:

root@fv2sah stack]# ovs-vsctl show
1532e349-c0e3-47b9-839e-d84470094823
    Bridge br-ctlplane
        Port "bond0.120"
            Interface "bond0.120"
                error: "could not open network device bond0.120 (No such device)"
        Port br-ctlplane
            Interface br-ctlplane
                type: internal
    ovs_version: "2.4.0"
[root@fv2sah stack]# ifup bond0.120
ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device bond0.120 does not seem to be present, delaying initialization.
ovs-vsctl: Error detected while setting up 'bond0.120'.  See ovs-vswitchd log for details.


If I add the missing vlan definition in the /etc/sysconfig/network-scripts/ifcfg-bond0.120 file:
VLAN=yes
I can now do a ifup bond0.120 and ovs now see the interface

[root@fv2sah network-scripts]# ovs-vsctl show
1532e349-c0e3-47b9-839e-d84470094823
    Bridge br-ctlplane
        Port "bond0.120"
            Interface "bond0.120"
        Port br-ctlplane
            Interface br-ctlplane
                type: internal
    ovs_version: "2.4.0"

Comment 1 Gonéri Le Bouder 2015-11-20 02:13:14 UTC
This is the correct os-net-config configuration:
{"network_config": [{"type": "ovs_bridge", "ovs_extra": ["br-set-external-id br-ctlplane bridge-id br-ctlplane"], "name": "br-ctlplane", "members": [{"type": "vlan", "name": "bond0", vlan_id: 120}], "addresses": [{"ip_netmask": "192.168.120.1/24"}]}]}

Comment 2 Gonéri Le Bouder 2015-11-20 18:58:42 UTC
Ok, it's more complicated than expected. the syntax above allow the creation of a internal OVS VLAN. That's not what we want. We just need the VLAN=true in /etc/sysconfig/network-scripts/ifcfg-bond0.120 and that's something os-net-config cannot do (yet?).

Comment 3 Gonéri Le Bouder 2015-11-20 21:01:53 UTC
I'd just submitted https://review.openstack.org/248246 upstream to fix the issue.

Comment 4 Dan Sneddon 2016-03-08 01:07:58 UTC
(In reply to Gonéri Le Bouder from comment #1)
> This is the correct os-net-config configuration:
> {"network_config": [{"type": "ovs_bridge", "ovs_extra": ["br-set-external-id
> br-ctlplane bridge-id br-ctlplane"], "name": "br-ctlplane", "members":
> [{"type": "vlan", "name": "bond0", vlan_id: 120}], "addresses":
> [{"ip_netmask": "192.168.120.1/24"}]}]}

Actually, this isn't right. If you are adding VLAN 120 to the br-ctlplane interface, then you wouldn't want a VLAN also defined under the bridge. That is what is overwriting your ifcfg-vlan120. In that case, you want to add a VLAN interface to the bridge but put the IP address directly on br-ctlplane, not on the VLAN interface.

We don't support that in os-net-config today. I see that your patch tries to add that functionality by overriding the interface object and allowing it to be specified as a VLAN.

Here is what we support today in os-net-config: Rather than trying to add an existing VLAN interface to your bridge, you can add the bond to the bridge and create OVSIntPort interfaces as VLANs to talk over the desired VLAN.

If you wanted to create the Linux bond outside of os-net-config, and have os-net-config create an OVS VLAN interface on top of that bond, you could use this configuration:

network_config:
  -
    type: ovs_bridge
    name: br-ctlplane
    members:
      -
        type: vlan
        vlan_id: 120
        ip_netmask:
          -
            192.0.2.1/24

Then add the bond to the bridge by hand after creation.

We do support the use case of creating the whole config with os-net-config:

network_config:
  -
    type: ovs_bridge
    name: br-ctlplane
    members:
      -
        type: linux_bond
        name: bond0
        members:
          -
            type: interface
            name: nic2
            primary: true
          -
            type: interface
            name: nic3
          -
            type: vlan
            vlan_id: 120
            device: bond0
            ip_netmask:
              -
                192.0.2.1/24

Whether we use one of the above configs for os-net-config, or if we add the functionality to os-net-config to add a VLAN interface to the bridge, we will have to update instack to be able to produce these kinds of configs if we want the process automated.

Comment 6 Chandan Kumar 2016-05-19 16:02:03 UTC
This bug is against a Version which has reached End of Life.
If it's still present in supported release (http://releases.openstack.org), please update Version and reopen.