HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   XEN On An Ubuntu Hardy Heron (8.04) Server System (amd64) (http://www.howtoforge.com/forums/showthread.php?t=27826)

c4rdinal 16th October 2008 04:46

XEN On An Ubuntu Hardy Heron (8.04) Server System (amd64)
 
Hi,

I had a problem configuring the Guest OS on my Ubuntu Hardy amd64 server.

Got this error:
Quote:

# xm create /etc/xen/Xen-Web1.cfg
Using config file "/etc/xen/Xen-Web1.cfg".
Error: Had a bootloader specified, but no disks are bootable
# cat /etc/xen/Xen-Web1.cfg
BLANK SCREEN!

------

I have some questions regarding the creation of filesystem. First these are my current setup:

My current partition

# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000360b1

Device Boot Start End Blocks Id System
/dev/sda1 * 1 36 289138+ fd Linux raid autodetect
/dev/sda2 37 1032 8000370 fd Linux raid autodetect
/dev/sda3 1033 2248 9767520 fd Linux raid autodetect
/dev/sda4 2249 19390 137693115 fd Linux raid autodetect

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c6918

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 36 289138+ fd Linux raid autodetect
/dev/sdb2 37 1032 8000370 fd Linux raid autodetect
/dev/sdb3 1033 2248 9767520 fd Linux raid autodetect
/dev/sdb4 2249 19390 137693115 fd Linux raid autodetect

Disk /dev/md0: 295 MB, 295960576 bytes
2 heads, 4 sectors/track, 72256 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 8192 MB, 8192262144 bytes
2 heads, 4 sectors/track, 2000064 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 10.0 GB, 10001842176 bytes
2 heads, 4 sectors/track, 2441856 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md3: 140.9 GB, 140997623808 bytes
2 heads, 4 sectors/track, 34423248 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md3 doesn't contain a valid partition table


My fstab
# cat /etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/md2
UUID=4885c421-5c69-43ec-9d93-f895046f3862 / ext3 relatime,errors=remount-ro 0 1
# /dev/md0
UUID=8cdb4531-3cb5-43a6-806c-9f20a2e0f844 /boot ext3 relatime 0 2
# /dev/md3
UUID=f639a70f-411e-4db0-b25a-521c1aeb9f88 /var ext3 relatime 0 2
# /dev/md1
UUID=2efb9cb0-c135-4b2e-803b-0f55638d34e2 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0


# df -h
Filesystem Size Used Avail Use% Mounted on
varrun 3.9G 60K 3.9G 1% /var/run
varlock 3.9G 0 3.9G 0% /var/lock
udev 3.9G 72K 3.9G 1% /dev
devshm 3.9G 0 3.9G 0% /dev/shm
lrm 3.9G 18M 3.9G 1% /lib/modules/2.6.24-19-xen/volatile
/dev/md0 274M 47M 213M 19% /boot
/dev/md3 131G 15G 110G 12% /var
overflow 1.0M 0 1.0M 0% /tmp


Here's my questions:

1. Do I have to create a partition just for Xen Guest OS storage? Or can I use an existing partition? I have a machine with soft RAID1 installed. I would like to use /var/vm for my Guest OS and it is mounted under /dev/md3, filesystem is ext3.

Finally, do I need to execute step 3?

2. The section:
# debootstrap --arch amd64 hardy /var/vm http://archive.ubuntu.com/ubuntu

Will this create a new directory for Guest OS? Or should I manually create it? I want to name the directory for my Guest OS as Xen-Web1?
# mkdir /var/vm/

3. In the section: Post creation of filesystem in target partition mount it to /mnt:

The command:
# mount /dev/sda2 /mnt

Can I do this instead? Is this correct?
#mount /dev/md3 /var/vm/

4. What is the right equivalent for the following command considering my setup?

Once done, prepare the chroot environment for /mnt:
# mount --bind /dev /mnt/dev
# mount proc /mnt/proc -t proc
# chroot /mnt /bin/bash

Can I do this instead:
# mount --bind /dev /var/vm/dev
# mount proc /var/vm/dev
# chroot /var/vm /bin/bash

Hope you can help me and thanks in advance.

James

c4rdinal 16th October 2008 07:30

Just wanna add, initiating the ff command was successful:
# debootstrap --arch amd64 hardy /var/vm http://archive.ubuntu.com/ubuntu

# ls -la /var/vm/xen/domains/Xen-Web1/
total 14448428
drwxr-xr-x 2 root root 4096 2008-10-14 03:26 .
drwxr-xr-x 3 root root 4096 2008-10-14 03:26 ..
-rw-r--r-- 1 root root 10485760000 2008-10-14 16:53 disk.img
-rw-r--r-- 1 root root 4294967296 2008-10-14 17:00 swap.img

There's no content for /etc/xen/Xen-Web1.cfg. Though I tried manually creating the config after saving it always delete everything.

# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 7931 4 r----- 404.8

Hope you can help me.

marchost 16th October 2008 15:16

Did you try with xen tools :

xen-create-image --hostname=xen1.example.com --size=2Gb --swap=256Mb --ide --ip=192.168.2.123 --netmask=255.255.255.0 --gateway=192.168.2.1 --force --dir=/home/xen --memory=256Mb --arch=amd64 --kernel=/boot/vmlinuz-2.6.24-19-xen --initrd=/boot/initrd.img-2.6.24-19-xen --install-method=debootstrap --dist=hardy --mirror=http://archive.ubuntu.com/ubuntu/ --passwd

And after that you need to replace "file:" with "tap:aio" in the cfg file.

This will create you an image file but you can mount it and copy the content to a partition afterward. You simply need to change the line "file:/home/xen.../disk.img" with something like "phy:/dev/md3,hda1,w"

Hope it helps...

More details : http://blogama.org/node/9


All times are GMT +2. The time now is 14:38.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.