Can tugboat infer region and size when creating a droplet from an image?

Posted July 23, 2014 2k views

When creating a droplet from an image, is there a way to tell tugboat (or DO) to use the “appropriate” region & size based on the image? I’ve written “freeze” and “thaw” scripts leveraging tugboat to put droplets on ice (power off, snapshot, & delete) and later thaw them out (create droplet from image) and they’re working great (e.g., “freeze foo” > free storage for a few weeks > then “thaw foo” and it’s back); however, if I have an image in a different region or a non-default size, my thaw script fails.

If info_image reported region & size, I could parse them and use them when creating a droplet from the image. As it stands, the “tugboat create foo -i 1234” command just reports an error referencing disk sizes like “Cannot create a droplet with a smaller disk (20GB) than the image (40GB).” Since DO sizes are memory-based, it makes the script hacky (e.g., use a single, hardcoded region for all images, then try to create image and, if it fails, try to interpret error message for disk size and map it to correct memory size).

The DO API for images reports regions, but not size, for the image, so maybe tugboat couldn’t do this if it wanted to? :-/

If there’s an easy way to infer region & size for a droplet using tugboat, I’d love to know about it. Otherwise, is this a feature request for the DO API, tugboat, or both?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


Right now the size information for images isn’t available in the API, though adding it is on the roadmap. Version 2 of the API was recently released for public beta. We’re still gathering feedback and adding more features to based on what we’re hearing from users. If there’s anything else you’re missing, please feel free to open an issue on our GitHub page.

As this is all scripted, one idea for a work around is to name all of your snapshots in a predictable manner with the droplet size in the name.