terraform-provider-vsphere icon indicating copy to clipboard operation
terraform-provider-vsphere copied to clipboard

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

Open rickhlx opened this issue 3 years ago • 3 comments

Community Guidelines

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

Description

According to https://github.com/hashicorp/terraform-provider-vsphere/pull/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

https://github.com/hashicorp/terraform-provider-vsphere/pull/447

rickhlx avatar Feb 22 '22 16:02 rickhlx

We need too, same use-case. Attaching extra disks on a different datastore cluster is possible using the vsphere client, so I expect it's also possible using the API.

holmesb avatar Nov 17 '22 08:11 holmesb

Is there any progress with this?

edenkoveshi avatar Feb 08 '24 06:02 edenkoveshi

Is there any progress with this?

I don't think so. I also need this. :(

pascal-hofmann avatar Mar 11 '24 15:03 pascal-hofmann