OpenStack nova compute supports two flavors of Virtual Machine (VM) migration:
- Cold migration(冷迁移) – migration of a VM which requires the VM to be powered off during the migrate operation during which time the VM is inaccessible.
- Hot or live migration(热迁移) – zero down-time migration whereupon the VM is not powered off during the migration and thus remains accessible.
Understanding these VM migration operations from an OpenStack internals perspective can be a daunting task. I had the pleasure of digging into these flows in the latter part of 2013 and as part of that effort created a rough outline of the internal flows. Other’s I’ve worked with found these flow outlines useful and thus they’re provided below.
Note – The outlines below were created based on the OpenStack source in late 2013 and thus reflect the state of OpenStack at that point in time.
Live Migration Flow:
1 | nova.api.openstack.compute.contrib.admin_actions._migrate_live() |
Cold Migration Flow:
1 | nova.api.openstack.compute.servers._resize() |
Cold migration confirm flow:
1 | nova.api.openstack.compute.servers._action_confirm_resize() |
Cold migration revert flow:
1 | nova.api.openstack.compute.servers._action_revert_resize() |
热迁移不关心存储,仅处理OS的相关迁移.冷迁移在分布式存储时,也不关心存储,若为本地存储时,也需要迁移存储相关.
Attention:本地存储的instance,不支持热迁移.
Source: http://bodenr.blogspot.com/2014/03/openstack-nova-vm-migration-live-and.html