def __init__(self): self._hostutils = hostutils.HostUtils() self._vmutils = vmutils.VMUtils() self._vhdutils = vhdutils.VHDUtils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._vmops = vmops.VMOps() self._imagecache = imagecache.ImageCache()
def __init__(self, host='.'): if sys.platform == 'win32': # A separate WMI class for VM serial ports has been introduced # in Windows 10 / Windows Server 2016 if hostutils.HostUtils().check_min_windows_version(10, 0): self._SERIAL_PORT_SETTING_DATA_CLASS = ( "Msvm_SerialPortSettingData") super(VMUtilsV2, self).__init__(host)
def __init__(self): self._hostutils = hostutils.HostUtils() self._vmutils = vmutils.VMUtils() self._vhdutils = vhdutils.VHDUtils() self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache() self._vif_driver = None self._load_vif_driver_class()
def __init__(self): # Live migration is supported starting from Hyper-V Server 2012 if hostutils.HostUtils().check_min_windows_version(6, 2): self._livemigrutils = livemigrationutils.LiveMigrationUtils() else: self._livemigrutils = None self._pathutils = pathutils.PathUtils() self._volumeops = volumeops.VolumeOps() self._imagecache = imagecache.ImageCache()
def _check_minimum_windows_version(self): if not hostutils.HostUtils().check_min_windows_version(6, 2): # the version is of Windows is older than Windows Server 2012 R2. # Log an error, lettingusers know that this version is not # supported any longer. err_msg = _LE('You are running nova-compute on an unsupported ' 'version of Windows (older than Windows / Hyper-V ' 'Server 2012). The support for this version of ' 'Windows has been removed in Mitaka.') LOG.error(err_msg) raise vmutils.HyperVException(err_msg)
def __init__(self, host='.'): self._enabled_states_map = dict( (v, k) for k, v in self._vm_power_states_map.iteritems()) if sys.platform == 'win32': self._init_hyperv_wmi_conn(host) self._conn_cimv2 = wmi.WMI(moniker='//%s/root/cimv2' % host) # On version of Hyper-V prior to 2012 trying to directly set properties # in default setting data WMI objects results in an exception self._clone_wmi_objs = False if sys.platform == 'win32': hostutls = hostutils.HostUtils() self._clone_wmi_objs = not hostutls.check_min_windows_version(6, 2)
def __init__(self, virtapi): super(HyperVDriver, self).__init__(virtapi) self._hostops = hostops.HostOps() self._volumeops = volumeops.VolumeOps() self._vmops = vmops.VMOps() self._snapshotops = snapshotops.SnapshotOps() self._livemigrationops = livemigrationops.LiveMigrationOps() self._migrationops = migrationops.MigrationOps() self._rdpconsoleops = rdpconsoleops.RDPConsoleOps() # check if the current version is older than kernel version 6.2 # (Windows Server 2012) if not hostutils.HostUtils().check_min_windows_version(6, 2): # the version is Windows Server 2008 R2. Log a warning, letting # users know that this version is deprecated in Liberty. LOG.warning( _LW('You are running nova-compute on Windows / Hyper-V Server ' '2008 R2. This version of Windows is deprecated in the ' 'current version of OpenStack and the support for it will ' 'be removed in the next cycle.'))
def get_hostutils(): return hostutils.HostUtils()
from nova.virt.hyperv import vmutilsv2 from nova.virt.hyperv import volumeutils from nova.virt.hyperv import volumeutilsv2 hyper_opts = [ cfg.BoolOpt('force_volumeutils_v1', default=False, help='Force V1 volume utility class'), ] CONF = cfg.CONF CONF.register_opts(hyper_opts, 'hyperv') LOG = logging.getLogger(__name__) utils = hostutils.HostUtils() def _get_class(v1_class, v2_class, force_v1_flag=False): # V2 classes are supported starting from Hyper-V Server 2012 and # Windows Server 2012 (kernel version 6.2) if not force_v1_flag and utils.check_min_windows_version(6, 2): cls = v2_class else: cls = v1_class LOG.debug("Loading class: %(module_name)s.%(class_name)s", {'module_name': cls.__module__, 'class_name': cls.__name__}) return cls def get_vmutils(host='.'):
def __init__(self): self._hostutils = hostutils.HostUtils() self._vmutils = vmutils.VMUtils() self._volutils = self._get_volume_utils() self._initiator = None self._default_root_device = 'vda'
def __init__(self): self._stats = None self._hostutils = hostutils.HostUtils() self._pathutils = pathutils.PathUtils()
def setUp(self): self._hostutils = hostutils.HostUtils() self._hostutils._conn_cimv2 = mock.MagicMock() super(HostUtilsTestCase, self).setUp()