Bug 1165306

Summary: [RFE] Add BMC interface to "Discovered Host" entry during foreman-discovery image
Product: Red Hat Satellite Reporter: John Trowbridge <jtrowbri>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.5CC: byodlows, dcleal, dmoessne, lzap, mhulan, ponsfrilus, riehecky, sghai, sthirugn, xdmoon
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 05:19:19 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:
Attachments:
Description Flags
with fake discover_host I can see the BMC interface none

Description John Trowbridge 2014-11-18 19:28:18 UTC
Description of problem:
1. Who is the customer behind the request?  
Account: Bank of America
Account number: 54545
TAM customer: yes  
SRM customer: yes  
Strategic: yes  
  
2. What is the nature and description of the request?  
-->
Automatically add the BMC interface to a "Discovered Host" entry using the foreman-discovery image.
  
3. Why does the customer need this? (List the business requirements here)  
-->
Bank of America requires a fully automated solution from the foreman UI.
  
4. How would the customer like to achieve this? (List the functional requirements here)  
-->
Providing a discovery image that adds the BMC interface automatically.
  
5. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.  
-->
An automated test on a device with a BMC interface would be able to test this functionality.  

6. Is there already an existing RFE upstream or in Red Hat Bugzilla?  
-->
No
  
7. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?  
-->
No
  
8. Is the sales team involved in this request and do they have any additional input?  
-->
No
  
9. List any affected packages or components.  
-->
The foreman discovery image
  
10. Would the customer be able to assist in testing this functionality if implemented?
-->
Yes

Additional Info:

The customer is currently using a manual process described in the "Configuration in Foreman" section here:
http://www.fitzdsl.net/2013/07/controlez-lalimentation-de-vos-serveurs-avec-foreman/

Comment 1 RHEL Program Management 2014-11-18 19:43:36 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Dominic Cleal 2014-11-20 13:33:15 UTC
lzap, please correct me if I'm wrong, but I believe this has already been delivered upstream with the latest images and plugin.

Comment 4 Lukas Zapletal 2014-11-20 16:02:08 UTC
Marek have included IPMI utilities on the image for Staypuft work, but I am not sure how this is/was used. CCing.

Marek, can you briefely describe the Staypuft use case? The customer would like to provision a system with IPMI set via Foreman Discovery. I don't believe this is currently possible.

Comment 9 Marek Hulan 2015-02-13 09:30:36 UTC
We added detection for IPMI device in discovery image. We use dmidecode to detect device, then ipmitool to fetch data like IP, MAC, netmask... We add these values as custom facts (names like fact_*) so we can parse them in Satellite and precreate such interfaces for discovered host when we receive facts from puppet agent. Therefore when users provision discovered host we can display the device in form and they don't have to type MAC and IP, they only specify username and password. They can still decide whether they want to e.g. remove the BMC interface or adjust some other attributes.

Comment 10 Marek Hulan 2015-02-13 09:39:32 UTC
How to test:
1) let some baremetal host with IPMI be discovered by Satellite
2) find the host in web UI under Host -> Discovered hosts
3) click Provision button for this host
4) select Interfaces tab
5) you should see interface with Type BMC with MAC address of IPMI device

Comment 11 Sachin Ghai 2015-02-13 10:45:12 UTC
Thanks Marek and Lukas. Info in comment 9 and 10 will help to verify bz.

Comment 17 Sachin Ghai 2015-05-26 08:04:01 UTC
Thanks Lukas. I tried steps in comment 16.

Created two fake commands and set them first in PATH.

Facter cmd gives me o/p like:

[root@fdi ~]# FACTERLIB=/usr/share/fdi/facts/ facter | grep ipmi
ipmi_enabled => true
ipmi_gateway => 10.16.71.254
ipmi_ipaddress => 10.16.66.72
ipmi_ipaddress_source => DHCP Address
ipmi_macaddress => 00:23:ae:fb:64:75
ipmi_subnet_mask => 255.255.248.0

[root@fdi ~]# systemctl stop discovery-register
[root@fdi ~]# systemctl start discovery-register

I stopped the discovery-register service and removed the discovered host from server and later I started the discovery-register and can see the discovered host again on UI but it doesn't show BMC facts and interface under new_host form.

Please suggest if I'm missing anything ?

Comment 18 Lukas Zapletal 2015-05-26 08:12:35 UTC
Weird, can you try to fake-discover a host:

[lzap@lzapx ~]$ cat ~/bin/public/discover-host
#!/bin/bash
URL=${1:-http://localhost:3000}
CREDENTIALS=${2:-admin:admin}
MAC=$(echo -n 52:54:00:; openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//')
MAC=${3:-$MAC}
IP="192.168.122.$(($RANDOM % 253 + 1))"
DEVICE=eth0
TMP_DATA=$(mktemp /tmp/discover-host-XXXXXXXXXX)
trap "rm -f $TMP_DATA" EXIT
cat <<EOD > $TMP_DATA
{
  "facts": {
    "discovery_bootif": "$MAC",
    "macaddress_$DEVICE": "$MAC",
    "ipaddress": "$IP",
    "ipaddress_$DEVICE": "$IP",
    "interfaces": "$DEVICE",
    "physicalprocessorcount": "3",
    "memorysize_mb": "900",
    "blockdevice.sda_size": "1234567890",
    "blockdevice.sdb_size": "123456700",
    "ipmi_1_gateway": "10.16.71.254",
    "ipmi_1_ipaddress": "10.16.68.91",
    "ipmi_1_ipaddress_source": "DHCP Address",
    "ipmi_1_macaddress": "00:14:5e:5b:8c:8e",
    "ipmi_1_subnet_mask": "255.255.248.0",
    "ipmi_enabled": "true",
    "ipmi_gateway": "10.16.71.254",
    "ipmi_ipaddress": "10.16.68.91",
    "ipmi_ipaddress_source": "DHCP Address",
    "ipmi_macaddress": "00:14:5e:5b:8c:8e",
    "ipmi_subnet_mask": "255.255.248.0"
  }
}
EOD
cat $TMP_DATA
curl -iku "$CREDENTIALS" \
  -H "Content-Type: application/json" \
  -d @$TMP_DATA -X POST $URL/api/v2/discovered_hosts/facts
echo -e "\n"

Comment 19 Sachin Ghai 2015-05-26 08:47:08 UTC
Yes.. with fake-discover host I can see the BMC interface on UI. Please see the screenshot.

Comment 20 Sachin Ghai 2015-05-26 08:48:57 UTC
Created attachment 1029808 [details]
with fake discover_host I can see the BMC interface

Comment 21 Sachin Ghai 2015-05-26 13:53:51 UTC
Verifying as per comment19.

Comment 22 Bryan Kearney 2015-08-11 13:18:54 UTC
This bug is slated to be released with Satellite 6.1.

Comment 23 errata-xmlrpc 2015-08-12 05:19:19 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