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

(server): unnecessary updates when using network with 1.44.1 #790

Closed
binaryfields opened this issue Nov 14, 2023 · 5 comments
Closed

(server): unnecessary updates when using network with 1.44.1 #790

binaryfields opened this issue Nov 14, 2023 · 5 comments
Labels
bug duplicate This issue or pull request already exists stale

Comments

@binaryfields
Copy link

binaryfields commented Nov 14, 2023

What happened?

Issue #556 does not seem to be fixed by #593.

I tried creating a server with network and public_network attributes and with each apply, TF will attempt to destroy and recreate the network.

# hcloud_server.node[1] will be updated in-place
  ~ resource "hcloud_server" "node" {
        id                         = "xxx"
        name                       = "node-2"
        # (17 unchanged attributes hidden)

      - network {
          - alias_ips   = [] -> null
          - ip          = "10.0.0.4" -> null
          - mac_address = "86:00:00:4d:83:aa" -> null
          - network_id  = xxx -> null
        }
      + network {
          + alias_ips   = (known after apply)
          + ip          = (known after apply)
          + mac_address = (known after apply)
          + network_id  = xxx
        }

        # (1 unchanged block hidden)
    }

What did you expect to happen?

No changes should be reported.

Please provide a minimal working example

resource "hcloud_server" "node" {
  count = var.node_count
  name  = "${var.cluster_name}-node-${count.index + 1}"

  server_type = var.node_type
  image       = var.instance_image
  datacenter  = var.datacenter
  ssh_keys    = [var.ssh_key_name]

  network {
    network_id = hcloud_network.private.id
  }

  public_net {
    ipv4_enabled = false
    ipv6_enabled = false
  }

  depends_on = [
    hcloud_network_subnet.private_subnet
  ]
}

terraform {
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = ">= 1.44.1"
    }
  }
}
@apricote
Copy link
Member

This seems to be the same issue as #650 (comment), can you try the fix mentioned in that comment?

@binaryfields
Copy link
Author

Adding alias_ips = [] to the network config of the server resource worked great. Thanks for the workaround.

@apricote
Copy link
Member

apricote commented Dec 4, 2023

I have added a note to the server docs for this: #804

apricote added a commit that referenced this issue Dec 11, 2023
People are still encountering this, so adding it to the official docs
might help them.

Related to #650 & #790
Copy link

github-actions bot commented Mar 3, 2024

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

@github-actions github-actions bot added the stale label Mar 3, 2024
@jooola jooola added the duplicate This issue or pull request already exists label Mar 4, 2024
@jooola
Copy link
Member

jooola commented Mar 4, 2024

Closing as duplicate of #650

@jooola jooola closed this as completed Mar 4, 2024
@jooola jooola closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug duplicate This issue or pull request already exists stale
Projects
None yet
Development

No branches or pull requests

3 participants