Browse Source

Merge "nova: use systemd to check container healthchecks"

tags/11.2.0
Zuul 1 month ago
parent
commit
33791111cb

+ 12
- 2
deployment/nova/nova-api-container-puppet.yaml View File

@@ -430,11 +430,21 @@ outputs:
430 430
         get_attr: [ApacheServiceBase, role_data, metadata_settings]
431 431
       deploy_steps_tasks:
432 432
         - name: validate nova api container state
433
-          when: step|int == 5
433
+          when:
434
+            - not container_healthcheck_disabled
435
+            - step|int == 5
434 436
           tags:
435 437
             - opendev-validation
436 438
             - opendev-validation-nova
437
-          command: "{{ container_cli }} exec nova_api /openstack/healthcheck"
439
+          block:
440
+            - name: Get nova-api healthcheck status
441
+              register: nova_api_healthcheck_state
442
+              systemd:
443
+                name: tripleo_nova_api_healthcheck
444
+            - name: Fail if nova-api healthcheck report failed status
445
+              fail:
446
+                msg: nova-api isn't working (healthcheck failed)
447
+              when: nova_api_healthcheck_state.status.ExecMainStatus != '0'
438 448
       host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]}
439 449
       external_upgrade_tasks:
440 450
         - when: step|int == 1

+ 12
- 6
deployment/nova/nova-compute-container-puppet.yaml View File

@@ -942,15 +942,21 @@ outputs:
942 942
         list_concat:
943 943
         - {get_attr: [NovaComputeCommon, nova_compute_common_deploy_steps_tasks]}
944 944
         - - name: validate nova compute container state
945
-            when: step|int == 5
945
+            when:
946
+              - not container_healthcheck_disabled
947
+              - step|int == 5
946 948
             tags:
947 949
               - opendev-validation
948 950
               - opendev-validation-nova
949
-            command:
950
-              str_replace:
951
-                template: "{{ container_cli }} exec nova_compute HEALTHCHECK"
952
-                params:
953
-                  HEALTHCHECK: {get_attr: [ContainersCommon, healthcheck_rpc_port, test]}
951
+            block:
952
+              - name: Get nova-compute healthcheck status
953
+                register: nova_compute_healthcheck_state
954
+                systemd:
955
+                  name: tripleo_nova_compute_healthcheck
956
+              - name: Fail if nova-compute healthcheck report failed status
957
+                fail:
958
+                  msg: nova-compute isn't working (healthcheck failed)
959
+                when: nova_compute_healthcheck_state.status.ExecMainStatus != '0'
954 960
       upgrade_tasks:
955 961
         - name: Remove openstack-nova-compute and python-nova package during upgrade
956 962
           package:

+ 12
- 6
deployment/nova/nova-conductor-container-puppet.yaml View File

@@ -191,15 +191,21 @@ outputs:
191 191
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
192 192
       deploy_steps_tasks:
193 193
         - name: validate nova conductor container state
194
-          when: step|int == 5
194
+          when:
195
+            - not container_healthcheck_disabled
196
+            - step|int == 5
195 197
           tags:
196 198
             - opendev-validation
197 199
             - opendev-validation-nova
198
-          command:
199
-            str_replace:
200
-              template: "{{ container_cli }} exec nova_conductor HEALTHCHECK"
201
-              params:
202
-                HEALTHCHECK: {get_attr: [ContainersCommon, healthcheck_rpc_port, test]}
200
+          block:
201
+            - name: Get nova-conductor healthcheck status
202
+              register: nova_conductor_healthcheck_state
203
+              systemd:
204
+                name: tripleo_nova_conductor_healthcheck
205
+            - name: Fail if nova-conductor healthcheck report failed status
206
+              fail:
207
+                msg: nova-conductor isn't working (healthcheck failed)
208
+              when: nova_conductor_healthcheck_state.status.ExecMainStatus != '0'
203 209
       host_prep_tasks:
204 210
         list_concat:
205 211
           - {get_attr: [NovaLogging, host_prep_tasks]}

+ 12
- 2
deployment/nova/nova-libvirt-container-puppet.yaml View File

@@ -801,11 +801,21 @@ outputs:
801 801
             - {}
802 802
       deploy_steps_tasks:
803 803
         - name: validate nova-libvirt container state
804
-          when: step|int == 4
804
+          when:
805
+            - not container_healthcheck_disabled
806
+            - step|int == 4
805 807
           tags:
806 808
             - opendev-validation
807 809
             - opendev-validation-nova
808
-          command: "{{ container_cli }} exec nova_libvirt /openstack/healthcheck"
810
+          block:
811
+            - name: Get nova-libvirt healthcheck status
812
+              register: nova_libvirt_healthcheck_state
813
+              systemd:
814
+                name: tripleo_nova_libvirt_healthcheck
815
+            - name: Fail if nova-libvirt healthcheck report failed status
816
+              fail:
817
+                msg: nova-libvirt isn't working (healtcheck failed)
818
+              when: nova_libvirt_healthcheck_state.status.ExecMainStatus != '0'
809 819
       host_prep_tasks:
810 820
         - name: create libvirt persistent data directories
811 821
           file:

+ 12
- 2
deployment/nova/nova-metadata-container-puppet.yaml View File

@@ -248,11 +248,21 @@ outputs:
248 248
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
249 249
       deploy_steps_tasks:
250 250
         - name: validate nova metadata container state
251
-          when: step|int == 5
251
+          when:
252
+            - not container_healthcheck_disabled
253
+            - step|int == 5
252 254
           tags:
253 255
             - opendev-validation
254 256
             - opendev-validation-nova
255
-          command: "{{ container_cli }} exec nova_metadata /openstack/healthcheck"
257
+          block:
258
+            - name: Get nova-metadata healthcheck status
259
+              register: nova_metadata_healthcheck_state
260
+              systemd:
261
+                name: tripleo_nova_metadata_healthcheck
262
+            - name: Fail if nova-metadata healthcheck report failed status
263
+              fail:
264
+                msg: nova-metadata isn't working (healthcheck failed)
265
+              when: nova_metadata_healthcheck_state.status.ExecMainStatus != '0'
256 266
       host_prep_tasks: {get_attr: [NovaMetadataLogging, host_prep_tasks]}
257 267
       external_upgrade_tasks:
258 268
         - when:

+ 12
- 2
deployment/nova/nova-migration-target-container-puppet.yaml View File

@@ -173,11 +173,21 @@ outputs:
173 173
              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
174 174
       deploy_steps_tasks:
175 175
         - name: validate nova migration target container state
176
-          when: step|int == 5
176
+          when:
177
+            - not container_healthcheck_disabled
178
+            - step|int == 5
177 179
           tags:
178 180
             - opendev-validation
179 181
             - opendev-validation-nova
180
-          command: "{{ container_cli }} exec nova_migration_target /openstack/healthcheck"
182
+          block:
183
+            - name: Get nova-migration-target healthcheck status
184
+              register: nova_migration_target_healthcheck_state
185
+              systemd:
186
+                name: tripleo_nova_migration_target_healthcheck
187
+            - name: Fail if nova-migration-target healthcheck report failed status
188
+              fail:
189
+                msg: nova-migration-target isn't working (healtcheck failed)
190
+              when: nova_migration_target_healthcheck_state.status.ExecMainStatus != '0'
181 191
       post_upgrade_tasks:
182 192
         - when: step|int == 1
183 193
           import_role:

+ 12
- 6
deployment/nova/nova-scheduler-container-puppet.yaml View File

@@ -188,15 +188,21 @@ outputs:
188 188
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
189 189
       deploy_steps_tasks:
190 190
         - name: validate nova scheduler container state
191
-          when: step|int == 5
191
+          when:
192
+            - not container_healthcheck_disabled
193
+            - step|int == 5
192 194
           tags:
193 195
             - opendev-validation
194 196
             - opendev-validation-nova
195
-          command:
196
-            str_replace:
197
-              template: "{{ container_cli }} exec nova_scheduler HEALTHCHECK"
198
-              params:
199
-                HEALTHCHECK: {get_attr: [ContainersCommon, healthcheck_rpc_port, test]}
197
+          block:
198
+            - name: Get nova-scheduler healthcheck status
199
+              register: nova_scheduler_healthcheck_state
200
+              systemd:
201
+                name: tripleo_nova_scheduler_healthcheck
202
+            - name: Fail if nova-scheduler healthcheck report failed status
203
+              fail:
204
+                msg: nova-scheduler isn't working (healthcheck failed)
205
+              when: nova_scheduler_healthcheck_state.status.ExecMainStatus != '0'
200 206
       host_prep_tasks:
201 207
         list_concat:
202 208
           - {get_attr: [NovaLogging, host_prep_tasks]}

+ 12
- 2
deployment/nova/nova-vnc-proxy-container-puppet.yaml View File

@@ -284,11 +284,21 @@ outputs:
284 284
           - null
285 285
       deploy_steps_tasks:
286 286
         - name: validate nova-vnc-proxy container state
287
-          when: step|int == 5
287
+          when:
288
+            - not container_healthcheck_disabled
289
+            - step|int == 5
288 290
           tags:
289 291
             - opendev-validation
290 292
             - opendev-validation-nova
291
-          command: "{{ container_cli }} exec nova_vnc_proxy /openstack/healthcheck"
293
+          block:
294
+            - name: Get nova-vnc-proxy healthcheck status
295
+              register: nova_vnc_proxy_healthcheck_state
296
+              systemd:
297
+                name: tripleo_nova_vnc_proxy_healthcheck
298
+            - name: Fail if nova-vnc-proxy healtcheck report failed status
299
+              fail:
300
+                msg: nova-vnc-proxy isn't working (healthcheck failed)
301
+              when: nova_vnc_proxy_healthcheck_state.status.ExecMainStatus != '0'
292 302
       host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]}
293 303
       fast_forward_upgrade_tasks:
294 304
         - when:

Loading…
Cancel
Save