@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
212 lines (211 loc) • 8.48 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `vsphere.StorageDrsVmOverride` resource can be used to add a Storage DRS
* override to a datastore cluster for a specific virtual machine. With this
* resource, one can enable or disable Storage DRS, and control the automation
* level and disk affinity for a single virtual machine without affecting the rest
* of the datastore cluster.
*
* 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
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const datastoreCluster = datacenter.then(datacenter => vsphere.getDatastoreCluster({
* name: "datastore-cluster1",
* datacenterId: datacenter.id,
* }));
* const memberDatastore = datacenter.then(datacenter => vsphere.getDatastore({
* name: "datastore-cluster1-member1",
* datacenterId: datacenter.id,
* }));
* const pool = datacenter.then(datacenter => vsphere.getResourcePool({
* name: "cluster1/Resources",
* datacenterId: datacenter.id,
* }));
* const network = datacenter.then(datacenter => vsphere.getNetwork({
* name: "public",
* datacenterId: datacenter.id,
* }));
* const vm = new vsphere.VirtualMachine("vm", {
* name: "test",
* resourcePoolId: pool.then(pool => pool.id),
* datastoreId: memberDatastore.then(memberDatastore => memberDatastore.id),
* numCpus: 2,
* memory: 1024,
* guestId: "otherLinux64Guest",
* networkInterfaces: [{
* networkId: network.then(network => network.id),
* }],
* disks: [{
* label: "disk0",
* size: 20,
* }],
* });
* const drsVmOverride = new vsphere.StorageDrsVmOverride("drs_vm_override", {
* datastoreClusterId: datastoreCluster.then(datastoreCluster => datastoreCluster.id),
* virtualMachineId: vm.id,
* sdrsEnabled: "false",
* });
* ```
*
* ## Import
*
* An existing override can be imported into this resource by
*
* supplying both the path to the datastore cluster and the path to the virtual
*
* machine to `pulumi import`. If no override exists, an error will be given.
*
* An example is below:
*
* [docs-import]: https://developer.hashicorp.com/terraform/cli/import
*
* ```sh
* $ pulumi import vsphere:index/storageDrsVmOverride:StorageDrsVmOverride drs_vm_override \
* ```
*
* '{"datastore_cluster_path": "/dc1/datastore/ds-cluster", \
*
* "virtual_machine_path": "/dc1/vm/srv1"}'
*/
export declare class StorageDrsVmOverride extends pulumi.CustomResource {
/**
* Get an existing StorageDrsVmOverride 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?: StorageDrsVmOverrideState, opts?: pulumi.CustomResourceOptions): StorageDrsVmOverride;
/**
* Returns true if the given object is an instance of StorageDrsVmOverride. 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 StorageDrsVmOverride;
/**
* The managed object reference
* ID of the datastore cluster to put the override in.
* Forces a new resource if changed.
*/
readonly datastoreClusterId: pulumi.Output<string>;
/**
* Overrides any Storage DRS automation
* levels for this virtual machine. Can be one of `automated` or `manual`. When
* not specified, the datastore cluster's settings are used according to the
* specific SDRS subsystem.
*/
readonly sdrsAutomationLevel: pulumi.Output<string | undefined>;
/**
* Overrides the default Storage DRS setting for
* this virtual machine. When not specified, the datastore cluster setting is
* used.
*/
readonly sdrsEnabled: pulumi.Output<string | undefined>;
/**
* Overrides the intra-VM affinity setting
* for this virtual machine. When `true`, all disks for this virtual machine
* will be kept on the same datastore. When `false`, Storage DRS may locate
* individual disks on different datastores if it helps satisfy cluster
* requirements. When not specified, the datastore cluster's settings are used.
*/
readonly sdrsIntraVmAffinity: pulumi.Output<string | undefined>;
/**
* The UUID of the virtual machine to create
* the override for. Forces a new resource if changed.
*/
readonly virtualMachineId: pulumi.Output<string>;
/**
* Create a StorageDrsVmOverride 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: StorageDrsVmOverrideArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering StorageDrsVmOverride resources.
*/
export interface StorageDrsVmOverrideState {
/**
* The managed object reference
* ID of the datastore cluster to put the override in.
* Forces a new resource if changed.
*/
datastoreClusterId?: pulumi.Input<string>;
/**
* Overrides any Storage DRS automation
* levels for this virtual machine. Can be one of `automated` or `manual`. When
* not specified, the datastore cluster's settings are used according to the
* specific SDRS subsystem.
*/
sdrsAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default Storage DRS setting for
* this virtual machine. When not specified, the datastore cluster setting is
* used.
*/
sdrsEnabled?: pulumi.Input<string>;
/**
* Overrides the intra-VM affinity setting
* for this virtual machine. When `true`, all disks for this virtual machine
* will be kept on the same datastore. When `false`, Storage DRS may locate
* individual disks on different datastores if it helps satisfy cluster
* requirements. When not specified, the datastore cluster's settings are used.
*/
sdrsIntraVmAffinity?: pulumi.Input<string>;
/**
* The UUID of the virtual machine to create
* the override for. Forces a new resource if changed.
*/
virtualMachineId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a StorageDrsVmOverride resource.
*/
export interface StorageDrsVmOverrideArgs {
/**
* The managed object reference
* ID of the datastore cluster to put the override in.
* Forces a new resource if changed.
*/
datastoreClusterId: pulumi.Input<string>;
/**
* Overrides any Storage DRS automation
* levels for this virtual machine. Can be one of `automated` or `manual`. When
* not specified, the datastore cluster's settings are used according to the
* specific SDRS subsystem.
*/
sdrsAutomationLevel?: pulumi.Input<string>;
/**
* Overrides the default Storage DRS setting for
* this virtual machine. When not specified, the datastore cluster setting is
* used.
*/
sdrsEnabled?: pulumi.Input<string>;
/**
* Overrides the intra-VM affinity setting
* for this virtual machine. When `true`, all disks for this virtual machine
* will be kept on the same datastore. When `false`, Storage DRS may locate
* individual disks on different datastores if it helps satisfy cluster
* requirements. When not specified, the datastore cluster's settings are used.
*/
sdrsIntraVmAffinity?: pulumi.Input<string>;
/**
* The UUID of the virtual machine to create
* the override for. Forces a new resource if changed.
*/
virtualMachineId: pulumi.Input<string>;
}