Bug 1268207

Summary: Duplicate Interfaces identifiers prevents updating host details (including removing the duplicate interfaces) from either UI or API
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: ProvisioningAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.2CC: bbuckingham, bkearney, cwelton, rbobek, riehecky, sghai, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/11034
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 08:56:46 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: 1327576    
Bug Blocks: 1122832    
Attachments:
Description Flags
duplicate eth1 interface
none
here I defined 3 interafces eth0, eth1, eth2
none
Later updated interface identifiers and updated facts via puppet. Interfaces identifier updated and I can edit host details like media etc none

Description Peter Vreman 2015-10-02 06:59:27 UTC
Description of problem:
I receive the unspecified error that something is wrong with the interfaces.
 1. What exactly is wrong is not specified leaving the user clueless what might be the fix.
 2. I never set the any values of interfaces through neither the GUI or API, so how can it be that it is now suddenly invalid?
 3. The error is thrown when other non-network related values were modified, i my case the medium and ptable.

# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"host\":{\"medium_id\":10,\"ptable_id\":7}}" -XPUT https://localhost/api/v2/hosts/5
{
  "error": {"id":5,"errors":{"interfaces":["some of interfaces are invalid"]},"full_messages":["Interfaces some of interfaces are invalid"]}
}

# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"host\":{\"medium_id\":10,\"ptable_id\":7}}" -XGET https://localhost/api/v2/hosts/5 | jq .interfaces
[
  {
    "type": "interface",
    "mac": "00:50:56:97:09:c0",
    "ip": "10.92.65.36",
    "name": null,
    "id": 13
  },
  {
    "type": "interface",
    "mac": "00:50:56:97:4b:fb",
    "ip": null,
    "name": null,
    "id": 12
  },
  {
    "type": "interface",
    "mac": "00:50:56:97:69:3a",
    "ip": "10.92.72.1",
    "name": null,
    "id": 14
  }
]


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. See the interface configuration above
2. Update a value in the host
3.

Actual results:
Updating of medium and ptable fails

Expected results:
Updating of medium and ptable succeeds


Additional info:

Comment 1 Peter Vreman 2015-10-02 07:18:58 UTC
Created attachment 1079362 [details]
duplicate eth1 interface

In the UI i can see that eth1 is used twice as identifier.

This is incorrect, as with the current running system there is only 1 eth1. The second eth1 was only used during the kickstart process. But after the reboot at the end of the kickstart the real ethX are there. Foreman shall then see those ethX values and remove any temporary ethX devices used during kickstart.

The same would happend with cloning the VM (e.g. for backup) and then reverting back to the clone (restore of backup). I will create a seperate BZ for this

Comment 2 Peter Vreman 2015-10-02 07:34:11 UTC
Below is the corresponding interface configuration and facter data seen on the host:

vrempet@li-lc-1017 ~
$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:97:69:3a brd ff:ff:ff:ff:ff:ff
    inet 10.92.72.1/24 brd 10.92.72.255 scope global eth2
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
    link/ether 00:50:56:97:4b:fb brd ff:ff:ff:ff:ff:ff
    inet 10.92.14.36/24 brd 10.92.14.255 scope global eth0
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
    link/ether 00:50:56:97:09:c0 brd ff:ff:ff:ff:ff:ff
    inet 10.92.65.36/24 brd 10.92.65.255 scope global eth1

vrempet@li-lc-1017 ~
$ sudo facter -p | grep interfaces
interfaces => eth0,eth1,eth2,lo

vrempet@li-lc-1017 ~
$ sudo facter -p | grep _eth
ipaddress_eth0 => 10.92.14.36
ipaddress_eth1 => 10.92.65.36
ipaddress_eth2 => 10.92.72.1
macaddress_eth0 => 00:50:56:97:4B:FB
macaddress_eth1 => 00:50:56:97:09:C0
macaddress_eth2 => 00:50:56:97:69:3A
mtu_eth0 => 9000
mtu_eth1 => 9000
mtu_eth2 => 9000
netmask_eth0 => 255.255.255.0
netmask_eth1 => 255.255.255.0
netmask_eth2 => 255.255.255.0
network_eth0 => 10.92.14.0
network_eth1 => 10.92.65.0
network_eth2 => 10.92.72.0

Comment 3 Peter Vreman 2015-10-02 09:34:35 UTC
Deleting the duplicate interfaces from the UI also not possible.
When i delete the duplicate interfaces and press Submit it always reports "Some of the interfaces are invalid. Please check the table below."

Comment 4 Peter Vreman 2015-10-05 14:38:01 UTC
Looks like http://projects.theforeman.org/issues/11034

Comment 6 Bryan Kearney 2015-10-07 12:44:16 UTC
Connecting redmine issue http://projects.theforeman.org/issues/11034 from this bug

Comment 7 Bryan Kearney 2015-10-07 12:45:02 UTC
Per Marek Hulan:


the upstream issue would just help with getting rid of extra interface but 
wouldn't solve the original cause - the creation of invalid interface. It's 
not straightforward to cherry pick this to downstream as it relies on fact 
that all addresses are in interfaces objects which is not the case in 6.1 as 
primary IP and MAC are still in host, so bigger changes would have to be done. 

Another workaround to get rid of invalid interfaces that should work in Sat 
6.1 is to use the interface API (not host API) which should skip this 
validation.

Comment 9 Bryan Kearney 2015-10-07 14:05:51 UTC
Upstream bug assigned to mhulan

Comment 12 Tazim Kolhar 2016-04-07 07:34:18 UTC
Hi,

  please provide verification steps

Thanks and Regards,
Tazim

Comment 13 Marek Hulan 2016-04-07 07:51:26 UTC
Tazim, you can try following

1. add new NIC to host with one existing interface, 
2. swap identifiers with the one that was already there (eth0 <-> eth1),
3. rerun puppet 

now go to host edit form and try to save it with some change, e.g. different partition table. Interfaces should be updated correctly after puppet run so no errors on interfaces should be reported.

Comment 14 Sachin Ghai 2016-05-31 08:43:46 UTC
Verified with sat6.2 snap13.1

The reported issue is no longer reproducible with snap13.1. I defined interfaces as suggested in comment13. I created 3 interfaces eth0, eth1 and eth2. later I swapped eth1 <-> eth2 and ran "puppet agent -t", I see updated config under host details -. NIC.

Later when I tried to update the ptable, media but edit host, I was able to do that without any issue.

Comment 15 Sachin Ghai 2016-05-31 09:29:41 UTC
Created attachment 1163160 [details]
here I defined 3 interafces eth0, eth1, eth2

Comment 16 Sachin Ghai 2016-05-31 10:10:23 UTC
Created attachment 1163169 [details]
Later updated interface identifiers and updated facts via puppet. Interfaces identifier updated and I can edit host details like media etc

Comment 18 errata-xmlrpc 2016-07-27 08:56:46 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:1500