Automating cloning, with static IP & NodeBalancer

Hi,

Each time I need to clone some (Ubuntu/Debian) Linodes to add more capacity to a Nodebalancer it's a process fraught with lots of potential for human error. Looking for a way to automate this.

Has anyone had any success automating this? I'm thinking a client-side script that interacts with the Linode API seems to be what's needed.

The process (when I do it manually) is:

1. Shutdown linode 1

2. Create linode 2

3. Clone the linode

4. Boot both linodes

5. Login to linode 2, via Lish or SSH

6. Setup /etc/network/interfaces to the new static network details

7. Set the new machine's hostname

8. Reboot

9. Add the new linode to the Nodebalancer

In Linode API terms I guess that's going to be something like:

1. linode.shutdown

2+3. linode.clone

4. linode.boot

5. login via ssh [note: the linode needs DHCP enabled for its primary web-facing IP]

6. network details are available at linode.ip.list, if I understand correctly

7. hostname is user-supplied

8. linode.reboot

9. nodebalancer.node.create

2 Replies

Why not use a config management tool so that deploying a new Linode doesn't involve using an old one as a gold master? Then you're looking at "create / deploy / boot a new Linode via the API, then point your config management tool at it". Bonus points if it self-configures via a StackScript.

There are a whole variety of tools that do this, like Puppet, Chef, Ansible, and Salt.

  • Les

Makes sense; it's clearly the best general-purpose solution both for cloning instances, and for obviating the need for cloning by building them from scratch.

Ok, this gives me the kick i need to put the time in to learn Ansible and ditch ClusterSSH. Thanks!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct