Bug 1193460

Summary: while adding alias interface, mac should be auto populated based on attached_to interface
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: ProvisioningAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: medium    
Version: 6.1.0CC: bkearney, jmontleo, sghai, sthirugn
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/9615
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:02:24 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: 1191913    
Bug Blocks: 1193023, 1193987    
Attachments:
Description Flags
alias config file created with incorrect name
none
virtual interfaces configured on rhel7 host
none
virtual interfaces configured on rhel6 host none

Description Sachin Ghai 2015-02-17 11:48:56 UTC
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:

Comment 4 Marek Hulan 2015-02-26 14:10:28 UTC
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.

Comment 5 Marek Hulan 2015-03-03 11:36:37 UTC
Created redmine issue http://projects.theforeman.org/issues/9615 from this bug

Comment 7 Bryan Kearney 2015-03-04 15:05:28 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9615 has been closed
-------------
Marek Hulán
Applied in changeset commit:5ad3c4f34b50fb1ac6d9f26e71e183813ab1c96f.

Comment 10 Sachin Ghai 2015-03-17 08:22:35 UTC
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.

Comment 11 Sachin Ghai 2015-03-17 08:24:21 UTC
Since I didn't specify the mac, the interface automatically removed. I can't see it on edit host after host provisioning succeed.

Comment 12 Marek Hulan 2015-03-19 14:53:26 UTC
Moving back to ON_QA as it's a separate issue tracked as https://bugzilla.redhat.com/show_bug.cgi?id=1191913

Comment 13 Sachin Ghai 2015-05-06 12:10:08 UTC
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
--

Comment 14 Sachin Ghai 2015-05-06 13:15:10 UTC
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.

Comment 15 Sachin Ghai 2015-05-06 13:16:17 UTC
Created attachment 1022667 [details]
alias config file created with incorrect name

Comment 16 Sachin Ghai 2015-05-06 13:59:26 UTC
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
--

Comment 17 Sachin Ghai 2015-05-07 05:52:47 UTC
I specified the interface identifier as eth0:0 and attached to interface as eth0.

Comment 18 Marek Hulan 2015-05-07 06:33:37 UTC
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?

Comment 19 Sachin Ghai 2015-05-08 05:47:56 UTC
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.

Comment 20 Sachin Ghai 2015-05-08 13:07:22 UTC
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

Comment 23 errata-xmlrpc 2015-08-12 05:26:10 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://access.redhat.com/errata/RHSA-2015:1592

Comment 24 sthirugn@redhat.com 2015-08-14 20:47:29 UTC
Accidentally closed with 6.1.1 errata

Comment 25 Bryan Kearney 2015-08-25 18:34:01 UTC
Upstream bug component is Provisioning

Comment 26 Marek Hulan 2015-08-27 08:43:42 UTC
Moving to POST again since upstream bug http://projects.theforeman.org/issues/9615 has been closed

Comment 28 Sachin Ghai 2016-04-11 11:19:15 UTC
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.

Comment 29 Sachin Ghai 2016-04-11 11:19:55 UTC
Created attachment 1145924 [details]
virtual interfaces configured on rhel7 host

Comment 30 Sachin Ghai 2016-04-11 11:20:30 UTC
Created attachment 1145925 [details]
virtual interfaces configured on rhel6 host

Comment 31 Bryan Kearney 2016-07-27 11:02:24 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://access.redhat.com/errata/RHBA-2016:1501