Red Hat Bugzilla – Bug 1193460
while adding alias interface, mac should be auto populated based on attached_to interface
Last modified: 2016-07-27 07:02:24 EDT
Description of problem: We don't have any validation around mac while adding an interface. I got to know we don't need mac when we add virtual interface. Now let's say I've to configure alias of eth0, so in this case mac of alias would be same as of eth0. So UI should auto populate same mac as of attached_to interface i.e. eth0. Or user should restrict to input mac address while defining new alias interface. I can create alias interface without defining mac and add_interface form saved successfully. But if I do that then interface won't be configured at provisioned node. In short, we should either of these: 1) either we should restrict user to input mac while alias interface via some validation/warning 2) Or UI should auto populate the mac of attached-to interface. Version-Release number of selected component (if applicable): Satellite-6.1.0-RHEL-6-20150210.0 Sat6.1.0 beta snap2 How reproducible: always Steps to Reproduce: 1. while creating new host, add alias interface without defining mac 2. 3. Actual results: alias interface won't be configured on provisioned node Expected results: UI should auto pick the mac of main interface to which we are attaching the alias. Additional info:
Alternative solution could be - change the config template so it uses MAC of interface that Alias or VLAN is attached to if the MAC is missing. The MAC should not be mandatory.
Created redmine issue http://projects.theforeman.org/issues/9615 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/9615 has been closed ------------- Marek Hulán Applied in changeset commit:5ad3c4f34b50fb1ac6d9f26e71e183813ab1c96f.
Verified with: sat6.1 beta snap6 compose2 (Satellite-6.1.0-RHEL-6-20150311.1). As per comment 4, I tried to create an alias interface without specifying mac while host provisioning. But I couldn't see configured alias interface on provisioned host. So as per comment 4, I believe config template should auto pick the mac of interface that Alias interface is attached to. Moving this back to assigned.
Since I didn't specify the mac, the interface automatically removed. I can't see it on edit host after host provisioning succeed.
Moving back to ON_QA as it's a separate issue tracked as https://bugzilla.redhat.com/show_bug.cgi?id=1191913
Verified with sat6.1 snap2 (Satellite-6.1.0-RHEL-7-20150429.2) I can provision a instance with alias interface and without defining mac. If I didn't specify mac, interface is getting configured on provisioned host without any issue. here is snippet from provisioning template: -- # eth0:0 interface real=`ip -o link | grep | awk '{print $2;}' | sed s/:$//` real=`echo eth0:0 | sed s/eth0/$real/` cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real BOOTPROTO="none" IPADDR="192.168.100.124" NETMASK="255.255.255.248" DEVICE="$real" ONBOOT=yes PEERDNS=no PEERROUTES=no TYPE=Alias EOF --
Sorry, I was bit quick.. I just checked on provisioned host. The aliased interface is not configured properly. The interface created with file ifcfg-:0. I think that's the issue. Please see the screenshot.
Created attachment 1022667 [details] alias config file created with incorrect name
In below snippet: looks like mac is missing : >> real=`ip -o link | grep | awk '{print $2;}' | sed s/:$//` -- # eth0:0 interface real=`ip -o link | grep | awk '{print $2;}' | sed s/:$//` real=`echo eth0:0 | sed s/eth0/$real/` cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real BOOTPROTO="none" IPADDR="192.168.100.124" NETMASK="255.255.255.248" DEVICE="$real" ONBOOT=yes PEERDNS=no PEERROUTES=no TYPE=Alias EOF --
I specified the interface identifier as eth0:0 and attached to interface as eth0.
Sachin, the snippet is correct, Alias interface does not have MAC in it's configuration. The thing here is that eth0 had a MAC that was not found on the host. Therefore the $real was empty. This happens if you provision a virtual host where you don't know the MAC before the host is physically created. Could you please share information what values you used for host primary interface and all additional interfaces and on which compute resource did you provision the host?
Hey Marek. I was using libvirt compute resource and I was trying to create aliase interface by attaching it to primary interface eth0. I didn't created any additional interface. But I'll test this change with discovery and will update here.
I tried alias configuration on discovered host without defining mac and this time interface configuration fails with same issue. Interface file created with name: ifcfg-:0 and value of DEVICE set like DEVICE=:0
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://access.redhat.com/errata/RHSA-2015:1592
Accidentally closed with 6.1.1 errata
Upstream bug component is Provisioning
Moving to POST again since upstream bug http://projects.theforeman.org/issues/9615 has been closed
Verified with sat6.2 beta snap6.2 I can define virtual interfaces like alias and vlan, without explicitly defining the mac address. [root@mac525400e6005b ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0_0 BOOTPROTO="none" IPADDR="192.168.100.120" NETMASK="255.255.255.248" DEVICE=eth0:0 ONBOOT=yes PEERDNS=no PEERROUTES=no TYPE=Alias [root@mac525400e6005b ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0.1 BOOTPROTO="none" IPADDR="192.168.100.122" NETMASK="255.255.255.248" DEVICE=eth0.1 ONBOOT=yes PEERDNS=no PEERROUTES=no VLAN=yes Please see the attached screenshots for verification.
Created attachment 1145924 [details] virtual interfaces configured on rhel7 host
Created attachment 1145925 [details] virtual interfaces configured on rhel6 host
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://access.redhat.com/errata/RHBA-2016:1501