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

Be more intelligent about adding local storage #198

Open
mbunkus opened this issue Apr 6, 2022 · 1 comment
Open

Be more intelligent about adding local storage #198

mbunkus opened this issue Apr 6, 2022 · 1 comment

Comments

@mbunkus
Copy link

mbunkus commented Apr 6, 2022

Summary

If we have an existing, running server & want to add a new Rocket Storage (storage_variant = "local"), we have to turn the server off manually before the changes can be applied. If the server is still running, a 409 error is returned by the API ('Hot-Plug of local storages is not supported.').

Terraform Version

Terraform v1.1.7
on linux_amd64
+ provider registry.terraform.io/gridscale/gridscale v1.14.2
+ provider registry.terraform.io/hashicorp/dns v3.2.3

Affected Resource(s)

  • gridscale_server & gridscale_storage

Terraform Configuration Files

resource "gridscale_storage" "test_mein_dc-primary-root" {
  name     = "test_mein_dc-primary root"
  capacity = 50
}

# resource "gridscale_storage" "test_mein_dc-primary-root_rocket" {
#   name            = "test_mein_dc-primary root rocket"
#   capacity        = 50
#   storage_variant = "local"
# }

resource "gridscale_server" "test_mein_dc-primary" {
  name             = "test_mein_dc-primary"
  cores            = 2
  memory           = 4
  hardware_profile = "q35"
  power            = true
  storage {
    object_uuid = gridscale_storage.test_mein_dc-primary-root.id
  }
  # storage {
  #   object_uuid = gridscale_storage.test_mein_dc-primary-root_rocket.id
  # }
}

Debug Output

Debug output

Expected Behavior

The server should be turned off, the storage should be added & the server should be turned on again, as is done for other similar types of changes.

Actual Behavior

The API returns the following error & the changes aren't applied:

gridscale_server.test_mein_dc-primary: Modifying... [id=d98293fe-583e-4c82-9061-b140cfac7cbb]
╷
│ Error: update server (d98293fe-583e-4c82-9061-b140cfac7cbb) resource - error: Error waiting for storage (a5c5c81f-e5c7-411a-a708-4d98905670a4) to be attached to server (d98293fe-583e-4c82-9061-b140cfac7cbb): Status code: 409. Error: {'type': 'HTTPError', 'status_code': 409, 'message': "(409, 'Hot-Plug of local storages is not supported.')"}. Request UUID: 1e035db3-f76c-42b7-9ed1-430ce9de0469.
│
│   with gridscale_server.test_mein_dc-primary,
│   on 33_env_test_mein.tf line 74, in resource "gridscale_server" "test_mein_dc-primary":
│   74: resource "gridscale_server" "test_mein_dc-primary" {

Steps to Reproduce

  1. terraform apply the config above first with the commented-out sections as they are to create a running server
  2. Comment-in the two storage sections & try terraform apply again. You'll run into the error now.
@nvthongswansea
Copy link
Contributor

@mbunkus thank you for suggesting this feature. We will consider it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants