Openstack: What the difference between nova migrate and nova evacuate?

G. Kaklam. asked:

On liberty, I’ve been searching for a way to “empty” a hypervisor from all its VMs.
At the nova client docs, I’ve found the following commands related to this:

  • nova evacuate : Evacuate server from failed host.

  • nova migrate : Migrate a server. The new host will be selected by the scheduler

  • nova live-migration : Migrate running server to a new machine.

and:

  • nova host-evacuate : Evacuate all instances from failed host.

  • nova host-evacuate-live : Live migrate all instances of the specified host to other available hosts.

  • nova host-servers-migrate : Migrate all instances of the specified host to other available hosts.

I can use commands from the first group to move the servers (aka VMs) one by one, from one hypervisor to another. Similarly by using a command from the second group, with a hypervisor as a target, all of its servers are moved to other hypervisors. And here comes the confusion.

What’s the difference between the “migrate” and “evacuate” commands (besides having slightly different arguments) when used to a working hypervisor?

Are they doing the same thing, or are they different underneath and I’m missing something? Should one be used in some cases and the other in others?
Even at the glossary it says:

  • migration: The process of moving a VM instance from one host to another.
  • evacuate: The process of migrating one or all virtual machine (VM) instances from one host to another, compatible with both shared storage live migration and block migration.

So, it should be similar. But then why do both exist?

My answer:


The nova help is a bit confusing, as it frequently uses the word “server” where “instance” is actually meant, and “host” where “compute node” is meant. OpenStack’s terminology has changed over its history, and some of the terms used here are the historical old terms.

So I experimented a bit to find out what these commands actually do. What I came up with is:

Commands which operate on failed compute nodes:

  • nova evacuate restarts a single instance that was running on a compute node that has gone down. By default OpenStack chooses which compute nodes will receive the instance, but a compute node can be selected with --target-host.
  • nova host-evacuate restarts all instances that were running on a compute node that has gone down. By default OpenStack chooses which compute nodes will receive the instances, but a compute node can be selected with --target-host.

    In either case, evacuation fails if the compute node is actually up.

Commands which operate on running compute nodes:

  • nova host-evacuate-live attempts to live migrate all instances running on a compute node to other compute nodes. By default OpenStack chooses which compute nodes will receive the instances, but a compute node can be selected with --target-host.
  • nova host-servers-migrate migrates stopped instances from a compute node. OpenStack chooses which compute nodes will receive the instances.
  • nova live-migration live migrates a single instance on a compute node. By default OpenStack chooses which compute nodes will receive the instances, but a compute node can be selected with --target-host.
  • nova migrate migrates a stopped instance from a compute node. OpenStack chooses which compute node will receive the instance.

Red Hat’s OpenStack documentation has a bit better explanation of evacuation and the difference between these commands than the upstream documentation.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.