How to set up a Ringfree node+pbx sandbox

note: as of ringfree-pbx-utils-3.0-41, ringfree-provision-pbx is now ringfree-provision-pbx.local.  A new tool has been added, ringfree-provision-pbx.nfs and instructions for setting up a sandbox with NFS storage will be available shortly.  In a future update, both will be removed in favor of a unified tool.
This document explains how to set up a node sandbox that you can run PBX instances outside of the main Ringfree datacenter infrastructure.  While this does not let you test connections through our Sansay SBC or through our proxy services, it does allow you to quickly create development environments to work on new features, bug fixes and test staging packages.  The best manner to create a sandbox is to use a virtual machine desktop application.  VMWare Workstation and Oracle Virtualbox will suffice.
1) Download installation media to your local workstation/laptop/computer:
http://mirror1.ringfree.biz/rel/6.3.1/isos/ringfree-os-6.3.1-dvd-update1.iso
2) When creating a VM, you are commonly asked what type of Linux distribution you are virtualizing.  REL/Ringfree OS is forked from Red Hat Enterprise Linux 6 so it or CentOS 6 are the choices you should use.  Be sure to set up your virtual network adapter to bridging mode so it grabs an IP in the same subnet as your local network.  This will allow you to register a phone to it.
3) During install, let the installer use all disk space.  If there’s a warning that pops up from Anaconda complaining that you’re using an unsupported CPU, ignore and continue as an update will pull in an updated kernel.  Any suitable CPU microcode will be applied after installation.
4) After installation, the default root password is “testpass”.  Log in.
5) Modify /etc/sysconfig/network-scripts/ifcfg-eth0 and set BOOT to yes.  Restart networking.  You will now have network access.  Set IP address from DHCP to static and choose an IP not in your DHCP range.  When restarting networking, you may see that system-config-network has segfaulted when trying to configure the OpenVZ network bridge (venet0).  This is a known bug but does not affect the node or the PBX working.
6) Create an A record for your VM’s ip address.   This is used during provisioning (the PBX uses that record to talk to the DB server).  Pointing DNS A records to private ip address ranges although seemingly bizarre is perfectly valid.
7) Update all packages:
# yum -y update

8) Run ‘ringfree-license’ and copy output and send it to john@ringfree.com.  Here is a sample output from a sandbox Kendall created and emailed me:

[root@sandbox ~]# ringfree-license
 
  **********************************************************
  * Ringfree License Tool                                  *
  **********************************************************
 
    Machine Code:        eedf23309653bbca1df760eb38da9f62
    Mac Address:         08:00:27:CD:E3:9A
    Interface found:     eth0
 
    Send the above information to Ringfree so you can
    complete your node registration!
 
    Email: support@ringfree.biz
    Hours: 9am-6pm EST

9) After John has whitelisted your MAC/machinecode, run ‘ringfree-node-setup’ and put your A record in when asked for FQDN.  For licensee put in Ringfree.  for license put in whatever, it’s not actually used and will be removed later.  Here is an example of me running this utility on a new sandbox:

[root@localhost ~]# ringfree-node-setup

**************************************
 Ringfree Node Setup tool
**************************************

Enter node FQDN/hostname:
sandbox1.office.ringfree.biz

Enter company name:
Ringfree

Enter Ringfree license:
blah


Ringfree Node configuration complete!
After John inserts the machine id and licensing info on the blessed list, you’ll then be able to provision PBXs.  To provision a pbx you would run the following:
ringfree-provision-pbx.local $CTID $HOSTNAME $IP $ROOTPW $ADMINPW $SUBDOMAIN $VENDORID
$CTID: container id.  I usually set sandboxes up in the XXX range as it’s easier to type later on (vzctl enter 100)
$HOSTNAME: it’s not required to be correct in the node-centric sandboxes without proxies.  But if you wanted to access the pbx at the address sandbox1.awesomesauce.com, you would enterawesomesauce.com here.
$IP:  Enter another ip address on your private network, something outside of the range of your DHCP.
$ROOTPW:  It’s not used for much as we don’t have ssh turned on inside PBXs, but this sets the root password inside the container.
$ADMINPW:  This is the password for the pbxadmin user “admin”
$SUBDOMAIN:   it’s not required to be correct in the node-centric sandboxes without proxies.  But if you wanted to access the pbx at the address sandbox1.awesomesauce.com, you would enter sandbox1 here.
$VENDORID:  always use a 0
Let the PBX provision.  Afterwards you can enter it at http://$IP/pbxadmin/
Next, let’s run ringfree-updatepbxscripts.  (This tool will not run unless the node is registered)
# ringfree-updatepbxscripts
Since it’s not in the datacenter, you’ll need to update packages inside the container manually with a “yum -y update”