0

I'm trying to use terraform vsphere to provision vSphere VMs. Now I can create VMs.

resource "vsphere_virtual_machine" "k8s_cp3" {
    name = "sat-k8s-cp3"
    datastore_id = data.vsphere_datastore.vsan.id
    resource_pool_id = data.vsphere_resource_pool.pool_esxi_storage.id
    host_system_id = data.vsphere_host.esxi_storage.id

    guest_id = "ubuntu64Guest"
    wait_for_guest_net_timeout = -1
    
    num_cpus = 2
    memory = 8192

    network_interface {
      network_id = data.vsphere_network.cluster_network.id
    }

    disk {
        label = "disk0"
        size = 120
    }
}

But if I don't have wait_for_gues_net_timeout set up. It will fail with waiting for OS to coming up.

I have a Cobbler to provide DHCP and PXE boot/OS installation services. The Cobbler needs the system to be added before the OS installation starts. It also need MAC address and an argument for Profile to choose which OS to be installed. The OS installation is fully automated if Cobbler system is correctly configured.

So here are my questions:

  • How should I create Cobbler system before or after VM is created?
  • How to collect the MAC address to pass to Cobbler so the OS installation if not using static MAC?
felixc
  • 11
  • 3

0 Answers0