Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resizing DigitalOcean Droplets without increasing disk size. #9573

Merged
merged 1 commit into from
Oct 25, 2016

Conversation

andrewsomething
Copy link
Contributor

This adds a new Boolean argument for the DigitalOcean Droplet resource, resize_disk It defaults to true to match the current behavior. When set to false, resizing a Droplet will only resize the RAM and CPU making it a reversible operation.

https://developers.digitalocean.com/documentation/v2/#resize-a-droplet

It also exposes the disk and vcpus attributes.

It resolves #9402.

@stack72
Copy link
Contributor

stack72 commented Oct 25, 2016

hi @andrewsomething

Thanks for the PR here - i had to make 1 change. Your code caused a failure in the import test :)

=== RUN   TestAccDigitalOceanDroplet_importBasic
--- FAIL: TestAccDigitalOceanDroplet_importBasic (44.58s)
    testing.go:265: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.

        (map[string]string) {
        }


        (map[string]string) (len=1) {
         (string) (len=11) "resize_disk": (string) (len=4) "true"
        }

This was because we never actually set resize_disk to state. So I simply ignored that field in the test - as it isn't part of an import :)

% make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanDroplet_importBasic'                               2 ↵
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/25 11:39:26 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanDroplet_importBasic -timeout 120m
=== RUN   TestAccDigitalOceanDroplet_importBasic
--- PASS: TestAccDigitalOceanDroplet_importBasic (56.04s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean   56.049s

I have manually merged this PR to get this changed added

Thanks for all the work here

Paul

@stack72 stack72 merged commit ccff5af into hashicorp:master Oct 25, 2016
@andrewsomething
Copy link
Contributor Author

Good catch. Thanks @stack72!

@nikoren
Copy link

nikoren commented May 4, 2017

hi @andrewsomething , I'm trying to upgrade terraform from 0.7 to 0.9.3 , and terraform identifies that there is not resize_disk setting in my current state:

~ digitalocean_droplet.stage-share-xxxx.1
    resize_disk: "" => "true"

When I try to apply the change , the node is restarted, and in digital_ocean console I can see the following history:

Event Initiated Execution Time
Power On 1 hour ago 6 seconds
Resize 2 hours ago 17 minutes 19 seconds
Power Off 2 hours ago 11 seconds
Create 1 month ago 20 seconds

Nothing gets resized but as you can see node goes down , which makes upgrading terraform version very complicated because all nodes should be restarted .

The question is , if there any workaround exist for this issue , or maybe I'm doing something wrong?

@ghost
Copy link

ghost commented Apr 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: resize DigitalOcean droplet without increasing disk size
3 participants