In order to cater for artifact-based installed, and rolling upgrades, this patch implements a set of local facts to inform the online migrations task. The 'nova_all_software_updated' variable will be set by the playbook on each run to ensure that the online migrations only happen once all venvs are homogenous. This ensures that the playbook can be executed in a serialised fashion and the data will not be corrupted. The ``upgrade_levels`` setting for ``compute`` is set to ``auto`` to ensure that a mixed RPC version deployment can operate properly when doing a rolling upgrade as suggested by [1]. Additional changes are made to improve the role's ability to be executed using serialised playbooks. Finally, the nova-manage command references to the config file location have been removed as they refer to the default location. [1] https://docs.openstack.org/developer/nova/upgrade.html Change-Id: I08e5a7f0ce526b11aa52c35ee29c458954a5f22d
37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
---
|
|
# Copyright 2017, 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.
|
|
|
|
# This needs to be done after Compute hosts are added.
|
|
- name: Perform a cell_v2 discover
|
|
command: "{{ nova_bin }}/nova-manage cell_v2 discover_hosts"
|
|
become: yes
|
|
become_user: "{{ nova_system_user_name }}"
|
|
changed_when: false
|
|
|
|
# When upgrading we need to map existing instances to the new cell1
|
|
# To do this we need the cell UUID.
|
|
- name: Get UUID of new Nova Cell
|
|
shell: "{{ nova_bin }}/nova-manage cell_v2 list_cells | grep ' {{ nova_cell1_name }} '"
|
|
become: yes
|
|
become_user: "{{ nova_system_user_name }}"
|
|
register: cell1_uuid
|
|
changed_when: false
|
|
|
|
- name: Map instances to new Cell1
|
|
command: "{{ nova_bin }}/nova-manage cell_v2 map_instances --cell_uuid {{ cell1_uuid['stdout'].split()[3] }}"
|
|
become: yes
|
|
become_user: "{{ nova_system_user_name }}"
|
|
changed_when: false
|