Class GetResourcePool
Inheritance
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public static class GetResourcePool
Methods
View SourceInvokeAsync(GetResourcePoolArgs, InvokeOptions)
The vsphere..ResourcePool data source can be used to discover the ID of a
resource pool in vSphere. This is useful to fetch the ID of a resource pool
that you want to use to create virtual machines in using the
vsphere..VirtualMachine resource.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var datacenter = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = "dc1",
}));
var pool = datacenter.Apply(datacenter => Output.Create(VSphere.GetResourcePool.InvokeAsync(new VSphere.GetResourcePoolArgs
{
DatacenterId = datacenter.Id,
Name = "resource-pool-1",
})));
}
}
{{% /example %}} {{% example %}}
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..ComputeClusterdata 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:
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var pool = Output.Create(VSphere.GetResourcePool.InvokeAsync(new VSphere.GetResourcePoolArgs
{
DatacenterId = data.Vsphere_datacenter.Dc.Id,
Name = "esxi1/Resources",
}));
}
}
For more information on the root resource pool, see Managing Resource Pools in the vSphere documentation.
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetResourcePoolResult> InvokeAsync(GetResourcePoolArgs args = null, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetResourcePoolArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetResourcePoolResult> |