ryancbutler / Citrix-VAD-LAB

Build a Citrix Virtual Apps and Desktop environment with Ansible and Terraform
77 stars 26 forks source link

Resource pool could not be found #10

Closed extromen13 closed 3 years ago

extromen13 commented 3 years ago

previous issue: Error: error fetching resource pool: resource pool #9

HI @ryancbutler the problem is with any name I am giving as resource pool, I also tried the root resource pool

"Specifying the root resource pool for a standalone host NOTE: Fetching the root resource pool for a cluster can now be done directly via the vsphere_compute_cluster data source.

All compute resources in vSphere (clusters, standalone hosts, and standalone ESXi) have a resource pool, even if one has not been explicitly created. This resource pool is referred to as the root resource pool and can be looked up by specifying the path as per the example below:

data "vsphere_resource_pool" "pool" { name = "esxi1/Resources" datacenter_id = "${data.vsphere_datacenter.dc.id}" }

is there a way how to list resource pool name via terraform? I have no other idea how to find out what is wrong, I also found some threads that are pointing to the same issue with resource pool

hashicorp/terraform-provider-vsphere#962 Thanks a lot

ryancbutler commented 3 years ago

From that issue you posted you should be able to get the ID using https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs/data-sources/compute_cluster#resource_pool_id

data "vsphere_compute_cluster" "compute_cluster" {
  name          = "compute-cluster1"
  datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

Then replace ${data.vsphere_resource_pool.pool.id} with data.vsphere_compute_cluster.compute_cluster.resource_pool_id