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

provider/scaleway server volume property #9695

Merged
merged 6 commits into from
Oct 29, 2016
Merged

provider/scaleway server volume property #9695

merged 6 commits into from
Oct 29, 2016

Conversation

nicolai86
Copy link
Contributor

as discussed in #9254 and #9499, some Scaleway server instance types require volumes to be specified at creation time, in order to be used.

The Scaleway CLI chooses to hide this from the user, but I think it's worthwile to make this choice explicit.

this PR adds a new property to scaleway_server, to make this work:

resource "scaleway_server" "test" {
  name = "test"
  image = "5faef9cd-ea9b-4a63-9171-9e26bec03dbc"
  type = "VC1M"

  volume {
    size_in_gb = 50
    type = "l_ssd"
  }
}

I've updated the docs and added test cases which pass:

TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewayServer_Volumes -timeout 120m
=== RUN   TestAccScalewayServer_Volumes
--- PASS: TestAccScalewayServer_Volumes (98.30s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   98.317s
kepler22b@terraform [scaleway/server-private-volumes*] # tig

this PR might need rebasing once #9687 is merged.

@stack72
Copy link
Contributor

stack72 commented Oct 28, 2016

Hi @nicolai86

So close on this one! one of the tests fails:

=== RUN   TestAccScalewayVolume_importBasic
--- FAIL: TestAccScalewayVolume_importBasic (4.41s)
    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=10) "size_in_gb": (string) (len=1) "2"
        }

P.

@stack72 stack72 added enhancement waiting-response An issue/pull request is waiting for a response from the community provider/scaleway labels Oct 28, 2016
@nicolai86
Copy link
Contributor Author

nicolai86 commented Oct 29, 2016

Hey @stack72

turns out it's an issue introduced in #9687. I should get into the habit of always running ALL the tests.

Fixed with a0e7825 , caa3ecc and a970396.

@nicolai86
Copy link
Contributor Author

Now all the tests are green:

TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScaleway -timeout 120m
=== RUN   TestAccScalewayDataSourceBootscript_Basic
--- PASS: TestAccScalewayDataSourceBootscript_Basic (1.53s)
=== RUN   TestAccScalewayDataSourceBootscript_Filtered
--- PASS: TestAccScalewayDataSourceBootscript_Filtered (1.63s)
=== RUN   TestAccScalewayDataSourceImage_Basic
--- PASS: TestAccScalewayDataSourceImage_Basic (8.22s)
=== RUN   TestAccScalewayDataSourceImage_Filtered
--- PASS: TestAccScalewayDataSourceImage_Filtered (8.24s)
=== RUN   TestAccScalewayIP_importBasic
--- PASS: TestAccScalewayIP_importBasic (2.16s)
=== RUN   TestAccScalewaySecurityGroup_importBasic
--- PASS: TestAccScalewaySecurityGroup_importBasic (2.23s)
=== RUN   TestAccScalewayServer_importBasic
--- PASS: TestAccScalewayServer_importBasic (106.45s)
=== RUN   TestAccScalewayVolume_importBasic
--- PASS: TestAccScalewayVolume_importBasic (2.97s)
=== RUN   TestAccScalewayIP_Basic
--- PASS: TestAccScalewayIP_Basic (13.27s)
=== RUN   TestAccScalewaySecurityGroupRule_Basic
--- PASS: TestAccScalewaySecurityGroupRule_Basic (10.55s)
=== RUN   TestAccScalewaySecurityGroup_Basic
--- PASS: TestAccScalewaySecurityGroup_Basic (2.49s)
=== RUN   TestAccScalewayServer_Basic
--- PASS: TestAccScalewayServer_Basic (105.04s)
=== RUN   TestAccScalewayServer_Volumes
--- PASS: TestAccScalewayServer_Volumes (141.97s)
=== RUN   TestAccScalewayServer_SecurityGroup
--- PASS: TestAccScalewayServer_SecurityGroup (90.29s)
=== RUN   TestAccScalewayVolumeAttachment_Basic
--- PASS: TestAccScalewayVolumeAttachment_Basic (331.85s)
=== RUN   TestAccScalewayVolume_Basic
--- PASS: TestAccScalewayVolume_Basic (3.57s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   832.462s

@nicolai86 nicolai86 changed the title provider/caleway server volume property provider/scaleway server volume property Oct 29, 2016
@stack72
Copy link
Contributor

stack72 commented Oct 29, 2016

You rock! Thanks so much :)

@stack72 stack72 merged commit 98d8468 into hashicorp:master Oct 29, 2016
mathieuherbert pushed a commit to mathieuherbert/terraform that referenced this pull request Oct 30, 2016
* provider/scaleway: extract volume validation helpers

* provider/scaleway: add server volume property

fixes hashicorp#9499

* provider/scaleway: update `scaleway_server` docu

* provider/scaleway: fix volume handling

this actually broken when merging the latest SDK update :(

* provider/scaleway: fix volume attachment

* provider/scaleway: fix volume expectation
gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
* provider/scaleway: extract volume validation helpers

* provider/scaleway: add server volume property

fixes hashicorp#9499

* provider/scaleway: update `scaleway_server` docu

* provider/scaleway: fix volume handling

this actually broken when merging the latest SDK update :(

* provider/scaleway: fix volume attachment

* provider/scaleway: fix volume expectation
@ghost
Copy link

ghost commented Apr 21, 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 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/scaleway waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants