def live_migrate_servers_from_host(self, image, host_to_evacuate,
flavor, block_migration=False, destination_host=None,
disk_over_commit=False, number_of_parallel_migrations=1,
**kwargs):
"""Live Migrate servers.
This scenario migrates all the VM in the specified compute host to another
compute node on the same availability zone.
:param image: image to be used to boot an instance
:param flavor: flavor to be used to boot an instance
:param block_migration: Specifies the migration type
on migrated instance or not
"""
servers_to_migrate = self._get_servers_from_compute(host_to_evacuate)
print "migrating servers: " + str(servers_to_migrate)
executor = ThreadPoolExecutor(max_workers=int(number_of_parallel_migrations))
futures = []
for server in servers_to_migrate:
a = executor.submit(self._migrate_server, server, destination_host, block_migration, disk_over_commit)
futures.append(a)
print(wait(futures))
nova_live_migration.py 文件源码
python
阅读 67
收藏 0
点赞 0
评论 0
评论列表
文章目录