Floating IPs - An upcomming life saver for me

In my previous post about virtualization, I talked about scaling servers up and down based on demand. Yet there is another interesting thing about virtualization, that makes it a life saver. Or yet to be a life saver.

In Hostly, we are currently developing a new type of service for our customers. We are calling it “Managed Servers”. It gives the power of virtualization, but with the simplicity of shared hosting. We are setting up virtual servers for our customers on the go, and configuring them programmatically. The managed server deployment takes about 4–5 minutes in the current alpha release of the module.

After a successful deployment, a username and password is sent to the customer, and when they connect to the terminal of the server, they see an empty folder. The www folder. The server is built with the newest version of Apache, PHP 7.0 and MySQL. A database has been created for them and they are good to go. Just like a normal shared hosting account, but now with up to a thousand times more power. Wow, huh?

I’m creating the feature with an interesting safety feature. All IPs assigned to the managed servers are floating. This basically means that I can reroute traffic throughout the cluster and onto another server in almost realtime. I just unassign an IP from a server and reassign it to a new server.

Why is this a life saver? — You, a few seconds ago

Imagine this scenario; Something has gone completely wrong. The server configurations are broken and the services are unable to start. This is a very rare condition, but it can potentially happen. I now have three options:

  1. Manually connect to the affected host and patch it.
  2. Build a whole new server and move the client.
  3. I can do nothing.

The answer here is kinda obvious. I do nothing, since I’m a lazy developer coding my way out of my problems. The Hostly Core will at this point already have figured out something is wrong and the solution is the second option. The server is unable to respond to normal requests and the server will be marked for maintenance. Whenever a server is marked for maintenance, the client is locked out from the server.

Since I chose to do nothing, the Core will build a new managed server, transfer the customer data from the old server to the new, and reroute the floating IP to the new server. The task takes about 10 minutes, then everything is like it used to be. The database is back online, the web server answers requests and the client doesn’t even have to change anything. No data has been lost.

The reason why Floating IPs are lifesavers is simple. If the customer had a static IP, they would have had to propagate the new IP to the internet. Such a change can potentially take up to days to propagate. Now they wouldn’t even know that they were moved — besides a new password for their terminal all of a sudden.

Virtualization saves the world once again — this time with a little help from Floating IPs.