AsteriskNOW + Xen

General discussions about AsteriskNOW.

Moderators: Moderator, Support

AsteriskNOW + Xen

Postby j4m3s » Wed Jan 03, 2007 5:18 pm

For those of you brave enough to take on a Xen installation here's a brief (very brief) howto on how to get a universal guest domain (aka domU) of AsteriskNOW running on a host domain (aka dom0)

1. Setup a dom0 on a distro of your choice with volgroups (rPath makes this really easy here)

2. Download the xen img http://asterisknow.org/downloads

3. Create a volume group for the asterisknow image
Code: Select all
lvcreate -L2G -n asterisknow VolGroup00


4. Gunzip the image and write to image to a Volgroup
Code: Select all
# gunzip <path_to_filename>/asterisk-1.4.0-...img.gz
# dd if=<path_to_image>/asterisk-1.4.0-beta2-x86.img of=/dev/VolGroup00/asterisknow bs=1M


5. Create an asteriskNOW domU config file
Code: Select all
# cat /etc/xen/asterisknow

import os
host_uname = os.uname()[2]

name = 'asterisknow'
kernel = "/boot/vmlinuz-%s" % host_uname
ramdisk = "/boot/initrd-%s.img" % host_uname
memory = '64'
vif = ['mac=00:13:D3:02:54:45,bridge=xenbr0'] 
disk = [ "phy:VolGroup00/asterisknow,xvda1,w" ]
root = "/dev/xvda1 ro"



NOTE!!! As of beta5, you can use pygrub and zaptel/mISDN should be built against the right kernels. Whether or not they function properly is another story. Good luck!!

That config would look somethin like this then:
Code: Select all
# cat /etc/xen/asterisknow

name = 'asterisknow'
memory = '64'
vif = ['mac=00:13:D3:02:54:45,bridge=xenbr0'] 
disk = [ "phy:VolGroup00/asterisknow,xvda1,w" ]
bootloader = 'pygrub'




6. Start it up
Code: Select all
# xm create asterisknow


Note: This is a little different for systems not using Volgroups
Last edited by j4m3s on Thu Aug 02, 2007 12:35 am, edited 1 time in total.
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

asterisknow xen beta4 crashed

Postby tommew » Fri Jan 26, 2007 9:38 am

Hi,

I try to boot the domu on fc6 dom0 using this manual.

Code: Select all
import os
host_uname = os.uname()[2]

name = 'asterisknow'
kernel = "/boot/vmlinuz-%s" % host_uname
ramdisk = "/boot/initrd-%s.img" % host_uname
memory = '64'
vif = ['mac=00:13:D3:02:54:45,bridge=xenbr0']
disk = [ "phy:VGXen/asterisknow,xvda1,w" ]
root = "/dev/xvda1 ro"


The domain is starting fine for some seconds - then the system seems to crash.:

Code: Select all
[root@minixen00 anow]# xm create asterisknow
Using config file "/etc/xen/asterisknow".
Started domain asterisknow
[root@minixen00 anow]#




The xend-logfiles are here: http://spe02.esc58.com/asterisknowxenbeta4.xendlog.txt

Is there any idea to keep the domain alive?

Thomas
tommew
Newsterisk
 
Posts: 1
Joined: Tue Oct 25, 2005 3:17 am

Postby ameyec » Fri Mar 02, 2007 10:46 am

It's normal what you get on the the screen. You won't see the console the way you did it.
better do
Code: Select all
xm create -c asterisknow

That will at least show you the console while starting and allow you to see more info.
ameyec
Newsterisk
 
Posts: 1
Joined: Tue Nov 28, 2006 11:11 am

Asterisk on Xen x86_64

Postby rhstone » Fri Mar 23, 2007 3:46 pm

I needed a Xen image for x86_64, since my host is 64-bit, and all my domUs need to be 64-bit as well. So I ended up installing Xen through QEMU off of the ISO for x86_64, but now I need a xen compatible kernel with Zaptel modules.

Instead of rolling my own, is there an easy command for Conary to build a xen kernel and compatible zaptel modules? I know someone must have built a xen kernel for the asterisk domU x86 image; I need the same script for x86_64.

Thanks!
rhstone
Newsterisk
 
Posts: 1
Joined: Fri Mar 23, 2007 3:38 pm

Postby j4m3s » Mon Apr 09, 2007 9:08 pm

I have a system with a 64bit dom0 with 64 and 32 bit domU's. It's a little difficult to start trying to use zaptel with xen images as they dont have true, native access to the hardware, at least realtime, which is necessary with telephony.

Here's an example config of a domU with a 32bit userland, running in a 64bit dom0.
Code: Select all
import os
host_uname = os.uname()[2]

name = 'AsteriskNOW-x86'
kernel = "/boot/vmlinuz-%s" % host_uname
ramdisk = "/boot/initrd-%s.img" % host_uname
memory = '512'
disk = [ 'phy:VolGroup00/AsteriskNOW-x86,xvda1,w' ]
vif = [ 'mac=00:FF:FF:FF:FF:AA' ]
on_reboot = 'restart'
on_crash = 'restart'
root = "/dev/xvda1 ro"


What you can do is load up a 32bit xen image, then 'conary migrate group-poundkey=...' to a x86_64 flavored group. You can browse the different group-poundkey (which are meta troves for installing the entire OS) on http://asterisk.rpath.org
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

Postby hitchcocknz » Fri May 04, 2007 7:26 pm

Hi there,

I believe that i might have a similar problem to Thomas's post in this thread - looking at his log the domain creation was actually failing for the same reason mine is.

I am attempting to install the AsteriskNow xen guest image on a box running FC6 Xen as the Dom0. I followed the guidelines in this thread, namely:
Create LV
dd the image onto it
Create xen config file for new DomU
Start DomU
Fails ! :(

The problem has me perplexed. Dom0 I assume is fine since I am running other DomU's OK. The LV for the AsteriskNow is VolGroupSys/LogVolAsteriskNow. Section of the log file that fails when trying to create the DomU is:

Linux version 2.6.18-1.2798.fc6xen (brewbuilder@hs20-bc2-4.build.redhat.com) (gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)) #1 SMP Mon Oct 16 15:11:19 EDT 2006
BIOS-provided physical RAM map:
Xen: 0000000000000000 - 0000000004800000 (usable)

.....etc, then eventually after the DomU kernel is loaded

Making device-mapper control node
Scanning logical volumes
Reading all physical volumes. This may take a while...
No volume groups found
Activating logical volumes
Volume group "VolGroupSys" not found
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


My config file looks like:

name = "AsteriskNow"
memory = "64"
kernel="/boot/vmlinuz-2.6.18-1.2798.fc6xen"
ramdisk="/boot/initrd-2.6.18-1.2798.fc6xen.img"
disk = [ 'phy:VolGroupSys/LogVolAsteriskNow,xvda1,w' ]
vif = [ '' ]
nographic=1
vcpus=1
root="/dev/xvda1 ro"
on_reboot = 'restart'
on_crash = 'restart'


I am perplexed because if I happen to have the lv LogVolAsteriskNow mounted, the creation of the DomU fails and tells me I already have it mounted somewhere else in a priviledged state. Hence I don't believe I have a lvm problem. The error message seems to be coming from the DomU kernel stating that it can't find VolGroupSys - but surely it shouldn't be looking for that since in the DomU it only knows about xvda1. As you can see I am a bit confused.

I have tried everything I can think of, including using another kernel and initrd image - all with the same effect, can't find VolGroupSys which I don't believe the DomU should even be looking for.

Any ideas or thoughts appreciated.

Regards
Shane
hitchcocknz
Newsterisk
 
Posts: 4
Joined: Fri May 04, 2007 4:47 pm

Xen domU failures

Postby merriam » Sat May 05, 2007 1:59 pm

I have to suggest you look in the xen logs on your dom0 to see if it is having trouble mounting the disk.

One thing that nobody has pointed out is the AsteriskNOW Xen image does NOT contain a xen kernel. When you boot it with a kernel image from your dom0 that kernel is going to look in /lib/modules for a directory matching the kernel name to load modules from. It won't be there. I copied the kernel boot images from dom0 and the /lib/modules directory to my *NOW image to get mine to boot.

The process goes something like this:

losetup -a

That shows you the loop devices currently in use. Pick one that isn't, perhaps loop1.

losetup /dev/loop1 /dev/VolGroup00/asterisknow

mkdir /tmp/asterisknow
mount /dev/loop1 /tmp/asterisknow

cp -r /boot/* /tmp/asterisknow/boot
cp -r /lib/modules/* /tmp/asterisknow/lib/modules

umount /tmp/asterisknow
rmdir /tmp/asterisknow

losetup -d /dev/loop1

All that, of course, breaks the concept of *NOW being an "appliance". It would be VERY helpful if the developers installed the rpath domU kernel in the xen image and updated it using the normal conary procedures. You could then use something like pygrub to boot the appliance using the *NOW provided kernel.
merriam
Newsterisk
 
Posts: 2
Joined: Wed Nov 22, 2006 7:24 am

Postby hitchcocknz » Sat May 05, 2007 8:52 pm

Thanks merriam for the info. I had noticed that the "Appliance" kernel image didn't have xen after it and the img name on the AsteriskNow website didn't have anything xen specific.

I have copied over the kernel and lib/modules etc. Unfortunately to no avail.

I'll look more closely at the logs. However I suspect it has something to do with the fact that my Dom0 is FC6 and by default has LV's for swap and / and a separate partition for /boot, whereas my DomU is simply one LV for the lot.

I agree, it would be nice if the image really was an applicance and the xen kernel images were included.

Cheers
Shane
hitchcocknz
Newsterisk
 
Posts: 4
Joined: Fri May 04, 2007 4:47 pm

Install *NOW-XEN img on a rented VPS using the RESCUE-System

Postby luxxx » Tue Aug 12, 2008 10:10 am

I have a VServer account on ispOne.de, which is based on XEN.
They use the following kernel on their DomUs:

Linux myvservername 2.6.16.37-domU-v1 #9 SMP Wed Apr 11 14:50:55 CEST 2007 i686 i686 i386 GNU/Linux

Unfortunately i can not install my own Xen DomU image. It is only possible to use the vserver webadmin interface to choose form one of the following images:
Debian 4.0; Suse 10.3; Fedora Core 3; Gentoo 2006.0; Ubuntu 8.04

But they offer a rescue system. If i boot this, the content of my installed system will be mounted into /rescue/.

Is there any way to install the asterisknow Xen image on my vserver?
I.e. by starting the rescue system, delete everything in /rescue/ and copy the content of the Asterisknow XEN image to this?
luxxx
Newsterisk
 
Posts: 1
Joined: Tue Aug 12, 2008 9:44 am


Return to AsteriskNOW General

Who is online

Users browsing this forum: No registered users and 0 guests