Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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. :)

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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