User Tools

Site Tools


virtualization:openvz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
virtualization:openvz [2012/08/25 15:41]
gcooper
virtualization:openvz [2012/08/31 14:46] (current)
gcooper
Line 24: Line 24:
  
 ===== PBX ===== ===== PBX =====
 +
 +http://tutorialsbay.com/how-to-isntall-asterisk-freepbx-on-a-vps/
  
 See [[voice:pbx:piaf_virtual|PiaF]]. See [[voice:pbx:piaf_virtual|PiaF]].
  
 http://pve.proxmox.com/wiki/PBX_in_a_Flash http://pve.proxmox.com/wiki/PBX_in_a_Flash
 +
 +http://www.pbxinaflash.com/community/index.php?threads/best-timing-source.9084/
 +
 +http://www.cadvision.com/blanchas/Asterisk/ZaptelPerformanceTesting.html
 +
 +==== Firewall ====
 +
 +We run the firewall on the Host Node (HN).
 +
 +Stop all running VMs.
 +
 +<file>
 +sed -i 's|ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length|ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp|' /etc/vz/vz.conf
 +
 +/etc/init.d/vz restart
 +</file>
 +
 +==== DAHDI ====
 +
 +Sangoma USB hardware timing source (internal UT50 and external UT51): 
 +
 +http://sangoma.com/products/accessories/tools.html
 +
 +:!: Note that DAHDI will only work if the Host Node and the VE are the same $ARCH (32/32 or 64/64).
 +
 +:!: HPET or hardware timing source is important.
 +
 +Is HN kernel compiled with HPET and am I using it?
 +
 +<file>
 +grep HPET /boot/config-2.6.32-11-pve
 +
 +cat /sys/devices/system/clocksource/clocksource0/available_clocksource
 +
 +cat /sys/devices/system/clocksource/clocksource0/current_clocksource
 +</file>
 +
 +Change the current clock source, test then add to ''rc.local'':
 +
 +<file>
 +echo hpet > /sys/devices/system/clocksource/clocksource0/current_clocksource
 +</file>
 +
 +
 +See also 'res_timing_timerfd'.
 +
 +<file>
 +dmesg | grep dahdi
 +
 +dahdi_test
 +</file>
 +
 +Acceptable score: >99.975
 +
 +=== Make DAHDI Timing Available to CTs ===
 +
 +This assumes Asterisk is running as the user 'asterisk'.
 +
 +<file>
 +CTID=100
 +vzctl stop $CTID
 +vzctl set $CTID --devnodes dahdi/pseudo:rw --save
 +vzctl start $CTID
 +vzctl exec $CTID chown -R asterisk.asterisk /dev/dahdi /lib/udev/devices/dahdi
 +</file>
 +
 +=== Alternate Method? ===
 +
 +You can export devices from the Hardware Node (HN) to the container (CT) by using the devnodes flag.
 +
 +You may need a line like this in the /etc/vz/conf/VEID.conf for the Asterisk VE:
 +
 +<file>
 +DEVNODES="dahdi/pseudo:rw dahdi/ctl:rw dahdi/channel:rw dahdi/timer:rw "
 +</file>
  
 ===== Templates ===== ===== Templates =====
  
-OpenVZ containers are created from templates.  Since containers are not fully virtualized environments, there is no booting to CD/DVD drives or ISO images.+OpenVZ containers are created from templates.  Since containers are not fully virtualized environments.  There is no booting to CD/DVD drives or ISO images.
  
 ==== Creating Templates ==== ==== Creating Templates ====
  
-http://www.elastix.org/component/kunena/25-newbies-corner-/57615-elastix-20-and-openvz--proxmox-template.html+http://wiki.openvz.org/Physical_to_container
  
 http://www.powerpbx.org/content/are-you-sure-you-want-revert-revision-sat-12102011-1203 http://www.powerpbx.org/content/are-you-sure-you-want-revert-revision-sat-12102011-1203
Line 43: Line 120:
 ==== Create a FreePBX (Centos 5) Template on Proxmox ==== ==== Create a FreePBX (Centos 5) Template on Proxmox ====
  
-Install your Centos server and application to a physical machine.+  - Install your Centos server and application to a physical machine
 +  - Create a Centos 5 container using an existing Centos template and shut it down.
  
-Create a Centos 5 container using an existing Centos template and shut it down.+=== Physical Machine (Source) ===
  
-Log into the Proxmox host.+Clean out the YUM database and stop running applications: 
 + 
 +<file> 
 +yum clean all 
 + 
 +amportal stop 
 +service dnsmasq stop 
 +service httpd stop 
 +service mysqld stop 
 +</file> 
 + 
 +=== Proxmox Host ===
  
 <file> <file>
Line 56: Line 145:
 mkdir /var/lib/vz/private/$CTID mkdir /var/lib/vz/private/$CTID
  
-rsync -arvpz --exclude=/dev --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/tmp -e ssh root@xx.xx.xx.xx:/ /var/lib/vz/private/$CTID/+rsync -arvpz --exclude=/dev --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/tmp 
 +-e ssh root@xx.xx.xx.xx:/ /var/lib/vz/private/$CTID/
  
 sed -i -e 's/^[0-9].*getty.*tty/#&/g' /var/lib/vz/private/$CTID/etc/inittab sed -i -e 's/^[0-9].*getty.*tty/#&/g' /var/lib/vz/private/$CTID/etc/inittab
Line 78: Line 168:
 chroot . chroot .
  
-MAKEDEV -d /dev -x {p,t}ty{a,p}{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} console core full kmem kmsg mem null port ptmx random urandom zero ram0+MAKEDEV -d /dev -x {p,t}ty{a,p}{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} console core full kmem kmsg mem null 
 +port ptmx random urandom zero ram0
  
-MAKEDEV -d /etc/udev/devices -x {p,t}ty{a,p}{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} console core full kmem kmsg mem null port ptmx random urandom zero ram0+MAKEDEV -d /etc/udev/devices -x {p,t}ty{a,p}{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} console core full kmem 
 +kmsg mem null port ptmx random urandom zero ram0
  
 chmod 1777 /tmp chmod 1777 /tmp
Line 154: Line 246:
 vzctl start $CTID vzctl start $CTID
 vzctl enter $CTID vzctl enter $CTID
 +
 +# For services info, see http://wiki.openvz.org/Physical_to_container
  
 chkconfig --list | grep :on chkconfig --list | grep :on
  
-for i in acpid apmd iptables ip6tables kudzu microcode_ctl smartd lm_sensors mcstrans netfs portmap restorecond sendmail sshd; do chkconfig $i off; done+for i in acpid apmd auditd bluetooth clock cupsd consolefont cpuspeed dnsmasq gpm hdparm iptables ip6tables isdn \ 
 +irqbalance kudzu lm_sensors lvm2-monitor mcstrans mdmonitor microcode_ctl netfs netplugd smartd netfs nfslock ntpd \ 
 +openibd pcmcia portmap postfix restorecond rpcidmapd rpcgssd sendmail wanrouter xfs; do chkconfig $i off; done
  
  
Line 164: Line 260:
  
  
 +Using ''tar'' instead of ''rsync'':
  
 +<file>
 +vim /etc/exclude
 +
 +.bash_history 
 +lost+found 
 +/dev/
 +/mnt/
 +/tmp/
 +/proc/
 +/sys/
 +/usr/src/*
 +</file>
 +
 +<file>
 +tar --numeric-owner -czvf /tmp/centos-5.0-x86_64-FreePBX-image.tar.gz -X /tmp/exclude /
 +
 +scp /tmp/centos-5.0-x86_64-FreePBX-image.tar.gz root@192.168.1.30:/var/lib/vz/template/cache/
 +</file>
  
  
virtualization/openvz.1345930895.txt.gz · Last modified: 2012/08/25 15:41 by gcooper