Hourly Pricing Questions

September 20, 2019 131 views
DigitalOcean

I’ve been running a droplet containing a web server the past year using monthly pricing. I’d like to get a second droplet for running a server for a video game but I’d only be using it during certain times of the day. From my understanding, if I were to use hourly pricing, I’d only be charged when the droplet is in use? When I don’t need it, could I create a snapshot, delete the droplet, and restore it when needed? Since I’ve never needed to do that, is that a quick process? Furthermore, could I automate that process so it automatically turns on from xpm-ypm on weekdays and then snapshots and destroys itself when it’s not those hours? Thanks for answering my questions!

2 Answers

Hello,

Yes, you could absolutely do that and you would be charged only for the hours that the droplet existed.

To create a snapshot, it usually takes up to 1 minute per GB of data used by your Droplet. So if your droplet uses 20GB, that it could take up to 20 minutes for the snapshot process to complete.

You can automate the whole process with the DigitalOcean’s API. So for example to create a new droplet based on a snapshot, you need to supply its ID for the image parameter:

curl -X POST -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer $TOKEN' -d \
    '{"name":"example.com","region":"nyc3","size":"1024mb","image": 12345}' \
    "https://api.digitalocean.com/v2/droplets" 

Hope that this helps.
Regards,
Bobby

if i turn off a droplet, would be charged too ?

Have another answer? Share your knowledge.