How to do bare metal restore?
My problem is that whenever I want to wipe my server and start over, I have to shut the server down, remove my main disk and swap disk images, restore my snapshot, resize my main disk image, change my disk and configuration profile labels, delete my old config profile, and reboot the server. Doing this all by hand is time-consuming and error-prone. Is there some way I can automate this process I've just described? I've looked through the documentation and while it's well-written, it's still all very confusing. This doesn't seem like a job for a stackscript as I need to resize my disk images and change the labels. Does Linode provide the tools to do what I need?
Thanks.
3 Replies
Really, you're probably way better off actually codifying your config with Puppet/Chef/Salt/Ansible/etc rather than trusting the gold-master and hoping you remember what you did to set up the configs inside it.
- Les
In essence, are you suggesting that I use the Linode API simply to create my configuration profile (using a base Linux distro) and resize my disks and then use a CM tool to perform all the initial "Getting Started" and "Securing Your Server" steps as well as installing all of my packages? That might make good sense. I think I'll look into Ansible as I'll only have at most five servers I'll ever need to configure. Chef and Puppet would probably be overkill.
As an aside, do you prefer a CM like Ansible to shell scripts? I would think that Bash scripts might be a better option since you then have the option to use them to create a Linode StackScript.
Thanks again.
As far as Ansible vs bash scripts, Ansible is leaps and bounds better. It does a much better job handling idempotency, so if there's an issue you can fix it and safely re-run the provisioning, and it has much better logging / validation baked in that will preserve your sanity.
When I used Ansible, I had a tiny StackScript that essentially did "git clone MYANSIBLEREPO" and then applied the playbooks for the server.
StackScripts are pretty inflexible, I much prefer to use them as a springboard to kick off the real provisioning.
- Les