terraform-provider-vultr icon indicating copy to clipboard operation
terraform-provider-vultr copied to clipboard

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

Open chmln opened this issue 4 years ago • 3 comments

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.

chmln avatar Dec 01 '20 00:12 chmln

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

ddymko avatar Dec 01 '20 17:12 ddymko

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

ddymko avatar Dec 02 '20 15:12 ddymko

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?

lae avatar Jun 13 '21 18:06 lae