Cross Hypervisor Migration To-from Nutanix AHV

Cross Virtual Platform Migration

If you want to do cross platform migration P2V / V2V between hypervisors VMware Esxi, Hyper-V, KVM, cloud AWS etc to / from Nutanix Acropolis Cluster AHV, convert the VM’s virtual disk format from qcow to vmware vmdk format, change / migrate / move VMs between container / datastore in Nutanix AHV through command line or Xtract / Move tool then this HyperHCI Blog’s post is only for you. VMs Workload Migrations / export the VM to Nutanix AHV or vise-versa is most common task in today’s life of mine. Every month i do thousands of migrations from source hypervisors to Nutanix Acropolis AHV Cluster.

Solution of Error: Failed to mount nfs share: mount/mnt call failed with RPC error: Mount failed with error MNT3ERR_NOENT(2) Operation not permitted(1).

Nutanix is most Popular HCI platform for customers around the world to migrate existing Physical / virtual VM workload across the platform.

Read also: P2V Migration Error: Unable to complete converter agent installation error code 1603

VMware Esxi to Nutanix AHV

If you want to migrate the VMs from existing VMware Esxi with / without vCenter environment to Nutanix Acropolis AHV Cluster then you can use Nutanix V2V Migration tool called Xtract, now known as MOVE Tool and deployed as VM on either VMware Esxi or Nutanix Acropolis AHV Cluster.

VMware Esxi to Nutanix AHV VM’s migration Prerequisites

  • Download the MOVE tool OVA / binary file from Nutanix Portal
  • Deploy Move VM on either VMware Esxi or Nutanix AHV cluster
  • Needs Virtual Machine administrator / root credentials
  • VMware Esxi and Nutanix Acropolis AHV cluster must be ping-able
  • VMware Esxi and Nutanix Acropolis AHV cluster must be ping-able
  • Source Operating System Must be supported by Nutanix AHV

Visit this blog for step to step migration from VMware Esxi to Nutanix AHV through Xract / Move tool.

Visit Link for Step to Step VMware Esxi to Nutanix AHV Migration: https://www.tech-coffee.net/migrate-vms-from-vmware-to-nutanix-ahv-with-nutanix-xtract/

Nutanix AHV to VMware Esxi

If you want to reverse migration from Nutanix Acropolis AHV cluster to VMware Esxi cluster then you have two methods.
Method 1 : Through VMware vCenter converter tool
Method 2 : Manual export the VM from Nutanix Acropolis AHV Cluster to VMware Esxi / Hyper-v etc.

Nutanix AHV to VMware Esxi VM’s Migration prerequisites

  • Latest Virtio Driver must be installed in Windows / Linux OS before migration
  • Source VM must be power off before migration
  • you should be friendly with Nutanix command line
  • Use WinSCP tool to export the VM file
  • Descriptor file must be generated on VMware Esxi platform after migration and before creating the VM from exported VM file
  • Must use the Nutanix Prism: Admin account credential

when specifying a datastore for Storage vMotion, you can enter the file path nfs://127.0.0.1/ContainerA/.acropolis/vmdisk/9365b2eb-a3fd-45ee-b9e5-64b87f64a2df . Replace container_name with the name of the storage container where the image is placed and replace vm_name with the name of the VM where the image is placed.After Storage vMotion moves the virtual disk files, use Image Service to convert the files to the raw format that AHV can use. When Storage vMotion is complete, shut down the source VM.

Step 1: Login to any Nutanix CVM

Step 2: Get the VM’s vDisk UUID and path

cvm$ acli vm.get  include_vmdisk_paths=true
VM details hosted on Nutanix AHV
VM details hosted on Nutanix AHV

copy the vmdisk_nfs_path in notepad file and exit from acli mode if you are in..

Step 3: Get the container list details

cvm$ nfs_ls

Output similar like below:

cvm$ nfs_ls

/NutanixManagementShare;
/SelfServiceContainer:
/ContainerA
/ContainerB

Note: Use above exiting contianer to export the VM’s vDisk. In My case: VM is running in ContainerA and using same container ( ContainerA ) to convert the VM.

Step 4: Now convert the AHV hosted VM ( vDisk format Qcow2 ) into VMware vDisk format vmdk.

Run command correctly otherwise you may be face this error :

Error 1: Failed to mount nfs share: mount/mnt call failed with RPC error: Mount failed with error MNT3ERR_NOENT(2) Operation not permitted(1)

Run following command correctly to avoid above error.

cvm$ sudo /usr/local/nutanix/bin/qemu-img convert -O vmdk -c nfs://127.0.0.1/ContainerA/.acropolis/vmdisk/<VM_UUID>  nfs://127.0.0.1/ContainerA/<Disk_name>.vmdk &

Example:

cvm$ sudo /usr/local/nutanix/bin/qemu-img convert -O vmdk -c nfs://127.0.0.1/VM/.acropolis/vmdisk/a9eb3662-3a8e-471b-83ae-73cf2ed8fda0 nfs://127.0.0.1/VM/VM_Disk_0.vmdk &

Attention: Export the vDisk into existing container ( in my case: ContainerA and ContainerB ) only. otherwise you get above Error 1: Failed to mount nfs share: mount/mnt call failed with RPC error: Mount failed with error MNT3ERR_NOENT(2) Operation not permitted(1)

Check the qemu-img conversion process through following command

cvm$ ps -aux | grep qemu-img
Qemu Process
Qemu Process

Step 5: Export the converted vDisk – vmdk through WinSCP software

Note: Login to Winscp to using Nutanix Prism IP address with Admin credential on Port Number 2222

Export / copy vDisk - vmdk
Export / copy vDisk – vmdk

In Right hand side you can see the converted vDisk: vmdk, now copy those vDisk to you local desktop.

Step 6: For next step to create VM on VMware Esxi from converted vDisk: vmdk – visit http://joshsinclair.com/?p=580

Change VM’s Container in Nutanix AHV

If you want to move / change / migrate the VM from one container / datastore to another in Nutanix AHV, this is possible only through command line. Migrate the virtual disk files from the source hypervisor to the temporarily mounted container. Copying the virtual disk files to targeted container that helps organize migrated virtual disk files. The virtual disk files are only required until converted by Image Service and can be easily identified and deleted when no longer required.

Nutanix AHV VM’s Prerequisites

  • Get VM’s vDisk UUID
  • Get VM’s container details
  • Copy VM’s vDisk in Image services in target container
  • Create VM using Image Services to select Moved VM’s vDisk

Method 1

You can use the Nutanix command line to change / move / migrate the VM’s data-storage / container to another one.

Do SSH to any Nutanix CVM on the Nutanix AHV Cluster and run following command

cvm$ /usr/local/nutanix/bin/nfs_dd -i nfs://127.0.0.1/storage_container1/.acropolis/vmdisk/vmdisk_uuid -o nfs://127.0.0.1/storage_container2/.acropolis/vmdisk/vmdisk_uuid -m create

Method 2

Download the vDisk from Nutanix cluster to your computer and then upload it to Nutanix cluster again either via Prism or Command line.

How to find VM disk files details

Connect to any CVM in cluster with ‘nutanix’ user and run following command to find Nutanix AHV hosted VM’s disk UUIDs:

nutanix@cvm:~$ acli vm.get include_vmdisk_paths=1 | grep -E ‘disk_list|vmdisk_nfs_path|vmdisk_size|vmdisk_uuid’

How to download VM disk files from Nutanix container to your workstation

  1. Power off user VM, which disks will be exported, to avoid data corruption.
  2. Using WinSCP, connect to a CVM using SFTP protocol and network port 2222 using Prism element credentials.
    Note: If AOS version is 5.5.X connection may fail, please check KB 5082 for details.
  3. Enable the option to show hidden files by going to Options > Preferences > Panels and then selecting the “Show hidden files”  option under the common settings.
  4. Navigate to the path e.g ContainerA/.acropolis/vmdisk/ that was found by above command. You can download required files from Nutanix container to your local PC now.

Read Also : What is difference between Nutanix Prism Central : Pro Vs Starter Features

How to upload VM disk files from your workstation to Nutanix container

  1. Using WinSCP, connect to a CVM using SFTP protocol and network port 2222 using Prism element credentials.
    Note: If AOS version is 5.5.X connection may fail, please check KB 5082 for details.
  2. Enable the option to show hidden files by going to Options > Preferences > Panels and then selecting the “Show hidden files”  option under the common settings.
  3. Select desired Nutanix container and upload file.

After uploaded the vDisk to Nutanix container now create new Image for each VM disk.

nutanix@cvm$ acli image.create source_url=< nfs://127.0.0.1/ContainerA/.acropolis/vmdisk/vDisk_UUID> container=< nfs://127.0.0.1 /ContainerB/.acropolis/vmdisk/> image_type=kDiskImage

<vDisk UUID> is constructed by appending "nfs://127.0.0.1" and VM disk path that was identified in Step 1. Example: nfs://127.0.0.1/ContainerA/.acropolis/vmdisk/9365b2eb-a3fd-45ee-b9e5-64b87f64a2df

Now go to Nutanix Prism and Create VM using uploaded vDisk from images services.

Nutanix AHV to AHV VMs Migration

If you wan to migrate the VMs between Nutanix AHV Cluster to AHV Cluster migration then you can use the Data Protection feature that is actually works as DR ( Disaster Recovery).

Follow steps

  • Create Remote sites between both Nutanix AHV Cluster for each other
  • Create Async DR domain on Source site, Select VMs and schedule the replication
  • Go Secondary site > Data Protection > Domain > restore VMs stapshots

VMs Migration is done.!

How to configure Data Protection – Site Replication for DR

Nutanix Data Protection Configuration

Migrate VMs ~ AWS to Nutanix AHV

The AWS cloud Platform to Nutanix AHV VMs migration has two methods

Method 1: manual AWS to Nutanix AHV migration
Visit this post for step to step migration : https://jbcomp.com/manual-aws-to-ahv-migration/

Method 2: using Nutanix Move-tool for VMs Migration
Visit link to Migrate the AWS cloud running VMs to Nutanix AHV Migration : https://vmwaremine.com/2019/04/16/add-amazon-aws-region-to-nutanix-move/#sthash.eqBidpev.dpbs

Conclusion

Migration of VMs to Nutanix AHV and vise-versa is very simple and little complex in some cases. But overall this is very interest thing to do. To migrate the VMs from Vmware Esxi, Hyper-V, KVM, AWS cloud, Change container / data-store to Nutanix AHV through manual process using command line or can use automation tool like Move-tool for V2V migration.

Thanks to being with HyperHCI Tech Blog.