| 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

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( 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.