Why aren't my droplets having their disks resized? (API)

I’m running an application which needs to be able to spin up droplets of different sizes, and I’m a bit puzzled about why my disk sizes appear not to be updating.

The script involved waits until the droplet is powered off, then triggers the resize API query like the following curl example:

curl -X POST -H ‘Content-Type: application/json’ -H “AUthorization: Bearer <token>” -d ‘{“type”:“resize”, “size”:“8gb”}’ “<dropletID>/actions”

I get responses like the following:

{“action”:{“id”:296405318,“status”:“in-progress”,“type”:“resize”,“started_at”:“2017-09-26T18:31:17Z”,“completed_at”:null,“resource_id”:63894287,“resource_type”:“droplet”,“region”:{“name”:“New York 3”,“slug”:“nyc3”,“sizes”:[“512mb”,“1gb”,“2gb”,“c-2”,“4gb”,“c-4”,“8gb”,“c-8”,“16gb”,“m-16gb”,“c-16”,“32gb”,“m-32gb”,“48gb”,“c-32”,“m-64gb”,“64gb”,“m-128gb”,“m-224gb”],“features”:[“private_networking”,“backups”,“ipv6”,“metadata”,“install_agent”],“available”:true},“region_slug”:“nyc3”}}

The resize succeeds, and I get an 8GB node with 4 cores and 8 GB of ram, but I’m still getting 20GB of hard disk space. The size list documentation (linked below) seems to indicate that I should be getting 80 GB.

What’s up?

Thanks, -Grant


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

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.

There are two types of resizes - CPU and RAM only, which is used by default and CPU, Disk and RAM. To get the second one with API, you’ll need also to pass disk: true argument in the request, such as:

  1. curl -X POST -H 'Content-Type: application/json' -H "AUthorization: Bearer <token>" -d '{"type":"resize", "size":"8gb","disk": true}' "<dropletID>/actions"

(didn’t tested, so I’m not 100% sure it’s working, maybe you’ll need quotes around true)

More about this in the API docs.

Gotcha, not sure how I missed that in the API - thanks!