«

»

Nutanix Acropolis VM Live Migration

“VMTurbo"
I guess many of you are aware of that Nutanix announced Acropolis today and immediately there were a lot of questions about what it is, what features it includes and how you use it.

This blog post will focus on just one of the features available in Nutanix Acropolis which is build upon the KVM hypervisor and completely integrated in the Nutanix PRISM or via the Nutanix REST API.

You got three options when you want to migrate a VM so you pick the one you prefer:

  • PRISM
  • Local or remote Acropolis interaction via the CVM
  • REST API

PRISM

So to perform a live migration using the PRISM UI you just need to follow the below very basic steps:

  • Log in to PRISM
  • Select VM in the drop down meny to the left:
    Screen Shot 2015-06-09 at 19.52.15
  • Click the table view.
  • Highlight the VM you want to migrate, in my case test04. As you can see in the below print screen it is located on the KVM with an IP address ending with .35. The simply click the Migrate optionScreen Shot 2015-06-09 at 19.53.03
  • The migrate wizard will let you select a target KVM host manually or you can let the system automatically select one for you.
    Screen Shot 2015-06-09 at 19.53.52
  • If you click VM Tasks you can watch the migration progress and while finished you’ll see how long it took. In this case 7 seconds.Screen Shot 2015-06-09 at 19.55.30

Local or Remote Acropolis interaction via the CVM

If you want to have more options you can use the Acropolis cli available via the Nutanix Controller Virtual Machine (CVM) running on each KVM. The available VM migration options are:

  • live – do a live migration of the VM or not. Suspend is the other option.
  • host – specify the host you want to migrate the VM to.
  • bandwidthMbps – specify the bandwidth allowed for the operation

Lets say for this test i want to migrate the same VM, test04, back to its original KVM host, the one ending with IP .35, but limit the available bandwidth for the live migration operation.

  • You can run the complete command from the CVM or accessing the Acropolis shell by typing acl so the below two options are available
    • acli vm.migrate test04 bandwidth_mbps=100 host=X.Y.Z.35 live=yes
    •  acli
      • vm.migrate test04 bandwidth_mbps=100 host=X.Y.Z.35 live=yes
  • If you want to start the live migration from e.g. your MacBook you can simply run the below command from a shell or terminal window:
    • ssh nutanix@NutanixClusterIP “/usr/local/nutanix/bin/acli vm.migrate test04 bandwidth_mbps=100 host=X.Y.Z.35 live=yes”

When verifying the migration we can see that this process (VM migration) took much longer time compared to the UI driven one because of the bandwidth limitation. First figure show the running task and the last one shows the end result.
Screen Shot 2015-06-09 at 20.00.40 Screen Shot 2015-06-09 at 20.04.19

REST API

Nutanix has a REST API available for PRISM interactions but the REST API we have to use for migrating VMs is obviously the one for Acropolis, called Management REST API.

The available options via REST API includes:

  • live – do a live migration of the VM or not. Suspend is the other option.
  • bandwidthMbps – specify the bandwidth allowed for the operation
  • hostUuid – specify the host you want to migrate the VM to.

The difference between the REST API options and the Local or remote Acropolis interaction via the CVM option is that the REST API requires you to specify a value for the live option. It is a boolean value meaning true or false.

Another difference is that you need to use the VM UUID and not the VM name. The UUID is shown under the VM name at the left hand side of the PRISM interface just under the VM Name so it’s really easy to find.

I used the following curl command to post the REST API command when migrating my test04 VM once more.

/usr/bin/curl -k -H “Content-Type: application/json” -X POST -u “admin:passwordn” -d ‘{“live”:”true”}’ https://X.Y.Z.42:9440/api/nutanix/v0.8/vms/58f11a9c-4377-4ec7-a333-c4f9ea2ae0f5/migrate

This conduct the blog post about how you can initiate Acropolis VM live migrations