Shift to using dashes instead of underscores for container names

Bug #1643680 reported by Jesse Pretorius
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-ansible
Confirmed
Wishlist
Unassigned

Bug Description

LXD provides macro templates which set the container hostname and hosts file to have the container name set whenever the container is created, renamed or restarted (by default). This presents a problem to us right now because we rely on the playbooks to ensure that the hostname is correctly set.

In order to prepare to use LXD for container creation and management, we need to shift to using dashes instead of underscores in container names. Implementing this will also allow us to remove all the machinery which handles changing the container host name to be compliant with DNS requirements.

Ideally the inventory should ensure that new containers are created with dashes, but still recognise containers created with underscores as valid.

If there's a way that we can also facilitate their conversion (through a major upgrade action) then that'd be really great because we can then accelerate the removal of the older method instead of having a long deprecation cycle.

Changed in openstack-ansible:
assignee: nobody → Nolan Brubaker (nolan-brubaker)
importance: Undecided → Wishlist
Changed in openstack-ansible:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/407655

Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
Nolan Brubaker (nolan-brubaker) wrote :

One problem with this - env.d-defined group names currently contain underscores. This, in turn affects group naming.

In order to fully implement this change, we'll have to redo the env.d group names, and probably provide a translation layer for names and/or a group name migration script.

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

@Nolan Why do the group names matter to the host/inventory name given to a container?

Revision history for this message
Nolan Brubaker (nolan-brubaker) wrote :

Jesse - they're appended to the physical host's name to make the containers. So, as an example: aio1-nova_api_metadata_container-dcbb9152. aio1 is the host name, nova_api_metadata_container is the group name from inventory, and the hash is generated on first run. nova_api_metadata_container is taken from playbooks/inventory/env.d/nova.yml L38.

There's also the option of not using the group names, though I think it's useful for managing a deployment to identify what container is associated with what function by name.

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

@Nolan Is there not a way to adjust the append process to use dashes instead of underscores?

Revision history for this message
Nolan Brubaker (nolan-brubaker) wrote :

We could probably do a replace in the script, but then env.d entries don't match the output/ansible targets.

For the separator between host name and group, I'm having a hard time finding exactly where to change it and not recreating existing containers. The inventory is being updated and referenced at the same time, which makes it somewhat difficult to look for pre-existing stuff.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on openstack-ansible (master)

Change abandoned by Nolan Brubaker (<email address hidden>) on branch: master
Review: https://review.openstack.org/407655

Changed in openstack-ansible:
assignee: Nolan Brubaker (nolan-brubaker) → nobody
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers