本文整理汇总了Python中ovs.lib.vdisk.VDiskController.migrate_from_voldrv方法的典型用法代码示例。如果您正苦于以下问题:Python VDiskController.migrate_from_voldrv方法的具体用法?Python VDiskController.migrate_from_voldrv怎么用?Python VDiskController.migrate_from_voldrv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ovs.lib.vdisk.VDiskController
的用法示例。
在下文中一共展示了VDiskController.migrate_from_voldrv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_event_migrate_from_volumedriver
# 需要导入模块: from ovs.lib.vdisk import VDiskController [as 别名]
# 或者: from ovs.lib.vdisk.VDiskController import migrate_from_voldrv [as 别名]
def test_event_migrate_from_volumedriver(self):
"""
Test migrate from volumedriver event
"""
_ = self
structure = Helper.build_service_structure(
{'vpools': [1],
'storagerouters': [1, 2],
'storagedrivers': [(1, 1, 1), (2, 1, 2)], # (<id>, <vpool_id>, <storagerouter_id>)
'mds_services': [(1, 1), (2, 2)]} # (<id>, <storagedriver_id>)
)
vpool = structure['vpools'][1]
storagedrivers = structure['storagedrivers']
storagerouters = structure['storagerouters']
self._roll_out_dtl_services(vpool=vpool, storagerouters=storagerouters)
vdisk = VDisk(VDiskController.create_new(volume_name='vdisk_1', volume_size=1024 ** 4, storagedriver_guid=storagedrivers[1].guid))
vdisk.storagedriver_client.migrate(vdisk.volume_id, storagedrivers[2].storagedriver_id, False)
VDiskController.migrate_from_voldrv(volume_id=vdisk.volume_id, new_owner_id=storagedrivers[2].storagedriver_id)
self.assertEqual(vdisk.storagedriver_id, storagedrivers[2].storagedriver_id)