Digital Ocean Droplet Resize - Appsembler

Digital Ocean Droplet Resize

<div>DROPLET_ID and downgrading droplet </div> <div>  </div> <div>Created on 06/27/14 at 15:59 UTC </div> <div>  </div> <div>Support Request Posted on 06/27/14 at 15:59 UTC </div> <div>Hi </div> <div>  </div> <div>So I want to downgrade my droplet to a lower tier. It's currently on the 2GB plan and I want to move it to the 1GB plan. </div> <div>  </div> <div>Based on the thread here:  </div> <div>https://www.digitalocean.com/community/questions/downgrade-plan-from-10-back-to-5-a-month-plan-can-this-be-done  </div> <div>I'm trying to  </div> <div>1. resize the drive down to 30GB (using the API)  </div> <div>2. create a snapshot of the drive  </div> <div>3. create a new droplet under the 1GB plan with the smaller snapshot </div> <div>  </div> <div>My problem is using the API to resize the drive. From the docs, I found this command:  </div> <div>curl -X POST "https://api.digitalocean.com/v2/droplets/10/actions"   </div> <div>-d'{"type":"resize","size":"1024mb"}'   </div> <div>-H "Authorization: Bearer $TOKEN"   </div> <div>-H "Content-Type: application/json"  </div> <div>Based on this, this is the command I want to run:  </div> <div>curl -X POST "https://api.digitalocean.com/v2/droplets/$DROPLET_ID/actions"   </div> <div>-d'{"type":"resize","size":"30720mb"}'   </div> <div>-H "Authorization: Bearer $TOKEN"   </div> <div>-H "Content-Type: application/json" </div> <div>  </div> <div>I set the "size" value to "30720mb".  </div> <div>I have TOKEN set to the api key from my setting panel  </div> <div>But I'm not sure what value to set for DROPLET_ID. I can't seem to find this value anywhere. </div> <div>  </div> <div>So my questions:  </div> <div>-Am I on the right path for downgrading a droplet?  </div> <div>-Where do I find the correct value for DROPLET_ID? </div> <div>  </div> <div>Thanks. </div> <div>  </div> <div>-TJ </div> <div>  </div> <div>---  </div> <div>Here's the output from curl when I set DROPLET_ID=111 </div> <div>  </div> <div>tj@tj-lenovo:~/Programming/elance/edx$ curl -v -X POST "https://api.digitalocean.com/v2/droplets/$DROPLET_ID/actions" -d'{"type":"resize","size":"30720mb"}' -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json"  </div> <div>* About to connect() to api.digitalocean.com port 443 (#0)  </div> <div>* Trying 198.41.188.27... connected  </div> <div>* successfully set certificate verify locations:  </div> <div>* CAfile: none  </div> <div>CApath: /etc/ssl/certs  </div> <div>* SSLv3, TLS handshake, Client hello (1):  </div> <div>* SSLv3, TLS handshake, Server hello (2):  </div> <div>* SSLv3, TLS handshake, CERT (11):  </div> <div>* SSLv3, TLS handshake, Server key exchange (12):  </div> <div>* SSLv3, TLS handshake, Server finished (14):  </div> <div>* SSLv3, TLS handshake, Client key exchange (16):  </div> <div>* SSLv3, TLS change cipher, Client hello (1):  </div> <div>* SSLv3, TLS handshake, Finished (20):  </div> <div>* SSLv3, TLS change cipher, Client hello (1):  </div> <div>* SSLv3, TLS handshake, Finished (20):  </div> <div>* SSL connection using ECDHE-RSA-AES128-SHA  </div> <div>* Server certificate:  </div> <div>* subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=5118787; street=270 Lafayette St; postalCode=10012; C=US; ST=New York; L=New York; O=Digital Ocean, Inc.; OU=Digital Ocean, Inc.; CN=www.di  </div> <div>* start date: 2014-03-21 00:00:00 GMT  </div> <div>* expire date: 2016-05-24 12:00:00 GMT  </div> <div>* subjectAltName: api.digitalocean.com matched  </div> <div>* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1  </div> <div>* SSL certificate verify ok.  </div> <div>> POST /v2/droplets/111/actions HTTP/1.1  </div> <div>> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3  </div> <div>> Host: api.digitalocean.com  </div> <div>> Accept: */*  </div> <div>> Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  </div> <div>> Content-Type: application/json  </div> <div>> Content-Length: 34  </div> <div>>  </div> <div>* upload completely sent off: 34out of 34 bytes  </div> <div>< HTTP/1.1 404 Not Found  </div> <div>< Server: cloudflare-nginx  </div> <div>< Date: Fri, 27 Jun 2014 15:53:12 GMT  </div> <div>< Content-Type: application/json; charset=utf-8  </div> <div>< Transfer-Encoding: chunked  </div> <div>< Connection: keep-alive  </div> <div>< Set-Cookie: __cfduid=d6ea7ee54af59020a756aa6b7bb9636131403884392782; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly  </div> <div>< Status: 404 Not Found  </div> <div>< RateLimit-Limit: 1200  </div> <div>< RateLimit-Remaining: 1195  </div> <div>< RateLimit-Reset: 1403886999  </div> <div>< Cache-Control: no-cache  </div> <div>< X-Request-Id: f34c6b2158b6695095d2fe07d3af6adb  </div> <div>< X-Runtime: 0.036405  </div> <div>< X-Rack-Cache: invalidate, pass  </div> <div>< CF-RAY: 1412d0eeeb39078b-EWR  </div> <div><  </div> <div>{  </div> <div>"id":"not_found",  </div> <div>"message":"The resource you were accessing could not be found."  </div> <div>}  </div> <div>* Connection #0 to host api.digitalocean.com left intact  </div> <div>* Closing connection #0  </div> <div>* SSLv3, TLS alert, Client hello (1): </div> <div>  </div> <div>Gravatar </div> <div>REPLY from Jason Posted on 06/27/14 at 18:08 UTC </div> <div>Hello, </div> <div>  </div> <div>Thank you for contacting DigitalOcean Support. </div> <div>  </div> <div>You are welcome, glad we could help! </div> <div>  </div> <div>We appreciate you being a Digital Ocean customer and please let us know if we can be of further assistance! </div> <div>  </div> <div>Regards, </div> <div>  </div> <div>DigitalOcean Support  </div> <div>Check out our community for helpful articles and tutorials.  </div> <div>https://digitalocean.com/community </div> <div>  </div> <div>Gravatar Admin </div> <div>REPLY from Keems21 Posted on 06/27/14 at 17:59 UTC </div> <div>This is perfect. </div> <div>  </div> <div>Thanks for the help. </div> <div>  </div> <div>-TJ </div> <div>  </div> <div>On Fri, Jun 27, 2014 at 12:05 PM, DigitalOcean <  </div> <div>support@support.digitalocean.com> wrote: </div> <div>  </div> <div>> There has been a response to your ticket:  </div> <div>>  </div> <div>> Hello,  </div> <div>>  </div> <div>> At this time we do not have the ability to resize servers down via  </div> <div>> snapshots. The reason for this is because it impedes the progress of some  </div> <div>> of of our newer features we are intending to roll out such as: customer  </div> <div>> managed kernels, fast disk resize (up), multiple partitions.  </div> <div>>  </div> <div>> These are the steps I suggest you take:  </div> <div>>  </div> <div>> 1) create a new smaller droplet  </div> <div>> 2) use rsync to sync the files between the two droplets (see link below)  </div> <div>> 3) take a snapshot of the smaller server  </div> <div>> 4) destroy the larger server to release the IP  </div> <div>> 5) rebuild a new server from the snapshot and it should reclaim the same IP  </div> <div>>  </div> <div>> Rsync guide is here:  </div> <div>> https://www.digitalocean.com/community/articles/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps  </div> <div>>  </div> <div>> If you have any questions, or run into any issues with Rsync, please let  </div> <div>> us know.  </div> <div>>  </div> <div>> Happy Coding,  </div> <div>> DigitalOcean Support  </div> <div>>  </div> <div>> ---  </div> <div>> Please log-in to your DigitalOcean Control Panel to view your reply:  </div> <div>> https://cloud.digitalocean.com/support/303465  </div> <div>> </div> <div>  </div> <div>Gravatar </div> <div>REPLY from Ryan Quinn Posted on 06/27/14 at 16:05 UTC </div> <div>Hello, </div> <div>  </div> <div>At this time we do not have the ability to resize servers down via snapshots. The reason for this is because it impedes the progress of some of of our newer features we are intending to roll out such as: customer managed kernels, fast disk resize (up), multiple partitions. </div> <div>  </div> <div>These are the steps I suggest you take: </div> <div>  </div> <div>1) create a new smaller droplet  </div> <div>2) use rsync to sync the files between the two droplets (see link below)  </div> <div>3) take a snapshot of the smaller server  </div> <div>4) destroy the larger server to release the IP  </div> <div>5) rebuild a new server from the snapshot and it should reclaim the same IP </div> <div>  </div> <div>Rsync guide is here: https://www.digitalocean.com/community/articles/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps </div> <div>  </div> <div>If you have any questions, or run into any issues with Rsync, please let us know. </div> <div>  </div> <div>Happy Coding,  </div> <div>DigitalOcean Support</div>