Bug 1782867 - "Found multiple compute-2, which is unexpected" if any host shortname starts with another host shortname
Summary: "Found multiple compute-2, which is unexpected" if any host shortname starts ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 16.0 (Train)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 16.0 (Train on RHEL 8.1)
Assignee: Adriano Petrich
QA Contact: Alexander Chuzhoy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-12 14:18 UTC by James Slagle
Modified: 2020-02-06 14:44 UTC (History)
5 users (show)

Fixed In Version: openstack-tripleo-common-11.3.2-0.20191212040219.77511ee.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-06 14:43:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1856193 0 None None None 2019-12-12 14:23:35 UTC
OpenStack gerrit 698726 0 None MERGED Revert "Update hostvars lookup to fix regression" 2020-01-30 16:14:35 UTC
Red Hat Product Errata RHEA-2020:0283 0 None None None 2020-02-06 14:44:05 UTC

Description James Slagle 2019-12-12 14:18:56 UTC
When config download runs to generate the ansible project directory, it will fail if any host shortname starts with another host's shortname.

Particularly, this will happen when deploying with more than 10 nodes of the same roles and using the default hostname formats since a hostname such as openstack-compute-10 starts with openstack-compute-1.

Sample traceback of a host called compute-2, and I also have hosts compute-20, compute-21, etc:

Traceback (most recent call last):
  File "/usr/bin/tripleo-config-download", line 57, in <module>
    stack_config.download_config(args.stack_name, args.output_dir)
  File "/home/centos/tripleo-common/tripleo_common/utils/config.py", line 577, in download_config
    self.write_config(stack, name, config_dir, config_type)
  File "/home/centos/tripleo-common/tripleo_common/utils/config.py", line 515, in write_config
    if role_host_vars and server_role:
SystemError: Found multiple `compute-2`, which is unexpected. This means that the FQDN of the selected device is either wrong or is sharing a name with another host, which is also wrong. Please correct this issue before continuing. Return data can be found here -> [{u'fqdn_internal_api': u'compute-2.internalapi.localdomain', u'fqdn_ctlplane': u'compute-2.ctlplane.localdomain', u'fqdn_storage': u'compute-2.storage.localdomain', u'fqdn_canonical': u'compute-2.localdomain', u'fqdn_tenant': u'compute-2.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-20.internalapi.localdomain', u'fqdn_ctlplane': u'compute-20.ctlplane.localdomain', u'fqdn_storage': u'compute-20.storage.localdomain', u'fqdn_canonical': u'compute-20.localdomain', u'fqdn_tenant': u'compute-20.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-21.internalapi.localdomain', u'fqdn_ctlplane': u'compute-21.ctlplane.localdomain', u'fqdn_storage': u'compute-21.storage.localdomain', u'fqdn_canonical': u'compute-21.localdomain', u'fqdn_tenant': u'compute-21.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-22.internalapi.localdomain', u'fqdn_ctlplane': u'compute-22.ctlplane.localdomain', u'fqdn_storage': u'compute-22.storage.localdomain', u'fqdn_canonical': u'compute-22.localdomain', u'fqdn_tenant': u'compute-22.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-23.internalapi.localdomain', u'fqdn_ctlplane': u'compute-23.ctlplane.localdomain', u'fqdn_storage': u'compute-23.storage.localdomain', u'fqdn_canonical': u'compute-23.localdomain', u'fqdn_tenant': u'compute-23.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-24.internalapi.localdomain', u'fqdn_ctlplane': u'compute-24.ctlplane.localdomain', u'fqdn_storage': u'compute-24.storage.localdomain', u'fqdn_canonical': u'compute-24.localdomain', u'fqdn_tenant': u'compute-24.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-25.internalapi.localdomain', u'fqdn_ctlplane': u'compute-25.ctlplane.localdomain', u'fqdn_storage': u'compute-25.storage.localdomain', u'fqdn_canonical': u'compute-25.localdomain', u'fqdn_tenant': u'compute-25.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-26.internalapi.localdomain', u'fqdn_ctlplane': u'compute-26.ctlplane.localdomain', u'fqdn_storage': u'compute-26.storage.localdomain', u'fqdn_canonical': u'compute-26.localdomain', u'fqdn_tenant': u'compute-26.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-27.internalapi.localdomain', u'fqdn_ctlplane': u'compute-27.ctlplane.localdomain', u'fqdn_storage': u'compute-27.storage.localdomain', u'fqdn_canonical': u'compute-27.localdomain', u'fqdn_tenant': u'compute-27.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-28.internalapi.localdomain', u'fqdn_ctlplane': u'compute-28.ctlplane.localdomain', u'fqdn_storage': u'compute-28.storage.localdomain', u'fqdn_canonical': u'compute-28.localdomain', u'fqdn_tenant': u'compute-28.tenant.localdomain'}, {u'fqdn_internal_api': u'compute-29.internalapi.localdomain', u'fqdn_ctlplane': u'compute-29.ctlplane.localdomain', u'fqdn_storage': u'compute-29.storage.localdomain', u'fqdn_canonical': u'compute-29.localdomain', u'fqdn_tenant': u'compute-29.tenant.localdomain'}].


The issue is caused by this patch:
https://review.opendev.org/#/c/695998/

These lines:
            if role_host_vars and server_role:
                servers_ansible_host_vars = [
                    v for k, v in server_role_vars.items()
                    if k.startswith(server)
                ]
                if len(servers_ansible_host_vars) > 1:
                    raise SystemError(
                        "Found multiple `{}`, which is unexpected. This means"
                        " that the FQDN of the selected device is either"
                        " wrong or is sharing a name with another host, which"
                        " is also wrong. Please correct this issue before"
                        " continuing. Return data can be found here"
                        " -> {}.".format(
                            server,
                            servers_ansible_host_vars
                        )
                    )
ine:

Comment 2 David Rosenfeld 2019-12-17 18:13:29 UTC
Verified: 

Executed regression job(which was reason for original commit):
https://rhos-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/DFG/view/df/view/controller_replacement/job/DFG-df-controller_replacement-16-virthost-3cont_3comp_3ceph-yes_UC_SSL-yes_OC_SSL-ceph-ipv4-geneve-replace_controller-corrupt_disk-RHELOSP-38495/7/

In addition checked with submitter and he stated: 

The problem I hit was fixed by this patch: https://code.engineering.redhat.com/gerrit/#/c/187649/ which is a revert of an earlier patch.

Above patch was committed to fix this bug.

Comment 6 errata-xmlrpc 2020-02-06 14:43:45 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/RHEA-2020:0283


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