Terraform: Error: timeout waiting for an available IP address

Terraform: Error: timeout waiting for an available IP address

我是 Terraform 的新手,我想使用 Terraform 创建 VM。下面是我的代码。 我想克隆一个 VM 并且不想提供 IP。 VM 在 vSphere 中创建,但 terraform 一直在等待 IP。有什么办法可以阻止 terraform 停止等待 ip?

下面是我的代码..

provider "vsphere" {
  user                 = var.vsphere_user
  password             = var.vsphere_pass
  vsphere_server       = var.vsphere_server
  allow_unverified_ssl = true
}

#Creating the data for resource

data "vsphere_datacenter" "dc" {
  name = var.vsphere_datacenter
}

data "vsphere_datastore_cluster" "datastore_cluster" {
  name          = var.datastore_cluster
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_datastore" "datastore" {
  name          = var.vsphere_datastore
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_resource_pool" "pool" {
  name = "RHEL IMAGES"
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_network" "network" {
  name          = var.network
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_virtual_machine" "template" {
  name          = var.vmtemp
  datacenter_id = data.vsphere_datacenter.dc.id
}

resource "vsphere_virtual_machine" "vm" {
  #   count = var.instances
  name             = var.vmname
  num_cpus         = var.cpu_number
  memory           = var.ram_size
  resource_pool_id = data.vsphere_resource_pool.pool.id
  guest_id         = data.vsphere_virtual_machine.template.guest_id

  network_interface {
    network_id = data.vsphere_network.network.id
    adapter_type = data.vsphere_virtual_machine.template.network_interface_types[0]

  }

  disk {
    label = "disk0"
    size  = 140
  }

  clone {
    template_uuid = data.vsphere_virtual_machine.template.id

    customize {
      linux_options {

        host_name = var.vmname
        domain    = "development.test"
      }

       network_interface {
         ipv4_address = ""
         ipv4_netmask = 0
       }
    }

  }
}

我已经尝试了以下选项但它不起作用..任何人都可以帮我解决这个问题吗?提前致谢。

我能够通过更改以下参数解决问题。

wait_for_guest_net_timeout = 0