Power on after snapshot not working via API

May 1, 2017 183 views
API Ubuntu

I am using tugboat to script a poweroff/snapshot of one of my droplets, and everything goes really well until the droplet snapshot completes... then the droplet never powers back on. Is this by design? Is there some state I can look for to indicate the droplet snapshot has completed to then issue the power on command?

2 Answers

Hi @GreymanIndustries

Yes, it's by design. The "create snapshot" command doesn't automatically send a "power on" command too.

When you run the create snapshot, in the response body you get an id of the action.
This id can be queried to get the status which returns in-progress, completed, errored.
Then you can loop that action query and trigger when it's completed and send a "power on".

Thanks, Hansen, that worked beautifully! I'm a little bit embarrassed by my inability to RTM, but I really appreciate your taking the time to respond!

Have another answer? Share your knowledge.