RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1334162 - nova-compute-wait complains about Invalid Nova host name.
Summary: nova-compute-wait complains about Invalid Nova host name.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: Asaf Hirshberg
URL:
Whiteboard:
Depends On: 1320783
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-09 04:44 UTC by Andrew Beekhof
Modified: 2016-11-04 04:50 UTC (History)
8 users (show)

Fixed In Version: fence-agents-4.0.11-40.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1320783
Environment:
Last Closed: 2016-11-04 04:50:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2373 0 normal SHIPPED_LIVE fence-agents bug fix update 2016-11-03 13:51:30 UTC

Comment 4 Oyvind Albrigtsen 2016-07-04 13:52:33 UTC
New build to fix 'nil' issue (see https://bugzilla.redhat.com/show_bug.cgi?id=1287311 for more info).

Comment 5 Asaf Hirshberg 2016-07-18 06:27:49 UTC
Andrew,
Can you please share reproducing steps?

Comment 6 Andrew Beekhof 2016-07-19 03:54:14 UTC
Pulling info from the description:

1. specify host as FQDN in nova.conf (eg. overcloud-controller-0.localdomain)
2. specify hostname of the node in pcs as FQDN (eg. overcloud-controller-0.localdomain)
3. set domain attribute of the remote resource (eg. localdomain)

Old agent: complains about invalid nova host name
New agent: works

Comment 7 Asaf Hirshberg 2016-08-07 06:37:21 UTC
Code Verified, 
[root@overcloud-controller-0 heat-admin]# rpm -qa |grep fence-agents-com
fence-agents-common-4.0.11-40.el7.x86_64
fence-agents-compute-4.0.11-40.el7.x86_64

[root@overcloud-controller-0 heat-admin]# sed -n '205,284p' /usr/sbin/fence_compute 
			logging.debug("Waiting for nova to update it's internal state for %s" % options["--plug"])
			time.sleep(1)

	if not _host_evacuate(options):
		sys.exit(1)

	return


def fix_domain(options):
	domains = {}
	last_domain = None

	if nova:
		# Find it in nova

		hypervisors = nova.hypervisors.list()
		for hypervisor in hypervisors:
			shorthost = hypervisor.hypervisor_hostname.split('.')[0]

			if shorthost == hypervisor.hypervisor_hostname:
				# Nova is not using FQDN 
				calculated = ""
			else:
				# Compute nodes are named as FQDN, strip off the hostname
				calculated = hypervisor.hypervisor_hostname.replace(shorthost+".", "")

			domains[calculated] = shorthost

			if calculated == last_domain:
				# Avoid complaining for each compute node with the same name
				# One hopes they don't appear interleaved as A.com B.com A.com B.com
				logging.debug("Calculated the same domain from: %s" % hypervisor.hypervisor_hostname)

			elif options.has_key("--domain") and options["--domain"] == calculated:
				# Supplied domain name is valid 
				return

			elif options.has_key("--domain"):
				# Warn in case nova isn't available at some point
				logging.warning("Supplied domain '%s' does not match the one calculated from: %s"
					      % (options["--domain"], hypervisor.hypervisor_hostname))

			last_domain = calculated

	if len(domains) == 0 and not options.has_key("--domain"):
		logging.error("Could not calculate the domain names used by compute nodes in nova")

	elif len(domains) == 1 and not options.has_key("--domain"):
		options["--domain"] = last_domain

	elif len(domains) == 1:
		logging.error("Overriding supplied domain '%s' does not match the one calculated from: %s"
			      % (options["--domain"], hypervisor.hypervisor_hostname))
		options["--domain"] = last_domain

	elif len(domains) > 1:
		logging.error("The supplied domain '%s' did not match any used inside nova: %s"
			      % (options["--domain"], repr(domains)))
		sys.exit(1)

def fix_plug_name(options):
	if options["--action"] == "list":
		return

	if not options.has_key("--plug"):
		return

	fix_domain(options)
	short_plug = options["--plug"].split('.')[0]
	logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], calculated))

	if not options.has_key("--domain"):
		# Nothing supplied and nova not available... what to do... nothing
		return

	elif options["--domain"] == "":
		# Ensure any domain is stripped off since nova isn't using FQDN
		options["--plug"] = short_plug

[root@overcloud-controller-0 heat-admin]#

Comment 9 errata-xmlrpc 2016-11-04 04:50:04 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://rhn.redhat.com/errata/RHBA-2016-2373.html


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