
When upgrading Nova, we sometimes hit an error where an old hypervisor that hasn’t been upgraded recently (for example due to broken hardware) is preventing Nova API from starting properly. This can be detected using the tool ``nova-status upgrade check`` to make sure that there are no ``nova-compute`` that are older than N-1 releases. This is already used in the Kolla Ansible upgrade task for Nova. However, this task uses the current ``nova-api`` container, so computes which will be too old after the upgrade are not caught. This patch changes Kolla Ansible so that the upgraded ``nova-api`` image is used to run the upgrade checks, allowing computes that will be too old to be detected before the upgrades are performed. Depends-On: https://review.opendev.org/c/openstack/kolla/+/878744 Closes-Bug: #1957080 Co-Authored-By: Pierre Riteau <pierre@stackhpc.com> Change-Id: I3a899411001834a0c88e37f45a756247ee11563d
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
---
|
|
- name: Run Nova upgrade checks
|
|
become: true
|
|
vars:
|
|
nova_api: "{{ nova_services['nova-api'] }}"
|
|
kolla_docker:
|
|
action: "start_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
detach: False
|
|
environment:
|
|
KOLLA_UPGRADE_CHECK:
|
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
|
image: "{{ nova_api.image }}"
|
|
labels:
|
|
UPGRADE:
|
|
name: "nova_upgrade_checks"
|
|
restart_policy: no
|
|
volumes: "{{ nova_api_default_volumes + nova_api_extra_volumes }}"
|
|
run_once: True
|
|
register: nova_upgrade_check_stdout
|
|
delegate_to: "{{ groups['nova-api'][0] }}"
|
|
failed_when: false
|
|
|
|
- name: Upgrade status check result
|
|
fail:
|
|
msg:
|
|
- "There was an upgrade status check failure!"
|
|
- "See the detail at https://docs.openstack.org/nova/latest/cli/nova-status.html#nova-status-checks"
|
|
vars:
|
|
first_nova_api_host: "{{ groups['nova-api'][0] }}"
|
|
when: hostvars[first_nova_api_host]['nova_upgrade_check_stdout']['rc'] not in [0, 1]
|
|
|
|
- name: Stopping top level nova services
|
|
become: true
|
|
kolla_docker:
|
|
action: "stop_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ item.value.container_name }}"
|
|
with_dict: "{{ nova_services }}"
|
|
when:
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
- nova_safety_upgrade | bool
|
|
|
|
- import_tasks: rolling_upgrade.yml
|