WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: <DIEDERIT@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] How to create a guest image NEWBIE!!!!
From: "JHJE (Jan Holst Jensen)" <jhje@xxxxxxxxxxxxxxx>
Date: Tue, 20 Sep 2005 11:07:13 +0200
Delivery-date: Tue, 20 Sep 2005 09:05:04 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW869ViSpxRpjfJSy+fE6zwiMmSEQA0qOcA
Thread-topic: [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

<Prev in Thread] Current Thread [Next in Thread>