Linode Forum
https://forum.linode.com/

Automating cloning, with static IP & NodeBalancer
https://forum.linode.com/viewtopic.php?f=19&t=11064
Page 1 of 1

Author:  corence [ Thu May 22, 2014 1:03 am ]
Post subject:  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

Author:  akerl [ Fri May 23, 2014 6:46 am ]
Post subject:  Re: Automating cloning, with static IP & NodeBalancer

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

Author:  corence [ Sun May 25, 2014 7:30 pm ]
Post subject:  Re: Automating cloning, with static IP & NodeBalancer

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!

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/