Migrating from Proxmox KVM to Nutanix AHV
During the summer we sold a cluster to a happy customer. In the project scope we had to migrate all the VMs from Proxmox (KVM) to Nutanix AHV.
To solve the problem we decided to use the built in disk clone software DD.
First we need to whitelist the old Proxmox host to be able to access the Nutanix Storage.
Go to Prism Elements -> Settings -> Filesystem Whitelist
Add the IP number of the source environment. In this example, the source Proxmox host have IP 10.10.10.10.
When the whitelist opreation is done, connect to the source host with ssh.
Once connected, start by creating a folder in /mnt/ thats called nutanix.
mkdir /mnt/nutanix
When you have created the folder, mount the nutanix storage to the folder you created.
mount <CLUSTER VIP IP>:/name-of-storage-container /mnt/nutanix
Then we take a look at the VMs diskfiles in the Proxmox environment.
In my case the files was zfs disk images, so we Run the command
zfslist
We now get a complete list of the path to the diskfiles.
Now, Install the Nutanix VirtIO drivers and shutdown the Virtual Machine in Proxmox, and start the copy of the file using dd towards the newly added nutanix target. Note the parameter bs=100M, use this to increase speed, its the chunk size that dd uses to copy the images.
dd if=/dev/zvol/Data/vm-109-disk-0 of=/mnt/nutanix/vmname-image.raw bs=100M
Once the copy operation is done, the image will be located in the ADFS store of the Nutanix Enivonment :). Go back to Prism Elements gui and go to VMs -> Create New VM
Fill out your Vm General configuration.
Then on the disk part, chose "new disk":
Under operation, chose "Clone from ADFS File".
Start by typeing a "/" and then chose the Storage Container that you copied the file to using DD, and then the Image file.
Type the exact size in GiB under Size (copy the value from Proxmox to be sure)
Add the correct network interfaces.
Now boot your VM in nutanix.
Notes and experiences
Once i booted the VMs i noticed that my Windows VMs did not boot properly (Linux VMs was fine) . This was probably because we had conflicting KVM VirtIO drivers and Nutanix VirtIO drivers.
So off to try to figure out what happens.
So i boot the VMs with the Windows Server 2022 install ISO, and VirtIO 1.7 iso attached to the VM. Then chose the Recovery Mode option, and open a cmd. For detailed steps on how to boot in to Recovery Mode using the Windows install ISO take a look at this KB from Nutanix
Once you have booted in to the Command Prompt of recovery mode. Inject the storage Virt IO driver using the following command once you have located the path to the Virt IO iso part where the storage driver is.
drvload vioscsi.inf
Once that the SCSI driver is loaded. Run the following command to se all the disks in the VM:
wmic logicaldisk get caption
Now explore what disk letter containing the "Windows installation". In my case it was F:\
Then we want to locate all the virtio drivers that where installed on the source VM and remove them.
Run the following command to get a table of all the installed drivers on the F:
dism /image:f:\ /get-drivers /format:table
You should se a list similar to this:
Once you have located all the KVM virtio drivers, look at it's corresponding name in the column of "Published name"
Then run the following command:
dism /image:f:\ /remove-driver /driver:oem<X>.inf
Then we will add the right SCSI driver from the Nutanix VirtIO ISO by running the following command:
## Note that you need to be in the working directory of the Virt IO Iso contanining the vioscsi.inf file ###
dism /image:f:\ /add-driver /driver:vioscsi.inf
Now the driver is added to the Windows Image. Now shutdown the VM, remove the Windows Server 2022 Iso that are mounted, and boot the VM.
It will now boot just fine.
Install the virtio MSI file that is located on the ISO that is still attached to the VM.
Cleanup
Once you're done with the migration of all the VMs from the Proxmox host.
Remember to clean up the files in the ADFS stora by browing /mnt/nutanix/ folder using LS / LL
ls /mnt/nutanix
Now delete the files:
rm vmname-image.raw
Last but not least, unmount the storage.
umount <Cluster VIP IP>:/name-of-storage-container /mnt/nutanix/
Remove the File system whitelist created in Prism Elements GUI.
Shutdown the proxmox host
You're done :) Great JOB :)