Add nova_status validation to queens

Bug #1903718 reported by Jon Thomas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
New
Undecided
Unassigned

Bug Description

Backport nova status validation to queens to be used as a preupgrade validation. This is somewhat of a rewrite due to the newer structure being completely different.

- hosts: nova_api
  vars:
    metadata:
      name: Nova Status Upgrade Check
      description: |
        Performs a release-specific readiness check before restarting services with
        new code. This command expects to have complete configuration and access to
        databases and services within a cell. For example, this check may query the
        Nova API database and one or more cell databases. It may also make requests
        to other services such as the Placement REST API via the Keystone service
        catalog

        The nova-status upgrade check command has three standard return codes:

        0 -> All upgrade readiness checks passed successfully and there is nothing to do.
        1 -> At least one check encountered an issue and requires further investigation. This is considered a warning but the upgrade may be OK.
        2 -> There was an upgrade status check failure that needs to be investigated. This should be considered something that stops an upgrade.
      groups:
        - pre-upgrade
  tasks:
  - name: Set container_cli fact from the inventory
    set_fact:
      container_cli: "{{ hostvars[inventory_hostname].container_cli | default('docker', true) }}"
    when: container_cli is not defined
  - name: Check nova upgrade status
    become: true
    command: "{{ container_cli }} exec -u root nova_api nova-status upgrade check"
    changed_when: false
    register: nova_upgrade_check
  - name: Warn if at least one check encountered an issue
    warn:
      msg: |
        At least one check encountered an issue and requires further investigation.
        This is considered a warning but the upgrade may be OK.
        See the detail at https://docs.openstack.org/nova/latest/cli/nova-status.html#nova-status-checks
    when: "nova_upgrade_check.rc == 1"
  - name: Fail if there was an upgrade status check failure
    fail:
      msg: |
        There was an upgrade status check failure that needs to be investigated.
        This should be considered something that stops an upgrade.
        See the detail at https://docs.openstack.org/nova/latest/cli/nova-status.html#nova-status-checks
    when: "nova_upgrade_check.rc not in [0, 1]"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.