From 70f1cd8392ce028466b83e3004d1eec2368d3739 Mon Sep 17 00:00:00 2001 From: Atul Deshmukh Date: Fri, 12 Aug 2022 10:43:04 +0000 Subject: [PATCH 1/2] CORTX-33927: Deployment failure due to wrong traversing of consul conf store Signed-off-by: Atul Deshmukh --- .../seagate/cortx/motr/bin/motr_mini_prov.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py b/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py index d4526f8d774..462cbe77165 100644 --- a/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py +++ b/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py @@ -516,14 +516,20 @@ def motr_tune_memory_config(self): self.logger.debug(f"FILE not found {MOTR_M0D_CONF_FILE_PATH}\n") return + # Get number of services. + # Ex: num_of_services will be 2 since in motr services will be confd, ios + # But in /etc/cortx/cluster.conf io is represented by ios. So first get the service names right + num_of_services = get_value(self, 'cortx>motr>limits>num_services', str) + # collect the memory and cpu limits. - services_limits = Conf.get(self._index, 'cortx>motr>limits')['services'] - for arr_elem in services_limits: - if arr_elem['name'] == "ios": - mem_min = arr_elem['memory']['min'] - mem_max = arr_elem['memory']['max'] - cpu_min = arr_elem['cpu']['min'] - cpu_max = arr_elem['cpu']['max'] + for i in range(num_of_services): + service_name = get_value(self, f'cortx>motr>limits>services[{i}]>name', str) + if service_name == "ios": + mem_min = get_value(self, f'cortx>motr>limits>services[{i}]>memory>min', str) + mem_max = get_value(self, f'cortx>motr>limits>services[{i}]>memory>max', str) + cpu_min = get_value(self, f'cortx>motr>limits>services[{i}]>cpu>min', str) + cpu_max = get_value(self, f'cortx>motr>limits>services[{i}]>cpu>max', str) + break self.logger.debug(f"Avaiable memory {mem_min} {mem_max}\n") self.logger.debug(f"Avaiable CPU {cpu_min} {cpu_max}\n") From 04d9fcec11f88ee5aaacdd649f805a5040c242fd Mon Sep 17 00:00:00 2001 From: Atul Deshmukh Date: Fri, 12 Aug 2022 11:09:51 +0000 Subject: [PATCH 2/2] CORTX-33927: Deployment failure due to wrong traversing of consul conf store Signed-off-by: Atul Deshmukh --- scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py b/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py index 462cbe77165..238a9ebda3c 100644 --- a/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py +++ b/scripts/install/opt/seagate/cortx/motr/bin/motr_mini_prov.py @@ -518,7 +518,6 @@ def motr_tune_memory_config(self): # Get number of services. # Ex: num_of_services will be 2 since in motr services will be confd, ios - # But in /etc/cortx/cluster.conf io is represented by ios. So first get the service names right num_of_services = get_value(self, 'cortx>motr>limits>num_services', str) # collect the memory and cpu limits.