FreePBX Failover/Load Balance over two different datacenters

Dear Experts,

I have two FreePBX virtual machines distributed over two different data centers but both are for the same company, I am planning to use sip trunk on those two VMs and seeking to get them to work in failover/load balance mode.

I know that some sip trunk provider provide the capabilities of failover in case my primary Public IP is not responsive however I would like to extend the failover and load balance to the level of the VM as well.

Have anyone tried to do the load balance/failover method on a VM level between two datacenters ? How would VoIP traffic react in case of primary VM down? how about end points configuration ? Can I direct end points to a single FQDN where both IPs can resolve and if one of the VMs are down still the end point would get register and act like nothing is happening ?

I would appreciate any person's comment that have had an experience with such scenario.

Thank you
LVL 24
Mohammed HamadaSenior IT ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
You'll have a much easier time if you run FreePBX on Ubuntu (installed at machine level), then LXD containers running your FreeBPX instances.

With LXD, you can just clone containers to different machines every night + have a running hot spare.

You can do all this with VMs + VMs are far slower than bare metal machines + tend to introduce lots of additional complexities, especially if Windows is running as your host/machine OS.

Generally, any way you setup your failover, simple way to test this is first just setup failover of your runtime environment. Once your failover is working correctly, then phase in your testing of FreePBX.

Your failover will also include changing your IP address, to your hot spare.

Be sure to run your primary + spare instances on separate machines on different networks.

Tip: If you're new to all this, best to hire someone, as it can be a bit tricky.

Tip: Be sure to do periodic testing of your failover sequence. Maybe once every 30 days, do a full failover so you're constantly switching between instances, to ensure your entire backup (data migration to spare) procedure is working correctly.
Mohammed HamadaSenior IT ConsultantAuthor Commented:
Hi David,

Thank you for the advise, my major concern here is that in case of failover I don't want to switch IPs ..etc thats why I asked this question.

Is this achievable in anyway? I have tried to do it with Microsoft Skype for Business on two different pools in different datacenters with pool pairing but unfortunately it requires manual failover. I know it can be done using branch server or appliance but not all functionalities will be there.

So I am trying it with FreePBX in order to maintain multiple sites without doing much work or down time.

I thought of using cloudflare's DNS load balancing capabilities but not sure if it would work properly with VoIP. I would appreciate if you can tell me whether you tried it or not?

Thank you
nociSoftware EngineerCommented:
The bigest hurdle would be the failover of IP addresses, if those don't migrate from one DC to the other then all connections on the failing equipment will be lost. after reregistration by the phones (phone should be able to register on both systems)  and of the PBX to the ISP a retry by the endusers can be attempted.

The RTP links will fail (They use barebones IP addresses determined using stun etc.) No DNS help here.
SolarWinds® IP Control Bundle (IPCB)

Combines SolarWinds IP Address Manager and User Device Tracker to help detect IP conflicts, quickly identify affected systems, and help your team take near instantaneous action. Help improve visibility and enhance reliability with SolarWinds IP Control Bundle.

Mohammed HamadaSenior IT ConsultantAuthor Commented:
Hi Noci,

Do you think it depends on the phone of how regularly it checks whether the phone is registered/not and re-register ? how would it be possible to do this on an end point ?
nociSoftware EngineerCommented:
Yes i think it is the registration interval.
Most IP-phones have a webpage for configuration. There you should be able to find SIP settings / Phone settings.
which should be adjustable.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed HamadaSenior IT ConsultantAuthor Commented:
Thank you both,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.