def get_instance_dir(self, instance_name, remote_server=None, create_dir=True, remove_dir=False): instance_dir = self._get_instances_sub_dir( instance_name, remote_server, create_dir=False, remove_dir=False) # In some situations, the instance files may reside at a different # location than the configured one. if not os.path.exists(instance_dir): vmutils = (self._vmutils if not remote_server else utilsfactory.get_vmutils(remote_server)) try: instance_dir = vmutils.get_vm_config_root_dir( instance_name) if remote_server: instance_dir = self._get_remote_unc_path(remote_server, instance_dir) LOG.info(_LI("Found instance dir at non-default location: %s"), instance_dir) except os_win_exc.HyperVVMNotFoundException: pass self._check_dir(instance_dir, create_dir=create_dir, remove_dir=remove_dir) return instance_dir
def __init__(self): self._diskutils = utilsfactory.get_diskutils() self._hostutils = utilsfactory.get_hostutils() self._pathutils = pathutils.PathUtils() self._vmutils = utilsfactory.get_vmutils() self._vmops = vmops.VMOps() self._api = api.API()
def __init__(self): self._livemigrutils = utilsfactory.get_livemigrationutils() self._pathutils = pathutils.PathUtils() self._vmops = vmops.VMOps() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._vmutils = utilsfactory.get_vmutils()
def get_instance_dir(self, instance_name, remote_server=None, create_dir=True, remove_dir=False): instance_dir = self._get_instances_sub_dir(instance_name, remote_server, create_dir=False, remove_dir=False) # In some situations, the instance files may reside at a different # location than the configured one. if not os.path.exists(instance_dir): vmutils = (self._vmutils if not remote_server else utilsfactory.get_vmutils(remote_server)) try: instance_dir = vmutils.get_vm_config_root_dir(instance_name) if remote_server: instance_dir = self._get_remote_unc_path( remote_server, instance_dir) LOG.info(_LI("Found instance dir at non-default location: %s"), instance_dir) except os_win_exc.HyperVVMNotFoundException: pass self._check_dir(instance_dir, create_dir=create_dir, remove_dir=remove_dir) return instance_dir
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._default_root_device = 'vda' self.volume_drivers = { constants.STORAGE_PROTOCOL_SMBFS: SMBFSVolumeDriver(), constants.STORAGE_PROTOCOL_ISCSI: ISCSIVolumeDriver(), constants.STORAGE_PROTOCOL_FC: FCVolumeDriver()}
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._volutils = utilsfactory.get_iscsi_initiator_utils() self._initiator = None self._default_root_device = 'vda' self.volume_drivers = {'smbfs': SMBFSVolumeDriver(), 'iscsi': ISCSIVolumeDriver()}
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._vhdutils = utilsfactory.get_vhdutils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._vmops = vmops.VMOps() self._imagecache = imagecache.ImageCache() self._block_dev_man = block_device_manager.BlockDeviceInfoManager()
def __init__(self, host='.'): super(MetricsUtils, self).__init__(host) self._metrics_svc_obj = None self._metrics_defs_obj = {} # We need to avoid a circular dependency. from os_win import utilsfactory self._vmutils = utilsfactory.get_vmutils(host)
def __init__(self): self._hostutils = utilsfactory.get_hostutils() self._vmutils = utilsfactory.get_vmutils() self._vhdutils = utilsfactory.get_vhdutils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._vmops = vmops.VMOps() self._imagecache = imagecache.ImageCache()
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._default_root_device = 'vda' self.volume_drivers = { constants.STORAGE_PROTOCOL_SMBFS: SMBFSVolumeDriver(), constants.STORAGE_PROTOCOL_ISCSI: ISCSIVolumeDriver(), constants.STORAGE_PROTOCOL_FC: FCVolumeDriver() }
def __init__(self): self._livemigrutils = utilsfactory.get_livemigrationutils() self._pathutils = pathutils.PathUtils() self._vmops = vmops.VMOps() self._volumeops = volumeops.VolumeOps() self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._imagecache = imagecache.ImageCache() self._vmutils = utilsfactory.get_vmutils() self._block_dev_man = block_device_manager.BlockDeviceInfoManager()
def __init__(self, state_change_callback=None, running_state_callback=None): self._vmutils = utilsfactory.get_vmutils() self._listener = self._vmutils.get_vm_power_state_change_listener( timeframe=CONF.hyperv.power_state_check_timeframe, filtered_states=self._TRANSITION_MAP.keys() ) self._polling_interval = CONF.hyperv.power_state_event_polling_interval self._state_change_callback = state_change_callback self._running_state_callback = running_state_callback
def __init__(self, state_change_callback=None): self._vmutils = utilsfactory.get_vmutils() self._listener = self._vmutils.get_vm_power_state_change_listener( timeframe=CONF.hyperv.power_state_check_timeframe, event_timeout=CONF.hyperv.power_state_event_polling_interval, filtered_states=list(self._TRANSITION_MAP.keys()), get_handler=True) self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._state_change_callback = state_change_callback
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._vhdutils = utilsfactory.get_vhdutils() self._hostutils = utilsfactory.get_hostutils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._vif_driver = None self._load_vif_driver_class() self._vm_log_writers = {}
def __init__(self, state_change_callback=None, running_state_callback=None): self._vmutils = utilsfactory.get_vmutils() self._listener = self._vmutils.get_vm_power_state_change_listener( timeframe=CONF.hyperv.power_state_check_timeframe, filtered_states=list(self._TRANSITION_MAP.keys())) self._polling_interval = CONF.hyperv.power_state_event_polling_interval self._state_change_callback = state_change_callback self._running_state_callback = running_state_callback
def __init__(self): self._default_root_device = 'vda' self._hostutils = utilsfactory.get_hostutils() self._vmutils = utilsfactory.get_vmutils() self._verify_setup() self.volume_drivers = {'smbfs': SMBFSVolumeDriver(), 'iscsi': ISCSIVolumeDriver(), 'fibre_channel': FCVolumeDriver()}
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._metricsutils = utilsfactory.get_metricsutils() self._vhdutils = utilsfactory.get_vhdutils() self._hostutils = utilsfactory.get_hostutils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._vif_driver = None self._load_vif_driver_class()
def __init__(self): self._clustutils = utilsfactory.get_clusterutils() self._vmutils = utilsfactory.get_vmutils() self._clustutils.check_cluster_state() self._instance_map = {} self._this_node = hostops.HostOps.get_hostname() self._context = context.get_admin_context() self._network_api = network.API() self._vmops = vmops.VMOps() self._serial_console_ops = serialconsoleops.SerialConsoleOps()
def __init__(self): self._default_root_device = 'vda' self._hostutils = utilsfactory.get_hostutils() self._vmutils = utilsfactory.get_vmutils() self._verify_setup() self.volume_drivers = { 'smbfs': SMBFSVolumeDriver(), 'iscsi': ISCSIVolumeDriver(), 'fibre_channel': FCVolumeDriver() }
def __init__(self): # Live migration is supported starting from Hyper-V Server 2012 if utilsfactory.get_hostutils().check_min_windows_version(6, 2): self._livemigrutils = utilsfactory.get_livemigrationutils() else: self._livemigrutils = None self._pathutils = pathutils.PathUtils() self._vmops = vmops.VMOps() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._vmutils = utilsfactory.get_vmutils()
def __init__(self, virtapi=None): self._virtapi = virtapi self._vmutils = utilsfactory.get_vmutils() self._metricsutils = utilsfactory.get_metricsutils() self._vhdutils = utilsfactory.get_vhdutils() self._hostutils = utilsfactory.get_hostutils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._block_dev_man = (block_device_manager.BlockDeviceInfoManager()) self._vif_driver = vif_utils.HyperVVIFDriver()
def __init__(self, virtapi=None): self._virtapi = virtapi self._vmutils = utilsfactory.get_vmutils() self._metricsutils = utilsfactory.get_metricsutils() self._vhdutils = utilsfactory.get_vhdutils() self._hostutils = utilsfactory.get_hostutils() self._pathutils = pathutils.PathUtils() self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._vif_driver_cache = {} self._block_device_manager = ( block_device_manager.BlockDeviceInfoManager())
def __init__(self): self._clustutils = utilsfactory.get_clusterutils() self._vmutils = utilsfactory.get_vmutils() self._clustutils.check_cluster_state() self._instance_map = {} self._daemon = None self._this_node = self._clustutils.get_node_name() self._context = context.get_admin_context() self._network_api = network.API() self._vmops = vmops.VMOps() self._serial_console_ops = serialconsoleops.SerialConsoleOps()
def __init__(self, instance_name): self._vmutils = utilsfactory.get_vmutils() self._pathutils = pathutils.PathUtils() self._instance_name = instance_name self._log_path = self._pathutils.get_vm_console_log_paths( self._instance_name)[0] self._client_connected = None self._input_queue = None self._output_queue = None self._serial_proxy = None self._workers = []
def get_hypervisor_vms(host='.'): nova_vms = [] other_vms = [] try: vmutils = utilsfactory.get_vmutils(host=host) vm_mappings = vmutils.list_instance_notes() except Exception as ex: print("WARNING: Could not get hypervisor vms: %s" % host) return nova_vms, other_vms for vm_name, notes in vm_mappings: if notes and uuidutils.is_uuid_like(notes[0]): nova_vms.append(notes[0]) else: other_vms.append(vm_name) return nova_vms, other_vms
def check_vm_states(hv_names): vm_state_map = collections.defaultdict(int) group_state_map = collections.defaultdict(int) for node_name in hv_names: try: vmutils = utilsfactory.get_vmutils(host=node_name) for vm_name in vmutils.list_instances(): state = vmutils.get_vm_state(vm_name) vm_state_map[state] += 1 if clusterutils and clusterutils.vm_exists(vm_name): state_info = clusterutils.get_cluster_group_state_info(vm_name) group_state_map[state_info['state']] += 1 except Exception as ex: print("WARNING: Could not get hypervisor vms: %s" % node_name) # For now, we'll just print the amount of vms/groups # that are currently in a specific state. print("VM state map: %s" % pretty_dict(vm_state_map)) print("Group state map: %s" % pretty_dict(group_state_map))
def __init__(self): self._conn = None self._diskutils = utilsfactory.get_diskutils() self._vmutils = utilsfactory.get_vmutils() self._migrutils = utilsfactory.get_migrationutils()
def __init__(self): self._volops = volumeops.VolumeOps() self._pathutils = pathutils.PathUtils() self._vmutils = utilsfactory.get_vmutils()
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._volutils = utilsfactory.get_iscsi_initiator_utils()
def __init__(self): super(PathUtils, self).__init__() self._smbutils = utilsfactory.get_smbutils() self._vmutils = utilsfactory.get_vmutils()
def __init__(self): self._smbutils = utilsfactory.get_smbutils() self._vmutils = utilsfactory.get_vmutils() self._username_regex = re.compile(r'user(?:name)?=([^, ]+)') self._password_regex = re.compile(r'pass(?:word)?=([^, ]+)')
def __init__(self): self._hostops = hostops.HostOps() self._vmutils = utilsfactory.get_vmutils() self._rdpconsoleutils = utilsfactory.get_rdpconsoleutils()
def __init__(self): self._vmops_prop = None self._vmutils = utilsfactory.get_vmutils() self._pathutils = pathutils.PathUtils()
def __init__(self): self._pathutils = pathutils.PathUtils() self._vmutils = utilsfactory.get_vmutils() self._vhdutils = utilsfactory.get_vhdutils()
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._diskutils = utilsfactory.get_diskutils()
def __init__(self): self._pathutils = utilsfactory.get_pathutils() self._vmutils = utilsfactory.get_vmutils() self._username_regex = re.compile(r'user(?:name)?=([^, ]+)') self._password_regex = re.compile(r'pass(?:word)?=([^, ]+)')
def __init__(self): self._vmutils = utilsfactory.get_vmutils() self._volutils = utilsfactory.get_iscsi_initiator_utils() self._initiator = None self._default_root_device = "vda" self.volume_drivers = {"smbfs": SMBFSVolumeDriver(), "iscsi": ISCSIVolumeDriver()}