GetResourcePool
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.
Example Usage
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",
})));
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc1")
pool = vsphere.get_resource_pool(datacenter_id=datacenter.id,
name="resource-pool-1")import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = pulumi.output(vsphere.getDatacenter({
name: "dc1",
}, { async: true }));
const pool = datacenter.apply(datacenter => vsphere.getResourcePool({
datacenterId: datacenter.id,
name: "resource-pool-1",
}, { async: true }));Specifying the root resource pool for a standalone host
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",
}));
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
pool = vsphere.get_resource_pool(datacenter_id=data["vsphere..Datacenter"]["dc"]["id"],
name="esxi1/Resources")import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const pool = vsphere_datacenter_dc.id.apply(id => vsphere.getResourcePool({
datacenterId: id,
name: "esxi1/Resources",
}, { async: true }));Using GetResourcePool
function getResourcePool(args: GetResourcePoolArgs, opts?: InvokeOptions): Promise<GetResourcePoolResult>function get_resource_pool(datacenter_id=None, name=None, opts=None)func LookupResourcePool(ctx *Context, args *LookupResourcePoolArgs, opts ...InvokeOption) (*LookupResourcePoolResult, error)Note: This function is named
LookupResourcePoolin the Go SDK.
public static class GetResourcePool {
public static Task<GetResourcePoolResult> InvokeAsync(GetResourcePoolArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Datacenter
Id string The managed object reference ID of the datacenter the resource pool is located in. This can be omitted if the search path used in
nameis an absolute path. For default datacenters, use the id attribute from an emptyvsphere..Datacenterdata source.- Name string
The name of the resource pool. This can be a name or path. This is required when using vCenter.
- Datacenter
Id string The managed object reference ID of the datacenter the resource pool is located in. This can be omitted if the search path used in
nameis an absolute path. For default datacenters, use the id attribute from an emptyvsphere..Datacenterdata source.- Name string
The name of the resource pool. This can be a name or path. This is required when using vCenter.
- datacenter
Id string The managed object reference ID of the datacenter the resource pool is located in. This can be omitted if the search path used in
nameis an absolute path. For default datacenters, use the id attribute from an emptyvsphere..Datacenterdata source.- name string
The name of the resource pool. This can be a name or path. This is required when using vCenter.
- datacenter_
id str The managed object reference ID of the datacenter the resource pool is located in. This can be omitted if the search path used in
nameis an absolute path. For default datacenters, use the id attribute from an emptyvsphere..Datacenterdata source.- name str
The name of the resource pool. This can be a name or path. This is required when using vCenter.
GetResourcePool Result
The following output properties are available:
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.