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

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?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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.