Search code examples
vmwareopenvz

Convert openVZ container to VMware


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.


Solution

  • 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.