Fixes for deploying nova-less undercloud

This commmit contains the fixes required to successfully deploy a
nova-less undercloud:

1. Also disable undercloud glance with nova

  When nova is switched off there are no consumers of glance left, so
  the glance API should be disabled too.

2. Don't mount /etc/nova into placement migrate script

  The script mysql-migrate-db.sh [1] is driven entirely by environment
  variables, and only does direct database operations, so there is no
  need for a configured /etc/nova to exist within the container which
  runs it.

  This change removes the unused bind mount to
  /var/lib/config-data/nova/etc/nova/. This directory doesn't exist
  when nova isn't deployed, so this change allows placement to be
  deployed without nova (which is a valid use-case).

3. Allow return code 5 (db connection error) from mysql-migrate-db.sh

  When nova is not deployed, the nova_api database user won't exist
  and mysql-migrate-db.sh will exit with error code 5. Add 5 to the
  list of allowed exit codes, and switch to paunch's inbuilt support
  for exit_codes instead of doing it in bash

4. Override MistralExecutorVolumes

  This variable contains a mount to /var/lib/config-data/nova which
  doesn't exist in a nova-less undercloud

[1] https://opendev.org/openstack/placement/src/branch/master/placement_db_tools/mysql-migrate-db.sh

Change-Id: If8733240e273ba1eedb7bea51548ac346c96d644
Blueprint: nova-less-deploy
This commit is contained in:
Steve Baker 2019-08-19 01:34:42 +00:00
parent 3cdc1a4a0a
commit e0bb2cc82e
2 changed files with 11 additions and 7 deletions

View File

@ -209,7 +209,6 @@ outputs:
-
- /var/lib/config-data/placement/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/placement/etc/placement/:/etc/placement/:ro
- /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
environment:
- PLACEMENT_USER=placement
- NOVA_API_USER=nova_api
@ -229,8 +228,9 @@ outputs:
- '='
- - 'NOVA_API_PASS'
- {get_param: NovaPassword}
# NOTE(lyarwood): We can swallow return codes of 0, 3 and 4 as they
# suggest this is a fresh deployment with no data to extract. The
# NOTE(lyarwood): We can swallow return codes of 0, 3, 4, 5 as they
# suggest this is a fresh deployment with no data to extract
# (or that placemant is being deployed without nova). The
# current list of return codes provided by the migrate script is:
# 0: Success
# 1: Usage error
@ -239,7 +239,8 @@ outputs:
# 4: No data to migrate from nova (new deployment)
# 5: Unable to connect to one or both databases
# 6: Unable to execute placement's CLI commands
command: "/usr/bin/bootstrap_host_exec placement su placement -s /bin/bash -c 'cd /tmp && /usr/share/placement/mysql-migrate-db.sh --migrate -; ret=$?; if [ $ret -ne 0 ] && [ $ret -ne 3 ] && [ $ret -ne 4 ]; then exit $ret; else exit 0; fi'"
exit_codes: [0, 3, 4, 5]
command: "/usr/bin/bootstrap_host_exec placement su placement -s /bin/bash -c 'cd /tmp && /usr/share/placement/mysql-migrate-db.sh --migrate -'"
placement_api_db_sync:
start_order: 1
image: *placement_api_image

View File

@ -1,10 +1,13 @@
# This heat environment can be used to disable the nova services used on the
# undercloud. It is used for underclouds which only use deployed-server
# This heat environment can be used to disable the nova/glance services used on
# the undercloud. It is used for underclouds which only use deployed-server
# (optionally using ironic provisioned nodes).
parameter_defaults:
MistralExecutorVolumes: []
resource_registry:
OS::TripleO::Services::NovaApi: OS::Heat::None
OS::TripleO::Services::NovaConductor: OS::Heat::None
OS::TripleO::Services::NovaIronic: OS::Heat::None
OS::TripleO::Services::NovaMetadata: OS::Heat::None
OS::TripleO::Services::NovaScheduler: OS::Heat::None
OS::TripleO::Services::NovaScheduler: OS::Heat::None
OS::TripleO::Services::GlanceApi: OS::Heat::None