本文整理汇总了Python中ovs.dal.lists.vdisklist.VDiskList.get_in_volume_ids方法的典型用法代码示例。如果您正苦于以下问题:Python VDiskList.get_in_volume_ids方法的具体用法?Python VDiskList.get_in_volume_ids怎么用?Python VDiskList.get_in_volume_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ovs.dal.lists.vdisklist.VDiskList
的用法示例。
在下文中一共展示了VDiskList.get_in_volume_ids方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _vdisks_guids
# 需要导入模块: from ovs.dal.lists.vdisklist import VDiskList [as 别名]
# 或者: from ovs.dal.lists.vdisklist.VDiskList import get_in_volume_ids [as 别名]
def _vdisks_guids(self):
"""
Gets the vDisk guids served by this StorageRouter.
"""
from ovs.dal.lists.vdisklist import VDiskList
vdisk_guids = []
for storagedriver in self.storagedrivers:
storagedriver_client = storagedriver.vpool.storagedriver_client
vdisk_guids += VDiskList.get_in_volume_ids(storagedriver_client.list_volumes(str(storagedriver.storagedriver_id))).guids
return vdisk_guids
示例2: _vdisks_guids
# 需要导入模块: from ovs.dal.lists.vdisklist import VDiskList [as 别名]
# 或者: from ovs.dal.lists.vdisklist.VDiskList import get_in_volume_ids [as 别名]
def _vdisks_guids(self):
"""
Gets the vDisk guids served by this StorageDriver.
"""
from ovs.dal.lists.vdisklist import VDiskList
volume_ids = []
for entry in self.vpool.objectregistry_client.get_all_registrations():
if entry.node_id() == self.storagedriver_id:
volume_ids.append(entry.object_id())
return VDiskList.get_in_volume_ids(volume_ids).guids
示例3: _vmachines_guids
# 需要导入模块: from ovs.dal.lists.vdisklist import VDiskList [as 别名]
# 或者: from ovs.dal.lists.vdisklist.VDiskList import get_in_volume_ids [as 别名]
def _vmachines_guids(self):
"""
Gets the vMachine guids served by this StorageRouter.
Definition of "served by": vMachine whose disks are served by a given StorageRouter
"""
from ovs.dal.lists.vdisklist import VDiskList
vmachine_guids = set()
for storagedriver in self.storagedrivers:
storagedriver_client = storagedriver.vpool.storagedriver_client
for vdisk in VDiskList.get_in_volume_ids(storagedriver_client.list_volumes(str(storagedriver.storagedriver_id))):
if vdisk.vmachine_guid is not None:
vmachine_guids.add(vdisk.vmachine_guid)
return list(vmachine_guids)
示例4: _vdisks_guids
# 需要导入模块: from ovs.dal.lists.vdisklist import VDiskList [as 别名]
# 或者: from ovs.dal.lists.vdisklist.VDiskList import get_in_volume_ids [as 别名]
def _vdisks_guids(self):
"""
Gets the vDisk guids served by this StorageRouter.
"""
from ovs.dal.lists.vdisklist import VDiskList
volume_ids = []
vpools = set()
storagedriver_ids = []
for storagedriver in self.storagedrivers:
vpools.add(storagedriver.vpool)
storagedriver_ids.append(storagedriver.storagedriver_id)
for vpool in vpools:
for entry in vpool.objectregistry_client.get_all_registrations():
if entry.node_id() in storagedriver_ids:
volume_ids.append(entry.object_id())
return VDiskList.get_in_volume_ids(volume_ids).guids