Convert openVZ container to VMware

1.1k Views Asked by At

I'm trying to convert an openVZ container to VMware. Since this is planned for roughly 1000 instances, I'm looking for a different approach than reinstalling from scratch. I followed the steps in the last post: https://communities.vmware.com/message/1719787#1719787 However, when booting from a live CD, it can't find any linux partition. I also tried yum install kernel-xx which had no effect on the live CD not finding a partition so I'm assuming there's an error while converting. Does anyone know of a solution or some tweaks to the one I posted? The OS in this case is CentOS 7 on openVZ 6.

3

There are 3 best solutions below

0
chris137 On BEST ANSWER

Long story short: Convert openVZ to KVM, then convert to VMWare.

  • create a KVM with the same OS as your container
  • mount the KVM image file
  • rsync all data to that image file
  • umount image file and start and stop KVM
  • convert img to vmdk with qemu-img
  • move vmdk file to esxi host
  • convert to thin-provisioned vmdk with vmkfstools

I had to tackle (and still am) multiple issues to make it boot, like recrating initrams, reinstalling policykit, reconfiguring networking, adjusting grub.

Hope this helps someone.

0
ededed On

It looks like you will have to go the OpenVZ -> KVM -> VMware route. This post by Roman Pertl explains how he did it, plus it also links to some other tutorials.

1
alguien On
rsync --exclude=/var/lib/initramfs-tools/* --exclude=/var/lock --exclude=/etc/fstab --exclude=/etc/modules --exclude=/etc/mtab --exclude=/boot/* --exclude=/proc/* --exclude=/lib/modules/* --exclude=/tmp/* --exclude=/dev/* --exclude=/sys/* -e ssh --delete-after --numeric-ids -avpogtStlHz / root@sourcevm:22/