"hostname" option is required if the baremetal node name includes capital letters

Bug #1978356 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Harald Jensås

Bug Description

When using baremetal deployment definition without hostname, but node name with uppercase letters:

- name: Controller
  count: 1
  instances:
    - name: Controller
- name: Compute
  count: 1
  instances:
    - name: Compute

The node provisioning process creates file:
 overcloud-deploy/overcloud/inventory-network-config.yaml

This file is is used when generating the ansible inventory. This file contain the hostnames with uppercase:

Compute:
  hosts:
    Compute:
      < .. config .. >
Controller:
  hosts:
    Controller:
      < .. config .. >

In the code generating the ansible inventory the hostname is lowercase because it is derived from a neutron port `dns_name` property.
The `dns_name` property is always lowercase:

$ openstack port set --dns-name UPPERCASE 3a10d10d-95bd-4c71-b24b-7d858af1ddc1
$ openstack port show 3a10d10d-95bd-4c71-b24b-7d858af1ddc1 -c dns_name
+----------+-----------+
| Field | Value |
+----------+-----------+
| dns_name | uppercase |
+----------+-----------+

The code that extend the inventory based on the `inventory-network-config.yaml` does a lookup using the lowercase name, and finds no data. The result is that any settings defined in `inventory-network-config.yaml` is not included in the inventory.

Since the hostname in inventory is always lowercase, we can convert to lowercase always when generating the `inventory-network-config.yaml`[1].

[1]https://opendev.org/openstack/tripleo-ansible/src/branch/master/tripleo_ansible/ansible_plugins/modules/tripleo_generate_inventory_network_config.py#L229

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (master)
Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/845486
Committed: https://opendev.org/openstack/tripleo-ansible/commit/0056c2b8970a3f6d6317edcdf2372ff32c29de85
Submitter: "Zuul (22348)"
Branch: master

commit 0056c2b8970a3f6d6317edcdf2372ff32c29de85
Author: Harald Jensås <email address hidden>
Date: Fri Jun 10 23:39:25 2022 +0200

    Use lowercase hostname in inventory network config

    The ansible inventory uses the neutron port dns_name as
    hostname. The `dns_name` in neutron is always lowercase.
    If a hostname with one or more capital letters are used in
    baremetal deployment YAML the data lookup from `inventory-
    network-config.yaml` does not succeed.

    This change fixes this issue by converting the hostname to
    lowercase when creating the content for `inventory-network-
    config.yaml`

    Closes-Bug: #1978356
    Change-Id: I1ee53976ecc63d206d9604c896b1bb59807ad9ff

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-ansible/+/845400

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/845400
Committed: https://opendev.org/openstack/tripleo-ansible/commit/77cd3b0701c773930a5f4cec18cca6bc6b563d8b
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 77cd3b0701c773930a5f4cec18cca6bc6b563d8b
Author: Harald Jensås <email address hidden>
Date: Fri Jun 10 23:39:25 2022 +0200

    Use lowercase hostname in inventory network config

    The ansible inventory uses the neutron port dns_name as
    hostname. The `dns_name` in neutron is always lowercase.
    If a hostname with one or more capital letters are used in
    baremetal deployment YAML the data lookup from `inventory-
    network-config.yaml` does not succeed.

    This change fixes this issue by converting the hostname to
    lowercase when creating the content for `inventory-network-
    config.yaml`

    Closes-Bug: #1978356
    Change-Id: I1ee53976ecc63d206d9604c896b1bb59807ad9ff
    (cherry picked from commit 0056c2b8970a3f6d6317edcdf2372ff32c29de85)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 5.0.0

This issue was fixed in the openstack/tripleo-ansible 5.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.