Skip to contentSkip to conversation

physical migration of older machines

DISCUSSION Jerry Geis 3 participants 3 messages Nov 21, 2007 1 message not in the archive KVM

lore
Share & tools
lore

Jerry Geis

author
#0 lore raw

I have an AMD 4800+ machine with 2 GIG RAM.

I have OLD machines that I want to virtualize and then TURN OFF. The old machines are redhat 7.3, redhat 9, centos 4 i386. I am using centos 5 x86_64.

I need to have the OLD machines migrated to the virtual image. What is the BEST way to do that??? Thats my big question.

Below is what I have tried and not been successful. I did not find a FAQ on this...

Thanks,

Jerry

----------------------------
I have the old disk and I created a 10GIG image and installed the 7.3, 9 and centos 4.
Now I want to make sure the new image matches the physical image. I mounted the image as:

mount -t ext3 -o loop,offset=32256 Image.redhat7.3.img /mnt/image

then I executed

tar --exclude ./boot --exclude --exclude ./proc --exclude ./dev -cvf - . | ssh [email protected] "( cd /mnt/image ; tar xvpf -)"

on the physical machine to copy to my host.

This seemed to work but on booting the file system is corrupt. I did umount /mnt/image before booting the VM.

I have not tried Ghost as the physical disk on these machines is minimum of 100GIG and I dont want VM images of this size. 10GIG is all I really need.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:

I have an AMD 4800+ machine with 2 GIG RAM.

I have OLD machines that I want to virtualize and then TURN OFF. The old machines are redhat 7.3, redhat 9, centos 4 i386. I am using centos 5 x86_64.

Migrating a physical machine to a virtual environment needs additional and probably
complicated guest OS specific tools. Vmware has statement they can, for KVM & Xen, I guess it still needs many community effort. Eddie

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jerry Geis

I have the old disk and I created a 10GIG image and installed the 7.3, 9 and centos 4.
Now I want to make sure the new image matches the physical image. I mounted the image as:

mount -t ext3 -o loop,offset=32256 Image.redhat7.3.img /mnt/image

then I executed

tar --exclude ./boot --exclude --exclude ./proc --exclude ./dev -cvf - . | ssh [email protected] "( cd /mnt/image ; tar xvpf -)"

Quoted 10 lines

on the physical machine to copy to my host.

This seemed to work but on booting the file system is corrupt. I did umount /mnt/image before booting the VM.

I have not tried Ghost as the physical disk on these machines is minimum of 100GIG and I dont want VM images of this size. 10GIG is all I really need.

What's happening probably is that the boot loader configuration is no longer valid.

If you have some temporary free space, the following untested hack may help:

- boot from a livecd on the image, and dd the entire disk to a file:

    dd if=/dev/hda bs=1M | ssh -C root@... 'cat > disk.img'

- start kvm with this image

qemu-system-x86_64 -hda disk.img ...

- create a file full of zeros which occupies all free space (inside the VM)

dd bs=1M if=/dev/zero of=/zeros; sync

- shut down the VM

- create a sparse image (that does not include the zeros), using *one* of the following:

   cp --sparse=always disk.img disk-new.img

or

qemu-img convert disk.img -O qcow2 disk-new.img

In the first case, the file will still appear large, but will
actually occupy less space. In the second case, the file size will reflect the amount of disk space it occupies.

- boot the new image, and delete the zeros file:

rm /zeros; sync

- remove the temporary 100GB image:

rm disk.img

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/