Automating cloning, with static IP & NodeBalancer
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
There are a whole variety of tools that do this, like Puppet, Chef, Ansible, and Salt.
- Les
Ok, this gives me the kick i need to put the time in to learn Ansible and ditch ClusterSSH. Thanks!