openvz template

Discussion in 'General' started by landfiets, Jan 21, 2009.

  1. landfiets

    Joined:
    May 20, 2008
    Messages:
    20
    Likes Received:
    0
    hi there. i try to get elastix running on openvz, but it is a hell of a job.
    is there anyone who allready has this running as a openvz container or/and is it possible that someone makes an openvz template so everyone can benefit from that?
     
  2. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    What technology do you use for virtualization?
     
  3. weshosking

    Joined:
    Feb 10, 2009
    Messages:
    2
    Likes Received:
    0
    Installing Elastix under Openvz, seems to be fairly easy.

    First thing - make sure you have the Centos (5.2 in my case ) template installed and then run something
    similar to the following :

    ------------------
    #!/bin/sh
    #
    # Create an server virtual machine. - This one for
    # checking Centos 5.2 operation - running Elastix (asterisk plus extra)
    #
    VID=101
    vzctl create $VID --ostemplate centos-5-x86 --config vps.basic
    vzctl set $VID --onboot yes --save
    vzctl set $VID --hostname elastix.bozo.com --save
    vzctl set $VID --ipadd 192.168.0.$VID --save
    vzctl set $VID --nameserver 192.168.0.253 --save
    vzctl set $VID --userpasswd root:elastix
    vzctl start $VID
    echo " RUN : vzctl exec $VID passwd "
    echo " Boost up the quota for disk and memory space "

    vzctl set $VID --diskspace 10485760 --save
    vzctl set $VID --kmemsize 15242880 --save
    vzctl set $VID --othersockbuf 636896 --save
    vzctl set $VID --numothersock 480 --save
    vzctl set $VID --privvmpages 1000000 --save
    vzctl set $VID --numproc 100 --save
    #
    # Restart the Virtual machine - so that it gets the IP addresses, etc.
    #
    vzctl restart $VID
    #
    # Where do we start here - install using yum
    sleep 20
    REPO=/var/lib/vz/private/$VID/etc/yum.repos.d/elastix.repo
    echo "[elastix]" >> $REPO
    echo "name=Elastix RPM Repository for CentOS" >> $REPO
    echo "baseurl=http://repo.elastix.org/centos/\$releasever/updates/RPMS/" >> $REPO
    echo "gpgcheck=0" >> $REPO
    echo "enabled=1" >> $REPO
    echo "" >> $REPO

    vzctl exec $VID "yum -y install asterisk*"
    vzctl exec $VID "yum -y install elastix-*"
    vzctl exec $VID "yum -y install freeze"
    vzctl exec $VID "yum -y install fxload"
    vzctl exec $VID "yum -y install kernel-module-rhino*"
    vzctl exec $VID "yum -y install libmfcr2"
    vzctl exec $VID "yum -y install lzop"
    vzctl exec $VID "yum -y install perl-HTML-TokeParser-Simple"
    vzctl exec $VID "yum -y install perl-WWW-Mechanize"

    vzctl exec $VID "yum -y install mod_ssl"

    -----

    I would suggest then rebooting this Virtual machine, and following instructions from there.
    (I am fairly clueless on Elastix side of things, but at least everything seems to come up unlike trying to do something similar with trixbox.... ).

    good luck,

    wes
     
  4. Tom Newman

    Joined:
    Feb 8, 2009
    Messages:
    3
    Likes Received:
    0
    Rafael

    We use OpenVZ at the moment and are looking to expand to Xen in the near future. Weshosking listed the correct procedure.


    Kindest Regards

    Tom
     
  5. landfiets

    Joined:
    May 20, 2008
    Messages:
    20
    Likes Received:
    0
    hi im very new to this, so let me ask some questions

    where do i set the ram size for the container? I see some digits there but they seem so very high.
    par example when i would like a container with elastix to have 256 MB of ram, what should I fill out?

    and secondly, you made a kind of sh file of it? and you ran it as a script or did you typ all of it in the root of the openvz kernel. and when you let itwork like a script how do you do that? what commands do you give to run it or do you use a shell software to login. please help. i'm trying to learn
     
  6. chopeta

    Joined:
    Jun 18, 2009
    Messages:
    10
    Likes Received:
    0
    What about kernel dependencies and dahdi compilation?

    I can't believe is that simple :)

    I will try here with my Proxmox server.
     
  7. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    Corrected a few errors in the script and copied over the kernel files.

    Code:
    mkdir /var/lib/vz/private/$VID/lib/modules/2.6.24-7-pve
    cp -r /lib/modules/2.6.24-7-pve/* /var/lib/vz/private/$VID/lib/modules/2.6.24-7-pve
    Unreferenced $releasever variable hardcoded to 5.

    repos URL prefixed with http://

    Introduced Dahdi.

    Attached script http://forum.elastix.org/old_files/install_elastix.zip
     
  8. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    The repo listed in the above scripts seems outdated. The new elastix one is:
     
  9. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
  10. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    The above gives errors needing the following missing dependencies even after yum install mysql* php-mysql php-common*:
    An easier way in ProxMox would be to create a CentOS v5.2 Container from the GUI and do the following from the console prompt of the container and placing the elastix.repo file attached herein into the /etc/yum.repos.d folder and setting execution permissions:

    Code:
    yum clean all
    yum -y  --enablerepo=elastix install perl* mysql* php-mysql php-common* ImageMagick php-pear-DB php-pear* dahdi* asterisk* elastix-* freeze fxload kernel-module-rhino* libmfcr2 lzop perl-HTML-TokeParser-Simple perl-WWW-Mechanize mod_ssl
    wget http://repo.elastix.org/elastix/1/base/i386/RPMS/perl-Data-UUID-1.149-0.i386.rpm
    rpm -ivh perl-Data-UUID-1.149-0.i386.rpm
    wget http://repo.elastix.org/elastix/1/base/i386/RPMS/hylafax-4.3.3-7rhel5.i386.rpm
    rpm -ivh hylafax-4.3.3-7rhel5.i386.rpm
    yum update
    
    http://forum.elastix.org/old_files/elastix_repo.zip
     
  11. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    I am still left with the following missing dependencies:
    Code:
    elastix-additionals-1.5-3.noarch from elastix has depsolving problems
      --> Missing Dependency: perl(Mail::IMAPClient) is needed by package elastix-additionals-1.5-3.noarch (elastix)
    elastix-1.5.2-2.3.noarch from elastix has depsolving problems
      --> Missing Dependency: elastix-sugarcrm is needed by package elastix-1.5.2-2.3.noarch (elastix)
    elastix-additionals-1.5-3.noarch from elastix has depsolving problems
      --> Missing Dependency: perl(MIME::Parser) is needed by package elastix-additionals-1.5-3.noarch (elastix)
    2009020507:asterisk-1.4.26.1-2.i386 from elastix has depsolving problems
      --> Missing Dependency: libspeexdsp.so.1 is needed by package 2009020507:asterisk-1.4.26.1-2.i386 (elastix)
    Error: Missing Dependency: libspeexdsp.so.1 is needed by package 2009020507:asterisk-1.4.26.1-2.i386 (elastix)
    Error: Missing Dependency: perl(MIME::Parser) is needed by package elastix-additionals-1.5-3.noarch (elastix)
    Error: Missing Dependency: elastix-sugarcrm is needed by package elastix-1.5.2-2.3.noarch (elastix)
    Error: Missing Dependency: perl(Mail::IMAPClient) is needed by package elastix-additionals-1.5-3.noarch (elastix)
    
     
  12. viraj

    Joined:
    Oct 30, 2008
    Messages:
    3
    Likes Received:
    0
    I have an OpenVZ template for elastix installed. Where should I upload it so others can use it as well?

    The issue I have with it currently is a weird SIP 401 error when I try to register X-Lite, but IP Phones are currently working well.
     
  13. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    Just post the install instructions and attach the script that does it - this will help in evaluation / updation and corrections being made quickly by the community.
     
  14. yashi

    Joined:
    Sep 30, 2009
    Messages:
    4
    Likes Received:
    0
    apmuthu, were you able to get elastix to work in the container?

    You need to install DAG repository to resolve your dependencies. Perhaps something like:
    Code:
    vzctl exec $VID "rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm"
    Let me know how it's working out ...
     
  15. ictdude

    Joined:
    Aug 12, 2009
    Messages:
    23
    Likes Received:
    0
    Is it already some where availible for download ?
     
  16. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    I have posted installation for using an openzv machine on proxmox here.

    I have not gotten to get the machine into a template due to dahdi being installed on the hardware server to support meetme.

    Hope this helps.

    Gil
     
  17. weshosking

    Joined:
    Feb 10, 2009
    Messages:
    2
    Likes Received:
    0
    Hi Guys,
    I thought that I would update the procedure to using the latest Centos (5.4 ) and the
    standard install technique (as much as that is possible under openvz ). Here is my script to do
    this :

    #!/bin/sh
    #
    # Create an server virtual machine. - This one for
    # checking Centos 5.4 operation - running Elastix (asterisk plus extra)
    #
    echo "Make teh mount point : mkdir /mnt/elastix-cd "
    echo "Mount the ISO image : mount -o loop /usr/local/iso/Elastix-1.6.0-i386-bin-29Oct2009.iso /mnt/elastix-cd "
    echo "fstab should have entry : "
    echo "/mnt/elastix-cd /var/lib/vz/root/$VID/mnt/elastix-cd none bind,noauto 0 0 "
    echo "Which has the Elastix CD to be mounted on it "
    VID=199
    vzctl create $VID --ostemplate centos-5-x86 --config vps.basic
    vzctl set $VID --onboot yes --save
    vzctl set $VID --hostname elastix1.local.net --save
    vzctl set $VID --ipadd 192.168.10.$VID --save
    vzctl set $VID --nameserver 192.168.10.202 --nameserver 192.168.10.16 --save
    vzctl set $VID --userpasswd root:AnyNewPwd
    vzctl start $VID
    echo " RUN : vzctl exec $VID passwd "
    echo " Boost up the quota for disk and memory space "

    vzctl set $VID --diskspace 10485760 --save
    vzctl set $VID --kmemsize 15242880 --save
    vzctl set $VID --othersockbuf 636896 --save
    vzctl set $VID --numothersock 480 --save
    vzctl set $VID --privvmpages 1000000 --save
    vzctl set $VID --numproc 120 --save
    vzctl set $VID --lockedpages 300 --save
    #
    # Restart the Virtual machine - so that it gets the IP addresses, etc.
    #
    vzctl restart $VID
    #
    # Where do we start here - install using yum
    sleep 20
    #ISOSRC=/usr/local/iso/Elastix-1.6.0-i386-bin-29Oct2009.iso
    #ISODEST=/var/lib/vz/private/$VID/usr/local/iso/Elastix.iso
    #
    #mkdir /var/lib/vz/private/$VID/usr/local/iso
    #cp $ISOSRC $ISODEST
    echo "Mount the ISO image : mount -o loop /usr/local/iso/Elastix-1.6.0-i386-bin-29Oct2009.iso /mnt/elastix-cd "
    echo "fstab should have entry : "
    echo "/mnt/elastix-cd /var/lib/vz/root/$VID/mnt/elastix-cd none bind,noauto 0 0 "
    echo "Which has the Elastix CD to be mounted on it "

    #
    REPO=/var/lib/vz/private/$VID/etc/yum.repos.d/elastix-cd.repo
    #
    echo "[elastix-CD]" >> $REPO
    echo "name=Elastix RPM Repository for CentOS CD" >> $REPO
    echo "baseurl=file:/mnt/elastix-cd" >> $REPO
    echo "gpgcheck=0" >> $REPO
    echo "enabled=1" >> $REPO
    echo "" >> $REPO


    #
    mkdir /var/lib/vz/root/$VID/mnt/elastix-cd
    mount /var/lib/vz/root/$VID/mnt/elastix-cd
    #
    vzctl exec $VID "cd /mnt/elastix-cd/Elastix; yum -y --nogpgcheck install asterisk* elastix-* freeze fxload kernel-module\
    -rhino* libmfcr2 lzop perl-HTML-TokeParser-Simple perl-WWW-Mechanize"
    #vzctl exec $VID "yum -y update"
     
  18. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    must we not
    Code:
    vzctl exec $VID "yum -y --nogpgcheck  install mod-ssl"
    as well?
     
  19. apmuthu

    Joined:
    Aug 1, 2009
    Messages:
    60
    Likes Received:
    0
    Assuming DAB is installed and /etc/appliance.info is placed in the container with the necessary info, what further steps are needed to make it into an installable appliance tar.gz file?

    Like what folders need to be excluded in the final tar.gz file and how the conf file is to be made generic to get values at install time.
     
  20. sirsolrac

    Joined:
    Feb 27, 2009
    Messages:
    24
    Likes Received:
    0
    Let me suggest you Proxmox for virtualization, it's better than Xen. It uses OpenVZ and KVM, you can choose what type of virtual machine you want. And the best, full Open Source so far.

    I have 4 Elastix running as virtual machines on the same server with no problems.
     

Share This Page