batrick / ceph-linode

Launch Ceph using the Linode VPS provider
GNU General Public License v3.0
13 stars 10 forks source link

improve linode cluster cleanup #9

Closed bengland2 closed 6 years ago

bengland2 commented 6 years ago

linode-nuke.py now deletes the ansible inventory file if it exists. This is important because otherwise launch.sh won't create new linodes (apparently expects them to already be there) if inventory file exists.

Also, linode-nuke.py now deletes the linodes themselves. This is important so that we don't leave the nodes lying around and get charged for them. Also, if we want to launch with a bigger or smaller configuration, it's easier if none of the old nodes are still around.

In some cases, I get this error:

2017-10-16 17:59:13,974 DEBUG Raw Response: {"ACTION":"linode.delete","DATA":{},"ERRORARRAY":[{"ERRORMESSAGE":"Linode must have no disks before delete","ERRORCODE":41}]}

But it does power them all down and delete the disks. If you re-run linode-nuke.py after the nodes are all powered down, it will finish deleting them all.

batrick commented 6 years ago

You can use linode-destroy.py to delete linodes. linode-nuke.py is to just reset the linodes to no disks/config so that you can start with a clean slate without getting charged for destroying the node and immediately starting a new one. In practice, nuking only saves money with smaller clusters and not much at that.

Also, this was mean to be driven by launch.sh which deletes the ansible_inventory when you use the --nuke option. (linode-*py doesn't know anything about ansible and I'd like to keep it that way).

bengland2 commented 6 years ago

OK, I misunderstood what it was for, withdrawing this PR.