public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* physical migration of older machines
@ 2007-11-21 13:20 Jerry Geis
       [not found] ` <474430AF.9080807-HlEKYY4NwfurDvn5mFPilA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry Geis @ 2007-11-21 13:20 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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 root-Q0ErXNX1RuZ17XPQcNv0jw@public.gmane.org "( 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: physical migration of older machines
       [not found] ` <474430AF.9080807-HlEKYY4NwfurDvn5mFPilA@public.gmane.org>
@ 2007-11-21 15:11   ` Dong, Eddie
  2007-11-21 15:49   ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Dong, Eddie @ 2007-11-21 15:11 UTC (permalink / raw)
  To: Jerry Geis, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: physical migration of older machines
       [not found] ` <474430AF.9080807-HlEKYY4NwfurDvn5mFPilA@public.gmane.org>
  2007-11-21 15:11   ` Dong, Eddie
@ 2007-11-21 15:49   ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2007-11-21 15:49 UTC (permalink / raw)
  To: Jerry Geis; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Jerry Geis wrote:
> 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 root-Q0ErXNX1RuZ17XPQcNv0jw@public.gmane.org "( 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.
>
>   

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

-- 
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-21 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-21 13:20 physical migration of older machines Jerry Geis
     [not found] ` <474430AF.9080807-HlEKYY4NwfurDvn5mFPilA@public.gmane.org>
2007-11-21 15:11   ` Dong, Eddie
2007-11-21 15:49   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox