Bug 1400314 - [RFE][XS-2] CloudForms does not show node hostname, only GUID for OpenStack Infrastructure Provider
Summary: [RFE][XS-2] CloudForms does not show node hostname, only GUID for OpenStack I...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: MVP
: 5.10.0
Assignee: Bronagh Sorota
QA Contact: Jad Haj Yahya
URL:
Whiteboard: openstack
: 1489632 (view as bug list)
Depends On:
Blocks: 1555371 1557361
TreeView+ depends on / blocked
 
Reported: 2016-11-30 21:32 UTC by Saif Ali
Modified: 2022-03-13 14:08 UTC (History)
19 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1557361 (view as bug list)
Environment:
Last Closed: 2019-02-11 13:55:21 UTC
Category: ---
Cloudforms Team: Openstack
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3228821 0 None None None 2017-10-31 17:14:01 UTC

Description Saif Ali 2016-11-30 21:32:06 UTC
Description of problem:
When we log into our Cloudforms instance, go to COMPUTE > INFRASTRUCTURE > NODES > any node, we see a field called hostname but it's being populated with an IP address.  We need them to display the hostname of the node.


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

How reproducible:


Steps to Reproduce:
1. Add OpenStack Infrastructure Provider
2. OMPUTE > INFRASTRUCTURE > NODES > Any node
3.

Actual results:


Expected results:
Properties:
Hostname: should display the node hostname

Additional info:

Comment 3 Robb Manes 2017-09-27 15:42:56 UTC
*** Bug 1489632 has been marked as a duplicate of this bug. ***

Comment 6 Tzu-Mainn Chen 2017-10-11 16:02:31 UTC
Ironic doesn't provide a hostname, unfortunately. Do you want the hypervisor_hostname, which comes from nova? If so, it looks like you can use the hypervisor_hostname field.

Comment 7 Robb Manes 2017-10-12 16:25:00 UTC
(In reply to Tzu-Mainn Chen from comment #6)
> Ironic doesn't provide a hostname, unfortunately. Do you want the
> hypervisor_hostname, which comes from nova? If so, it looks like you can use
> the hypervisor_hostname field.

As per our discussion here (https://github.com/ManageIQ/manageiq-providers-openstack/pull/95) if there's not an instance deployed then using Nova we can't get the name of the host, so we always default to the GUID.  I read through this and learned a bit more about the Ironic and Nova API's and see what you mean now a bit better I think.

Here we set the hypervisor_hostname to the UUID (https://github.com/ManageIQ/manageiq-providers-openstack/blob/master/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb#L331)

And here we set the host_name to the UUID (also possible including `purpose`): (https://github.com/ManageIQ/manageiq-providers-openstack/blob/master/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb#L313)

So, and please correct me if I'm wrong, there doesn't seem to be a way for us to reliably get any non-UUID name from the Ironic or Nova API's for each hypervisor, just a relatively persistant UUID to refer to each node.  For customers desiring reporting (which they can select either the 'hostname' which will be assigned to the ip_address or the 'hypervisor_hostname' which will provide the UUID) I can't think of a way to remedy this without actually having it returned by Ironic.

Do I understand the problem right?  If so, I think the solution for everyone is, unfortunately, to just match UUID's to the appropriate host using the Ironic API/Openstack CLI, and there isn't much we can do in CFME/MIQ to map those two values, as we don't truly know the hostname and don't have a reliable way to get it (or, rather, we can't ensure that we will *always* have the hostname as if no instances are on a node, we will have to rely on the GUID of the node from Ironic)?

Let me know if I am off-base with my analysis/assumptions.

Comment 8 Tzu-Mainn Chen 2017-10-12 16:36:46 UTC
Hi! That's correct, except that the hypervisor_hostname will actually be something like 'overcloud-novacompute-0' or 'overcloud-controller-0'. If that's a better value we can expose it in the reports UI, but I'm not sure there's much else we can do.

Comment 9 Robb Manes 2017-10-12 18:06:02 UTC
(In reply to Tzu-Mainn Chen from comment #8)
> Hi! That's correct, except that the hypervisor_hostname will actually be
> something like 'overcloud-novacompute-0' or 'overcloud-controller-0'. If
> that's a better value we can expose it in the reports UI, but I'm not sure
> there's much else we can do.

I will ask the customer if that's something they're interested in exposing or using.  When I create a report with "hypervisor_hostname" it still provides the UUID followed by "(NovaCompute)" which I assume is the `purpose` part of the string returned in the identify_host_name method.  The end problem is reporting so *perhaps* that's better - either way thank you very much for the help so far.

Waiting on me for now until we hear back.

Comment 10 Robb Manes 2017-10-31 15:30:13 UTC
Potentially dumb: would it be out of the question to do resolution of DNS names by IPv4 address in CFME and fallback if it can't be found, particularly if the OSP and CFME instances don't share DNS?

Something like:

diff --git a/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb b/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb
index 403f31d..25b40ff 100644
--- a/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb
+++ b/app/models/manageiq/providers/openstack/infra_manager/refresh_parser.rb
@@ -188,7 +188,12 @@ module ManageIQ
         host_name           = identify_host_name(indexed_resources, host.instance_uuid, uid)
         hypervisor_hostname = identify_hypervisor_hostname(host, indexed_servers)
         ip_address          = identify_primary_ip_address(host, indexed_servers)
-        hostname            = ip_address
+
+       begin
+         hostname = Resolv.getname ip_address
+       rescue ResolvError
+         hostname = ip_address
+       end
 
         introspection_details = get_introspection_details(host)
         extra_attributes = get_extra_attributes(introspection_details)

I know we'd have to have resolv be required somewhere too, and this might add overhead and delay due to possibly slow DNS during a refresh so it may not be acceptable.

Comment 11 Robb Manes 2017-10-31 16:53:30 UTC
(In reply to Robb Manes from comment #10)
> I know we'd have to have resolv be required somewhere too, and this might
> add overhead and delay due to possibly slow DNS during a refresh so it may
> not be acceptable.

In addition to just delay, assuming that OSP and CFME have different DNS servers, we could get faux results for addresses potentially if they are both in private spaces with different DNS, if the IP's overlapped from one to the other.  This is probably a bad idea overall, but sans having Ironic/Heat provide us with this information I don't think this can really be addressed in CFME - correct me if I'm wrong.

(In reply to Tzu-Mainn Chen from comment #8)
> Hi! That's correct, except that the hypervisor_hostname will actually be
> something like 'overcloud-novacompute-0' or 'overcloud-controller-0'. If
> that's a better value we can expose it in the reports UI, but I'm not sure
> there's much else we can do.

The customer in this specific case is looking for a way to avoid doing node-lookups, just getting the DNS name, so I think this is a "no" in our specific case.  I do think it would potentially be better-looking on a report than a wrapping UUID however, but that is my personal opinion as that name is still entirely relative to ironic and not helpful for this specific customer's use case.

Comment 12 Robb Manes 2017-11-01 19:00:27 UTC
(In reply to Tzu-Mainn Chen from comment #8)
> Hi! That's correct, except that the hypervisor_hostname will actually be
> something like 'overcloud-novacompute-0' or 'overcloud-controller-0'. If
> that's a better value we can expose it in the reports UI, but I'm not sure
> there's much else we can do.

The customer has requested that we report logical names from ironic instead of UUID's - I was wrong.  Is this something we can request/do here?  Thanks!

Comment 13 Marek Aufart 2017-11-02 08:49:53 UTC
Hi Robb, I'm not sure I'm getting it. Do we want add some field to Host page or adjust a field identifying the Host in Reports? Thanks

The field we currently store about the host are at http://paste.openstack.org/show/625320/

Comment 14 Robb Manes 2017-11-02 17:31:33 UTC
(In reply to Marek Aufart from comment #13)
> Hi Robb, I'm not sure I'm getting it. Do we want add some field to Host page
> or adjust a field identifying the Host in Reports? Thanks

In this case, a way to expose the hypervisor_hostname to reports as it is the ironic logical hostname is what we're looking for - which is better than the IP and UUID it currently displays with just "hostname" now.  Thanks!

Comment 17 Chris Paquin 2017-11-16 18:54:25 UTC
I think the preference, at least for my customer, would be the nova name.

Comment 28 Petr Blaho 2018-03-09 16:26:54 UTC
PR upstream https://bugzilla.redhat.com/show_bug.cgi?id=1400314

Comment 29 Marianne Feifer 2018-03-09 17:10:00 UTC
Hey, Petr.  I think you meant to put the link to the upstream PR in Comment 28.

Comment 30 Marek Aufart 2018-03-12 07:46:21 UTC
It is https://github.com/ManageIQ/manageiq-ui-classic/pull/3561

Comment 31 Petr Blaho 2018-03-12 12:40:04 UTC
Sorry Marianne, I think I was a little tired that day :-)

Thank you Marek for providing the right link.

Comment 35 Jad Haj Yahya 2018-07-03 08:40:07 UTC
Verified on 5.10.0.2

Comment 37 Jad Haj Yahya 2018-11-14 10:06:58 UTC
Verified on 5.10.0.23


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