Skip to content

r/virtual_machine: add support for allowing additional disks on different datastore clusters #1601

@rickhlx

Description

@rickhlx

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

According to #447
It was decided that:

When datastore_cluster_id is in use, datastore assignment to individual disks is not possible, nor is it possible to use this with a VM that is attaching an external disk. This decision was made to simplify the workflows that Terraform would need to handle.

However, we'd like to ask for reconsidering the former. We would like to abililty to provision extra disks on datastores/datastore clusters that are different from the VM's datastore_cluster_id

Use Case(s)

In our environment we have two different types of datatores, "Gold" and "Silver". OS disks are generally deployed to "Gold" datastores. Some workloads are deployed on a "Silver" when they do not need high performance or use more capacity. With this change we would gain the ability to provision a VM on the standard "Gold" datastore, with additional disks on the "Silver" datastores.

Potential Terraform Provider Configuration

resource "vsphere_virtual_machine" "vm" {
  name                 = "terraform-test"
  resource_pool_id     = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
  datastore_cluster_id = "${data.vsphere_datastore_cluster.datastore_cluster_gold.id}"

  num_cpus = 2
  memory   = 1024
  guest_id = "other3xLinux64Guest"

  network_interface {
    network_id = "${data.vsphere_network.network.id}"
  }

  disk {
    label = "disk0"
    size  = 20
  }

  disk {
    label = "disk1"
    size  = 20
    datastore_cluster_id = "${data.vsphere_datastore_cluster.datastore_cluster_silver.id}"
  }
}

References

#447

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions