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:
*** Bug 1489632 has been marked as a duplicate of this bug. ***
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.
(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.
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.
(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.
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.
(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.
(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!
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/
(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!
I think the preference, at least for my customer, would be the nova name.
PR upstream https://bugzilla.redhat.com/show_bug.cgi?id=1400314
Hey, Petr. I think you meant to put the link to the upstream PR in Comment 28.
It is https://github.com/ManageIQ/manageiq-ui-classic/pull/3561
Sorry Marianne, I think I was a little tired that day :-) Thank you Marek for providing the right link.
https://github.com/ManageIQ/manageiq-ui-classic/commit/cee29342fed1f5586efafe44ceb1b32e4e08e632
Verified on 5.10.0.2
Verified on 5.10.0.23