Phil Bower's picture

I have just started experimenting with the Turnkey hub and I have a question about what's the best way to quickly restore an instance.

I only want to run my instances while I'm using them so I'm interested in figuring out the fastest way to create new instances and restore  backups to them.

I know that I can do this manually.

Part 1

Launch a new server

Do work…

Perform a backup

apt-get update
apt-get install tklbam
tklbam-init <Key>
tklbam-backup

Terminate my server

<Time passes>

Part 2

Launch a new server like this one

SSH into it

Perform restore by running these commands

apt-get update
apt-get install tklbam
tklbam-init <Key>
tklbam-restore <backup id>

What I'd like to do is some how automate Part 2 so that by simply selecting "launch a new server like this one" I don't even have to log into it to perform the restore.

I've noticed a few things like mounting an EBS volume, TKLPatch, configuration hook scripts, and user-data scripts, and I'm guessing the answer will have to do with one or more of these. But I could use a little help connecting the dots. What I've come up with so far is putting the commands from Part 2 into a script on an EBS volume that I can then execute with an SSH from my desktop. It's not a bad solution but I'm wondering if there is a better alternative.

Forum: 
Tags: 
Jeremy Davis's picture

But I can suggest that if you are using the new v11.0RC (or aren't they available on AWS yet?) TKLBAM is already installed (so no need for the apt-get lines of code).

Phil Bower's picture

v11.0RC aren't available on AWS yet.

Jeremy Davis's picture

Hopefully someone a little more useful than me will be along shortly :)

Liraz Siri's picture

Thanks for the feedback, we may add support for doing this for the next release.

But it will involve a compromise. The main technical problem is that backups can be passphrase protected. So long as you only enter the passphrase on your machine (e.g., in the command line) we don't have the passphrase. This means you don't have to trust us or the Hub, which is a good thing from a security standpoint.

"Restore on launch" would only work with backups that are not passphrase protected or otherwise require you to enter your passphrase into the Hub. I guess we could support both and leave it to you to decide if the extra convenience is worth giving away some of your security.

What do you think?

Alon Swartz's picture

Check out the announcement for details.

Add new comment