rakutentech / terraform-provider-vsphere

[DEPRECATED] Terraform Custom Provider for VMware vSphere
Mozilla Public License 2.0
82 stars 30 forks source link

Support for placing VM in folder #51

Closed diamond29 closed 8 years ago

diamond29 commented 8 years ago

I'd like to put my vm's in specific folders so I can group them in the UI.

Maybe this is part of the custom_configuration_parameters? Or is there some documentation I could read on that?

ivan-exness commented 8 years ago

I think it can help: https://www.terraform.io/docs/providers/vsphere/r/folder.html

predominant commented 8 years ago

@diamond29 check the link from @ivan-exness which has the folder information.

Here's a snipped example:

First create the folder:

resource "vsphere_folder" "foo_folder" {
  path = "my/folder"
  datacenter = "my_datacenter"
}

Next, create a VM in that folder:

resource "vsphere_virtual_machine" "my_vm_in_a_folder" {
  # . . .
  folder     = "${vsphere_folder.foo_folder.path}"
  # . . .
}