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

[Bug]: Changing hcloud server from arm64 to x86 results in an error #853

Open
mzhaase opened this issue Jan 23, 2024 · 1 comment
Open

Comments

@mzhaase
Copy link

mzhaase commented Jan 23, 2024

What happened?

Changed the type of a server from an ARM one to an x86 one. Terraform output:

 # module.kubernetes-cluster.hcloud_server.worker[1] will be updated in-place
resource "hcloud_server" "worker" {
       ...
      ~ server_type                = "cax11" -> "cx11"
...
    }
    
 Error: server type has incompatible architecture (invalid_server_type)

What did you expect to happen?

When changing the server so architectures are switched, the server should probably be recreated instead of updated-in-place.

Please provide a minimal working example

resource "hcloud_server" "worker" {
    image         = "debian12
    location      = "fsn1"
    name          = "worker"
    server_type = "cax11"
    ssh_key       = xxx
}

Deploy, then change "cax11" to "cx11"

@mzhaase mzhaase added the bug label Jan 23, 2024
@apricote
Copy link
Member

Hey @mzhaase,

thanks for the report!

Unfortunately this is not possible with the current code. With the Terraform Provider SDKv2, which we currently use to implement most of the resources, we can only mark a field as always or never forcing a replacement. As changing the server type within an architecture is supported, we would like to keep this as is.

We are currently migrating to the new Terraform Provider Plugin Framework (#752), which supports conditionally forcing a replacement. The hcloud_server resource is planned as one of the next resources to refactor, as we already know of a few bugs that we can finally solve with the new Plugin Framework.

For now, you can manually tell terraform to replace the resource through terraform apply -replace="hcloud_server.worker" or by tainting the resource and then applying: terraform taint hcloud_server.worker.

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

No branches or pull requests

2 participants