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]: Trouble with firewall attachments and ARM machines #1059

Closed
hadmut opened this issue Dec 10, 2024 · 3 comments
Closed

[Bug]: Trouble with firewall attachments and ARM machines #1059

hadmut opened this issue Dec 10, 2024 · 3 comments
Labels

Comments

@hadmut
Copy link

hadmut commented Dec 10, 2024

What happened?

Hi,

I was just changing a running and working terraform / hcloud installation in two details:

  • I've change a single test machine into an expandable test machine by using count to create an arbitrary number of machines.
  • I've replaced the machine type from cx22 to cax11.

Creating machines and firewalls worked well, but creating firewall attachments failed:

  • when creating, terraform claimed to have created a firewall attachment (green), but actually, the ARM machine wasn't covered by the firewall.
  • removing the firewall attachment (either with terraform destroy --target or in order to create a new one) failed with an error message that terraform can't find the server with a given ID.

Either the hcloud terraform provider has trouble with arm machines, or there is some problem in the hetzner cloud.

What did you expect to happen?

work like with x86 machines

Please provide a minimal working example

too many changes, I'll create a new example.

@hadmut hadmut added the bug label Dec 10, 2024
@jooola
Copy link
Member

jooola commented Dec 10, 2024

Could you provide use a code example so we can better understand and maybe reproduce your issue?

@hadmut
Copy link
Author

hadmut commented Dec 10, 2024

I cannot reproduce the problem today, although terraform scripts unchanged.

But I had sent a request to Hetzner Support about this last night. Maybe they have resetted some devices.

@jooola
Copy link
Member

jooola commented Dec 13, 2024

I could not reproduce the issue using the following configuration:

terraform {
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = ">= 1.49.1"
    }
  }
}


resource "hcloud_server" "test" {
  name        = "test"
  server_type = "cax11"
  image       = "ubuntu-20.04"
}

resource "hcloud_firewall" "test" {
  name = "test"

  rule {
    direction  = "in"
    protocol   = "icmp"
    source_ips = ["0.0.0.0/0", "::/0"]
  }
}

resource "hcloud_firewall_attachment" "test" {
  firewall_id = hcloud_firewall.test.id
  server_ids  = [hcloud_server.test.id]
}

The firewall was successfully attached using a fresh deployment (with x86 and with arm)

I was also able to force replace the existing server to change the server type using:

terrafrom apply -replace="hcloud_server.test"

After everything was applied, the firewall attachment was properly working.

The underlying problem seems to be #1058 which surely messed up the state, I will therefor close this issue.

If you are still encountering the issues, feel free to reopen and please provide use the exact steps you did to reproduce it.

Cheers

@jooola jooola closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants