diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index 896bb6359f..ddfea0415b 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -293,9 +293,37 @@ outputs: get_attr: [NovaApiBase, role_data, metadata_settings] host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova_api is deployed + command: systemctl is-enabled --quiet openstack-nova-api + tags: common + ignore_errors: True + register: nova_api_enabled + - name: Check for nova-api running under apache + tags: common + shell: httpd -t -D DUMP_VHOSTS | grep -q 'nova' + ignore_errors: True + register: httpd_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-api is running" + command: systemctl is-active --quiet openstack-nova-api + tags: step0,validation + when: nova_api_enabled.rc == 0 and httpd_enabled.rc != 0 - name: Stop and disable nova_api service tags: step2 + when: nova_api_enabled.rc == 0 and httpd_enabled.rc != 0 service: name=openstack-nova-api state=stopped enabled=no + - name: Check if httpd service is running + command: systemctl is-active --quiet httpd + tags: common + ignore_errors: True + register: httpd_running + - name: "PreUpgrade step0,validation: Check if nova_wsgi is running" + tags: step0,validation + shell: systemctl status 'httpd' | grep -q 'nova' + when: httpd_enabled.rc == 0 and httpd_running.rc == 0 + - name: Stop nova_api service (running under httpd) + tags: step2 + when: httpd_enabled.rc == 0 and httpd_running.rc == 0 + service: name=httpd state=stopped - name: Remove openstack-nova-api package if operator requests it yum: name=openstack-nova-api state=removed tags: step2 diff --git a/docker/services/nova-compute.yaml b/docker/services/nova-compute.yaml index e6939442ee..addc108aff 100644 --- a/docker/services/nova-compute.yaml +++ b/docker/services/nova-compute.yaml @@ -176,6 +176,11 @@ outputs: path: /etc/ceph state: directory upgrade_tasks: + - name: Check if nova_compute is deployed + command: systemctl is-enabled --quiet openstack-nova-compute + tags: common + ignore_errors: True + register: nova_compute_enabled - name: Set compute upgrade level to auto tags: step1 ini_file: @@ -183,8 +188,13 @@ outputs: template: "dest=/etc/nova/nova.conf section=upgrade_levels option=compute value=LEVEL" params: LEVEL: {get_param: UpgradeLevelNovaCompute} + - name: "PreUpgrade step0,validation: Check service openstack-nova-compute is running" + command: systemctl is-active --quiet openstack-nova-compute + tags: step0,validation + when: nova_compute_enabled.rc == 0 - name: Stop and disable nova-compute service tags: step2 + when: nova_compute_enabled.rc == 0 service: name=openstack-nova-compute state=stopped enabled=no - name: Remove openstack-nova-compute package if operator requests it yum: name=openstack-nova-compute state=removed diff --git a/docker/services/nova-conductor.yaml b/docker/services/nova-conductor.yaml index 59b64d6eed..9f1801f976 100644 --- a/docker/services/nova-conductor.yaml +++ b/docker/services/nova-conductor.yaml @@ -128,6 +128,11 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova_conductor is deployed + command: systemctl is-enabled --quiet openstack-nova-conductor + tags: common + ignore_errors: True + register: nova_conductor_enabled - name: Set compute upgrade level to auto tags: step1 ini_file: @@ -135,8 +140,13 @@ outputs: template: "dest=/etc/nova/nova.conf section=upgrade_levels option=compute value=LEVEL" params: LEVEL: {get_param: UpgradeLevelNovaCompute} + - name: "PreUpgrade step0,validation: Check service openstack-nova-conductor is running" + command: systemctl is-active --quiet openstack-nova-conductor + tags: step0,validation + when: nova_conductor_enabled.rc == 0 - name: Stop and disable nova_conductor service tags: step2 + when: nova_conductor_enabled.rc == 0 service: name=openstack-nova-conductor state=stopped enabled=no - name: Remove openstack-nova-conductor package if operator requests it yum: name=openstack-nova-conductor state=removed diff --git a/docker/services/nova-consoleauth.yaml b/docker/services/nova-consoleauth.yaml index 6ef73cd20f..e928bea71b 100644 --- a/docker/services/nova-consoleauth.yaml +++ b/docker/services/nova-consoleauth.yaml @@ -123,8 +123,18 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova_consoleauth is deployed + command: systemctl is-active --quiet openstack-nova-consoleauth + tags: common + ignore_errors: True + register: nova_consoleauth_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-consoleauth is running" + command: systemctl is-active --quiet openstack-nova-consoleauth + tags: step0,validation + when: nova_consoleauth_enabled.rc == 0 - name: Stop and disable nova_consoleauth service tags: step2 + when: nova_consoleauth_enabled.rc == 0 service: name=openstack-nova-consoleauth state=stopped enabled=no - name: Remove openstack-nova-console package if operator requests it yum: name=openstack-nova-console state=removed diff --git a/docker/services/nova-ironic.yaml b/docker/services/nova-ironic.yaml index c56cf416e6..ac7842ad30 100644 --- a/docker/services/nova-ironic.yaml +++ b/docker/services/nova-ironic.yaml @@ -130,6 +130,16 @@ outputs: /var/log/containers/nova and /var/log/containers/httpd/nova-*. ignore_errors: true upgrade_tasks: + - name: Check if nova ironic is deployed + command: systemctl is-enabled --quiet openstack-nova-compute + tags: common + ignore_errors: True + register: nova_ironic_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-compute is running" + command: systemctl is-active --quiet openstack-nova-compute + tags: step0,validation + when: nova_ironic_enabled.rc == 0 - name: Stop and disable nova-compute service tags: step2 + when: nova_ironic_enabled.rc == 0 service: name=openstack-nova-compute state=stopped enabled=no diff --git a/docker/services/nova-libvirt.yaml b/docker/services/nova-libvirt.yaml index f90a3d5b54..5510b1f6c6 100644 --- a/docker/services/nova-libvirt.yaml +++ b/docker/services/nova-libvirt.yaml @@ -308,6 +308,16 @@ outputs: metadata_settings: get_attr: [NovaLibvirtBase, role_data, metadata_settings] upgrade_tasks: + - name: Check if nova_libvirt is deployed + command: systemctl is-enabled --quiet libvirtd + tags: common + ignore_errors: True + register: nova_libvirt_enabled + - name: "PreUpgrade step0,validation: Check service libvirtd is running" + command: systemctl is-active --quiet libvirtd + tags: step0,validation + when: nova_libvirt_enabled.rc == 0 - name: Stop and disable libvirtd service tags: step2 + when: nova_libvirt_enabled.rc == 0 service: name=libvirtd state=stopped enabled=no diff --git a/docker/services/nova-metadata.yaml b/docker/services/nova-metadata.yaml index b6f42ea19d..ca691e0c49 100644 --- a/docker/services/nova-metadata.yaml +++ b/docker/services/nova-metadata.yaml @@ -117,6 +117,16 @@ outputs: get_attr: [NovaMetadataBase, role_data, metadata_settings] host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova_api_metadata is deployed + command: systemctl is-enabled --quiet openstack-nova-api + tags: common + ignore_errors: True + register: nova_metadata_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-api is running" + command: systemctl is-active --quiet openstack-nova-api + tags: step0,validation + when: nova_metadata_enabled.rc == 0 - name: Stop and disable nova_api service tags: step2 + when: nova_metadata_enabled.rc == 0 service: name=openstack-nova-api state=stopped enabled=no diff --git a/docker/services/nova-placement.yaml b/docker/services/nova-placement.yaml index 5995e51900..089be1122f 100644 --- a/docker/services/nova-placement.yaml +++ b/docker/services/nova-placement.yaml @@ -138,8 +138,23 @@ outputs: get_attr: [NovaPlacementBase, role_data, metadata_settings] host_prep_tasks: {get_attr: [NovaPlacementLogging, host_prep_tasks]} upgrade_tasks: + - name: Check for nova placement running under apache + tags: common + shell: "httpd -t -D DUMP_VHOSTS | grep -q placement_wsgi" + ignore_errors: True + register: httpd_enabled + - name: Check if httpd is running + tags: common + command: systemctl is-active --quiet httpd + ignore_errors: True + register: httpd_running + - name: "PreUpgrade step0,validation: Check if placement_wsgi is running" + shell: systemctl status 'httpd' | grep -q placement_wsgi + tags: step0,validation + when: httpd_enabled.rc == 0 and httpd_running.rc == 0 - name: Stop and disable nova_placement service (running under httpd) tags: step2 + when: httpd_enabled.rc == 0 and httpd_running.rc == 0 service: name=httpd state=stopped enabled=no - name: Remove httpd package if operator requests it yum: name=httpd state=removed diff --git a/docker/services/nova-scheduler.yaml b/docker/services/nova-scheduler.yaml index 66652e5d89..7f5a26d3a0 100644 --- a/docker/services/nova-scheduler.yaml +++ b/docker/services/nova-scheduler.yaml @@ -124,8 +124,18 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova_scheduler is deployed + command: systemctl is-enabled --quiet openstack-nova-scheduler + tags: common + ignore_errors: True + register: nova_scheduler_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-scheduler is running" + command: systemctl is-active --quiet openstack-nova-scheduler + tags: step0,validation + when: nova_scheduler_enabled.rc == 0 - name: Stop and disable nova_scheduler service tags: step2 + when: nova_scheduler_enabled.rc == 0 service: name=openstack-nova-scheduler state=stopped enabled=no - name: Remove openstack-nova-scheduler package if operator requests it yum: name=openstack-nova-scheduler state=removed diff --git a/docker/services/nova-vnc-proxy.yaml b/docker/services/nova-vnc-proxy.yaml index 9a6c92351c..de1633556a 100644 --- a/docker/services/nova-vnc-proxy.yaml +++ b/docker/services/nova-vnc-proxy.yaml @@ -123,8 +123,18 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: + - name: Check if nova vncproxy is deployed + command: systemctl is-enabled --quiet openstack-nova-novncproxy + tags: common + ignore_errors: True + register: nova_vncproxy_enabled + - name: "PreUpgrade step0,validation: Check service openstack-nova-novncproxy is running" + command: systemctl is-active --quiet openstack-nova-novncproxy + tags: step0,validation + when: nova_vncproxy_enabled.rc == 0 - name: Stop and disable nova_vnc_proxy service tags: step2 + when: nova_vncproxy_enabled.rc == 0 service: name=openstack-nova-novncproxy state=stopped enabled=no - name: Remove openstack-nova-novncproxy package if operator requests it yum: name=openstack-nova-novncproxy state=removed