I need to P2V a rhel5 machine to xen under rhel5. I know I can use dd if=/dev/sda then using virt-install --import on the host, but the downside of this is the original machine has 80% free space on its drive.

Does anyone know of (or can document) a quick and easy method which works reliably, to produce a bootable xen image which can run under a hvm in such cases ?

I tried clonezilla to make the image, to avoid the free space problem, but it failed to do the clone with "something went wrong" (useless info, i know).

At the moment im looking at doing a dd of each partition, and a file level copy of the partition which is mostly empty, then creating a new virtual disk, copying the partitions over to it by mounting both the new image and the virtual drive on a second vm, then copying the boot sectors over, then copying the file level backup..... there must be an easier way ?

Oh, and budget is $0. :)


Use virt-p2v which is part of RHEL6 and Fedora 15.

It is a commandline tool that migrates from physical to virtual.

The author of virt-p2v have made many other tools in the virt- series. Check out his blog for cool howtos.

  • I ran into the man page for virt-p2v, but i didnt know it was standard on rhel6. I thought it was undergoing a large rewrite, I'll give this a go tommorow, thanks ! – Sirex Feb 3 '11 at 19:54

Seem to have found a kludge for this.

Instead of messing about with partition sizes and such, just dd the entire drive and use cp --sparse=always to make a sparse file version of the image. The dd still takes a long time, but it removes the need for vast quantities of space on the vm host, which was the original concern.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.