Snapshot droplet without downtime?

February 1, 2015 1k views

I've seen comments throughout this community that droplets sized 1gb or greater can create a snapshot without first bringing the droplet offline. This appears to not actually be the case, so, assuming this, is there a recommended way of knowing when a droplet has been turned off so that the snapshot can occur, all through the API?

Obviously I could poll the droplet via the API and check when the status of the droplet changes. Same goes for the actual snapshot creation (to get the new ID). Is there a better way?

The use case here is scaling horizontally, where a simple git pull isn't enough to make sure all servers are in sync (there are symlinked files, assets, conf files, etc.)

1 Answer

It is not possible to create a snapshot of any size droplet without powering it off. There should be two ways to track when your droplet is ready for a snapshot.

1.) Whenever you send an event (like a power off) via the API an event id is returned which can then be polled via the actions endpoint for it's status.
2.) With a power off event you can also, as you indicated use the droplet endpoint to get current status.

When you run your snapshot event your droplet will automatically be powered back on as soon as it has completed. This is done to help limit your downtime.

Have another answer? Share your knowledge.