Skip to main content

FreeSWITCH in OpenVZ

About

OpenVZ is an open source container-based virtualization solution built on Linux. OpenVZ creates isolated, secure containers (otherwise known as VEs or VPSs) on a single physical server enabling better server utilization and ensuring that applications do not conflict. Each container performs and executes exactly like a stand-alone server; containers can be rebooted independently and have root access, users, IP addresses, memory, processes, files, applications, system libraries and configuration files. See http://wiki.openvz.org for more information.

Running FreeSWITCH in OpenVZ

  • FreeSWITCH in OpenVZ doesn't differ at all from running on standalone Linux.
  • FreeSWITCH OpenVZ template
  • vzctl create 200 --ostemplate centos-5-x86\_64-freeswitch
  • vzctl set 200 --ipadd 192.168.1.200 --hostname freeswitch-01 --nameserver 192.168.1.1 --save
  • vzctl start 200
  • vzctl enter 200 (to check things are ok)
  • exit (to exit the ve)
  • vzctl set --userpasswd root:password
  • ssh [root@192.168.1.200](mailto:root@192.168.1.200) (using the password set in prior step)

Resource Considerations

  • Use the ve-vps.basic.conf-sample included with OpenVZ for basic resources.
  • If you run into problems 'cat /proc/user_beancounters', look at failcnt and increase resources.

Live Migration of a running FreeSWITCH VE

You can migrate a live running OpenVZ container with very little downtime. This requires ssh keys on each host so they can login without a password.

For example if you have two OpenVZ hardware nodes called openvz-hn01 and openvz-hn02:

  • FreeSWITCH VEID 200 running on openvz-hn02

  • On openvz-hn02 you issue 'vzmigrate -v --online openvz-hn01 200' (This will live migrate the VE to openvz-hn01)

To migrate it back you perform the inverse:

  • On openvz-hn01 you issue 'vzmigrate -v --online openvz-hn02 200' (This will live migrate the VE to openvz-hn02)

You will have somewhere around 600ms-2000ms of audio drop out if live calls are up and media is passing thru your VE running FreeSWITCH. This all depends on the network between the two hardware nodes