Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m trying to use the API to create a droplet that has attached block storage.
In the web interface you can create a volume directly in the “new droplet” interface. However this doesn’t appear to be the case with the API. That’s fine. I first create the block volume with the Block Storage API. Then I create a droplet.
When I create the droplet however, the VM is automatically powered on. This means that I have to poll the action to see when the VM has been created, then force it to power down, attach the block storage, then power it back up. This seems like a kind of ugly way to get the storage attached. Plus, I’m using cloud-init to automate running a task in the VM, and if the VM is already powered on and I power it off, it could mess up the cloud-init flow (e.g. on the second boot a script may not run).
The API docs do not indicate any parameters that can be used to include a block volume in the create endpoint, nor do I see any parameters to create the droplet without powering it on.
What’s the best practice for doing this via the API?
indranil
doug.landau
ralph1
AI-LastWish
newuser23
Brett Bibby
a9124199d01b441190d9a64b3bf57e
nandaf89840b3eb242fe5d0371
MassiveGrayStarfish
Stian Mathisen
Cosmo Mathieu
aliasgar