Skip to content

r/virtual_machine: relax ide0:0 reservation for CD-ROM when none is attached #1354

@obesser

Description

@obesser

The provider enforces a restriction of using IDE0:0 for CDROM only. This is a problem if you have to clone a template that uses 4 IDE hard disks and no CDROM (there is no way to change the template, these are vendor appliances) because you cannot specify more than 4 (0-3) unit numbers for IDE.

Terraform Version

v0.14.7

vSphere Provider Version

1.24.3

Affected Resource(s)

  • vsphere_virtual_machine

Terraform Configuration Files

resource "vsphere_virtual_machine" "vm" {
  name             = "vmname"
  resource_pool_id = data.vsphere_compute_cluster.cluster.resource_pool_id
  datastore_id     = data.vsphere_datastore.datastore.id
  guest_id         = data.vsphere_virtual_machine.template.guest_id
  network_interface {
    network_id = data.vsphere_network.network.id
  }
  disk {
    label           = "disk0"
    size            = data.vsphere_virtual_machine.template.disks.0.size
    controller_type = "ide"
    unit_number     = 0
  }
  disk {
    label           = "disk1"
    size            = data.vsphere_virtual_machine.template.disks.1.size
    controller_type = "ide"
    unit_number     = 1
  }
  disk {
    label           = "disk2"
    size            = data.vsphere_virtual_machine.template.disks.2.size
    controller_type = "ide"
    unit_number     = 2
  }
  disk {
    label           = "disk3"
    size            = data.vsphere_virtual_machine.template.disks.3.size
    controller_type = "ide"
    unit_number     = 3
  }
  clone {
    template_uuid = data.vsphere_virtual_machine.template.id
  }
}

Debug Output

trace log

Expected Behavior

Let me clone the template if it does not contain a CDROM drive and I do not specify a CDROM in the configuration.
Maybe use a flag to ignore the restriction to reserve IDE unit number 0 for CDROM.

Actual Behavior

Got the error message:
Error: disk.0: unit_number 0 on IDE is reserved for CD-ROM

Steps to Reproduce

Use the above config to clone a VM that has 4 IDE hard disks.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions