Browse Source

Add missing update_serial key to compute roles

I missed this the changes from I4ee0110a6c2b9466d81e37e5df27f5f81a6eceb5 when
rebasing I9f40a2a3561fcb1d1fec9d9c3c1f9cabaf02650c.

Add the missing key to the roles and add some validation to catch this.

Change-Id: I0f38df69777340ebbdc5c419f121524dbc74cad7
Related-bug: #1831617
Implements: blueprint nova-backend-per-role
(cherry picked from commit c2977e3c00)
(cherry picked from commit 7b72488d2e)
tags/9.4.1
Oliver Walsh 2 months ago
parent
commit
d9dcd8d516

+ 2
- 0
roles/ComputeHCIOvsDpdk.yaml View File

@@ -9,6 +9,8 @@
9 9
     - Tenant
10 10
     - Storage
11 11
     - StorageMgmt
12
+  # CephOSD present so serial has to be 1
13
+  update_serial: 1
12 14
   RoleParametersDefault:
13 15
     TunedProfileName: "cpu-partitioning"
14 16
     VhostuserSocketGroup: "hugetlbfs"

+ 1
- 0
roles/ComputeLocalEphemeral.yaml View File

@@ -9,6 +9,7 @@
9 9
     - InternalApi
10 10
     - Tenant
11 11
     - Storage
12
+  update_serial: 25
12 13
   HostnameFormatDefault: '%stackname%-novacompute-local-%index%'
13 14
   RoleParametersDefault:
14 15
     TunedProfileName: "virtual-host"

+ 1
- 0
roles/ComputeRBDEphemeral.yaml View File

@@ -9,6 +9,7 @@
9 9
     - InternalApi
10 10
     - Tenant
11 11
     - Storage
12
+  update_serial: 25
12 13
   HostnameFormatDefault: '%stackname%-novacompute-rbd-%index%'
13 14
   RoleParametersDefault:
14 15
     TunedProfileName: "virtual-host"

+ 20
- 1
tools/yaml-validate.py View File

@@ -467,8 +467,27 @@ def validate_with_compute_role_services(role_filename, role_tpl, exclude_service
467 467
               'ServicesDefault in roles/Compute.yaml'.format(role_filename,
468 468
               ', '.join(missing_services)))
469 469
         return 1
470
-    return 0
471 470
 
471
+    cmpt_us = cmpt_tpl[0].get('update_serial', None)
472
+    tpl_us = role_tpl[0].get('update_serial', None)
473
+
474
+    if 'OS::TripleO::Services::CephOSD' in role_services:
475
+        if tpl_us not in (None, 1):
476
+            print('ERROR: update_serial in {0} ({1}) '
477
+                  'is should be 1 as it includes CephOSD'.format(
478
+                      role_filename,
479
+                      tpl_us,
480
+                      cmpt_us))
481
+            return 1
482
+    elif cmpt_us is not None and tpl_us != cmpt_us:
483
+        print('ERROR: update_serial in {0} ({1}) '
484
+              'does not match roles/Compute.yaml {2}'.format(
485
+                  role_filename,
486
+                  tpl_us,
487
+                  cmpt_us))
488
+        return 1
489
+
490
+    return 0
472 491
 
473 492
 def validate_multiarch_compute_roles(role_filename, role_tpl):
474 493
     errors = 0

Loading…
Cancel
Save