From 1cf27363e5a20785f7ae0412f032e3a5098dd08a Mon Sep 17 00:00:00 2001 From: Chris Friesen Date: Wed, 6 Feb 2019 15:38:52 -0600 Subject: [PATCH] use one mariadb server pod for AIO-DX In the case of AIO-DX there are only two controllers and only one of them will be "active" at a time. This makes it difficult to reliably use multiple mariadb server pods since there is no third node to ensure the remaining nodes have quorum if one node goes down. Accordingly, for now we will use a single mariadb server pod for this case. Change-Id: Iadd72df667b09fb3533eb8f80b7fefd9414b7f07 Signed-off-by: Chris Friesen Story: 2004712 Task: 29382 --- sysinv/sysinv/sysinv/sysinv/helm/garbd.py | 12 +++++++----- sysinv/sysinv/sysinv/sysinv/helm/mariadb.py | 11 ++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/helm/garbd.py b/sysinv/sysinv/sysinv/sysinv/helm/garbd.py index 55b77186f6..2bf19b440d 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/garbd.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/garbd.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # +from sysinv.api.controllers.v1 import utils from sysinv.common import constants from sysinv.common import exception from sysinv.openstack.common import log as logging @@ -32,11 +33,12 @@ class GarbdHelm(base.BaseHelm): def get_meta_overrides(self, namespace): def _meta_overrides(): - if self._num_controllers() < 2: - # If there are fewer than 2 controllers we'll use a single - # mariadb server and so we don't want to run garbd. This - # will remove "openstack-garbd" from the charts in the - # openstack-mariadb chartgroup. + if (self._num_controllers() < 2 or + utils.is_aio_duplex_system(self.dbapi)): + # If there are fewer than 2 controllers or we're on AIO-DX + # we'll use a single mariadb server and so we don't want to + # run garbd. This will remove "openstack-garbd" from the + # charts in the openstack-mariadb chartgroup. return { 'schema': 'armada/ChartGroup/v1', 'metadata': { diff --git a/sysinv/sysinv/sysinv/sysinv/helm/mariadb.py b/sysinv/sysinv/sysinv/sysinv/helm/mariadb.py index 265c7f8698..db9b896781 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/mariadb.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/mariadb.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # +from sysinv.api.controllers.v1 import utils from sysinv.common import constants from sysinv.common import exception from sysinv.openstack.common import log as logging @@ -21,6 +22,14 @@ class MariadbHelm(openstack.OpenstackBaseHelm): common.HELM_NS_OPENSTACK ] + def _num_server_replicas(self): + # For now we want to run with a single mariadb server pod for the + # AIO-DX case. + if utils.is_aio_duplex_system(self.dbapi): + return 1 + else: + return self._num_controllers() + def get_namespaces(self): return self.SUPPORTED_NAMESPACES @@ -29,7 +38,7 @@ class MariadbHelm(openstack.OpenstackBaseHelm): common.HELM_NS_OPENSTACK: { 'pod': { 'replicas': { - 'server': self._num_controllers() + 'server': self._num_server_replicas() } }, 'images': self._get_images_overrides(),