For the purpose of this document the following is required :
All the hypervisors are of a homogeneous nature (the same cpu, arch, type and model)
All virtual machines are volume backed, since we are not going to do live block migration.
Bright OpenStack 7.3 or 8.0 is installed. The instances being migrated does not have SR-IOV ports.
To get a list of all hypervisors :#nova hypervisor-list
To identify virtual machines running on a hypervisor :#nova hypervisor-servers <node>
To disable the hypervisor from being scheduled any virtual machines :#nova service-disable --reason "Host is drained" <node> nova-compute
To live evacuate all instances in a host :nova host-evacuate-live <node>
To live migrate an instance from one host to another host :#nova live-migration <instance id> <node>
To verify that the machine has been migrated :
If you are evacuating a hypervisor, you need to make sure that the following list is empty:#nova hypervisor-servers <node>
If you are migrating only a single instance :#openstack server show <instance-id> | grep host
Note :
Do not perform the following step till you verify that your machines have been migrated.
Do not perform following step if you have any virtual machines on that host that you want to keep alive.
To disable starting any OpenStack services on the node :#cmsh ; device ; use <node> ; set useexclusivelyfor hpc ; commit
To enable the node once more :#cmsh ; device ; use <node> ; clear useexclusivelyfor ; commit
#nova service-enable --reason "Host is back" <node> nova-compute
To verify that the migration has been completed.