Back up all you like - but can you resuscitate your data after a flood?
Trevor Pott learns a salutary lesson in data restoration
For many of our systems we not only test our backups – restoring from those backups on a regular basis is an automated process. Like any good sysadmins we maintain a test lab, re-populated each morning with last night's data.
Almost all critical systems have this sort of automated restore sequence set up so we rarely put much thought into what it might take to do a restore.
You will note that critical systems had automated restore procedures. The websites have not traditionally been viewed as critical.
The reasoning was that if we had undergone a severe outage or disaster and these systems were down we would have bigger fish to fry. We have the database and the website files, a manual restore should take a matter of minutes.
While that is all true, the hole in the plan is that you have to have something to restore to. If you don't have a copy of the virtual machines where those files and databases live, you have to build a new one from scratch.
As soon as I heard of the evacuation I knew we were going to get bitten by that lack of a virtual machine
Trevor – brilliant sort that he is – forgot to put the virtual machine templates in the backups directory. City floods, servers go down and here I sit with a bunch of rarballs and nowhere to inject them. The kicker is that we even had warning that the building had to be evacuated. As soon as I heard of the pending evacuation I knew we were going to get bitten by that lack of a virtual machine.
Before we were forced to abandon the Calgary location I had initiated a download of the virtual machine from the virtual server to the backup directory in the hopes that the power would stay on long enough to get the virtual machine replicated across the WAN.
I uncapped the fibrelinks and let them replicate at a full 100Mb, but no dice. There just wasn't enough time.
It took only minutes to get a virtual machine up, the database injected and the files uploaded. Bleary-eyed from lack of sleep and out of coffee it took me at least an hour to figure out that the reason the website wouldn't load was because I forgot to flush privileges on the MySQL server after restoring the MySQL database (and with it all the user and host authentication).
So now the website loads and … it doesn't quite load. About 75 per cent of the PHP is not being parsed. After combing through config files I realise that the version of PHP that ships with the latest CentOS has decided to deprecate the use of short <? $somephp ?> tags. Everything in those applications is written in those short tags so I had to change a value in the php.ini to get it work again.
Problem solved. The websites load properly and we are up and running again. Elapsed time: a little over two hours. Ouch!
That was bad enough but we were not out of the woods yet. It turned out that email messages submitted by forms on the website were not getting through. We chased this around for a while until we came across a change in Sendmail behaviour that altered how it processed the hostname.
If the hostname wasn't quite right then it did funny things when set up to forward mail to an internal processing server before being sent on to the net. Sendmail would send to some addresses but not to others. Non-deterministic behaviour in computers gives me all of the sads.
Needless to say with that behaviour pattern we didn't catch it until a day later. That makes our total recovery time from outage to 100-per-cent functional a little more than a day.
The best-laid plans
Two hours outage to primary operation is bad but a day to get all the bugs worked out is awful. I have lost both the primary server and the primary operating system disk on the secondary server, walked a semi-retired technophobic lady through prying the panel off and rewiring the system over a cell phone, in the dark, and had the systems back up in less time than that.
I have spent years crafting this absolutely bulletproof backup system (the ability to shoot any system in the data centre and recover from it is a requirement for my designs) but was brought low by a failure to properly plan the details of recovery.
Companies with budgets shouldn't have to worry about building the infrastructure of backups any more. We have cloud backup and recovery software providers such as Asigra. (Canada has a top-tier cloud backup software provider. Yes, I am going to milk that link for a while.)
Appliance vendors such as Unitrends and even full-bore paper + bits data lifecycle companies such as Iron Mountain provide backup. Making your data exist in more than one place should be nearly effort-free at this point.
That other part, though, is testing your restoration procedures. We should probably all be paying a little more attention to that. ®