GetComputeCluster
The vsphere..ComputeCluster data source can be used to discover the ID of a
cluster in vSphere. This is useful to fetch the ID of a cluster that you want
to use for virtual machine placement via the
vsphere..VirtualMachine resource, allowing
you to specify the cluster’s root resource pool directly versus using the alias
available through the vsphere..ResourcePool
data source.
You may also wish to see the
vsphere..ComputeClusterresource for further details about clusters or how to work with them.
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 computeCluster = Output.Create(VSphere.GetComputeCluster.InvokeAsync(new VSphere.GetComputeClusterArgs
{
DatacenterId = data.Vsphere_datacenter.Dc.Id,
Name = "compute-cluster1",
}));
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc1")
compute_cluster = vsphere.get_compute_cluster(datacenter_id=data["vsphere..Datacenter"]["dc"]["id"],
name="compute-cluster1")import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = pulumi.output(vsphere.getDatacenter({
name: "dc1",
}, { async: true }));
const computeCluster = vsphere_datacenter_dc.id.apply(id => vsphere.getComputeCluster({
datacenterId: id,
name: "compute-cluster1",
}, { async: true }));Using GetComputeCluster
function getComputeCluster(args: GetComputeClusterArgs, opts?: InvokeOptions): Promise<GetComputeClusterResult>function get_compute_cluster(datacenter_id=None, name=None, opts=None)func LookupComputeCluster(ctx *Context, args *LookupComputeClusterArgs, opts ...InvokeOption) (*LookupComputeClusterResult, error)Note: This function is named
LookupComputeClusterin the Go SDK.
public static class GetComputeCluster {
public static Task<GetComputeClusterResult> InvokeAsync(GetComputeClusterArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Name string
The name or absolute path to the cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the cluster 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 or absolute path to the cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the cluster 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 or absolute path to the cluster.
- datacenter
Id string The managed object reference ID of the datacenter the cluster 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 or absolute path to the cluster.
- datacenter_
id str The managed object reference ID of the datacenter the cluster 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.
GetComputeCluster Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Pool stringId - Datacenter
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Pool stringId - Datacenter
Id string
- id string
The provider-assigned unique ID for this managed resource.
- name string
- resource
Pool stringId - datacenter
Id string
- id str
The provider-assigned unique ID for this managed resource.
- name str
- resource_
pool_ strid - datacenter_
id str
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.