3.6. Evacuate Instances
If you want to move an instance from a dead or shut-down compute node to a new host server in the same environment (for example, because the server needs to be swapped out), you can evacuate it using nova evacuate.
- An evacuation is only useful if the instance disks are on shared storage or if the instance disks are Block Storage volumes. Otherwise, the disks will not be accessible and cannot be accessed by the new compute node.
- An instance can only be evacuated from a server if the server is shut down; if the server is not shut down, the evacuate command will fail.
Note
If you have a functioning compute node, and you want to:
- Make a static copy (not running) of an instance for backup purposes or to copy the instance to a different environment, make a snapshot using nova image-create (see Migrate a Static Instance).
- Move an instance in a static state (not running) to a host in the same environment (shared storage not needed), migrate it using nova migrate (see Migrate a Static Instance).
- Move an instance in a live state (running) to a host in the same environment, migrate it using nova live-migration (see Migrate a Live (running) Instance).
3.6.1. Evacuate One Instance
Evacuate an instance using:
#nova evacuate [--password pass] [--on-shared-storage] instance_name [target_host]
Where:
- --password pass - Admin password to set for the evacuated instance (cannot be used if --on-shared-storage is specified). If a password is not specified, a random password is generated and output when evacuation is complete.
- --on-shared-storage - Indicates that all instance files are on shared storage.
- instance_name - Name of the instance to be evacuated.
- target_host - Host to which the instance is evacuated; if you do not specify the host, the Compute scheduler selects one for you. You can find possible hosts using:
#nova host-list | grep compute
#nova evacuate myDemoInstance Compute2_OnEL7.myDomain
3.6.2. Evacuate All Instances
Evacuate all instances on a specified host using:
#nova host-evacuate instance_name [--target target_host] [--on-shared-storage] source_host
Where:
- --target target_host - Host to which the instance is evacuated; if you do not specify the host, the Compute scheduler selects one for you. You can find possible hosts using:
#nova host-list | grep compute - --on-shared-storage - Indicates that all instance files are on shared storage.
- source_host - Name of the host to be evacuated.
For example:
#nova host-evacuate --target Compute2_OnEL7.localdomain myDemoHost.localdomain