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])
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))
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))