4

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?

G. Kaklam.
  • 143
  • 1
  • 1
  • 4

1 Answers1

5

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • A further consideration is whether shared storage (such as Ceph RBD) hosts the root disk of the VM(s) to be migrated and is available to the source and target hypervisor. `nova live-migration` works best (only?) when this condition is fulfilled. This blog gives further relevant details: https://raymii.org/s/articles/Openstack_-_(Manually)_migrating_(KVM)_Nova_Compute_Virtual_Machines.html – sxc731 Dec 31 '17 at 18:44