From Fortech I.T. Solutions - SANDBOX

Assorted-Reference: Vmware-to-kvm-proxmox-migration

Migration to KVM - Proxmox from VMWare Guest (or physical) Server Instance for RHEL / CentOS

These are some notes I prepared after doing this process for a client in early September-2012. Oddly enough I've migrated plenty of Windows hosts to KVM / Proxmox but have not migrated many Linux hosts - most linux VM hosts I've worked with start out as clean installs, which is a different business entirely.

Note some links for reference:

Rationale for this stuff:

Concisely, steps taken:

  1. Plan for downtime. Schedule as required. The 'slow' part in this process is copying disk image over network. Vanilla gig-ether yielded 'image write' performance of about 30 minutes for a ~30gig HDD and 'image restore' performance of about 15 minutes. Larger HDDs will take longer to clone via the network. Faster networks may offer better speed. YMMV.
  2. Console access on your host that is being migrated to KVM; consider running 'yum update' to keep things 'good and current' before getting started.
  3. If running inside VMWare and you have VMWare tools installed, uninstall VMWare tools. Now. Don't forget this step!
  4. If required, reboot using the new kernel
  5. If you wish, take a backup of the current latest initrd
  6. Force build of a new initrd which has KVM VirtIO_BLK support.
  7. If you are prudent, consider rebooting to be sure it still works with this new initrd. Otherwise, rush ahead! :-)
  8. Prep your storage target for the image of the system
  9. Boot your VM using Clonezilla live CD, backup your host to the storage target. Wait patiently while blocks are copied.
  10. Meanwhile, prep your new KVM VM with appropriate specs (kernel version, appropriate HDD capacity of VirtIO bus type; NIC of VirtIO type most likely; appropriate CPU and RAM allocations). Boot this VM from a clonezilla LiveCD and get it ready to do a restore.
  11. Once your donor system is imaged, restore to the new VM. Wait patiently. (But this step is faster than the 'image write' fortunately.)
  12. Reboot clonezilla once done, power up your KVM VM. It should now actually boot properly from the system image you have poured in.
  13. Confirm function, power off the donor system, happy days.

Actual commands and hints:

Backup your current initrd:

cd /boot
cp initrd-$(uname -r).img BACKUP_initrd-$(uname -r).img

Force new initrd with Virtio_BLK support

mkinitrd --with virtio_pci --with virtio_blk -f /boot/initrd-$(uname -r).img $(uname -r)

Note that the dashes and syntax above do actually matter. I found some incorrect versions of this command on other google-hit-websites and they simply fail to work, because the commands are wrong. Copy and paste is your friend here - fewer typos! :-)

Uninstall VMWare Tools:

as per URL: http://www.vmware.com/support/ws5/doc/ws_newguest_tools_linux.html

From a tar install
vmware-uninstall-tools.pl

From an RPM install
rpm -e VMwareTools

In my case the RPM removal was appropriate and it worked perfectly. 

Note you may need to finesse the name of the VMware tools RPM, 
if present it will likely be visible from a command such as,

rpm -aq | grep -i vmware

Clonezilla hints:

General context reminder:

Retrieved from http://sandbox.fortechitsolutions.ca/pmwiki.php/Assorted-Reference/Vmware-to-kvm-proxmox-migration
Page last modified on September 07, 2012, at 03:55 PM