Ejemplo n.º 1
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))
Ejemplo n.º 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))
Ejemplo n.º 3
0
 def _get_proxy_region_and_host_region_name(self, proxy_matched_region):
     return '.'.join([
         RefFsSystemUtils.get_az_by_domain(proxy_matched_region),
         RefFsSystemUtils.get_dc_by_domain(proxy_matched_region)
     ])
Ejemplo n.º 4
0
 def _get_proxy_region_and_host_region_name(self, proxy_matched_region):
     return '.'.join([RefFsSystemUtils.get_az_by_domain(proxy_matched_region),
                                                RefFsSystemUtils.get_dc_by_domain(proxy_matched_region)])