From e0bb2cc82e7de27061bdeb06033f789fc3cf6e91 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Mon, 19 Aug 2019 01:34:42 +0000 Subject: [PATCH] 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 --- deployment/placement/placement-api-container-puppet.yaml | 9 +++++---- environments/undercloud-disable-nova.yaml | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/deployment/placement/placement-api-container-puppet.yaml b/deployment/placement/placement-api-container-puppet.yaml index f1a9e76400..ccc8a29bb7 100644 --- a/deployment/placement/placement-api-container-puppet.yaml +++ b/deployment/placement/placement-api-container-puppet.yaml @@ -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 diff --git a/environments/undercloud-disable-nova.yaml b/environments/undercloud-disable-nova.yaml index f048c12067..9348e49560 100644 --- a/environments/undercloud-disable-nova.yaml +++ b/environments/undercloud-disable-nova.yaml @@ -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 \ No newline at end of file + OS::TripleO::Services::NovaScheduler: OS::Heat::None + OS::TripleO::Services::GlanceApi: OS::Heat::None \ No newline at end of file