@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
477 lines (476 loc) • 20.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `vsphere.DatastoreCluster` resource can be used to create and manage
* datastore clusters. This can be used to create groups of datastores with a
* shared management interface, allowing for resource control and load balancing
* through Storage DRS.
*
* For more information on vSphere datastore clusters and Storage DRS, see [this
* page][ref-vsphere-datastore-clusters].
*
* [ref-vsphere-datastore-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/creating-a-datastore-cluster.html
*
* > **NOTE:** This resource requires vCenter and is not available on direct ESXi
* connections.
*
* > **NOTE:** Storage DRS requires a vSphere Enterprise Plus license.
*
* ## Example Usage
*
* The following example sets up a datastore cluster and enables Storage DRS with
* the default settings. It then creates two NAS datastores using the
* `vsphere.NasDatastore` resource and assigns them to
* the datastore cluster.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const config = new pulumi.Config();
* const hosts = config.getObject<any>("hosts") || [
* "esxi-01.example.com",
* "esxi-02.example.com",
* "esxi-03.example.com",
* ];
* const datacenter = vsphere.getDatacenter({});
* const hostsGetHost = (new Array(hosts.length)).map((_, i) => i).map(__index => (vsphere.getHost({
* name: hosts[__index],
* datacenterId: _arg0_.id,
* })));
* const datastoreCluster = new vsphere.DatastoreCluster("datastore_cluster", {
* name: "datastore-cluster-test",
* datacenterId: datacenter.then(datacenter => datacenter.id),
* sdrsEnabled: true,
* });
* const datastore1 = new vsphere.NasDatastore("datastore1", {
* name: "datastore-test1",
* hostSystemIds: [esxiHosts.map(__item => __item.id)],
* datastoreClusterId: datastoreCluster.id,
* type: "NFS",
* remoteHosts: ["nfs"],
* remotePath: "/export/test1",
* });
* const datastore2 = new vsphere.NasDatastore("datastore2", {
* name: "datastore-test2",
* hostSystemIds: [esxiHosts.map(__item => __item.id)],
* datastoreClusterId: datastoreCluster.id,
* type: "NFS",
* remoteHosts: ["nfs"],
* remotePath: "/export/test2",
* });
* ```
*
* ## Import
*
* An existing datastore cluster can be imported into this resource
*
* via the path to the cluster, via the following command:
*
* [docs-import]: https://developer.hashicorp.com/terraform/cli/import
*
* ```sh
* $ pulumi import vsphere:index/datastoreCluster:DatastoreCluster datastore_cluster /dc1/datastore/ds-cluster
* ```
*
* The above would import the datastore cluster named `ds-cluster` that is located
*
* in the `dc1` datacenter.
*/
export declare class DatastoreCluster extends pulumi.CustomResource {
/**
* Get an existing DatastoreCluster resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatastoreClusterState, opts?: pulumi.CustomResourceOptions): DatastoreCluster;
/**
* Returns true if the given object is an instance of DatastoreCluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is DatastoreCluster;
/**
* A map of custom attribute ids to attribute
* value strings to set for the datastore cluster. See
* [here][docs-setting-custom-attributes] for a reference on how to set values
* for custom attributes.
*
* [docs-setting-custom-attributes]: /docs/providers/vsphere/r/custom_attribute.html#using-custom-attributes-in-a-supported-resource
*
* > **NOTE:** Custom attributes are unsupported on direct ESXi connections
* and require vCenter.
*/
readonly customAttributes: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The managed object ID of
* the datacenter to create the datastore cluster in. Forces a new resource if
* changed.
*/
readonly datacenterId: pulumi.Output<string>;
/**
* The relative path to a folder to put this datastore
* cluster in. This is a path relative to the datacenter you are deploying the
* datastore to. Example: for the `dc1` datacenter, and a provided `folder` of
* `foo/bar`, The provider will place a datastore cluster named
* `datastore-cluster-test` in a datastore folder located at
* `/dc1/datastore/foo/bar`, with the final inventory path being
* `/dc1/datastore/foo/bar/datastore-cluster-test`.
*/
readonly folder: pulumi.Output<string | undefined>;
/**
* The name of the datastore cluster.
*/
readonly name: pulumi.Output<string>;
/**
* Advanced configuration options for storage DRS.
*/
readonly sdrsAdvancedOptions: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The default automation level for all virtual machines in this storage cluster.
*/
readonly sdrsAutomationLevel: pulumi.Output<string | undefined>;
/**
* When true, storage DRS keeps VMDKs for individual VMs on the same datastore by default.
*/
readonly sdrsDefaultIntraVmAffinity: pulumi.Output<boolean | undefined>;
/**
* Enable Storage DRS for this datastore cluster.
* Default: `false`.
*/
readonly sdrsEnabled: pulumi.Output<boolean | undefined>;
/**
* The threshold, in GB, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
readonly sdrsFreeSpaceThreshold: pulumi.Output<number | undefined>;
/**
* The free space threshold to use. When set to utilization, drsSpaceUtilizationThreshold is used, and when set to freeSpace, drsFreeSpaceThreshold is used.
*/
readonly sdrsFreeSpaceThresholdMode: pulumi.Output<string | undefined>;
/**
* The threshold, in percent, of difference between space utilization in datastores before storage DRS makes decisions to balance the space.
*/
readonly sdrsFreeSpaceUtilizationDifference: pulumi.Output<number | undefined>;
/**
* Overrides the default automation settings when correcting I/O load imbalances.
*/
readonly sdrsIoBalanceAutomationLevel: pulumi.Output<string | undefined>;
/**
* The I/O latency threshold, in milliseconds, that storage DRS uses to make recommendations to move disks from this datastore.
*/
readonly sdrsIoLatencyThreshold: pulumi.Output<number | undefined>;
/**
* Enable I/O load balancing for this datastore cluster.
*/
readonly sdrsIoLoadBalanceEnabled: pulumi.Output<boolean | undefined>;
/**
* The difference between load in datastores in the cluster before storage DRS makes recommendations to balance the load.
*/
readonly sdrsIoLoadImbalanceThreshold: pulumi.Output<number | undefined>;
/**
* The threshold of reservable IOPS of all virtual machines on the datastore before storage DRS makes recommendations to move VMs off of a datastore.
*/
readonly sdrsIoReservableIopsThreshold: pulumi.Output<number | undefined>;
/**
* The threshold, in percent, of actual estimated performance of the datastore (in IOPS) that storage DRS uses to make recommendations to move VMs off of a datastore when the total reservable IOPS exceeds the threshold.
*/
readonly sdrsIoReservablePercentThreshold: pulumi.Output<number | undefined>;
/**
* The reservable IOPS threshold to use, percent in the event of automatic, or manual threshold in the event of manual.
*/
readonly sdrsIoReservableThresholdMode: pulumi.Output<string | undefined>;
/**
* The storage DRS poll interval, in minutes.
*/
readonly sdrsLoadBalanceInterval: pulumi.Output<number | undefined>;
/**
* Overrides the default automation settings when correcting storage and VM policy violations.
*/
readonly sdrsPolicyEnforcementAutomationLevel: pulumi.Output<string | undefined>;
/**
* Overrides the default automation settings when correcting affinity rule violations.
*/
readonly sdrsRuleEnforcementAutomationLevel: pulumi.Output<string | undefined>;
/**
* Overrides the default automation settings when correcting disk space imbalances.
*/
readonly sdrsSpaceBalanceAutomationLevel: pulumi.Output<string | undefined>;
/**
* The threshold, in percent of used space, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
readonly sdrsSpaceUtilizationThreshold: pulumi.Output<number | undefined>;
/**
* Overrides the default automation settings when generating recommendations for datastore evacuation.
*/
readonly sdrsVmEvacuationAutomationLevel: pulumi.Output<string | undefined>;
/**
* The IDs of any tags to attach to this resource.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Create a DatastoreCluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DatastoreClusterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DatastoreCluster resources.
*/
export interface DatastoreClusterState {
/**
* A map of custom attribute ids to attribute
* value strings to set for the datastore cluster. See
* [here][docs-setting-custom-attributes] for a reference on how to set values
* for custom attributes.
*
* [docs-setting-custom-attributes]: /docs/providers/vsphere/r/custom_attribute.html#using-custom-attributes-in-a-supported-resource
*
* > **NOTE:** Custom attributes are unsupported on direct ESXi connections
* and require vCenter.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The managed object ID of
* the datacenter to create the datastore cluster in. Forces a new resource if
* changed.
*/
datacenterId?: pulumi.Input<string>;
/**
* The relative path to a folder to put this datastore
* cluster in. This is a path relative to the datacenter you are deploying the
* datastore to. Example: for the `dc1` datacenter, and a provided `folder` of
* `foo/bar`, The provider will place a datastore cluster named
* `datastore-cluster-test` in a datastore folder located at
* `/dc1/datastore/foo/bar`, with the final inventory path being
* `/dc1/datastore/foo/bar/datastore-cluster-test`.
*/
folder?: pulumi.Input<string>;
/**
* The name of the datastore cluster.
*/
name?: pulumi.Input<string>;
/**
* Advanced configuration options for storage DRS.
*/
sdrsAdvancedOptions?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The default automation level for all virtual machines in this storage cluster.
*/
sdrsAutomationLevel?: pulumi.Input<string>;
/**
* When true, storage DRS keeps VMDKs for individual VMs on the same datastore by default.
*/
sdrsDefaultIntraVmAffinity?: pulumi.Input<boolean>;
/**
* Enable Storage DRS for this datastore cluster.
* Default: `false`.
*/
sdrsEnabled?: pulumi.Input<boolean>;
/**
* The threshold, in GB, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
sdrsFreeSpaceThreshold?: pulumi.Input<number>;
/**
* The free space threshold to use. When set to utilization, drsSpaceUtilizationThreshold is used, and when set to freeSpace, drsFreeSpaceThreshold is used.
*/
sdrsFreeSpaceThresholdMode?: pulumi.Input<string>;
/**
* The threshold, in percent, of difference between space utilization in datastores before storage DRS makes decisions to balance the space.
*/
sdrsFreeSpaceUtilizationDifference?: pulumi.Input<number>;
/**
* Overrides the default automation settings when correcting I/O load imbalances.
*/
sdrsIoBalanceAutomationLevel?: pulumi.Input<string>;
/**
* The I/O latency threshold, in milliseconds, that storage DRS uses to make recommendations to move disks from this datastore.
*/
sdrsIoLatencyThreshold?: pulumi.Input<number>;
/**
* Enable I/O load balancing for this datastore cluster.
*/
sdrsIoLoadBalanceEnabled?: pulumi.Input<boolean>;
/**
* The difference between load in datastores in the cluster before storage DRS makes recommendations to balance the load.
*/
sdrsIoLoadImbalanceThreshold?: pulumi.Input<number>;
/**
* The threshold of reservable IOPS of all virtual machines on the datastore before storage DRS makes recommendations to move VMs off of a datastore.
*/
sdrsIoReservableIopsThreshold?: pulumi.Input<number>;
/**
* The threshold, in percent, of actual estimated performance of the datastore (in IOPS) that storage DRS uses to make recommendations to move VMs off of a datastore when the total reservable IOPS exceeds the threshold.
*/
sdrsIoReservablePercentThreshold?: pulumi.Input<number>;
/**
* The reservable IOPS threshold to use, percent in the event of automatic, or manual threshold in the event of manual.
*/
sdrsIoReservableThresholdMode?: pulumi.Input<string>;
/**
* The storage DRS poll interval, in minutes.
*/
sdrsLoadBalanceInterval?: pulumi.Input<number>;
/**
* Overrides the default automation settings when correcting storage and VM policy violations.
*/
sdrsPolicyEnforcementAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default automation settings when correcting affinity rule violations.
*/
sdrsRuleEnforcementAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default automation settings when correcting disk space imbalances.
*/
sdrsSpaceBalanceAutomationLevel?: pulumi.Input<string>;
/**
* The threshold, in percent of used space, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
sdrsSpaceUtilizationThreshold?: pulumi.Input<number>;
/**
* Overrides the default automation settings when generating recommendations for datastore evacuation.
*/
sdrsVmEvacuationAutomationLevel?: pulumi.Input<string>;
/**
* The IDs of any tags to attach to this resource.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a DatastoreCluster resource.
*/
export interface DatastoreClusterArgs {
/**
* A map of custom attribute ids to attribute
* value strings to set for the datastore cluster. See
* [here][docs-setting-custom-attributes] for a reference on how to set values
* for custom attributes.
*
* [docs-setting-custom-attributes]: /docs/providers/vsphere/r/custom_attribute.html#using-custom-attributes-in-a-supported-resource
*
* > **NOTE:** Custom attributes are unsupported on direct ESXi connections
* and require vCenter.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The managed object ID of
* the datacenter to create the datastore cluster in. Forces a new resource if
* changed.
*/
datacenterId: pulumi.Input<string>;
/**
* The relative path to a folder to put this datastore
* cluster in. This is a path relative to the datacenter you are deploying the
* datastore to. Example: for the `dc1` datacenter, and a provided `folder` of
* `foo/bar`, The provider will place a datastore cluster named
* `datastore-cluster-test` in a datastore folder located at
* `/dc1/datastore/foo/bar`, with the final inventory path being
* `/dc1/datastore/foo/bar/datastore-cluster-test`.
*/
folder?: pulumi.Input<string>;
/**
* The name of the datastore cluster.
*/
name?: pulumi.Input<string>;
/**
* Advanced configuration options for storage DRS.
*/
sdrsAdvancedOptions?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The default automation level for all virtual machines in this storage cluster.
*/
sdrsAutomationLevel?: pulumi.Input<string>;
/**
* When true, storage DRS keeps VMDKs for individual VMs on the same datastore by default.
*/
sdrsDefaultIntraVmAffinity?: pulumi.Input<boolean>;
/**
* Enable Storage DRS for this datastore cluster.
* Default: `false`.
*/
sdrsEnabled?: pulumi.Input<boolean>;
/**
* The threshold, in GB, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
sdrsFreeSpaceThreshold?: pulumi.Input<number>;
/**
* The free space threshold to use. When set to utilization, drsSpaceUtilizationThreshold is used, and when set to freeSpace, drsFreeSpaceThreshold is used.
*/
sdrsFreeSpaceThresholdMode?: pulumi.Input<string>;
/**
* The threshold, in percent, of difference between space utilization in datastores before storage DRS makes decisions to balance the space.
*/
sdrsFreeSpaceUtilizationDifference?: pulumi.Input<number>;
/**
* Overrides the default automation settings when correcting I/O load imbalances.
*/
sdrsIoBalanceAutomationLevel?: pulumi.Input<string>;
/**
* The I/O latency threshold, in milliseconds, that storage DRS uses to make recommendations to move disks from this datastore.
*/
sdrsIoLatencyThreshold?: pulumi.Input<number>;
/**
* Enable I/O load balancing for this datastore cluster.
*/
sdrsIoLoadBalanceEnabled?: pulumi.Input<boolean>;
/**
* The difference between load in datastores in the cluster before storage DRS makes recommendations to balance the load.
*/
sdrsIoLoadImbalanceThreshold?: pulumi.Input<number>;
/**
* The threshold of reservable IOPS of all virtual machines on the datastore before storage DRS makes recommendations to move VMs off of a datastore.
*/
sdrsIoReservableIopsThreshold?: pulumi.Input<number>;
/**
* The threshold, in percent, of actual estimated performance of the datastore (in IOPS) that storage DRS uses to make recommendations to move VMs off of a datastore when the total reservable IOPS exceeds the threshold.
*/
sdrsIoReservablePercentThreshold?: pulumi.Input<number>;
/**
* The reservable IOPS threshold to use, percent in the event of automatic, or manual threshold in the event of manual.
*/
sdrsIoReservableThresholdMode?: pulumi.Input<string>;
/**
* The storage DRS poll interval, in minutes.
*/
sdrsLoadBalanceInterval?: pulumi.Input<number>;
/**
* Overrides the default automation settings when correcting storage and VM policy violations.
*/
sdrsPolicyEnforcementAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default automation settings when correcting affinity rule violations.
*/
sdrsRuleEnforcementAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default automation settings when correcting disk space imbalances.
*/
sdrsSpaceBalanceAutomationLevel?: pulumi.Input<string>;
/**
* The threshold, in percent of used space, that storage DRS uses to make decisions to migrate VMs out of a datastore.
*/
sdrsSpaceUtilizationThreshold?: pulumi.Input<number>;
/**
* Overrides the default automation settings when generating recommendations for datastore evacuation.
*/
sdrsVmEvacuationAutomationLevel?: pulumi.Input<string>;
/**
* The IDs of any tags to attach to this resource.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
}