Skip to content

r/virtual_machine: add support to manage CD-ROM connection state #1372

@felipeaom

Description

@felipeaom

vSphere Provider Version

version = "1.15.0"

vSphere Version

VMware Version: 6.7.0 Update 3 (Build 14320388)

Affected Resource(s)

  • vsphere_virtual_machine

Terraform Configuration Files

resource "vsphere_virtual_machine" "virtualmachine" {
  name                       = var.vs_vmname
  resource_pool_id           = data.vsphere_resource_pool.pool.id
  datastore_id               = data.vsphere_datastore.datastore.id
  force_power_off            = true
  shutdown_wait_timeout      = 1
  
  num_cpus                   = "4"
  memory                     = "8192"
  wait_for_guest_net_timeout = 0
  guest_id                   = var.vs_guestid
  nested_hv_enabled          = true
  
  network_interface {
    network_id   = data.vsphere_network.networking.id
    adapter_type = "vmxnet3"
  }
  
  cdrom {
    datastore_id = data.vsphere_datastore.datastore.id
    path         = var.vs_iso_custom
  }

  disk {
    size             = "300"
    label            = "disk0.vmdk"
    thin_provisioned = false
  }

Explaining the code

My code is to create a VM to use a custom ISO to do a silent installation. However, when the VM is turned on, the "connect" flag is not marked in the CD / DVD settings. This way I need to shut down the VM, mark the flag and start again to boot correctly. Does anyone have any idea if it is a BUG or if it has an option in the code to insert?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions