GetDatastoreCluster
The vsphere..DatastoreCluster data source can be used to discover the ID of a
datastore cluster in vSphere. This is useful to fetch the ID of a datastore
cluster that you want to use to assign datastores to using the
vsphere..NasDatastore or
vsphere..VmfsDatastore resources, or 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 datastoreCluster = Output.Create(VSphere.GetDatastoreCluster.InvokeAsync(new VSphere.GetDatastoreClusterArgs
{
DatacenterId = data.Vsphere_datacenter.Dc.Id,
Name = "datastore-cluster1",
}));
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc1")
datastore_cluster = vsphere.get_datastore_cluster(datacenter_id=data["vsphere..Datacenter"]["dc"]["id"],
name="datastore-cluster1")import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = pulumi.output(vsphere.getDatacenter({
name: "dc1",
}, { async: true }));
const datastoreCluster = vsphere_datacenter_dc.id.apply(id => vsphere.getDatastoreCluster({
datacenterId: id,
name: "datastore-cluster1",
}, { async: true }));Using GetDatastoreCluster
function getDatastoreCluster(args: GetDatastoreClusterArgs, opts?: InvokeOptions): Promise<GetDatastoreClusterResult>function get_datastore_cluster(datacenter_id=None, name=None, opts=None)func LookupDatastoreCluster(ctx *Context, args *LookupDatastoreClusterArgs, opts ...InvokeOption) (*LookupDatastoreClusterResult, error)Note: This function is named
LookupDatastoreClusterin the Go SDK.
public static class GetDatastoreCluster {
public static Task<GetDatastoreClusterResult> InvokeAsync(GetDatastoreClusterArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Name string
The name or absolute path to the datastore cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the datastore 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 datastore cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the datastore 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 datastore cluster.
- datacenter
Id string The managed object reference ID of the datacenter the datastore 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 datastore cluster.
- datacenter_
id str The managed object reference ID of the datacenter the datastore 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.
GetDatastoreCluster 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.