DebugFactor.com | Forum

Error allocating IP from infoblox in Terraform

During the VM build using Vsphere provider in Terraform, I am facing an issue.
Below is the part of configuration in main.tf

resource "infoblox_ip_allocation" "IP_for_vm" {
vm_name = var.name_of_vm
....
}
variable "name_of_vm" {
type = string
default = "servername1"
}

I am getting the below error during terraform apply.

Error: Error allocating IP from network block(10.120.0.0/13): WAPI request error: 400('400 Bad Request') 

Please advice.

Error while allocating IP is most likely because you are trying to use a hostname/vm name which already has an IP assigned. Hence, infoblox did not assign an IP again and error-ed out.