vultr / terraform-provider-vultr

Terraform Vultr provider
https://www.terraform.io/docs/providers/vultr/
Mozilla Public License 2.0
192 stars 65 forks source link

[BUG] - Issues attaching reserved IP to a different server #77

Open chmln opened 3 years ago

chmln commented 3 years ago

Describe the bug I've got a reserved IP:

resource "vultr_reserved_ip" "ip" {
  label = "site-ip"
  region_id = data.vultr_region.region.id
  ip_type = "v4"

  lifecycle {
    prevent_destroy = true
  }
}

And a server

resource "vultr_server" "vm" {
  ...
  reserved_ip = vultr_reserved_ip.ip.subnet
}

Occasionally, when a server is destroyed and replaced with another one, I get this error:

Error: error creating server: Server add failed: Floating IPv4 address is already attached to another server

This typically goes away on the second terraform apply.

To Reproduce Steps to reproduce the behavior: see above

Expected behavior No errors.

ddymko commented 3 years ago

@chmln That is strange behavior....we will look into this

ddymko commented 3 years ago

The issue here is the API is still processing the detach of the reserved_ip while TF is already in the process of trying to attach it to a new instance.

This is why when you run terraform apply it will run without any problems. We'll look into addressing this in the API itself

lae commented 3 years ago

I'm experimenting with an instance that has a floating IP and consistently running into this. Seems like it's been a while - is it still being addressed?