Re: [Hampshire] Converting real servers to virtualised ones

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Converting real servers to virtualised ones

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x57b41100.hantslug.org.uk.9259': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Fri Feb 29 12:10:11 2008 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Fri, Feb 29, 2008 at 11:21:40AM +0000, Tony Whitmore wrote:
> At work we have a few (primarily Windows) servers which don't really do
> very much. They are ideal fodder for virtualisation. We are currently
> running a Xen server with Linux domUs but bootstrapped these from scratch.
>
> I know VMWare has a utility to convert physical hosts to VMWare virtual
> machines (or just disk images?). Can one convert a physical server to a
> disk image or partition for use with Xen? Or do other virtualisation
> solutions support this better?*


Well, trivially -- bring the machine down, boot into your favourite
live CD, dd the disk over the network onto the VM host's
storage... all done.

More practically, qemu-img will do format conversions, if you need
it. I haven't tried exactly this method, but something like the
following would be my first port of call:

$ dd if=/dev/hda | qemu-img convert -f host_device - -O qcow2 - | netcat ...

(Replace qcow2 with vmdk for a VMWare image, or just leave out the
qemu-img if you want to do a direct copy, of course).

If you want to shrink the overall size of the disk used by the VM,
then you'll probably have to play games with a suitable
resizing/partitioning tool as well. Finally, you haven't decided on
the storage format for your VMs -- this will depend on your choice of
VM host environment, and on how you want to manage storage.

Using qemu, I've had terrible trouble growing qcow format images in
the past. Nowadays, I use raw disk images stored in LVM LVs, which is
less efficient in terms of storage space, but much easier to manage
(IMO).

When I last played with Xen, it only handled raw disk or partition
images. The former was for hardware (full virtualisation), and the
latter for software (paravirtualisation). It may be able to cope with
other image formats now, although see my comment above about qcow...

> The server supports VT on the CPUs but should run headless without
> X.


Host environments derived from the qemu device model should support
three output modes for their guests: VNC, SDL (requires a GUI display
on the host; close the SDL window and kill the guest), and "none" (all
graphical output from the guest is binned). This includes (k)qemu, kvm
and Xen. There are probably others. I would recommend running VNC for
installation, and then moving to "none" for production use.

That's all pretty random and incoherent. Hope it's of some use.

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
             --- Happiness is mandatory.  Are you happy? ---