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 speedup server deletion #9491

Merged
merged 2 commits into from
Oct 27, 2016
Merged

provider/scaleway speedup server deletion #9491

merged 2 commits into from
Oct 27, 2016

Conversation

nicolai86
Copy link
Contributor

@nicolai86 nicolai86 commented Oct 20, 2016

using terminate instead of poweroff leads to a faster shutdown

fixes #9430

tests remain green. I've used the opportunity to start switching from indefinite waits to resource.Retry so things time out properly after a while. Previously this would not happen.

TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScaleway -timeout 120m
=== RUN   TestAccScalewayDataSourceBootscript_Basic
--- PASS: TestAccScalewayDataSourceBootscript_Basic (1.43s)
=== RUN   TestAccScalewayDataSourceBootscript_Filtered
--- PASS: TestAccScalewayDataSourceBootscript_Filtered (1.30s)
=== RUN   TestAccScalewayDataSourceImage_Basic
--- PASS: TestAccScalewayDataSourceImage_Basic (7.55s)
=== RUN   TestAccScalewayDataSourceImage_Filtered
--- PASS: TestAccScalewayDataSourceImage_Filtered (6.82s)
=== RUN   TestAccScalewayIP_importBasic
--- PASS: TestAccScalewayIP_importBasic (1.96s)
=== RUN   TestAccScalewaySecurityGroup_importBasic
--- PASS: TestAccScalewaySecurityGroup_importBasic (2.52s)
=== RUN   TestAccScalewayServer_importBasic
--- PASS: TestAccScalewayServer_importBasic (99.63s)
=== RUN   TestAccScalewayVolume_importBasic
--- PASS: TestAccScalewayVolume_importBasic (4.32s)
=== RUN   TestAccScalewayIP_Basic
--- PASS: TestAccScalewayIP_Basic (8.95s)
=== RUN   TestAccScalewaySecurityGroupRule_Basic
--- PASS: TestAccScalewaySecurityGroupRule_Basic (5.50s)
=== RUN   TestAccScalewaySecurityGroup_Basic
--- PASS: TestAccScalewaySecurityGroup_Basic (3.23s)
=== RUN   TestAccScalewayServer_Basic
--- PASS: TestAccScalewayServer_Basic (87.76s)
=== RUN   TestAccScalewayServer_SecurityGroup
--- PASS: TestAccScalewayServer_SecurityGroup (184.57s)
=== RUN   TestAccScalewayVolumeAttachment_Basic
--- PASS: TestAccScalewayVolumeAttachment_Basic (333.76s)
=== RUN   TestAccScalewayVolume_Basic
--- PASS: TestAccScalewayVolume_Basic (4.61s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   753.928s

using `terminate` instead of `poweroff` leads to a faster shutdown

fixes #9430
if server.State != "stopped" {
if err := s.PostServerAction(serverID, "poweroff"); err != nil {
return err
return resource.Retry(5*time.Minute, func() *resource.RetryError {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 minutes seams very optimistic considering the current performances of scaleway, any way to make this with config at the provider level and/or to put 10 minutes ?

if err := waitForServerState(s, serverID, "stopped"); err != nil {
return err

if serr, ok := err.(api.ScalewayAPIError); ok {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at some point we could consider an helper method like isRessouceMissingError(err) bool no ?

@stack72
Copy link
Contributor

stack72 commented Oct 27, 2016

Hi @nicolai86

Thanks for the work here - this LGTM! I think we should have a follow up at some point that addresses @dcharbonnier points though :)

% make testacc TEST=./builtin/providers/scaleway                                                                                                                                                          ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/27 12:23:47 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v  -timeout 120m
=== RUN   TestAccScalewayDataSourceBootscript_Basic
--- PASS: TestAccScalewayDataSourceBootscript_Basic (1.50s)
=== RUN   TestAccScalewayDataSourceBootscript_Filtered
--- PASS: TestAccScalewayDataSourceBootscript_Filtered (1.47s)
=== RUN   TestAccScalewayDataSourceImage_Basic
--- PASS: TestAccScalewayDataSourceImage_Basic (8.10s)
=== RUN   TestAccScalewayDataSourceImage_Filtered
--- PASS: TestAccScalewayDataSourceImage_Filtered (7.79s)
=== RUN   TestAccScalewayIP_importBasic
--- PASS: TestAccScalewayIP_importBasic (2.26s)
=== RUN   TestAccScalewaySecurityGroup_importBasic
--- PASS: TestAccScalewaySecurityGroup_importBasic (2.54s)
=== RUN   TestAccScalewayServer_importBasic
--- PASS: TestAccScalewayServer_importBasic (94.30s)
=== RUN   TestAccScalewayVolume_importBasic
--- PASS: TestAccScalewayVolume_importBasic (3.25s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccScalewayIP_Basic
--- PASS: TestAccScalewayIP_Basic (9.45s)
=== RUN   TestAccScalewaySecurityGroupRule_Basic
--- PASS: TestAccScalewaySecurityGroupRule_Basic (5.42s)
=== RUN   TestAccScalewaySecurityGroup_Basic
--- PASS: TestAccScalewaySecurityGroup_Basic (2.50s)
=== RUN   TestAccScalewayServer_Basic
--- PASS: TestAccScalewayServer_Basic (111.86s)
=== RUN   TestAccScalewayServer_SecurityGroup
--- PASS: TestAccScalewayServer_SecurityGroup (179.46s)
=== RUN   TestAccScalewayVolumeAttachment_Basic
--- PASS: TestAccScalewayVolumeAttachment_Basic (355.01s)
=== RUN   TestAccScalewayVolume_Basic
--- PASS: TestAccScalewayVolume_Basic (3.39s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   788.291s

@stack72 stack72 merged commit ec20f80 into hashicorp:master Oct 27, 2016
mathieuherbert pushed a commit to mathieuherbert/terraform that referenced this pull request Oct 30, 2016
* provider/scaleway speedup server deletion

using `terminate` instead of `poweroff` leads to a faster shutdown

fixes hashicorp#9430

* provider/scaleway: extract server shutdown code
gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
* provider/scaleway speedup server deletion

using `terminate` instead of `poweroff` leads to a faster shutdown

fixes hashicorp#9430

* provider/scaleway: extract server shutdown code
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slow to destroy scaleway instances
3 participants