Exemple #1
0
 def _meta_overrides():
     if (self._num_controllers() < 2 or
             utils.is_aio_duplex_system(self.dbapi) or
             (self._distributed_cloud_role() ==
                 constants.DISTRIBUTED_CLOUD_ROLE_SYSTEMCONTROLLER)):
         # If there are fewer than 2 controllers or we're on AIO-DX
         # or we are on distributed cloud system controller
         # 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': {
                 'schema': 'metadata/Document/v1',
                 'name': 'openstack-mariadb',
             },
             'data': {
                 'description': 'Mariadb',
                 'sequenced': True,
                 'chart_group': [
                     'openstack-mariadb',
                 ]
             }
         }
     else:
         return {}
Exemple #2
0
 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()
Exemple #3
0
def get_ceph_storage_model(dbapi=None):

    if not dbapi:
        dbapi = pecan.request.dbapi

    if utils.is_aio_simplex_system(dbapi):
        return constants.CEPH_AIO_SX_MODEL

    if utils.is_aio_duplex_system(dbapi):
        return constants.CEPH_CONTROLLER_MODEL

    is_storage_model = False
    is_controller_model = False

    monitor_list = dbapi.ceph_mon_get_list()
    for mon in monitor_list:
        ihost = dbapi.ihost_get(mon['forihostid'])
        if ihost.personality == constants.WORKER:
            # 3rd monitor is on a compute node, so OSDs are on controller
            is_controller_model = True
        elif ihost.personality == constants.STORAGE:
            # 3rd monitor is on storage-0, so OSDs are also on storage nodes
            is_storage_model = True

    # There are cases where we delete the monitor on worker node and have not
    # yet assigned it to another worker. In this case check if any OSDs have
    # been configured on controller nodes.

    if not is_storage_model:
        controller_hosts = dbapi.ihost_get_by_personality(constants.CONTROLLER)
        for chost in controller_hosts:
            istors = dbapi.istor_get_by_ihost(chost['uuid'])
            if len(istors):
                is_controller_model = True
                break

    if is_storage_model and is_controller_model:
        # Both types should not be true at the same time, but we should log a
        # message for debug purposes
        # TODO(sdinescu): Improve error message
        LOG.error("Wrong ceph storage type. Bad configuration.")
        return constants.CEPH_STORAGE_MODEL
    elif is_storage_model:
        return constants.CEPH_STORAGE_MODEL
    elif is_controller_model:
        return constants.CEPH_CONTROLLER_MODEL
    else:
        # This case is for the install stage where the decision
        # to configure OSDs on controller or storage nodes is not
        # clear (before adding a monitor on a compute or before
        # configuring the first storage node)
        return constants.CEPH_UNDEFINED_MODEL
Exemple #4
0
 def _meta_overrides():
     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': {
                 'schema': 'metadata/Document/v1',
                 'name': 'openstack-mariadb',
             },
             'data': {
                 'description': 'Mariadb',
                 'sequenced': True,
                 'chart_group': [
                     'openstack-mariadb',
                 ]
             }
         }
     else:
         return {}