Add container/service clean up for ironic/trove

When upgrading from pike to queens there are the following
changes to the container/service setup:

1. The ironic conductor service has been consolidated into
   the ironic_api_container. The previously implemented
   ironic_conductor_container can be removed.

2. All trove services have been consolidated into the
   trove_api_container. The previously implemented
   trove_conductor_container and trove_taskmanager_container
   can be removed.

Change-Id: I6964fa54ee67ec651b61a675a61acf55f86158bb
This commit is contained in:
Jesse Pretorius 2018-04-10 12:23:40 +01:00
parent 2173902760
commit e44e518b3c
5 changed files with 104 additions and 0 deletions

View File

@ -274,8 +274,15 @@ changes to the container/service setup:
# A new ``heat_api`` container is created with all heat services # A new ``heat_api`` container is created with all heat services
running in it. The previously implemented ``heat_apis_container`` running in it. The previously implemented ``heat_apis_container``
and ``heat_engine_container`` can be removed. and ``heat_engine_container`` can be removed.
# The ironic conductor service has been consolidated into
the ``ironic_api_container``. The previously implemented
``ironic_conductor_container`` can be removed.
# All nova services are consolidated into the ``nova_api_container`` # All nova services are consolidated into the ``nova_api_container``
and the rest of the nova containers can be removed. and the rest of the nova containers can be removed.
# All trove services have been consolidated into the
``trove_api_container``. The previously implemented
``trove_conductor_container`` and ``trove_taskmanager_container``
can be removed.
This cleanup can be done by hand, or the playbooks provided This cleanup can be done by hand, or the playbooks provided
can be used to do it for you from the deployment node. The can be used to do it for you from the deployment node. The
@ -292,5 +299,7 @@ from the haproxy configuration.
# openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-cinder.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes # openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-cinder.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes
# openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-heat.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes # openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-heat.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes
# openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-ironic.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes
# openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-nova.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes # openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-nova.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes
# openstack-ansible "${UPGRADE_PLAYBOOKS}/cleanup-trove.yml" -e force_containers_destroy=yes -e force_containers_data_destroy=yes
# openstack-ansible --tags haproxy_server-config haproxy-install.yml # openstack-ansible --tags haproxy_server-config haproxy-install.yml

View File

@ -10,8 +10,15 @@ upgrade:
* A new ``heat_api`` container is created with all heat services * A new ``heat_api`` container is created with all heat services
running in it. The previously implemented ``heat_apis_container`` running in it. The previously implemented ``heat_apis_container``
and ``heat_engine_container`` can be removed. and ``heat_engine_container`` can be removed.
* The ironic conductor service has been consolidated into
the ``ironic_api_container``. The previously implemented
``ironic_conductor_container`` can be removed.
* All nova services are consolidated into the ``nova_api_container`` * All nova services are consolidated into the ``nova_api_container``
and the rest of the nova containers can be removed. and the rest of the nova containers can be removed.
* All trove services have been consolidated into the
``trove_api_container``. The previously implemented
``trove_conductor_container`` and ``trove_taskmanager_container``
can be removed.
Playbooks have been added to facilitate this process through Playbooks have been added to facilitate this process through
automation. Please see the ``Major upgrades`` chapter in the automation. Please see the ``Major upgrades`` chapter in the

View File

@ -203,6 +203,8 @@ function main {
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-nova.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-nova.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-cinder.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-cinder.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-heat.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-heat.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-ironic.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/cleanup-trove.yml -e force_containers_destroy=yes -e force_containers_data_destroy=yes")
RUN_TASKS+=("haproxy-install.yml --tags haproxy_server-config") RUN_TASKS+=("haproxy-install.yml --tags haproxy_server-config")
# Run the tasks in order # Run the tasks in order
for item in ${!RUN_TASKS[@]}; do for item in ${!RUN_TASKS[@]}; do

View File

@ -0,0 +1,42 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: ironic_conductor_container
become: yes
gather_facts: no
tasks:
- name: Gather the necessary facts
setup:
gather_subset: "!facter,!ohai"
- name: Shut down ironic services in containers which will be deleted
service:
name: "ironic-conductor"
enabled: no
state: stopped
- include: "{{ playbook_dir }}/../../../playbooks/lxc-containers-destroy.yml"
vars:
container_group: "ironic_conductor_container"
- hosts: localhost
connection: local
become: yes
gather_facts: no
tasks:
- name: Remove the inventory entries for the deleted containers
command: >-
{{ playbook_dir }}/../../inventory-manage.py -r {{ item }}
with_items: "{{ groups['ironic_conductor_container'] }}"

View File

@ -0,0 +1,44 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: trove_conductor_container:trove_taskmanager_container
become: yes
gather_facts: no
tasks:
- name: Gather the necessary facts
setup:
gather_subset: "!facter,!ohai"
- name: Shut down trove services in containers which will be deleted
service:
name: >-
{{ ansible_hostname | regex_replace('^.*-(trove)-(conductor|taskmanager)-container-[\\w\\d]+$', '\\1-\\2') }}
enabled: no
state: stopped
- include: "{{ playbook_dir }}/../../../playbooks/lxc-containers-destroy.yml"
vars:
container_group: "trove_conductor_container:trove_taskmanager_container"
- hosts: localhost
connection: local
become: yes
gather_facts: no
tasks:
- name: Remove the inventory entries for the deleted containers
command: >-
{{ playbook_dir }}/../../inventory-manage.py -r {{ item }}
with_items: "{{ groups['trove_conductor_container'] +
groups['trove_taskmanager_container'] }}"