Example #1
0
    def create_ag_az_for_cascaded_node(self):
        reference_service = RefServices()
        name_aggregate = config.CONF.cascaded_node_plugins.aggregate_name
        az = config.CONF.node_cfg.availability_zone
        host = config.CONF.sysconfig.hostname
        logger.info('@@@@ Start to create aggregate for aggregate <%s> availability_zone <%s> @@@@' %
                    (name_aggregate, az))

        if reference_service.nova_aggregate_exist(name_aggregate, az):
            logger.info('aggregate<%s> availability_zone<%s> is exist, no need to create.')
        else:
            aggregate_obj = reference_service.nova_aggregate_create(name_aggregate, az)
            reference_service.nova_aggregate_add_host(aggregate_obj.id, host)

        logger.info('@@@@ End to create aggregate for aggregate <%s> availability_zone <%s> @@@@' %
                    (name_aggregate, az))
Example #2
0
    def create_aggregate_in_cascaded_node(self):
        """
        nova aggregate-create az31.singapore--aws az31.singapore--aws
        nova host-list
        nova aggregate-add-host az31.singapore--aws 42114FD9-D446-9248-3A05-23CF474E3C68

        :return:
        """
        ref_service = RefServices()
        host_id = socket.gethostname()
        region = RefCPSService.get_local_domain()
        os_region_name = '.'.join([RefFsSystemUtils.get_az_by_domain(region), RefFsSystemUtils.get_dc_by_domain(region)])
        if not ref_service.nova_aggregate_exist(os_region_name, os_region_name):
            create_result = ref_service.nova_aggregate_create(os_region_name, os_region_name)
            if create_result is not None:
                ref_service.nova_aggregate_add_host(create_result, host_id)
        print('Success to create region<%s> for host<%s>' % (os_region_name, host_id))
Example #3
0
    def create_ag_az_for_cascaded_node(self):
        reference_service = RefServices()
        name_aggregate = config.CONF.cascaded_node_plugins.aggregate_name
        az = config.CONF.node_cfg.availability_zone
        host = config.CONF.sysconfig.hostname
        logger.info(
            '@@@@ Start to create aggregate for aggregate <%s> availability_zone <%s> @@@@'
            % (name_aggregate, az))

        if reference_service.nova_aggregate_exist(name_aggregate, az):
            logger.info(
                'aggregate<%s> availability_zone<%s> is exist, no need to create.'
            )
        else:
            aggregate_obj = reference_service.nova_aggregate_create(
                name_aggregate, az)
            reference_service.nova_aggregate_add_host(aggregate_obj.id, host)

        logger.info(
            '@@@@ End to create aggregate for aggregate <%s> availability_zone <%s> @@@@'
            % (name_aggregate, az))
Example #4
0
    def create_aggregate_in_cascaded_node(self):
        """
        nova aggregate-create az31.singapore--aws az31.singapore--aws
        nova host-list
        nova aggregate-add-host az31.singapore--aws 42114FD9-D446-9248-3A05-23CF474E3C68

        :return:
        """
        ref_service = RefServices()
        host_id = socket.gethostname()
        region = RefCPSService.get_local_domain()
        os_region_name = '.'.join([
            RefFsSystemUtils.get_az_by_domain(region),
            RefFsSystemUtils.get_dc_by_domain(region)
        ])
        if not ref_service.nova_aggregate_exist(os_region_name,
                                                os_region_name):
            create_result = ref_service.nova_aggregate_create(
                os_region_name, os_region_name)
            if create_result is not None:
                ref_service.nova_aggregate_add_host(create_result, host_id)
        print('Success to create region<%s> for host<%s>' %
              (os_region_name, host_id))