Bug 1489632

Summary: OpenStack infrastructure hosts have ip_address assigned to hostname
Product: Red Hat CloudForms Management Engine Reporter: Robb Manes <rmanes>
Component: ProvidersAssignee: Tzu-Mainn Chen <tzumainn>
Status: CLOSED DUPLICATE QA Contact: Ola Pavlenko <opavlenk>
Severity: high Docs Contact:
Priority: high    
Version: 5.8.0CC: gblomqui, jfrey, jhardy, obarenbo, okolisny
Target Milestone: GA   
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-27 15:42:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1511957    

Description Robb Manes 2017-09-08 01:32:47 UTC
Description of problem:
Using an OpenStack infrastructure provider, the "hostname" field is always set to the IP address, not the hostname of the host.

$ curl -k -u admin:smartvm https://cfme-env/api/hosts/1000000000111 | python -mjson.tool
{
    "actions": [
	{
	    "href": "https://cfme-env/api/hosts/1000000000111",
	    "method": "post",
	    "name": "edit"
	}
    ],
---------------
    "hostname": "192.168.1.2",
    "href": "https://cfme-env/api/hosts/1000000000111",
    "hypervisor_hostname": "prod-compute-host.example.com",
    "id": 1000000000633,
    "ipaddress": "192.168.1.2",
---------------
    "vmm_product": "rhel (Nova Compute hypervisor)",
    "vmm_vendor": "redhat"
}

In other providers this field is the genuine hostname, such as OVirt or RHEV I believe after reviewing their gems.  I didn't see if 'hostname' field is set this way in the event it's behind a load balancer or something similar, but as it appears not I thought I'd submit the PR anyway.

The impact of this is reports showing the name of the host only provide an IP address, not the actual hostname, which is necessary for capacity reporting to the end customer.

Upstream PR is here - if this is in error please feel free to shut it down with an explanation as to why the IP should also be the hostname:

https://github.com/ManageIQ/manageiq-providers-openstack/pull/94

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

How reproducible:
Every time

Steps to Reproduce:
1. Add OpenStack infrastructure provider
2. View hostname

Actual results:
Hostname and IP address are always the same.

Expected results:
Hostname should be the hostname of the host, not the address.

Thanks!

Comment 2 Robb Manes 2017-09-08 01:45:19 UTC
Improperly opened PR, sorry about that.  Link is:

https://github.com/ManageIQ/manageiq-providers-openstack/pull/95

Comment 3 Robb Manes 2017-09-27 15:42:56 UTC

*** This bug has been marked as a duplicate of bug 1400314 ***