nova_live_migration.py 文件源码

python
阅读 67 收藏 0 点赞 0 评论 0

项目:benchmarking_live-migration 作者: osic 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号