Operating System - Linux
1752288 Members
4182 Online
108786 Solutions
New Discussion

V2P cloning using qemu and ssh

 
SOLVED
Go to solution
Alan_152
Honored Contributor

V2P cloning using qemu and ssh

I am documenting for a customer my method of converting a VMware Server image to raw disk. In the procedure, I have 2 separate steps:

1. At the source, execute:

• # qemu-img convert *.vmdk -O raw test.iso
This will take approximately 15 minutes to convert formats

2. At the destination, using a network-capable LiveCD, execute:

• # ssh root@ ‘dd if=//test.iso’ | dd of=/dev/sda

My question is, is there any way to condense this sequence down to 1 command line (i.e., pipe qemu-img directly through ssh)? I'm thinking along the lines of something like:

• # ssh root@ 'qemu-img convert *.vmdk' | qemu-img -O raw /dev/sda
5 REPLIES 5
Alzhy
Honored Contributor
Solution

Re: V2P cloning using qemu and ssh

I don't think it is possible unless you can test if -O in qemu-img can accept a pipe as output like:

qemu-img convert redhat.vmdk -O raw - |dd of=/somewhere/redhat.raw

if it can, then your SSH construct could be:

qemu-img convert redhat.vmdk -O raw - | ssh serverX dd of=/dev/sda

Any reason why you are doing a V2P man? Some issues with vendor support you must demonstrate?

I usually employ MondoRescue for my V2P and P2V needs. (For the Saladheads - that's Physical to Virtual, Virtual to Physical Linux conversions)


Hakuna Matata.
Alan_152
Honored Contributor

Re: V2P cloning using qemu and ssh

The reason for the V2P is that for our particular platform things like kdump, clearclase, reboot, etc., don't perform nearly as well in the VMware Server environment that it was built it on as they do on bare metal.

And, since this is an automated test/compile platform as well, we get performance improvements by working on bare-metal as well.

I'll try your suggestion -- it won't be a big deal if it doesn't work since my way does. I'm just looking to tighten up the documentation a little bit.
Alzhy
Honored Contributor

Re: V2P cloning using qemu and ssh

Hey... what version of vMware do you virtualize your Linux guests on? Are your Linux guests RHEL? What version?

We are using vSphere 4.0, but going with 4.1 soon. Our Linux Guests are either RHEL 5.4 or 5.5. We have HyperThreading ON on some servers but OFF on some. For heavy CPU need processes like single thread monolothic apps we have HyperThreading OFF.... I think Intel or GCC compilers would prefer real cores over threaded cores. Try it.

Or you may want switching your geusts to use KVM instead. I find KVM under RHEL 5.5 faster for Linux and WIdnows guests over vSphere even. And no vMare Toolz to be worried too as guests aer FULLY Virtuaized.

Hakuna Matata.
Alan_152
Honored Contributor

Re: V2P cloning using qemu and ssh

The host is SLES 11.0 x64 running VMWare Server 2 (not my choice). The clients are SLES 11.0 x64 with customized kernels and strange networking (these clients are for development work on a high-speed call routing/call switching platform).

I have converted the vmdks to run off of ESXi and VirtualBox, both environments providing better performance -- but the best environment of all of them is still the bare metal one (there is a developer's process that tends to max out a single core, so when that core is a virtualized one being shared across a set of physical cores under VMWare, we run into a variety of issues).

We ran virtualized here in order to save money. Now that the project is being moved overseas to a company not so frightened about purchasing additional servers, it just makes sense to go the V2P route.
Alzhy
Honored Contributor

Re: V2P cloning using qemu and ssh

Gotcha.. thanks for sharing.

And I am amazed the venerable vMware Server 2.0 (the freebee) is in use this way. Wow!

I use it on top of an UBuntu Desktop so I can have Windows Virtual PCs running on top of my Ubuntu Main OS. The trick that I use to get the most performance out of vMware server 2.0 guests is to use actual physical disks or partitions thereof instead of a vmdk file resident on a Linux filesystem.

ESXi (free too) would be better as it is a bare metal hypervisor. I use KVM as I can do Live guest moves to different physical machines without the costly licenses of vMotion on ESX/vSPhere.

Good Luck...!
Hakuna Matata.