Xen Virtualized PIAF

rd_cortes

New Member
Joined
Oct 18, 2007
Messages
4
Reaction score
0
I have been trying for several weeks now to make an installation of PIAF in a DomU of aCentOS Xen. Is there anyone that can write a Kickstart for this to work??

I have no clue of how to write one so i can install in Xen. It would be really nice to have a paravirtualized PIAF that can use PCI Telephony Cards, and have a few other servers within the same box.
 
If you install it on another system. After install There will be a anaconda-ks.cfg in the /root. That is the kickstart file for the install.
 
Thanks jshanley!

User jshanley send me a PM with the following information...
Thank you very much jshanley!!!

jshanley
Xen: PBX in a Flash
I can't post in your thread yet; they are taking forever to authorize my account on this forum.

But, here's the ks.cfg from the iso. I am about to do the same thing (install PBX in a Flash inside Xen).



Code:
install
cdrom
lang en_US.UTF-8
network --device eth0 --bootproto dhcp --hostname pbx.local
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --disabled


%packages
@admin-tools
@base
@base-x
@core
@development-libs
@development-tools
@dns-server
@ftp-server
@mail-server
@mysql
@network-server
@server-cfg
@smb-server
@sound-and-video
@system-tools
@web-server
@x-software-development
webmin
netconfig
kernel-devel
php-mysql
MySQL-shared-compat
php
php-gd
php-mbstring
php-pear
php-mysql
perl
perl-libwww-perl
perl-DateManip
perl-DBD-MySQL
perl-DBI
perl-Net-DNS
perl-suidperl
perl-XML-Parser
audiofile-devel
dhcp
gd
lm_sensors
mc
mysql-devel
gcc-c++
flite
flite-devel
automake




%post
echo "cd /var" >> /etc/rc.d/rc3.d/S99local
echo "rm pbx_load.tar.gz" >> /etc/rc.d/rc3.d/S99local
echo "rm -rf pbx_load" >> /etc/rc.d/rc3.d/S99local
echo "wget http://pbxinaflash.net/scripts/pbx_load.tar.gz" >> /etc/rc.d/rc3.d/S99local
echo "tar zxfv pbx_load.tar.gz" >> /etc/rc.d/rc3.d/S99local
echo "cd /var/pbx_load/" >> /etc/rc.d/rc3.d/S99local
echo "echo 2>&1 | tee /root/install_pbx.log" >> /etc/rc3.d/S99local
echo "echo Installing pbx... 2>&1 | tee -a /root/install_pbx.log" >> /etc/rc3.d/S99local
echo "echo 2>&1 | tee -a /root/install_pbx.log" >> /etc/rc3.d/S99local
echo "date 2>&1 | tee -a /root/install_pbx.log" >> /etc/rc3.d/S99local
echo "echo 2>&1 | tee -a /root/install_pbx.log" >> /etc/rc3.d/S99local
echo "chmod 711 install-pbx.sh" >> /etc/rc3.d/S99local
echo "./install-pbx.sh 2>&1 | tee -a /root/install_pbx.log" >> /etc/rc3.d/S99local
eject
 
lmatter
user_offline.gif

Junior Member
Join Date: Mar 2008
Location: N. California
Posts: 0


virt-install of centos and kickstart
Hi,

I am also trying to do this. And I also have not been authorized to post in this forum.

Anyway, I have been making slow progress. I want to install this in a para-virtualized domU, so I am using virt-install to install CentOS 5, and I'm trying to use this ks file.

First thing I had to do was remove the "cdrom" after "install" so it wouldn't try to load a scsi driver.

I also get errors on packages like "webmin" and "flite"; not sure how to add another repo (like DAG ?) when the install is sourced from the --location option of virt-install. But I'm hopeful I'll get there. Here is my virt-install command:

virt-install -p --location=http://mirrors.kernel.org/centos/5/os/x86_64/\ --name=pbxdev --ram=512 --file=/dev/VolGroup00/pbxdev -x "ks=http://192.168.1.xxx/ks.cfg" --vnc --vncport=5905 --bridge=xenbr0

Change the "ks=" to whatever suits you.

After I have CentOS installed, I want to rebuild the kernel for 1000Hz timing, and also patch the ztdummy driver not to use the RTC.

Feel free to post this for me if you want.

Good luck,
LMatter
 
I was able to nudge the install of this kickstart file all the way through to the end. It complained about not finding webmin, flite, flite-devel, and MySQL-shared-compat so I had to continue without those.

The post configuration apparently happened while I was off doing something else.

Unfortunately, when I boot the domU up, during loading of the zaptel modules, the vm crashes; it just goes away. Not sure if this is related to using a x86_64 system. I haven't had time to look into it yet.

I plan to try this again but perform the post steps manually to keep a better eye on it.
 
Hi

The packages you mention that failed are extras I've dropped onto the CD, they are not part of the centos repository.

There is a Centos 64 bit ISO I've done for PiaF, which either flies, or won't install at all :confused5: if that is any help to you.

Joe
 
I did another virt-install of centos 5.1 using the above kickstart, but with the offending packages commented out and the post steps commented out.

I then installed flite* and ran the pbx_load file, which built everything.

Again, loading ztdummy crashed the domU, so I brought it up in single user mode, edited ztdummy.c to comment out the USE_RTC macro and rebuilt zaptel. This allowed the domU to boot. Now I'm trying to rebuild the kernel with 1000Hz timing (see http://www.sandelman.ca/mcr/blog/colo 28-Jan entry)

I haven't done any testing of asterisk yet accept to access the webserver.
 
I finally have this working. I think I did it the most difficult way possible; oh well.

An easier way, that I did not try, would probably be to install the normal ISO (64 bit from jroper if needed) into an HVM guest, then install a paravirtualized kernel rpm, then change your /etc/xen/configfile as necessary to boot PV instead of HVM. You might need to tweek the network "hardware" setting too.

Long story short, I built a CentOS 5.1 x86_64 kernel using these instructions. I used the config from the /boot directory, and the only thing I changed was the timer (1000Hz).

I have uploaded the kernel rpms here.
This is my first time creating a signed RPM so be gentle if I did it wrong. Usual warnings about using RPMs from people you don't know, and of course don't use this in a production environment!

I installed a PV CentOS 5.1 domU using the kickstart above, but commented out the problem packages; adding them later (except webmin and netconfig which I don't use). I also commented out the post steps and ran them (more or less) manually.

Note that it will crash your domU when it tries to load the ztdummy module so if you can comment that out of the install first that would be good. Otherwise you have to boot the domU in single user mode and fix it.

To fix it, just edit /usr/src/zaptel/kernel/ztdummy.c and comment out #define USE_RTC, then cd /usr/src/zaptel and "make install". Exit single usermode if needed.

I've only done minimal testing (calling *60 from xlite on my home lan, installed modules via the web), but so far so good.

Surprisingly, running in a PV domU didn't help as much as I thought with "glitchy" voicemail prompts. I was hoping for a little more responsiveness from a PV kernel. If I do something like "ls -lR /" in another domU, the voice prompts from piaf get spotty.
 
anyone end up having any luck running a reliable pbiaf on xen? Id really like to do it and i am not interested in using a third party to host it. I am looking to be able to do this myself. Seems a waste of resources to dedicate a full server to pbiaf if i know it really only needs a small amount of ram/cpu (its only using 100mhz of cpu and 168mb of ram on average).
 
Here's a writeup and download link from Tobias Göller that I have not yet tested:

Howto install PiAF as paravirt guest in xen

Disclaimer: This document comes as is. I will NOT take any responsability
for any damage you're doing on your own system!
I have this system as described here running on Xen 3.3.1. Since it's paravirtualized it should run on any xen server.

Prerequisites:
In order to set up PiAF as a paravirt guest you must have a running XEN Server. This Document only covers the setup on 64-Bit (AMD64 / x86/64) Xen Server systems.

The main reason why I do not cover 32Bit Systems here is mainly due to the lack of 32Bit Xen-Paravirt compatible Kernel images. And because if I wanted to have it on 32bit - feel free to play around with HVM (fully virtualized) guests. For 32Bit, this will work just fine.

Preamble
Basically, the setup on xen is relatively simple. You just have to do three (3) things before you start:

1st: Get a xen-paravirt kompatible kernel and initrd image fitting x86_64 systems.
2nd: Modify the initrd.img file residiing on the ISO-Image in <CDROM-Mount-Point>/isolinux/initrd.img
3rd: Modify the Kickstart File.

I have no idea why the kickstart file won't load from a http-server. In my case it simply didn't. The System came up - get an IP but resisted to work with the Kickstart file (i.e. resisted to download it in the first place).

Your milage may vary there but I suggest you'd do it the way I'm describing here - it's probably the easiest way to do.

Creating the initrd.img file
****************************
The Problem with the initrd.img coming with the ISO is the lack for xennet and xenblk drivers.

So we create a new initrd.img out of the initrd.img from the iso, the initrd.img from CentOS.

- Create two directories
$ mkdir -p /tmp/initrd-piaf
$ mkdir -p /tmp/initrd-centos

$ cd /tmp/initrd-piaf
$ zcat <CDROM-Mount-Poing>/isolinux/initrd.img | cpio -id

$ cd /tmp/initrd-centos
$ zcat Centois-Initrd.img | cpio -id

$ cp modules/* /tmp/initrd-piaf/modules/

$ cd /tmp/initrd-piaf

$ cp <CDROM-Mount-Point>/DESIRED.cfg .

Edit the CFG-File:
Change the "network --device eth0 --bootproto dhcp --pbx.local"

to

"network --device eth0 --ip=YourIP --netmask=YourNetmask --gateway=YourGateway --nameserver=YourNameserver --hostname=pbx.local"

Uncomment the "firewall --enabled --port=22:tcp" line (#)


Next: Create the XEN Initrd File

!! MAKE SURE YOU'RE STILL IN /tmp/initrd-piaf/ !!

find ./ | cpio -H newc -o > ../piaf-initrd.cpio && cd .. && gzip -9 piaf-initrd.cpio && cp piaf-initrd.cpio.gz piaf-initrd.img

Done. Your new initrd.img is now in /tmp/piaf-initrd.img

==> SAVE THIS!

Now, create the XEN Boot Config File:
#############
# Kernel + memory size
kernel = '/path/to/your/downloaded/xen-compatible/kernel'
ramdisk = '/tmp/piaf-initrd.img'
#bootloader='/usr/bin/pygrub'


memory = '256'

#
# Disk device(s).
#

disk = [ 'file:/var/lib/xen/images/trixbox/disk0,xvda,w' ]

#
# Hostname
#
name = 'PiAF'

vcpus=1
cpu_cap=90
acpi=1

#
# Networking
#
vif = [ 'bridge=br0' ]


#
# Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

extra = 'ks=file:/ks16alt.cfg' # <= this must be adapted according to the name
# of your Kickstart file!
#####################

WARNING!!
The config above MUST be changed before the first boot (when the system is ready)

If you reboot the PiAF after installation with the modified initrd again, you will start again from the beginning.

Best is to issue an xm destroy after the first shutdown.

After this you will need to do the following:
In order to boot the system with the "standard" initrd from PiAF, attach the disk-image using kpartx -a -v /path/to/your/diskimage and do a mount /dev/mapper/loopXpY to a mountpoint of your choice.

Do a chroot to that mountpoint.

issue a yum install kernel-xen to install the xen-kernel. Don't worry about the errors telling you about /sys etc.

Check the $MOUNTPOINT/grub/menu.lst for the entries. In my case the entry was missing and I had to add it by hand.

Now hit ^D, unmount the Disk-Image and issue kpartx -d -v /path/to/your/diskimage

Now, you're almost done:
Edit the Xen-Configfile and comment the ramdisk- and kernel lines, uncomment the pygrub line.

Issue a xm create -c

And here was his followup after some additional experimentation:

Basically, all you have to do is:

1st: Enhance the initrd.img
2nd: configure XEN with the kickstart file
3rd: install
4th: shutdown
5th: loopback mount and chroot, install kernel-xen
6th: have fun :-)
 
Try installing centos 5.2 using virt-install first, then grab the:

piafdl-0.1-1.noarch.rpm
piafxtras-0.1-1.noarch.rpm

rpms and install them. Then you need to add a whole bunch of dependancies.

Look at this kickstart file's snippet for clues:

Code:
%packages
@admin-tools
@base
@base-x
@core
@development-libs
@development-tools
@dns-server
@ftp-server
@mail-server
@mysql
@network-server
@server-cfg
@smb-server
@sound-and-video
@system-tools
@web-server
@x-software-development
webmin
kernel-devel
php-mysql
MySQL-shared-compat
php 
php-gd 
php-mbstring
php-pear
php-mysql
php-pear-DB
perl 
perl-libwww-perl 
perl-DateManip 
perl-DBD-MySQL 
perl-DBI 
perl-Net-DNS 
perl-suidperl 
perl-XML-Parser 
audiofile-devel         
dhcp                   
gd 
lm_sensors
libusb-devel
mc         
mysql-devel
gcc-c++
flite
flite-devel
automake
vim-enhanced
piafdl
piafxtras
xinetd
t*f*t*p-server
joe
gtk2
gtk2-devel

Then when the dependancies are in, run piafdl 14...
 
so you two are having pretty good success with PIAF and Xen so far? Ive yet to take the dive as i just havent had the extra time lately. My regular server is running it fine, but its just a waste of a server and rack space since i dont have a lot of traffic on the system.
 
To test the viability of this without wasting too much time I have downloaded Tobias Göller's image and have it running....BUT....does anyone know where I can find the root password or the IP address that has been configured for this image?

TIA,
Jordan.
 
Never mind, got to the grub screen using ""xm create -c PiAF", entered single user mode and reset the password.

If anyone else is wondering the default IP is 172.30.100.200.

Regards,
Jordan.
 
To test the viability of this without wasting too much time I have downloaded Tobias Göller's image and have it running....BUT....does anyone know where I can find the root password or the IP address that has been configured for this image?

TIA,
Jordan.

and what was your findings?
 
Successfull install on DOMu

working
i can confirm i have installed centos5.3 + PIAF on domu.

okay so i have a base domu that i build from , it is just a clean install of core centos 5.3

this is what i did.

yum -y groupinstall admin-tools base base-x core development-libs development-tools dns-server ftp-server mail-server mysql network-server server-cfg smb-server sound-and-video system-tools web-server x-software-development

yum -y install kernel-xen-devel php-mysql php php-gd php-mbstring php-pear php-mysql php-pear-db perl perl-libwww-perl perl-Date-Manip perl-DBD-mysql perl-DBI perl-Net-DNS perl-suidperl perl-XML-Parser audiofile-devel dhcp gd lm_sensors mc mysql-devel gcc-c++ automake xinetd t*f*t*p-server joe vim-enhanced

cd /tmp
get piafdl-0.1-1.noarch.rpm ## available inside the PIAF iso
get piafxtras-0.1-1.noarch.rpm ## available inside the PIAF iso
rpm -Uvh piafdl-0.1-1.noarch.rpm
rpm -Uvh piafxtras-0.1-1.noarch.rpm
/usr/local/sbin/piafdl 14

### now you will need to install your kernel-xen-devel
uname -r ### this will tell you what kernel you have mine is 2.6.18-128.el5xen
### i found my kernal here. http://rpm.pbone.net/index.php3?stat=3&limit=5&srodzaj=3&dl=40&search=kernel-xen-devel

wget ftp://ftp.pbone.net/mirror/ftp.cent...ntOS/kernel-xen-devel-2.6.18-128.el5.i686.rpm

rpm -i kernel-xen-devel-2.6.18-128.el5.i686.rpm

cd /usr/src/zaptel/kernel
make install
make config
genzaptelconfig


## tying to start zt dummy will maybe crash your domu, so heres what i did next . from dom0
xm shutdown <my-piaf-domu> , if that doesnt work xm destory <my-piaf-domu>. now we have to edit the zt dummy file . so we need to start the domu , but not start zaptel , then edit the file then start zaptel and configure , okay so from dom0 xm create -c <my-piaf-domu>
press i for interactive startup... just press yes to everything untill you get to zaptel press no, then press continue for the remaining services.

as per lmatter's post . do this
edit /usr/src/zaptel/kernel/ztdummy.c and comment out #define USE_RTC, then cd /usr/src/zaptel and "make install"

now reboot

all working

i have a working domu+config the file is 5GB but i can upload it to a central server if somebody wants to share it.
darren at sra dot net dot au
 
Has anyone tested PCI passthrough on PIAF / Xen setup. For example, if I had a Digium FXO card, would I be able to dedicate that PCI device to my Xen Virtual server?
 
i have tested it a i could not get it working properly . but i will try again. pci back is a bit trickey to configure.
 
Hardware cards typically have to be installed at the server level and not on the VM.
 
Sangoma has a USB FXO device that I have heard can provide a timing device for XEN Instances. But, assigning PCI devices to a XEN instance? I haven't heard of that.
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top