Instance migration in OpenStack can be used to redistribute VM loads or for maintenance and comes in two types - nova migrate and nova live-migration. Nova migrate shuts down instances during migration and does not allow target host selection, while nova live-migration suspends instances to minimize downtime but requires shared storage and has additional requirements. Administrators should use nova live-migration when choosing the target host is important or to minimize downtime, and nova migrate when not choosing the host or if configuration prevents live-migration.
2. Migration
Can be used for?
useful when a compute host requires maintenance.
useful to redistribute the load when many VM instances are
running on a specific physical machine.
Can NOT be used for?
Modifying instance properties such as CPU/RAM
4. Each option has requirements and restrictions
For example:
You can't live-migrate without shared storage.
You can't live-migrate if you have a config-drive enabled.
You can't select the target host if you use the nova migrate
(non-live) command.
5. Migration Commands
Openstack has two commands specific to virtual machine migration:
nova migrate $UUID
nova live-migration $UUID $COMPUTE-HOST
6. nova migrate $UUID
The nova migrate command shuts down an instance to move it to
another hypervisor.
The instance is down for a period of time and sees this as a regular
shutdown.
It is not possible to specify the compute host you want to migrate the
instance to. (there are workarounds to do it the dirty way, however).
This command does not require shared storage, the migrations can take a
long time.
7. nova migrate $UUID (Cont.)
The nova migrate command shuts down an instance to move it to
another hypervisor.
The Openstack cluster chooses the target hypervisor machine based on the
free resources and availability.
The migrate command works with any type of instance.
The VM clock has no issues.
8. nova live-migration $UUID $COMPUTE-HOST
The nova live-migration command has almost no instance downtime.
The instance is suspended and does not see this as a shutdown.
The live-migration lets you specify the compute host you want to
migrate to, however with some limitations. This requires shared
storage, instances without a config-drive when block storage is used,
or volume-backed instances.
9. nova live-migration $UUID $COMPUTE-HOST (Cont.)
The nova live-migration command has almost no instance downtime.
The migration fails if there are not enough resources on the target
hypervisor
The VM clock might be off to prevent issues.
10. when to use which option
If it is important to choose the compute host or to have very little
downtime you need to use the nova live-migration command.
If you don't want to choose the compute host, or you have a
configdrive enabled, you need to use the nova migrate command.
If you need to specify the compute host and you have a config-drive
enabled, you need to manually migrate the machine, or use a dirty
trick to fool nova migrate.