Friday, February 24, 2012

Migrate Virtuozzo containers to VMware ESXi virtual machine

Since Virtuozzo uses VZFS, which shares its common files with the host operating system, it's not possible to convert a container to a virtual machine, as you would do a physical to virtual, or virtual to virtual migration.
So the VMware converter cannot be used, you'll get an error indicating that the source server details cannot be retrieved, both on Windows and Linux.

As a workaround, you can migrate the containers to Parallels virtual machines. For this you need the PSBM (Parallels Server Bare Metal) product. Install this hypervisor on a physical machine, it supports installation inside virtual machines, but there are limitations, read about them here.

Once you have the PSBM, you are ready to migrate the containers to virtual machines. The "pmigrate" CLI tool can be used to do this, as such:

Linux:       pmigrate ct root@yourvzserver.com/CTID vm localhost/vmname
Windows: pmigrate ct Administrator@yourvzserver.com/CTID vm localhost/vmname


A prerequisite for this migration, is that you have the Parallels transporter agent installed, on the Virtuozzo source hardware node. Installers for both Linux and Windows can be found under /usr/share/pmigrate/tools/ on the PSBM.

It's a live migration, the container stays online, during and after migration is finished.
Depending on the guest operating system of the container, the Parallels tools (equivalent to VMware tools) will be automatically installed inside the virtual machine during the migration process.

There are limitations on which guest OS can be migrated, I have tried these with success:
Debian 5 x86/x64
Debian 6 x86/x64
Windows 2003 x64
Windows 2008R2 x64

For a complete list of supported guest operating systems, browse to page 31 on this document.

Once the virtual machine is running on PSBM, you can use the VMware converter for migration to an ESXi server. You can use the converter on 2 different ways.

  • If the virtual machine is online and accessible from the ESXi and converter, you can do a migration as you would do a powered-on physical machine
  • Another way is to use the "Backup image or third-party virtual machine" converter option. You'll need the Parallels VM configuration and harddisk files, these can be found under /var/parallels/ on the PSBM.

A couple remarks:

  • The cpu/memory/disk resources from the original containers will have to be reapplied after migration, since these are not preserved
  • Because of the hardware changes, Windows (2008R2) will have to be re-activated after migration
  • Remove the Parallels tools on Windows guests, before converting them from PSBM to VMware. I wasn't able to uninstall this software anymore once the VM was running on VMware.