Add support for new WMI iSCSI initiator API
blueprint hyper-v-volume-w2012 Change-Id: Iba432176c822c45820e2b46e1d28bfa941c8ddab
This commit is contained in:
parent
ac7737dc8b
commit
92792423bf
|
@ -23,7 +23,7 @@ import time
|
|||
|
||||
from nova import exception
|
||||
from nova.virt.hyperv import constants
|
||||
from nova.virt.hyperv import volumeutils
|
||||
from nova.virt.hyperv import volumeutilsV2
|
||||
from xml.etree import ElementTree
|
||||
|
||||
# Check needed for unit testing on Unix
|
||||
|
@ -37,7 +37,9 @@ class HyperVUtils(object):
|
|||
self.__conn_v2 = None
|
||||
self.__conn_cimv2 = None
|
||||
self.__conn_wmi = None
|
||||
self._volumeutils = volumeutils.VolumeUtils()
|
||||
self.__conn_storage = None
|
||||
self._volumeutils = volumeutilsV2.VolumeUtilsV2(
|
||||
self._conn_storage, self._conn_wmi)
|
||||
|
||||
@property
|
||||
def _conn(self):
|
||||
|
@ -63,6 +65,13 @@ class HyperVUtils(object):
|
|||
self.__conn_wmi = wmi.WMI(moniker='//./root/wmi')
|
||||
return self.__conn_wmi
|
||||
|
||||
@property
|
||||
def _conn_storage(self):
|
||||
if self.__conn_storage is None:
|
||||
storage_namespace = '//./Root/Microsoft/Windows/Storage'
|
||||
self.__conn_storage = wmi.WMI(moniker=storage_namespace)
|
||||
return self.__conn_storage
|
||||
|
||||
def create_vhd(self, path):
|
||||
image_service = self._conn.query(
|
||||
"Select * from Msvm_ImageManagementService")[0]
|
||||
|
@ -210,7 +219,8 @@ class HyperVUtils(object):
|
|||
|
||||
def logout_iscsi_volume_sessions(self, volume_id):
|
||||
target_iqn = self._get_target_iqn(volume_id)
|
||||
self._volumeutils.logout_storage_target(self._conn_wmi, target_iqn)
|
||||
if (self.iscsi_volume_sessions_exist(volume_id)):
|
||||
self._volumeutils.logout_storage_target(target_iqn)
|
||||
|
||||
def iscsi_volume_sessions_exist(self, volume_id):
|
||||
target_iqn = self._get_target_iqn(volume_id)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue