示例#1
0
    def __init__(self):
        self.proxy_match_host = CONF.DEFAULT.proxy_match_host
        self.proxy_match_region = CONF.DEFAULT.proxy_match_region
        self.proxies = self.proxy_match_host.keys()
        self.current_proxy = CONF.DEFAULT.current_node

        # cascading.hybrid.huawei.com
        self.cascading_region = RefCPSService.get_local_domain()
        log.info('cascading region is: %s' % self.cascading_region)
        local_dc, local_az = RefFsUtils.get_local_dc_az()
        # cascading.hybrid
        self.cascading_os_region_name = '.'.join([local_az, local_dc])
示例#2
0
    def __init__(self):
        self.proxy_match_host = CONF.DEFAULT.proxy_match_host
        self.proxy_match_region = CONF.DEFAULT.proxy_match_region
        self.proxies = self.proxy_match_host.keys()
        self.current_proxy = CONF.DEFAULT.current_node

        # cascading.hybrid.huawei.com
        self.cascading_region = RefCPSService.get_local_domain()
        log.info('cascading region is: %s' % self.cascading_region)
        local_dc, local_az = RefFsUtils.get_local_dc_az()
        # cascading.hybrid
        self.cascading_os_region_name = '.'.join([local_az, local_dc])
示例#3
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))
示例#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))