Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Aug 20, 2015 8:25 pm 
Offline
Junior Member

Joined: Thu Feb 06, 2014 6:26 pm
Posts: 25
How does one do what I call a "bare metal restore" of a linode server? When I first set up my server I followed the Linode "Getting Started" and "Securing Your Server" instructions and created my user account. I then created a snapshot of the server. Now, anytime that I restore this snapshot, I have a clean server that I can install my website and all its packages onto.

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.


Top
   
PostPosted: Thu Aug 20, 2015 8:37 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
https://www.linode.com/api will get you part of the way, though you have to restore the backup by hand.

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


Top
   
PostPosted: Thu Aug 20, 2015 9:10 pm 
Offline
Junior Member

Joined: Thu Feb 06, 2014 6:26 pm
Posts: 25
Thanks. Actually, after looking at the API, if I created an image of the disk (rather than a snapshot), I could use disk.createfromimage to restore from that image.

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.


Top
   
PostPosted: Thu Aug 20, 2015 9:28 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
I'd say that Puppet isn't overkill, I'm currently using it to configure my two Macs.

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 MY_ANSIBLE_REPO" 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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group