[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-users] How to create a guest image NEWBIE!!!!



> How do i create a img file to run in xen?! 
> CDWRITE?!
> For example, I habe an PC with e.g. RedHat3 Server. Thats the 
> System I want to put in the img file. This img file I want to 
> run in xen!

Hi Thomas.

First, you'll want to create a tar-archive of the server that you want
to migrate, in your case the RedHat system.

The safest way would be to boot your RedHat server into e.g. Knoppix and
mount the RedHat partitions from there. Alternatively, booting the
RedHat and going to runlevel 1 should also be reasonably safe - worked
for me on a server I migrated.

Do a tarball of the RedHat file system (e.g. 'tar cf RedHat-image.tar
*') and move that to the Xen server. Note that there is no need to tar
the /boot partition - Xen provides the whole boot-setup for your virtual
machine.

Since you want to build an image file, create one large enough to hold
the unpacked tar-file (see section 5.2 of the Xen user manual):

  dd if=/dev/zero of=redhat-disk bs=1k seek=<your disk size in
kilobytes>k count=1
  mkfs -t ext3 redhat-disk

  mount -o loop redhat-disk /mnt
  cd /mnt
  tar xf /path/to/RedHat-image.tar
  umount /mnt (!)

(!) Don't forget to umount the loop-back device before turning on your
VM. Otherwise it gets really nasty; trust me - I've been there :-).

Also, add a swap image:

  dd if=/dev/zero of=redhat-swap bs=1k seek=1024k count=1
  mkswap redhat-swap

Now point the VM configuration file to these two image files and make
sure that the assigned device names match the device names expected by
/etc/fstab in the RedHat file system.

Hope this helps.

And, by the way, I can really recommend using LVM instead of file-backed
storage once you feel comfortable running Xen.

Cheers
-- Jan Holst Jensen, Novo Nordisk A/S, Denmark

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.