I'm attempting to use the vSphere provider to deploy VMs on a vSphere 6.0 cluster. However the VSPHERE_VIRTUAL_MACHINE argument resource_pool is not working as expected. Whenever I specify a resource pool the result is this error.
Error applying plan:
1 error(s) occurred:
Log file
https://gist.github.com/trodemaster/843ce9b16c6790e54ec9eee6e86b965a
.tf config file specifying resource pool
https://gist.github.com/trodemaster/4664509aed64919cba7f0009cf7853f0
Not sure what other details are going to be helpful in debugging this. Please advise...
Terraform version..
Terraform v0.6.15-dev (d1ac7d3b2e1be2f32092275340f33a2d73f7b31a)
The vSphere edition would be helpful as well
Is there more than one datacenter in your vCenter server? Also does is the account you login with have at least read access all the way down to the root? I have seen similar problems when the vCenter server is shared and different groups have been assigned to sub folders under the datacenter
This environment is 6.0u2. I have one datacenter and have named that in the config as well. The permissions config is very simple as this is a test lab. The user account is "administrator" from the root propagated down to all objects. Without specifying the resource pool name terraform is able to deploy to the cluster which is the parent object to the resource pool.
Is this related?? https://github.com/hashicorp/terraform/pull/4100
Yes does seem related to #4100 ! From my quick read seems like resource_pool does not currently work with clusters. If that's the case clearly a big omission. Outside of a lab I would say 99% of vSphere environments are a cluster.
cluster_name/Resources/resource_pool_name
In your case it would be:
resource_pool = "MacPro/Resources/Image_Lab"
@tommymalmqvist thanks!! I assume that we should add that to the docs?
Good idea, I'll add it as an example.
@tommymalmqvist cookie for u!! One thing I was thinking about is mentioning the command line VMware tool that the API provides. You want me to file an issue for doc improvements?
Sure, assign it to me.
Sorry, moved PR to https://github.com/hashicorp/terraform/issues/6198 this issue instead, fyi.
@trodemaster can we close this?? We will hold it open a couple more days!
Yes we can close this one. I agree that some additional doc examples would be very helpful. Do have to say that specifying the cluster and the constant value of "resources" seems redundant. My config already specified the cluster. Might be more elegant to require the cluster value and just create the full path from that.
@trodemaster I would like to follow the standard that govc / govmomi uses. We have multiple points, for instance network names that are not standardized.
That is only a thought, but keeping it the same syntax as what govc / govmomi uses just make sense.
Can I recruit you for some documentation awesomeness??
@jen20 @phinze can we close this issue??
@catsby please close pretty please, sugar on top ;)
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
cluster_name/Resources/resource_pool_name
In your case it would be:
resource_pool = "MacPro/Resources/Image_Lab"