Nick Hardiman describes several methods of backups of your Amazon EC2 machines. He also details the steps for restoring snapshot backups.
As part of my operational readiness preparation, I want to make sure my Internet service is recoverable. I covered the developers’ favourite method – application-level backup – in my last post.
Sysadmins prefer to back up chunks of the file system. Many outstanding Linux backup utilities can help you manage a file system, the complexity of versioning, automation, backups spread across different media and rolling back to just the right files.
OS level backups got all the attention for decades. Now it’s a bit old and the younger model VM snapshots are getting all the attention. Don’t be dazzled: OS-level backup is the best solution.
The elephant gun approach – when you absolutely positively have to back up everything – is to copy the contents of an EC2 machine. You don’t really copy the machine itself: you copy a disk volume. Behind the scenes, the volume is reduced to one fat image file and some meta-data.
AWS make it easy to litter their storage with your backups. If an enterprise uses these volumes as its backup strategy, storage use spirals. The enterprise ends up with thousands of files in many cloud storage areas and has quite a job keeping track of the what is being stored, how much is being stored, and how much it is costing. The enterprise’s spanner-wielding officers archive their work using a storage service like AWS S3, and bean-counting officers monitor the financial implications using a cost monitoring service like Uptimecloud.
This is a simple backup procedure for taking one snapshot and storing it in EBS. A snapshot is a copy of a disk volume. A snapshot is not a complete copy – it is only the bits that have changed since the last snapshot.
This procedure is similar to launching a new VM.
Find the name of the volume to back up.
One method of restoring is to recreate the entire EC2 machine. This restore procedure is similar to my initial EC2 machine creation.
Another way is to make a volume from the snapshot to mount the volume on an existing EC2 machine and copy files from it. I have done this when my new EC2 machine’s kernel refused to mount an old snapshot’s volume.
The first thing to do is a little research. You can’t mount a volume from one zone on a machine in another zone.
Check the EC2 machine.
Create a volume.
Attach the volume.
Copy files.
Clean up.
Nick Hardiman builds and maintains the infrastructure required to run Internet services such as the web. Nick deals with the lower layers of the Internet - the machines, networks, operating systems and applications. Nick's job stops there and he hands over to the designers and developers who build the top layer that customers use.