From 3a69cc589e5b4280d259fc49ff7cf342dc9f8cac Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Wed, 17 Jul 2019 16:08:40 +0100 Subject: [PATCH] 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 c2977e3c00c08eca8d5f52f7fb9c61abdf0ef28f) (cherry picked from commit 7b72488d2ef12d99524f6926fca0efe310ff453e) (cherry picked from commit d9dcd8d51677c0435fc74ac7f40a544fa4ac41af) --- roles/ComputeHCIOvsDpdk.yaml | 2 ++ roles/ComputeLocalEphemeral.yaml | 1 + roles/ComputeRBDEphemeral.yaml | 1 + tools/yaml-validate.py | 21 ++++++++++++++++++++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/roles/ComputeHCIOvsDpdk.yaml b/roles/ComputeHCIOvsDpdk.yaml index 60fbd175dd..2f1c43bd8e 100644 --- a/roles/ComputeHCIOvsDpdk.yaml +++ b/roles/ComputeHCIOvsDpdk.yaml @@ -12,6 +12,8 @@ HostnameFormatDefault: '%stackname%-computehciovsdpdk-%index%' disable_upgrade_deployment: True deprecated_nic_config_name: 'compute-dpdk.yaml' + # CephOSD present so serial has to be 1 + update_serial: 1 RoleParametersDefault: TunedProfileName: "cpu-partitioning" VhostuserSocketGroup: "hugetlbfs" diff --git a/roles/ComputeLocalEphemeral.yaml b/roles/ComputeLocalEphemeral.yaml index e642b1ee40..a30efe8779 100644 --- a/roles/ComputeLocalEphemeral.yaml +++ b/roles/ComputeLocalEphemeral.yaml @@ -9,6 +9,7 @@ - InternalApi - Tenant - Storage + update_serial: 25 HostnameFormatDefault: '%stackname%-novacompute-local-%index%' RoleParametersDefault: TunedProfileName: "virtual-host" diff --git a/roles/ComputeRBDEphemeral.yaml b/roles/ComputeRBDEphemeral.yaml index 6a5298b214..64bb53a7f6 100644 --- a/roles/ComputeRBDEphemeral.yaml +++ b/roles/ComputeRBDEphemeral.yaml @@ -9,6 +9,7 @@ - InternalApi - Tenant - Storage + update_serial: 25 HostnameFormatDefault: '%stackname%-novacompute-rbd-%index%' RoleParametersDefault: TunedProfileName: "virtual-host" diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 314d6c363c..aa04f9bf2f 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -365,8 +365,27 @@ def validate_with_compute_role_services(role_filename, role_tpl, exclude_service 'ServicesDefault in roles/Compute.yaml'.format(role_filename, ', '.join(missing_services))) return 1 - return 0 + cmpt_us = cmpt_tpl[0].get('update_serial', None) + tpl_us = role_tpl[0].get('update_serial', None) + + if 'OS::TripleO::Services::CephOSD' in role_services: + if tpl_us not in (None, 1): + print('ERROR: update_serial in {0} ({1}) ' + 'is should be 1 as it includes CephOSD'.format( + role_filename, + tpl_us, + cmpt_us)) + return 1 + elif cmpt_us is not None and tpl_us != cmpt_us: + print('ERROR: update_serial in {0} ({1}) ' + 'does not match roles/Compute.yaml {2}'.format( + role_filename, + tpl_us, + cmpt_us)) + return 1 + + return 0 def search(item, check_item, check_key): if check_item(item):