Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1193460 - while adding alias interface, mac should be auto populated based on attached_to interface
while adding alias interface, mac should be auto populated based on attached_...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Provisioning (Show other bugs)
6.1.0
Unspecified Unspecified
medium Severity high (vote)
: Beta
: Unused
Assigned To: Marek Hulan
Sachin Ghai
http://projects.theforeman.org/issues...
: Reopened, Triaged
Depends On: 1191913
Blocks: 1193023 1193987
  Show dependency treegraph
 
Reported: 2015-02-17 06:48 EST by Sachin Ghai
Modified: 2016-07-27 07:02 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 07:02:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
alias config file created with incorrect name (27.42 KB, image/png)
2015-05-06 09:16 EDT, Sachin Ghai
no flags Details
virtual interfaces configured on rhel7 host (60.91 KB, image/png)
2016-04-11 07:19 EDT, Sachin Ghai
no flags Details
virtual interfaces configured on rhel6 host (90.44 KB, image/png)
2016-04-11 07:20 EDT, Sachin Ghai
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 9615 None None None 2016-04-22 11:14 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Sachin Ghai 2015-02-17 06:48:56 EST
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 09:10:28 EST
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 06:36:37 EST
Created redmine issue http://projects.theforeman.org/issues/9615 from this bug
Comment 7 Bryan Kearney 2015-03-04 10:05:28 EST
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 04:22:35 EDT
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 04:24:21 EDT
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 10:53:26 EDT
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 08:10:08 EDT
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 09:15:10 EDT
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 09:16:17 EDT
Created attachment 1022667 [details]
alias config file created with incorrect name
Comment 16 Sachin Ghai 2015-05-06 09:59:26 EDT
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 01:52:47 EDT
I specified the interface identifier as eth0:0 and attached to interface as eth0.
Comment 18 Marek Hulan 2015-05-07 02:33:37 EDT
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 01:47:56 EDT
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 09:07:22 EDT
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 01:26:10 EDT
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 16:47:29 EDT
Accidentally closed with 6.1.1 errata
Comment 25 Bryan Kearney 2015-08-25 14:34:01 EDT
Upstream bug component is Provisioning
Comment 26 Marek Hulan 2015-08-27 04:43:42 EDT
Moving to POST again since upstream bug http://projects.theforeman.org/issues/9615 has been closed
Comment 28 Sachin Ghai 2016-04-11 07:19:15 EDT
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 07:19 EDT
Created attachment 1145924 [details]
virtual interfaces configured on rhel7 host
Comment 30 Sachin Ghai 2016-04-11 07:20 EDT
Created attachment 1145925 [details]
virtual interfaces configured on rhel6 host
Comment 31 Bryan Kearney 2016-07-27 07:02:24 EDT
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

Note You need to log in before you can comment on or make changes to this bug.