本文整理汇总了Python中ovs.lib.mdsservice.MDSServiceController.mds_checkup方法的典型用法代码示例。如果您正苦于以下问题:Python MDSServiceController.mds_checkup方法的具体用法?Python MDSServiceController.mds_checkup怎么用?Python MDSServiceController.mds_checkup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ovs.lib.mdsservice.MDSServiceController
的用法示例。
在下文中一共展示了MDSServiceController.mds_checkup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: migrate_from_voldrv
# 需要导入模块: from ovs.lib.mdsservice import MDSServiceController [as 别名]
# 或者: from ovs.lib.mdsservice.MDSServiceController import mds_checkup [as 别名]
def migrate_from_voldrv(volume_id, new_owner_id):
"""
Triggered when volume has changed owner (Clean migration or stolen due to other reason)
Triggered by volumedriver messages
:param volume_id: Volume ID of the disk
:type volume_id: unicode
:param new_owner_id: ID of the storage driver the volume migrated to
:type new_owner_id: unicode
:returns: None
"""
sd = StorageDriverList.get_by_storagedriver_id(storagedriver_id=new_owner_id)
vdisk = VDiskList.get_vdisk_by_volume_id(volume_id=volume_id)
if vdisk is not None:
logger.info('Migration - Guid {0} - ID {1} - Detected migration for virtual disk {2}'.format(vdisk.guid, vdisk.volume_id, vdisk.name))
if sd is not None:
logger.info('Migration - Guid {0} - ID {1} - Storage Router {2} is the new owner of virtual disk {3}'.format(vdisk.guid, vdisk.volume_id, sd.storagerouter.name, vdisk.name))
MDSServiceController.mds_checkup()
VDiskController.dtl_checkup(vdisk_guid=vdisk.guid)