Bug 1162794

Summary: When setting up bonding and multiple subnets with VLANs with the installer the interfaces are missing the interface
Product: Red Hat OpenStack Reporter: Ramon Acedo <racedoro>
Component: rubygem-staypuftAssignee: Brad P. Crochet <brad>
Status: CLOSED ERRATA QA Contact: Asaf Hirshberg <ahirshbe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: Foreman (RHEL 6)CC: avozza, brad, dmacpher, dmaley, kimi.zhang, mburns, oblaut, pasik, rhos-maint, stuart.stent, tytus.kurek, yeylon
Target Milestone: ga   
Target Release: Installer   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Bonded VLAN interface configuration would fail if no MAC address existed for a parent interface. This is because the bond used the MAC address for identification. This fix changes the behaviour to use the interface name to identify the interface instead, which causes bonded VLANs to work correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-09 15:15:21 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: 1177026    

Description Ramon Acedo 2014-11-11 17:27:57 UTC
This is with A2 (rhel-osp-installer-0.4.7-1.el6ost.noarch)
To reproduce:

1. Create multiple subnets with VLAN IDs
2. Assign them to the different network roles with the deployment setup wizard
3. Assign hosts to the Controller HA and Compute (Neutron) roles
4. Configure the hosts network in the deployment: Hosts->Assigned->Select all->Configure Networks
5. Setup bonding with 2 NICs and assign the network roles to the bond interface

After deployment this how /etc/sysconfig/network-scripts looks like:

# ls /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-.101  /etc/sysconfig/network-scripts/ifcfg-.104   /etc/sysconfig/network-scripts/ifcfg-eno16777984
/etc/sysconfig/network-scripts/ifcfg-.102  /etc/sysconfig/network-scripts/ifcfg-.105   /etc/sysconfig/network-scripts/ifcfg-eno33557248
/etc/sysconfig/network-scripts/ifcfg-.103  /etc/sysconfig/network-scripts/ifcfg-bond0  /etc/sysconfig/network-scripts/ifcfg-lo

Looking at the install.post.log I can see some errors probably related:

head -20 install.post.log
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
found provisioning interface = eno16777984
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
found interface with default gateway =
gateway interface is a vlan and/or bond = bond0.105
setting PEERDNS=no on eno33557248
setting PEERDNS=no on bond0.105
sed: can't read /etc/sysconfig/network-scripts/ifcfg-bond0.105: No such file or directory
setting DEFROUTE=yes on bond0.105
sed: can't read /etc/sysconfig/network-scripts/ifcfg-bond0.105: No such file or directory

Back in the installer UI if I edit the hosts and go to Network I can see how the interfaces appear to be as expected with bond0.105 etc.

Comment 3 Ramon Acedo 2014-11-11 18:11:03 UTC
Looks like it's the same cause than https://bugzilla.redhat.com/show_bug.cgi?id=1157846

The reason seems to be the lack of MAC address in the interfaces, this is how the provisioning templates look like:

# bond0.101 interface
real=`ip -o link | grep  | awk '{print $2;}' | sed s/:$//`
real=`echo bond0.101 | sed s/bond0/$real/`

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real
BOOTPROTO="none"
IPADDR="192.168.101.12"
NETMASK="255.255.255.0"
GATEWAY=""
DEVICE="$real"
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
VLAN=yes
NM_CONTROLLED=no
DEFROUTE=no
EOF




# bond0.102 interface
real=`ip -o link | grep  | awk '{print $2;}' | sed s/:$//`
real=`echo bond0.102 | sed s/bond0/$real/`

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real
BOOTPROTO="none"
IPADDR="192.168.102.1"
NETMASK="255.255.255.0"
GATEWAY=""
DEVICE="$real"
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
VLAN=yes
NM_CONTROLLED=no
DEFROUTE=no
EOF

Comment 4 Mike Burns 2014-11-12 11:31:25 UTC
*** Bug 1163034 has been marked as a duplicate of this bug. ***

Comment 5 Brad P. Crochet 2014-11-12 16:41:29 UTC
PR available: https://github.com/theforeman/foreman-installer-staypuft/pull/111

Comment 6 Ramon Acedo 2014-11-13 10:53:58 UTC
Tested the patch and works as expected.

Comment 7 Ramon Acedo 2014-11-18 14:06:08 UTC
I noticed that despite the deployment works with the above changes, if the bonding module is not loaded at boot time the bonding device(s) won't be brought up after reboot. 

This solves it for me:

echo "alias bond* bonding" > /etc/modprobe.d/bonding.conf

This probably should be done properly by the kickstart_networking_setup Provisioning Template snippet.

Comment 8 Mike Burns 2015-01-05 15:41:53 UTC
@bcrochet can you look at comment 7?

Comment 10 Asaf Hirshberg 2015-01-13 07:36:38 UTC
verified

foreman-installer-1.6.0-0.2.RC1.el7ost.noarch
rhel-osp-installer-client-0.5.4-1.el7ost.noarch
openstack-foreman-installer-3.0.8-1.el7ost.noarch
rhel-osp-installer-0.5.4-1.el7ost.noarch
foreman-proxy-1.6.0.30-5.el7ost.noarch

Comment 13 errata-xmlrpc 2015-02-09 15:15:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0156.html