Package @pulumi/vsphere

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-vsphere repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-vsphere repo.

var vsphere = require("@pulumi/vsphere");
import * as vsphere from "@pulumi/vsphere";

Index ▾

computeCluster.ts computeClusterHostGroup.ts computeClusterVmAffinityRule.ts computeClusterVmAntiAffinityRule.ts computeClusterVmDependencyRule.ts computeClusterVmGroup.ts computeClusterVmHostRule.ts customAttribute.ts datacenter.ts datastoreCluster.ts datastoreClusterVmAntiAffinityRule.ts distributedPortGroup.ts distributedVirtualSwitch.ts dpmHostOverride.ts drsVmOverride.ts file.ts folder.ts getComputeCluster.ts getCustomAttribute.ts getDatacenter.ts getDatastore.ts getDatastoreCluster.ts getDistributedVirtualSwitch.ts getFolder.ts getHost.ts getNetwork.ts getResourcePool.ts getTag.ts getTagCategory.ts getVappContainer.ts getVirtualMachine.ts getVmfsDisks.ts haVmOverride.ts hostPortGroup.ts hostVirtualSwitch.ts license.ts nasDatastore.ts provider.ts resourcePool.ts storageDrsVmOverride.ts tag.ts tagCategory.ts utilities.ts vappContainer.ts vappEntity.ts virtualDisk.ts virtualMachine.ts virtualMachineSnapshot.ts vmfsDatastore.ts

Modules ▾

class ComputeCluster

extends CustomResource

constructor

new ComputeCluster(name: string, args: ComputeClusterArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeCluster resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterState, opts?: pulumi.CustomResourceOptions): ComputeCluster

Get an existing ComputeCluster resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeCluster. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

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.

property datacenterId

public datacenterId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the cluster in. Forces a new resource if changed.

property dpmAutomationLevel

public dpmAutomationLevel: pulumi.Output<string | undefined>;

The automation level for host power operations in this cluster. Can be one of manual or automated. Default: manual.

property dpmEnabled

public dpmEnabled: pulumi.Output<boolean | undefined>;

Enable DPM support for DRS in this cluster. Requires drs_enabled to be true in order to be effective. Default: false.

property dpmThreshold

public dpmThreshold: pulumi.Output<number | undefined>;

A value between 1 and 5 indicating the threshold of load within the cluster that influences host power operations. This affects both power on and power off operations - a lower setting will tolerate more of a surplus/deficit than a higher setting. Default: 3.

property drsAdvancedOptions

public drsAdvancedOptions: pulumi.Output<{[key: string]: any} | undefined>;

A key/value map that specifies advanced options for DRS and DPM.

property drsAutomationLevel

public drsAutomationLevel: pulumi.Output<string | undefined>;

The default automation level for all virtual machines in this cluster. Can be one of manual, partiallyAutomated, or fullyAutomated. Default: manual.

property drsEnablePredictiveDrs

public drsEnablePredictiveDrs: pulumi.Output<boolean | undefined>;

When true, enables DRS to use data from [vRealize Operations Manager][ref-vsphere-vro] to make proactive DRS recommendations. *

property drsEnableVmOverrides

public drsEnableVmOverrides: pulumi.Output<boolean | undefined>;

Allow individual DRS overrides to be set for virtual machines in the cluster. Default: true.

property drsEnabled

public drsEnabled: pulumi.Output<boolean | undefined>;

Enable DRS for this cluster. Default: false.

property drsMigrationThreshold

public drsMigrationThreshold: pulumi.Output<number | undefined>;

A value between 1 and 5 indicating the threshold of imbalance tolerated between hosts. A lower setting will tolerate more imbalance while a higher setting will tolerate less. Default: 3.

property folder

public folder: pulumi.Output<string | undefined>;

The name of the folder to locate the cluster in.

property forceEvacuateOnDestroy

public forceEvacuateOnDestroy: pulumi.Output<boolean | undefined>;

Force removal of all hosts in the cluster during destroy and make them standalone hosts. Use of this flag mainly exists for testing and is not recommended in normal use.

property haAdmissionControlFailoverHostSystemIds

public haAdmissionControlFailoverHostSystemIds: pulumi.Output<string[] | undefined>;

Defines the [managed object IDs][docs-about-morefs] of hosts to use as dedicated failover hosts. These hosts are kept as available as possible - admission control will block access to the host, and DRS will ignore the host when making recommendations.

property haAdmissionControlHostFailureTolerance

public haAdmissionControlHostFailureTolerance: pulumi.Output<number | undefined>;

The maximum number of failed hosts that admission control tolerates when making decisions on whether to permit virtual machine operations. The maximum is one less than the number of hosts in the cluster. Default: 1. *

property haAdmissionControlPerformanceTolerance

public haAdmissionControlPerformanceTolerance: pulumi.Output<number | undefined>;

The percentage of resource reduction that a cluster of virtual machines can tolerate in case of a failover. A value of 0 produces warnings only, whereas a value of 100 disables the setting. Default: 100 (disabled).

property haAdmissionControlPolicy

public haAdmissionControlPolicy: pulumi.Output<string | undefined>;

The type of admission control policy to use with vSphere HA. Can be one of resourcePercentage, slotPolicy, failoverHosts, or disabled. Default: resourcePercentage.

property haAdmissionControlResourcePercentageAutoCompute

public haAdmissionControlResourcePercentageAutoCompute: pulumi.Output<boolean | undefined>;

Automatically determine available resource percentages by subtracting the average number of host resources represented by the ha_admission_control_host_failure_tolerance setting from the total amount of resources in the cluster. Disable to supply user-defined values. Default: true. *

property haAdmissionControlResourcePercentageCpu

public haAdmissionControlResourcePercentageCpu: pulumi.Output<number | undefined>;

Controls the user-defined percentage of CPU resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlResourcePercentageMemory

public haAdmissionControlResourcePercentageMemory: pulumi.Output<number | undefined>;

Controls the user-defined percentage of memory resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlSlotPolicyExplicitCpu

public haAdmissionControlSlotPolicyExplicitCpu: pulumi.Output<number | undefined>;

Controls the user-defined CPU slot size, in MHz. Default: 32.

property haAdmissionControlSlotPolicyExplicitMemory

public haAdmissionControlSlotPolicyExplicitMemory: pulumi.Output<number | undefined>;

Controls the user-defined memory slot size, in MB. Default: 100.

property haAdmissionControlSlotPolicyUseExplicitSize

public haAdmissionControlSlotPolicyUseExplicitSize: pulumi.Output<boolean | undefined>;

Controls whether or not you wish to supply explicit values to CPU and memory slot sizes. The default is false, which tells vSphere to gather a automatic average based on all powered-on virtual machines currently in the cluster.

property haAdvancedOptions

public haAdvancedOptions: pulumi.Output<{[key: string]: any} | undefined>;

A key/value map that specifies advanced options for vSphere HA.

property haDatastoreApdRecoveryAction

public haDatastoreApdRecoveryAction: pulumi.Output<string | undefined>;

Controls the action to take on virtual machines if an APD status on an affected datastore clears in the middle of an APD event. Can be one of none or reset. Default: none. *

property haDatastoreApdResponse

public haDatastoreApdResponse: pulumi.Output<string | undefined>;

Controls the action to take on virtual machines when the cluster has detected loss to all paths to a relevant datastore. Can be one of disabled, warning, restartConservative, or restartAggressive. Default: disabled. *

property haDatastoreApdResponseDelay

public haDatastoreApdResponseDelay: pulumi.Output<number | undefined>;

Controls the delay in minutes to wait after an APD timeout event to execute the response action defined in ha_datastore_apd_response. Default: 3 minutes. *

property haDatastorePdlResponse

public haDatastorePdlResponse: pulumi.Output<string | undefined>;

Controls the action to take on virtual machines when the cluster has detected a permanent device loss to a relevant datastore. Can be one of disabled, warning, or restartAggressive. Default: disabled. *

property haEnabled

public haEnabled: pulumi.Output<boolean | undefined>;

Enable vSphere HA for this cluster. Default: false.

property haHeartbeatDatastoreIds

public haHeartbeatDatastoreIds: pulumi.Output<string[] | undefined>;

The list of managed object IDs for preferred datastores to use for HA heartbeating. This setting is only useful when ha_heartbeat_datastore_policy is set to either userSelectedDs or allFeasibleDsWithUserPreference.

property haHeartbeatDatastorePolicy

public haHeartbeatDatastorePolicy: pulumi.Output<string | undefined>;

The selection policy for HA heartbeat datastores. Can be one of allFeasibleDs, userSelectedDs, or allFeasibleDsWithUserPreference. Default: allFeasibleDsWithUserPreference.

property haHostIsolationResponse

public haHostIsolationResponse: pulumi.Output<string | undefined>;

The action to take on virtual machines when a host has detected that it has been isolated from the rest of the cluster. Can be one of none, powerOff, or shutdown. Default: none.

property haHostMonitoring

public haHostMonitoring: pulumi.Output<string | undefined>;

Global setting that controls whether vSphere HA remediates virtual machines on host failure. Can be one of enabled or disabled. Default: enabled.

property haVmComponentProtection

public haVmComponentProtection: pulumi.Output<string | undefined>;

Controls vSphere VM component protection for virtual machines in this cluster. Can be one of enabled or disabled. Default: enabled. *

property haVmDependencyRestartCondition

public haVmDependencyRestartCondition: pulumi.Output<string | undefined>;

The condition used to determine whether or not virtual machines in a certain restart priority class are online, allowing HA to move on to restarting virtual machines on the next priority. Can be one of none, poweredOn, guestHbStatusGreen, or appHbStatusGreen. The default is none, which means that a virtual machine is considered ready immediately after a host is found to start it on. *

property haVmFailureInterval

public haVmFailureInterval: pulumi.Output<number | undefined>;

If a heartbeat from a virtual machine is not received within this configured interval, the virtual machine is marked as failed. The value is in seconds. Default: 30.

property haVmMaximumFailureWindow

public haVmMaximumFailureWindow: pulumi.Output<number | undefined>;

The length of the reset window in which ha_vm_maximum_resets can operate. When this window expires, no more resets are attempted regardless of the setting configured in ha_vm_maximum_resets. -1 means no window, meaning an unlimited reset time is allotted. The value is specified in seconds. Default: -1 (no window).

property haVmMaximumResets

public haVmMaximumResets: pulumi.Output<number | undefined>;

The maximum number of resets that HA will perform to a virtual machine when responding to a failure event. Default: 3

property haVmMinimumUptime

public haVmMinimumUptime: pulumi.Output<number | undefined>;

The time, in seconds, that HA waits after powering on a virtual machine before monitoring for heartbeats. Default: 120 (2 minutes).

property haVmMonitoring

public haVmMonitoring: pulumi.Output<string | undefined>;

The type of virtual machine monitoring to use when HA is enabled in the cluster. Can be one of vmMonitoringDisabled, vmMonitoringOnly, or vmAndAppMonitoring. Default: vmMonitoringDisabled.

property haVmRestartAdditionalDelay

public haVmRestartAdditionalDelay: pulumi.Output<number | undefined>;

Additional delay in seconds after ready condition is met. A VM is considered ready at this point. Default: 0 (no delay). *

property haVmRestartPriority

public haVmRestartPriority: pulumi.Output<string | undefined>;

The default restart priority for affected virtual machines when vSphere detects a host failure. Can be one of lowest, low, medium, high, or highest. Default: medium.

property haVmRestartTimeout

public haVmRestartTimeout: pulumi.Output<number | undefined>;

The maximum time, in seconds, that vSphere HA will wait for virtual machines in one priority to be ready before proceeding with the next priority. Default: 600 (10 minutes). *

property hostClusterExitTimeout

public hostClusterExitTimeout: pulumi.Output<number | undefined>;

The timeout for each host maintenance mode operation when removing hosts from a cluster. The value is specified in seconds. Default: 3600 (1 hour).

property hostSystemIds

public hostSystemIds: pulumi.Output<string[] | undefined>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the cluster.

property proactiveHaAutomationLevel

public proactiveHaAutomationLevel: pulumi.Output<string | undefined>;

Determines how the host quarantine, maintenance mode, or virtual machine migration recommendations made by proactive HA are to be handled. Can be one of Automated or Manual. Default: Manual. *

property proactiveHaEnabled

public proactiveHaEnabled: pulumi.Output<boolean | undefined>;

Enables Proactive HA. Default: false. *

property proactiveHaModerateRemediation

public proactiveHaModerateRemediation: pulumi.Output<string | undefined>;

The configured remediation for moderately degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to MaintenanceMode when proactive_ha_severe_remediation is set to QuarantineMode. Default: QuarantineMode. *

property proactiveHaProviderIds

public proactiveHaProviderIds: pulumi.Output<string[] | undefined>;

The list of IDs for health update providers configured for this cluster. *

property proactiveHaSevereRemediation

public proactiveHaSevereRemediation: pulumi.Output<string | undefined>;

The configured remediation for severely degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to QuarantineMode when proactive_ha_moderate_remediation is set to MaintenanceMode. Default: QuarantineMode. *

property resourcePoolId

public resourcePoolId: pulumi.Output<string>;

The managed object ID of the cluster’s root resource pool.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ComputeClusterHostGroup

extends CustomResource

The vsphere_compute_cluster_host_group resource can be used to manage groups of hosts in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

This resource mainly serves as an input to the vsphere_compute_cluster_vm_host_rule resource - see the documentation for that resource for further details on how to use host groups.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below is the exact same configuration as the example in the vsphere_compute_cluster resource, but in addition, it creates a host group with the same hosts that get put into the cluster.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const datacenter = config.get("datacenter") || "dc1";
const hosts = config.get("hosts") || [
    "esxi1",
    "esxi2",
    "esxi3",
];

const dc = pulumi.output(vsphere.getDatacenter({
    name: datacenter,
}));
const hostsHost: Output<vsphere.GETHOSTResult>[] = [];
for (let i = 0; i < hosts.length; i++) {
    hostsHost.push(vsphere.getHost);
%!(EXTRA string=dc.apply(dc => vsphere.getHost({
        datacenterId: dc.id,
        name: hosts[i],
    })))}
const computeCluster = new vsphere.ComputeCluster("compute_cluster", {
    datacenterId: dc.id,
    drsAutomationLevel: "fullyAutomated",
    drsEnabled: true,
    haEnabled: true,
    hostSystemIds: hostsHost.map(v => v.id),
});
const clusterHostGroup = new vsphere.ComputeClusterHostGroup("cluster_host_group", {
    computeClusterId: computeCluster.id,
    hostSystemIds: hostsHost.map(v => v.id),
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_host_group.html.markdown.

constructor

new ComputeClusterHostGroup(name: string, args: ComputeClusterHostGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterHostGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterHostGroupState, opts?: pulumi.CustomResourceOptions): ComputeClusterHostGroup

Get an existing ComputeClusterHostGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterHostGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property hostSystemIds

public hostSystemIds: pulumi.Output<string[] | undefined>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the host group. This must be unique in the cluster. Forces a new resource if changed.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ComputeClusterVmAffinityRule

extends CustomResource

The vsphere_compute_cluster_vm_affinity_rule resource can be used to manage VM affinity rules in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

This rule can be used to tell a set to virtual machines to run together on a single host within a cluster. When configured, DRS will make a best effort to ensure that the virtual machines run on the same host, or prevent any operation that would keep that from happening, depending on the value of the mandatory flag.

Keep in mind that this rule can only be used to tell VMs to run together on a non-specific host - it can’t be used to pin VMs to a host. For that, see the vsphere_compute_cluster_vm_host_rule resource.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below creates two virtual machines in a cluster using the vsphere_virtual_machine resource, creating the virtual machines in the cluster looked up by the vsphere_compute_cluster data source. It then creates an affinity rule for these two virtual machines, ensuring they will run on the same host whenever possible.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm: vsphere.VirtualMachine[] = [];
for (let i = 0; i < 2; i++) {
    vm.push(new vsphere.VirtualMachine(`vm-${i}`, {
        datastoreId: datastore.id,
        disks: [{
            label: "disk0",
            size: 20,
        }],
        guestId: "other3xLinux64Guest",
        memory: 2048,
        networkInterfaces: [{
            networkId: network.id,
        }],
        numCpus: 2,
        resourcePoolId: cluster.resourcePoolId,
    }));
}
const clusterVmAffinityRule = new vsphere.ComputeClusterVmAffinityRule("cluster_vm_affinity_rule", {
    computeClusterId: cluster.id,
    virtualMachineIds: vm.map(v => v.id),
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_vm_affinity_rule.html.markdown.

constructor

new ComputeClusterVmAffinityRule(name: string, args: ComputeClusterVmAffinityRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterVmAffinityRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterVmAffinityRuleState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmAffinityRule

Get an existing ComputeClusterVmAffinityRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterVmAffinityRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Enable this rule in the cluster. Default: true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mandatory

public mandatory: pulumi.Output<boolean | undefined>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

public name: pulumi.Output<string>;

The name of the rule. This must be unique in the cluster.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineIds

public virtualMachineIds: pulumi.Output<string[]>;

The UUIDs of the virtual machines to run on the same host together.

class ComputeClusterVmAntiAffinityRule

extends CustomResource

The vsphere_compute_cluster_vm_anti_affinity_rule resource can be used to manage VM anti-affinity rules in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

This rule can be used to tell a set to virtual machines to run on different hosts within a cluster, useful for preventing single points of failure in application cluster scenarios. When configured, DRS will make a best effort to ensure that the virtual machines run on different hosts, or prevent any operation that would keep that from happening, depending on the value of the mandatory flag.

Keep in mind that this rule can only be used to tell VMs to run separately on non-specific hosts - specific hosts cannot be specified with this rule. For that, see the vsphere_compute_cluster_vm_host_rule resource.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below creates two virtual machines in a cluster using the vsphere_virtual_machine resource, creating the virtual machines in the cluster looked up by the vsphere_compute_cluster data source. It then creates an anti-affinity rule for these two virtual machines, ensuring they will run on different hosts whenever possible.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm: vsphere.VirtualMachine[] = [];
for (let i = 0; i < 2; i++) {
    vm.push(new vsphere.VirtualMachine(`vm-${i}`, {
        datastoreId: datastore.id,
        disks: [{
            label: "disk0",
            size: 20,
        }],
        guestId: "other3xLinux64Guest",
        memory: 2048,
        networkInterfaces: [{
            networkId: network.id,
        }],
        numCpus: 2,
        resourcePoolId: cluster.resourcePoolId,
    }));
}
const clusterVmAntiAffinityRule = new vsphere.ComputeClusterVmAntiAffinityRule("cluster_vm_anti_affinity_rule", {
    computeClusterId: cluster.id,
    virtualMachineIds: vm.map(v => v.id),
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_vm_anti_affinity_rule.html.markdown.

constructor

new ComputeClusterVmAntiAffinityRule(name: string, args: ComputeClusterVmAntiAffinityRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterVmAntiAffinityRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterVmAntiAffinityRuleState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmAntiAffinityRule

Get an existing ComputeClusterVmAntiAffinityRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterVmAntiAffinityRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Enable this rule in the cluster. Default: true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mandatory

public mandatory: pulumi.Output<boolean | undefined>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

public name: pulumi.Output<string>;

The name of the rule. This must be unique in the cluster.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineIds

public virtualMachineIds: pulumi.Output<string[]>;

The UUIDs of the virtual machines to run on hosts different from each other.

class ComputeClusterVmDependencyRule

extends CustomResource

The vsphere_compute_cluster_vm_dependency_rule resource can be used to manage VM dependency rules in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

A virtual machine dependency rule applies to vSphere HA, and allows user-defined startup orders for virtual machines in the case of host failure. Virtual machines are supplied via groups, which can be managed via the vsphere_compute_cluster_vm_group resource.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

Example Usage

The example below creates two virtual machine in a cluster using the vsphere_virtual_machine resource in a cluster looked up by the vsphere_compute_cluster data source. It then creates a group with this virtual machine. Two groups are created, each with one of the created VMs. Finally, a rule is created to ensure that vm1 starts before vm2.

Note how dependency_vm_group_name and vm_group_name are sourced off of the name attributes from the vsphere_compute_cluster_vm_group resource. This is to ensure that the rule is not created before the groups exist, which may not possibly happen in the event that the names came from a “static” source such as a variable.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm1 = new vsphere.VirtualMachine("vm1", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    memory: 2048,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: cluster.resourcePoolId,
});
const clusterVmGroup1 = new vsphere.ComputeClusterVmGroup("cluster_vm_group1", {
    computeClusterId: cluster.id,
    virtualMachineIds: [vm1.id],
});
const vm2 = new vsphere.VirtualMachine("vm2", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    memory: 2048,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: cluster.resourcePoolId,
});
const clusterVmGroup2 = new vsphere.ComputeClusterVmGroup("cluster_vm_group2", {
    computeClusterId: cluster.id,
    virtualMachineIds: [vm2.id],
});
const clusterVmDependencyRule = new vsphere.ComputeClusterVmDependencyRule("cluster_vm_dependency_rule", {
    computeClusterId: cluster.id,
    dependencyVmGroupName: clusterVmGroup1.name,
    vmGroupName: clusterVmGroup2.name,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_vm_dependency_rule.html.markdown.

constructor

new ComputeClusterVmDependencyRule(name: string, args: ComputeClusterVmDependencyRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterVmDependencyRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterVmDependencyRuleState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmDependencyRule

Get an existing ComputeClusterVmDependencyRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterVmDependencyRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property dependencyVmGroupName

public dependencyVmGroupName: pulumi.Output<string>;

The name of the VM group that this rule depends on. The VMs defined in the group specified by vm_group_name will not be started until the VMs in this group are started.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Enable this rule in the cluster. Default: true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mandatory

public mandatory: pulumi.Output<boolean | undefined>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

public name: pulumi.Output<string>;

The name of the rule. This must be unique in the cluster.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vmGroupName

public vmGroupName: pulumi.Output<string>;

The name of the VM group that is the subject of this rule. The VMs defined in this group will not be started until the VMs in the group specified by dependency_vm_group_name are started.

class ComputeClusterVmGroup

extends CustomResource

The vsphere_compute_cluster_vm_group resource can be used to manage groups of virtual machines in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

This resource mainly serves as an input to the vsphere_compute_cluster_vm_dependency_rule and vsphere_compute_cluster_vm_host_rule resources. See the individual resource documentation pages for more information.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below creates two virtual machines in a cluster using the vsphere_virtual_machine resource, creating the virtual machine in the cluster looked up by the vsphere_compute_cluster data source. It then creates a group from these two virtual machines.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm: vsphere.VirtualMachine[] = [];
for (let i = 0; i < 2; i++) {
    vm.push(new vsphere.VirtualMachine(`vm-${i}`, {
        datastoreId: datastore.id,
        disks: [{
            label: "disk0",
            size: 20,
        }],
        guestId: "other3xLinux64Guest",
        memory: 2048,
        networkInterfaces: [{
            networkId: network.id,
        }],
        numCpus: 2,
        resourcePoolId: cluster.resourcePoolId,
    }));
}
const clusterVmGroup = new vsphere.ComputeClusterVmGroup("cluster_vm_group", {
    computeClusterId: cluster.id,
    virtualMachineIds: vm.map(v => v.id),
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_vm_group.html.markdown.

constructor

new ComputeClusterVmGroup(name: string, args: ComputeClusterVmGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterVmGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterVmGroupState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmGroup

Get an existing ComputeClusterVmGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterVmGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the VM group. This must be unique in the cluster. Forces a new resource if changed.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineIds

public virtualMachineIds: pulumi.Output<string[] | undefined>;

The UUIDs of the virtual machines in this group.

class ComputeClusterVmHostRule

extends CustomResource

The vsphere_compute_cluster_vm_host_rule resource can be used to manage VM-to-host rules in a cluster, either created by the vsphere_compute_cluster resource or looked up by the vsphere_compute_cluster data source.

This resource can create both affinity rules, where virtual machines run on specified hosts, or anti-affinity rules, where virtual machines run on hosts outside of the ones specified in the rule. Virtual machines and hosts are supplied via groups, which can be managed via the vsphere_compute_cluster_vm_group and vsphere_compute_cluster_host_group resources.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below creates a virtual machine in a cluster using the vsphere_virtual_machine resource in a cluster looked up by the vsphere_compute_cluster data source. It then creates a group with this virtual machine. It also creates a host group off of the host looked up via the vsphere_host data source. Finally, this virtual machine is configured to run specifically on that host via a vsphere_compute_cluster_vm_host_rule resource.

Note how vm_group_name and affinity_host_group_name are sourced off of the name attributes from the vsphere_compute_cluster_vm_group and vsphere_compute_cluster_host_group resources. This is to ensure that the rule is not created before the groups exist, which may not possibly happen in the event that the names came from a “static” source such as a variable.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const host = dc.apply(dc => vsphere.getHost({
    datacenterId: dc.id,
    name: "esxi1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const clusterHostGroup = new vsphere.ComputeClusterHostGroup("cluster_host_group", {
    computeClusterId: cluster.id,
    hostSystemIds: [host.id],
});
const vm = new vsphere.VirtualMachine("vm", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    memory: 2048,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: cluster.resourcePoolId,
});
const clusterVmGroup = new vsphere.ComputeClusterVmGroup("cluster_vm_group", {
    computeClusterId: cluster.id,
    virtualMachineIds: [vm.id],
});
const clusterVmHostRule = new vsphere.ComputeClusterVmHostRule("cluster_vm_host_rule", {
    affinityHostGroupName: clusterHostGroup.name,
    computeClusterId: cluster.id,
    vmGroupName: clusterVmGroup.name,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/compute_cluster_vm_host_rule.html.markdown.

constructor

new ComputeClusterVmHostRule(name: string, args: ComputeClusterVmHostRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ComputeClusterVmHostRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ComputeClusterVmHostRuleState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmHostRule

Get an existing ComputeClusterVmHostRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ComputeClusterVmHostRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property affinityHostGroupName

public affinityHostGroupName: pulumi.Output<string | undefined>;

When this field is used, the virtual machines defined in vm_group_name will be run on the hosts defined in this host group.

property antiAffinityHostGroupName

public antiAffinityHostGroupName: pulumi.Output<string | undefined>;

When this field is used, the virtual machines defined in vm_group_name will not be run on the hosts defined in this host group.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Enable this rule in the cluster. Default: true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mandatory

public mandatory: pulumi.Output<boolean | undefined>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

public name: pulumi.Output<string>;

The name of the rule. This must be unique in the cluster.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vmGroupName

public vmGroupName: pulumi.Output<string>;

The name of the virtual machine group to use with this rule.

class CustomAttribute

extends CustomResource

constructor

new CustomAttribute(name: string, args?: CustomAttributeArgs, opts?: pulumi.CustomResourceOptions)

Create a CustomAttribute resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CustomAttributeState, opts?: pulumi.CustomResourceOptions): CustomAttribute

Get an existing CustomAttribute resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomAttribute. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property managedObjectType

public managedObjectType: pulumi.Output<string | undefined>;

The object type that this attribute may be applied to. If not set, the custom attribute may be applied to any object type. For a full list, click here. Forces a new resource if changed.

property name

public name: pulumi.Output<string>;

The name of the custom attribute.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Datacenter

extends CustomResource

Provides a VMware vSphere datacenter resource. This can be used as the primary container of inventory objects such as hosts and virtual machines.

Example Usages

Create datacenter on the root folder:

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const prodDatacenter = new vsphere.Datacenter("prod_datacenter", {});

Create datacenter on a subfolder:

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const researchDatacenter = new vsphere.Datacenter("research_datacenter", {
    folder: "/research/",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/datacenter.html.markdown.

constructor

new Datacenter(name: string, args?: DatacenterArgs, opts?: pulumi.CustomResourceOptions)

Create a Datacenter resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatacenterState, opts?: pulumi.CustomResourceOptions): Datacenter

Get an existing Datacenter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Datacenter. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to value strings to set for datacenter resource. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property folder

public folder: pulumi.Output<string | undefined>;

The folder where the datacenter should be created. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property moid

public moid: pulumi.Output<string>;

[Managed object ID][docs-about-morefs] of this datacenter.

property name

public name: pulumi.Output<string>;

The name of the datacenter. This name needs to be unique within the folder. Forces a new resource if changed.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class DatastoreCluster

extends CustomResource

constructor

new DatastoreCluster(name: string, args: DatastoreClusterArgs, opts?: pulumi.CustomResourceOptions)

Create a DatastoreCluster resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatastoreClusterState, opts?: pulumi.CustomResourceOptions): DatastoreCluster

Get an existing DatastoreCluster resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

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.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

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.

property datacenterId

public datacenterId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the datastore cluster in. Forces a new resource if changed.

property folder

public folder: pulumi.Output<string | undefined>;

The name of the folder to locate the datastore cluster in.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the datastore cluster.

property sdrsAdvancedOptions

public sdrsAdvancedOptions: pulumi.Output<{[key: string]: any} | undefined>;

Advanced configuration options for storage DRS.

property sdrsAutomationLevel

public sdrsAutomationLevel: pulumi.Output<string | undefined>;

The global automation level for all virtual machines in this datastore cluster. Default: manual.

property sdrsDefaultIntraVmAffinity

public sdrsDefaultIntraVmAffinity: pulumi.Output<boolean | undefined>;

When true, all disks in a single virtual machine will be kept on the same datastore. Default: true.

property sdrsEnabled

public sdrsEnabled: pulumi.Output<boolean | undefined>;

Enable Storage DRS for this datastore cluster. Default: false.

property sdrsFreeSpaceThreshold

public sdrsFreeSpaceThreshold: pulumi.Output<number | undefined>;

The free space threshold to use. When set to utilization, drs_space_utilization_threshold is used, and when set to freeSpace, drs_free_space_threshold is used. Default: utilization.

property sdrsFreeSpaceThresholdMode

public sdrsFreeSpaceThresholdMode: pulumi.Output<string | undefined>;

The free space threshold to use. When set to utilization, drs_space_utilization_threshold is used, and when set to freeSpace, drs_free_space_threshold is used.

property sdrsFreeSpaceUtilizationDifference

public sdrsFreeSpaceUtilizationDifference: pulumi.Output<number | undefined>;

The threshold, in percent, of difference between space utilization in datastores before storage DRS makes decisions to balance the space. Default: 5 percent.

property sdrsIoBalanceAutomationLevel

public sdrsIoBalanceAutomationLevel: pulumi.Output<string | undefined>;

Overrides the default automation settings when correcting I/O load imbalances.

property sdrsIoLatencyThreshold

public sdrsIoLatencyThreshold: pulumi.Output<number | undefined>;

The I/O latency threshold, in milliseconds, that storage DRS uses to make recommendations to move disks from this datastore. Default: 15 seconds.

property sdrsIoLoadBalanceEnabled

public sdrsIoLoadBalanceEnabled: pulumi.Output<boolean | undefined>;

Enable I/O load balancing for this datastore cluster. Default: true.

property sdrsIoLoadImbalanceThreshold

public sdrsIoLoadImbalanceThreshold: pulumi.Output<number | undefined>;

The difference between load in datastores in the cluster before storage DRS makes recommendations to balance the load. Default: 5 percent.

property sdrsIoReservableIopsThreshold

public sdrsIoReservableIopsThreshold: 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. Note that this setting should only be set if sdrs_io_reservable_percent_threshold cannot make an accurate estimate of the capacity of the datastores in your cluster, and should be set to roughly 50-60% of the worst case peak performance of the backing LUNs.

property sdrsIoReservablePercentThreshold

public sdrsIoReservablePercentThreshold: 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. Default: 60 percent.

property sdrsIoReservableThresholdMode

public sdrsIoReservableThresholdMode: pulumi.Output<string | undefined>;

The reservable IOPS threshold setting to use, sdrs_io_reservable_percent_threshold in the event of automatic, or sdrs_io_reservable_iops_threshold in the event of manual. Default: automatic.

property sdrsLoadBalanceInterval

public sdrsLoadBalanceInterval: pulumi.Output<number | undefined>;

The storage DRS poll interval, in minutes. Default: 480 minutes.

property sdrsPolicyEnforcementAutomationLevel

public sdrsPolicyEnforcementAutomationLevel: pulumi.Output<string | undefined>;

Overrides the default automation settings when correcting storage and VM policy violations.

property sdrsRuleEnforcementAutomationLevel

public sdrsRuleEnforcementAutomationLevel: pulumi.Output<string | undefined>;

Overrides the default automation settings when correcting affinity rule violations.

property sdrsSpaceBalanceAutomationLevel

public sdrsSpaceBalanceAutomationLevel: pulumi.Output<string | undefined>;

Overrides the default automation settings when correcting disk space imbalances.

property sdrsSpaceUtilizationThreshold

public sdrsSpaceUtilizationThreshold: pulumi.Output<number | undefined>;

The threshold, in percent of used space, that storage DRS uses to make decisions to migrate VMs out of a datastore.

property sdrsVmEvacuationAutomationLevel

public sdrsVmEvacuationAutomationLevel: pulumi.Output<string | undefined>;

Overrides the default automation settings when generating recommendations for datastore evacuation.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class DatastoreClusterVmAntiAffinityRule

extends CustomResource

The vsphere_datastore_cluster_vm_anti_affinity_rule resource can be used to manage VM anti-affinity rules in a datastore cluster, either created by the vsphere_datastore_cluster resource or looked up by the vsphere_datastore_cluster data source.

This rule can be used to tell a set to virtual machines to run on different datastores within a cluster, useful for preventing single points of failure in application cluster scenarios. When configured, Storage DRS will make a best effort to ensure that the virtual machines run on different datastores, or prevent any operation that would keep that from happening, depending on the value of the mandatory flag.

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 example below creates two virtual machines in a cluster using the vsphere_virtual_machine resource, creating the virtual machines in the datastore cluster looked up by the vsphere_datastore_cluster data source. It then creates an anti-affinity rule for these two virtual machines, ensuring they will run on different datastores whenever possible.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastoreCluster = dc.apply(dc => vsphere.getDatastoreCluster({
    datacenterId: dc.id,
    name: "datastore-cluster1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm: vsphere.VirtualMachine[] = [];
for (let i = 0; i < 2; i++) {
    vm.push(new vsphere.VirtualMachine(`vm-${i}`, {
        datastoreClusterId: datastoreCluster.id,
        disks: [{
            label: "disk0",
            size: 20,
        }],
        guestId: "other3xLinux64Guest",
        memory: 2048,
        networkInterfaces: [{
            networkId: network.id,
        }],
        numCpus: 2,
        resourcePoolId: cluster.resourcePoolId,
    }));
}
const clusterVmAntiAffinityRule = new vsphere.DatastoreClusterVmAntiAffinityRule("cluster_vm_anti_affinity_rule", {
    datastoreClusterId: datastoreCluster.id,
    virtualMachineIds: vm.map(v => v.id),
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/datastore_cluster_vm_anti_affinity_rule.html.markdown.

constructor

new DatastoreClusterVmAntiAffinityRule(name: string, args: DatastoreClusterVmAntiAffinityRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a DatastoreClusterVmAntiAffinityRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatastoreClusterVmAntiAffinityRuleState, opts?: pulumi.CustomResourceOptions): DatastoreClusterVmAntiAffinityRule

Get an existing DatastoreClusterVmAntiAffinityRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of DatastoreClusterVmAntiAffinityRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property datastoreClusterId

public datastoreClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the datastore cluster to put the group in. Forces a new resource if changed.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Enable this rule in the cluster. Default: true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mandatory

public mandatory: pulumi.Output<boolean | undefined>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

public name: pulumi.Output<string>;

The name of the rule. This must be unique in the cluster.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineIds

public virtualMachineIds: pulumi.Output<string[]>;

The UUIDs of the virtual machines to run on different datastores from each other.

class DistributedPortGroup

extends CustomResource

The vsphere_distributed_port_group resource can be used to manage vSphere distributed virtual port groups. These port groups are connected to distributed virtual switches, which can be managed by the vsphere_distributed_virtual_switch resource.

Distributed port groups can be used as networks for virtual machines, allowing VMs to use the networking supplied by a distributed virtual switch (DVS), with a set of policies that apply to that individual newtork, if desired.

For an overview on vSphere networking concepts, see this page. For more information on vSphere DVS portgroups, see this page.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

Example Usage

The configuration below builds on the example given in the vsphere_distributed_virtual_switch resource by adding the vsphere_distributed_port_group resource, attaching itself to the DVS created here and assigning VLAN ID 1000.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const esxiHosts = config.get("esxiHosts") || [
    "esxi1",
    "esxi2",
    "esxi3",
];
const networkInterfaces = config.get("networkInterfaces") || [
    "vmnic0",
    "vmnic1",
    "vmnic2",
    "vmnic3",
];

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const host: Output<vsphere.GETHOSTResult>[] = [];
for (let i = 0; i < esxiHosts.length; i++) {
    host.push(vsphere.getHost);
%!(EXTRA string=dc.apply(dc => vsphere.getHost({
        datacenterId: dc.id,
        name: esxiHosts[i],
    })))}
const dvs = new vsphere.DistributedVirtualSwitch("dvs", {
    activeUplinks: [
        "uplink1",
        "uplink2",
    ],
    datacenterId: dc.id,
    hosts: [
        {
            devices: networkInterfaces,
            hostSystemId: host[0].id,
        },
        {
            devices: networkInterfaces,
            hostSystemId: host[1].id,
        },
        {
            devices: networkInterfaces,
            hostSystemId: host[2].id,
        },
    ],
    standbyUplinks: [
        "uplink3",
        "uplink4",
    ],
    uplinks: [
        "uplink1",
        "uplink2",
        "uplink3",
        "uplink4",
    ],
});
const pg = new vsphere.DistributedPortGroup("pg", {
    distributedVirtualSwitchUuid: dvs.id,
    vlanId: 1000,
});

Overriding DVS policies

All of the default port policies available in the vsphere_distributed_virtual_switch resource can be overridden on the port group level by specifying new settings for them.

As an example, we also take this example from the vsphere_distributed_virtual_switch resource where we manually specify our uplink count and uplink order. While the DVS has a default policy of using the first uplink as an active uplink and the second one as a standby, the overridden port group policy means that both uplinks will be used as active uplinks in this specific port group.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dvs = new vsphere.DistributedVirtualSwitch("dvs", {
    activeUplinks: ["tfup1"],
    datacenterId: vsphere_datacenter_dc.id,
    standbyUplinks: ["tfup2"],
    uplinks: [
        "tfup1",
        "tfup2",
    ],
});
const pg = new vsphere.DistributedPortGroup("pg", {
    activeUplinks: [
        "tfup1",
        "tfup2",
    ],
    distributedVirtualSwitchUuid: dvs.id,
    standbyUplinks: [],
    vlanId: 1000,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/distributed_port_group.html.markdown.

constructor

new DistributedPortGroup(name: string, args: DistributedPortGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a DistributedPortGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DistributedPortGroupState, opts?: pulumi.CustomResourceOptions): DistributedPortGroup

Get an existing DistributedPortGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of DistributedPortGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

public activeUplinks: pulumi.Output<string[]>;

List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.

property allowForgedTransmits

public allowForgedTransmits: pulumi.Output<boolean>;

Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.

property allowMacChanges

public allowMacChanges: pulumi.Output<boolean>;

Controls whether or not the Media Access Control (MAC) address can be changed.

property allowPromiscuous

public allowPromiscuous: pulumi.Output<boolean>;

Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.

property autoExpand

public autoExpand: pulumi.Output<boolean | undefined>;

Allows the port group to create additional ports past the limit specified in number_of_ports if necessary. Default: true.

property blockAllPorts

public blockAllPorts: pulumi.Output<boolean>;

Indicates whether to block all ports by default.

property blockOverrideAllowed

public blockOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [port shutdown policy][port-shutdown-policy] to be overridden on an individual port.

property checkBeacon

public checkBeacon: pulumi.Output<boolean>;

Enable beacon probing on the ports this policy applies to.

property configVersion

public configVersion: pulumi.Output<string>;

Version string of the configuration that this spec is trying to change.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value string to set for port group. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property description

public description: pulumi.Output<string | undefined>;

An optional description for the port group.

property directpathGen2Allowed

public directpathGen2Allowed: pulumi.Output<boolean>;

Allow VMDirectPath Gen2 on the ports this policy applies to.

property distributedVirtualSwitchUuid

public distributedVirtualSwitchUuid: pulumi.Output<string>;

The ID of the DVS to add the port group to. Forces a new resource if changed.

property egressShapingAverageBandwidth

public egressShapingAverageBandwidth: pulumi.Output<number>;

The average egress bandwidth in bits per second if egress shaping is enabled on the port.

property egressShapingBurstSize

public egressShapingBurstSize: pulumi.Output<number>;

The maximum egress burst size allowed in bytes if egress shaping is enabled on the port.

property egressShapingEnabled

public egressShapingEnabled: pulumi.Output<boolean>;

True if the traffic shaper is enabled for egress traffic on the port.

property egressShapingPeakBandwidth

public egressShapingPeakBandwidth: pulumi.Output<number>;

The peak egress bandwidth during bursts in bits per second if egress traffic shaping is enabled on the port.

property failback

public failback: pulumi.Output<boolean>;

If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ingressShapingAverageBandwidth

public ingressShapingAverageBandwidth: pulumi.Output<number>;

The average ingress bandwidth in bits per second if ingress shaping is enabled on the port.

property ingressShapingBurstSize

public ingressShapingBurstSize: pulumi.Output<number>;

The maximum ingress burst size allowed in bytes if ingress shaping is enabled on the port.

property ingressShapingEnabled

public ingressShapingEnabled: pulumi.Output<boolean>;

True if the traffic shaper is enabled for ingress traffic on the port.

property ingressShapingPeakBandwidth

public ingressShapingPeakBandwidth: pulumi.Output<number>;

The peak ingress bandwidth during bursts in bits per second if ingress traffic shaping is enabled on the port.

property key

public key: pulumi.Output<string>;

The generated UUID of the portgroup.

property lacpEnabled

public lacpEnabled: pulumi.Output<boolean>;

Whether or not to enable LACP on all uplink ports.

property lacpMode

public lacpMode: pulumi.Output<string>;

The uplink LACP mode to use. Can be one of active or passive.

property livePortMovingAllowed

public livePortMovingAllowed: pulumi.Output<boolean | undefined>;

Allow a port in this port group to be moved to another port group while it is connected.

property name

public name: pulumi.Output<string>;

The name of the port group.

property netflowEnabled

public netflowEnabled: pulumi.Output<boolean>;

Indicates whether to enable netflow on all ports.

property netflowOverrideAllowed

public netflowOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [Netflow policy][netflow-policy] on this port group to be overridden on an individual port.

property networkResourcePoolKey

public networkResourcePoolKey: pulumi.Output<string | undefined>;

The key of a network resource pool to associate with this port group. The default is -1, which implies no association.

property networkResourcePoolOverrideAllowed

public networkResourcePoolOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the network resource pool set on this port group to be overridden on an individual port.

property notifySwitches

public notifySwitches: pulumi.Output<boolean>;

If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.

property numberOfPorts

public numberOfPorts: pulumi.Output<number>;

The number of ports available on this port group. Cannot be decreased below the amount of used ports on the port group.

property portConfigResetAtDisconnect

public portConfigResetAtDisconnect: pulumi.Output<boolean | undefined>;

Reset a port’s settings to the settings defined on this port group policy when the port disconnects.

property portNameFormat

public portNameFormat: pulumi.Output<string | undefined>;

An optional formatting policy for naming of the ports in this port group. See the portNameFormat attribute listed [here][ext-vsphere-portname-format] for details on the format syntax.

property portPrivateSecondaryVlanId

public portPrivateSecondaryVlanId: pulumi.Output<number>;

The secondary VLAN ID for this port.

property securityPolicyOverrideAllowed

public securityPolicyOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [security policy settings][sec-policy-settings] defined in this port group policy to be overridden on an individual port.

property shapingOverrideAllowed

public shapingOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [traffic shaping options][traffic-shaping-settings] on this port group policy to be overridden on an individual port.

public standbyUplinks: pulumi.Output<string[]>;

List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.

property tags

public tags: pulumi.Output<string[] | undefined>;

A list of tag IDs to apply to this object.

property teamingPolicy

public teamingPolicy: pulumi.Output<string>;

The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, failover_explicit, or loadbalance_loadbased.

property trafficFilterOverrideAllowed

public trafficFilterOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow any traffic filters on this port group to be overridden on an individual port.

public txUplink: pulumi.Output<boolean>;

If true, a copy of packets sent to the switch will always be forwarded to an uplink in addition to the regular packet forwarded done by the switch.

property type

public type: pulumi.Output<string | undefined>;

The port group type. Can be one of earlyBinding (static binding) or ephemeral. Default: earlyBinding.

property uplinkTeamingOverrideAllowed

public uplinkTeamingOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [uplink teaming options][uplink-teaming-settings] on this port group to be overridden on an individual port.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vlanId

public vlanId: pulumi.Output<number>;

The VLAN ID for single VLAN mode. 0 denotes no VLAN.

property vlanOverrideAllowed

public vlanOverrideAllowed: pulumi.Output<boolean | undefined>;

Allow the [VLAN settings][vlan-settings] on this port group to be overridden on an individual port.

property vlanRanges

public vlanRanges: pulumi.Output<{
    maxVlan: number;
    minVlan: number;
}[]>;

The VLAN ID for single VLAN mode. 0 denotes no VLAN.

class DistributedVirtualSwitch

extends CustomResource

constructor

new DistributedVirtualSwitch(name: string, args: DistributedVirtualSwitchArgs, opts?: pulumi.CustomResourceOptions)

Create a DistributedVirtualSwitch resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DistributedVirtualSwitchState, opts?: pulumi.CustomResourceOptions): DistributedVirtualSwitch

Get an existing DistributedVirtualSwitch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of DistributedVirtualSwitch. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

public activeUplinks: pulumi.Output<string[]>;

A list of active uplinks to be used in load balancing. These uplinks need to match the definitions in the uplinks DVS argument. See here for more details.

property allowForgedTransmits

public allowForgedTransmits: pulumi.Output<boolean>;

Controls whether or not a virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.

property allowMacChanges

public allowMacChanges: pulumi.Output<boolean>;

Controls whether or not the Media Access Control (MAC) address can be changed.

property allowPromiscuous

public allowPromiscuous: pulumi.Output<boolean>;

Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.

property blockAllPorts

public blockAllPorts: pulumi.Output<boolean>;

Shuts down all ports in the port groups that this policy applies to, effectively blocking all network access to connected virtual devices.

property checkBeacon

public checkBeacon: pulumi.Output<boolean>;

Enables beacon probing as an additional measure to detect NIC failure.

property configVersion

public configVersion: pulumi.Output<string>;

The version string of the configuration that this spec is trying to change.

property contactDetail

public contactDetail: pulumi.Output<string | undefined>;

The detailed contact information for the person who is responsible for the DVS.

property contactName

public contactName: pulumi.Output<string | undefined>;

The name of the person who is responsible for the DVS.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value strings to set for virtual switch. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property datacenterId

public datacenterId: pulumi.Output<string>;

The ID of the datacenter where the distributed virtual switch will be created. Forces a new resource if changed.

property description

public description: pulumi.Output<string | undefined>;

A detailed description for the DVS.

property directpathGen2Allowed

public directpathGen2Allowed: pulumi.Output<boolean>;

Allow VMDirectPath Gen2 for the ports for which this policy applies to.

property egressShapingAverageBandwidth

public egressShapingAverageBandwidth: pulumi.Output<number>;

The average bandwidth in bits per second if egress traffic shaping is enabled on the port.

property egressShapingBurstSize

public egressShapingBurstSize: pulumi.Output<number>;

The maximum burst size allowed in bytes if egress traffic shaping is enabled on the port.

property egressShapingEnabled

public egressShapingEnabled: pulumi.Output<boolean>;

true if the traffic shaper is enabled on the port for egress traffic.

property egressShapingPeakBandwidth

public egressShapingPeakBandwidth: pulumi.Output<number>;

The peak bandwidth during bursts in bits per second if egress traffic shaping is enabled on the port.

property failback

public failback: pulumi.Output<boolean>;

If true, the teaming policy will re-activate failed uplinks higher in precedence when they come back up.

property faulttoleranceMaximumMbit

public faulttoleranceMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the faultTolerance traffic class, in Mbits/sec.

property faulttoleranceReservationMbit

public faulttoleranceReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the faultTolerance traffic class, in Mbits/sec.

property faulttoleranceShareCount

public faulttoleranceShareCount: pulumi.Output<number>;

The amount of shares to allocate to the faultTolerance traffic class for a custom share level.

property faulttoleranceShareLevel

public faulttoleranceShareLevel: pulumi.Output<string>;

The allocation level for the faultTolerance traffic class. Can be one of high, low, normal, or custom.

property folder

public folder: pulumi.Output<string | undefined>;

The folder to create the DVS in. Forces a new resource if changed.

property hbrMaximumMbit

public hbrMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the hbr traffic class, in Mbits/sec.

property hbrReservationMbit

public hbrReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the hbr traffic class, in Mbits/sec.

property hbrShareCount

public hbrShareCount: pulumi.Output<number>;

The amount of shares to allocate to the hbr traffic class for a custom share level.

property hbrShareLevel

public hbrShareLevel: pulumi.Output<string>;

The allocation level for the hbr traffic class. Can be one of high, low, normal, or custom.

property hosts

public hosts: pulumi.Output<{
    devices: string[];
    hostSystemId: string;
}[] | undefined>;

Use the host block to declare a host specification. The options are:

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ingressShapingAverageBandwidth

public ingressShapingAverageBandwidth: pulumi.Output<number>;

The average bandwidth in bits per second if ingress traffic shaping is enabled on the port.

property ingressShapingBurstSize

public ingressShapingBurstSize: pulumi.Output<number>;

The maximum burst size allowed in bytes if ingress traffic shaping is enabled on the port.

property ingressShapingEnabled

public ingressShapingEnabled: pulumi.Output<boolean>;

true if the traffic shaper is enabled on the port for ingress traffic.

property ingressShapingPeakBandwidth

public ingressShapingPeakBandwidth: pulumi.Output<number>;

The peak bandwidth during bursts in bits per second if ingress traffic shaping is enabled on the port.

property ipv4Address

public ipv4Address: pulumi.Output<string | undefined>;

An IPv4 address to identify the switch. This is mostly useful when used with the Netflow arguments found below.

property iscsiMaximumMbit

public iscsiMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the iSCSI traffic class, in Mbits/sec.

property iscsiReservationMbit

public iscsiReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the iSCSI traffic class, in Mbits/sec.

property iscsiShareCount

public iscsiShareCount: pulumi.Output<number>;

The amount of shares to allocate to the iSCSI traffic class for a custom share level.

property iscsiShareLevel

public iscsiShareLevel: pulumi.Output<string>;

The allocation level for the iSCSI traffic class. Can be one of high, low, normal, or custom.

property lacpApiVersion

public lacpApiVersion: pulumi.Output<string>;

The Link Aggregation Control Protocol group version to use with the switch. Possible values are singleLag and multipleLag.

property lacpEnabled

public lacpEnabled: pulumi.Output<boolean>;

Enables LACP for the ports that this policy applies to.

property lacpMode

public lacpMode: pulumi.Output<string>;

The LACP mode. Can be one of active or passive.

property linkDiscoveryOperation

public linkDiscoveryOperation: pulumi.Output<string | undefined>;

Whether to advertise or listen for link discovery traffic.

property linkDiscoveryProtocol

public linkDiscoveryProtocol: pulumi.Output<string | undefined>;

The discovery protocol type. Valid types are cdp and lldp.

property managementMaximumMbit

public managementMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the management traffic class, in Mbits/sec.

property managementReservationMbit

public managementReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the management traffic class, in Mbits/sec.

property managementShareCount

public managementShareCount: pulumi.Output<number>;

The amount of shares to allocate to the management traffic class for a custom share level.

property managementShareLevel

public managementShareLevel: pulumi.Output<string>;

The allocation level for the management traffic class. Can be one of high, low, normal, or custom.

property maxMtu

public maxMtu: pulumi.Output<number>;

The maximum transmission unit (MTU) for the virtual switch.

property multicastFilteringMode

public multicastFilteringMode: pulumi.Output<string>;

The multicast filtering mode to use with the switch. Can be one of legacyFiltering or snooping.

property name

public name: pulumi.Output<string>;

The name of the distributed virtual switch.

property netflowActiveFlowTimeout

public netflowActiveFlowTimeout: pulumi.Output<number | undefined>;

The number of seconds after which active flows are forced to be exported to the collector. Allowed range is 60 to 3600. Default: 60.

property netflowCollectorIpAddress

public netflowCollectorIpAddress: pulumi.Output<string | undefined>;

IP address for the Netflow collector, using IPv4 or IPv6. IPv6 is supported in vSphere Distributed Switch Version 6.0 or later. Must be set before Netflow can be enabled.

property netflowCollectorPort

public netflowCollectorPort: pulumi.Output<number | undefined>;

Port for the Netflow collector. This must be set before Netflow can be enabled.

property netflowEnabled

public netflowEnabled: pulumi.Output<boolean>;

Enables Netflow on all ports that this policy applies to.

property netflowIdleFlowTimeout

public netflowIdleFlowTimeout: pulumi.Output<number | undefined>;

The number of seconds after which idle flows are forced to be exported to the collector. Allowed range is 10 to 600. Default: 15.

property netflowInternalFlowsOnly

public netflowInternalFlowsOnly: pulumi.Output<boolean | undefined>;

Whether to limit analysis to traffic that has both source and destination served by the same host. Default: false.

property netflowObservationDomainId

public netflowObservationDomainId: pulumi.Output<number | undefined>;

The observation domain ID for the Netflow collector.

property netflowSamplingRate

public netflowSamplingRate: pulumi.Output<number | undefined>;

The ratio of total number of packets to the number of packets analyzed. The default is 0, which indicates that the switch should analyze all packets. The maximum value is 1000, which indicates an analysis rate of 0.001%.

property networkResourceControlEnabled

public networkResourceControlEnabled: pulumi.Output<boolean | undefined>;

Set to true to enable network I/O control. Default: false.

property networkResourceControlVersion

public networkResourceControlVersion: pulumi.Output<string>;

The version of network I/O control to use. Can be one of version2 or version3. Default: version2.

property nfsMaximumMbit

public nfsMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the nfs traffic class, in Mbits/sec.

property nfsReservationMbit

public nfsReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the nfs traffic class, in Mbits/sec.

property nfsShareCount

public nfsShareCount: pulumi.Output<number>;

The amount of shares to allocate to the nfs traffic class for a custom share level.

property nfsShareLevel

public nfsShareLevel: pulumi.Output<string>;

The allocation level for the nfs traffic class. Can be one of high, low, normal, or custom.

property notifySwitches

public notifySwitches: pulumi.Output<boolean>;

If true, the teaming policy will notify the broadcast network of an uplink failover, triggering cache updates.

property portPrivateSecondaryVlanId

public portPrivateSecondaryVlanId: pulumi.Output<number>;

Used to define a secondary VLAN ID when using private VLANs.

public standbyUplinks: pulumi.Output<string[]>;

A list of standby uplinks to be used in failover. These uplinks need to match the definitions in the uplinks DVS argument. See here for more details.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property teamingPolicy

public teamingPolicy: pulumi.Output<string>;

The uplink teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.

public txUplink: pulumi.Output<boolean>;

Forward all traffic transmitted by ports for which this policy applies to its DVS uplinks.

public uplinks: pulumi.Output<string[]>;

A list of strings that uniquely identifies the names of the uplinks on the DVS across hosts. The number of items in this list controls the number of uplinks that exist on the DVS, in addition to the names. See here for an example on how to use this option.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vdpMaximumMbit

public vdpMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the vdp traffic class, in Mbits/sec.

property vdpReservationMbit

public vdpReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the vdp traffic class, in Mbits/sec.

property vdpShareCount

public vdpShareCount: pulumi.Output<number>;

The amount of shares to allocate to the vdp traffic class for a custom share level.

property vdpShareLevel

public vdpShareLevel: pulumi.Output<string>;

The allocation level for the vdp traffic class. Can be one of high, low, normal, or custom.

property version

public version: pulumi.Output<string>;
  • The version of the DVS to create. The default is to create the DVS at the latest version supported by the version of vSphere being used. A DVS can be upgraded to another version, but cannot be downgraded.

property virtualmachineMaximumMbit

public virtualmachineMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the virtualMachine traffic class, in Mbits/sec.

property virtualmachineReservationMbit

public virtualmachineReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the virtualMachine traffic class, in Mbits/sec.

property virtualmachineShareCount

public virtualmachineShareCount: pulumi.Output<number>;

The amount of shares to allocate to the virtualMachine traffic class for a custom share level.

property virtualmachineShareLevel

public virtualmachineShareLevel: pulumi.Output<string>;

The allocation level for the virtualMachine traffic class. Can be one of high, low, normal, or custom.

property vlanId

public vlanId: pulumi.Output<number>;

The VLAN ID for single VLAN mode. 0 denotes no VLAN.

property vlanRanges

public vlanRanges: pulumi.Output<{
    maxVlan: number;
    minVlan: number;
}[]>;

Used to denote VLAN trunking. Use the min_vlan and max_vlan sub-arguments to define the tagged VLAN range. Multiple vlan_range definitions are allowed, but they must not overlap. Example below:

property vmotionMaximumMbit

public vmotionMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the vmotion traffic class, in Mbits/sec.

property vmotionReservationMbit

public vmotionReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the vmotion traffic class, in Mbits/sec.

property vmotionShareCount

public vmotionShareCount: pulumi.Output<number>;

The amount of shares to allocate to the vmotion traffic class for a custom share level.

property vmotionShareLevel

public vmotionShareLevel: pulumi.Output<string>;

The allocation level for the vmotion traffic class. Can be one of high, low, normal, or custom.

property vsanMaximumMbit

public vsanMaximumMbit: pulumi.Output<number>;

The maximum allowed usage for the vsan traffic class, in Mbits/sec.

property vsanReservationMbit

public vsanReservationMbit: pulumi.Output<number>;

The amount of guaranteed bandwidth for the vsan traffic class, in Mbits/sec.

property vsanShareCount

public vsanShareCount: pulumi.Output<number>;

The amount of shares to allocate to the vsan traffic class for a custom share level.

property vsanShareLevel

public vsanShareLevel: pulumi.Output<string>;

The allocation level for the vsan traffic class. Can be one of high, low, normal, or custom.

class DpmHostOverride

extends CustomResource

The vsphere_dpm_host_override resource can be used to add a DPM override to a cluster for a particular host. This allows you to control the power management settings for individual hosts in the cluster while leaving any unspecified ones at the default power management settings.

For more information on DPM within vSphere clusters, see this page.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The following example creates a compute cluster comprised of three hosts, making use of the vsphere_compute_cluster resource. DPM will be disabled in the cluster as it is the default setting, but we override the setting of the first host referenced by the vsphere_host data source (esxi1) by using the vsphere_dpm_host_override resource so it will be powered off when the cluster does not need it to service virtual machines.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const datacenter = config.get("datacenter") || "dc1";
const hosts = config.get("hosts") || [
    "esxi1",
    "esxi2",
    "esxi3",
];

const dc = pulumi.output(vsphere.getDatacenter({
    name: datacenter,
}));
const hostsHost: Output<vsphere.GETHOSTResult>[] = [];
for (let i = 0; i < hosts.length; i++) {
    hostsHost.push(vsphere.getHost);
%!(EXTRA string=dc.apply(dc => vsphere.getHost({
        datacenterId: dc.id,
        name: hosts[i],
    })))}
const computeCluster = new vsphere.ComputeCluster("compute_cluster", {
    datacenterId: dc.id,
    drsAutomationLevel: "fullyAutomated",
    drsEnabled: true,
    hostSystemIds: hostsHost.map(v => v.id),
});
const dpmHostOverride = new vsphere.DpmHostOverride("dpm_host_override", {
    computeClusterId: computeCluster.id,
    dpmAutomationLevel: "automated",
    dpmEnabled: true,
    hostSystemId: hostsHost[0].id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/dpm_host_override.html.markdown.

constructor

new DpmHostOverride(name: string, args: DpmHostOverrideArgs, opts?: pulumi.CustomResourceOptions)

Create a DpmHostOverride resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DpmHostOverrideState, opts?: pulumi.CustomResourceOptions): DpmHostOverride

Get an existing DpmHostOverride resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of DpmHostOverride. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the override in. Forces a new resource if changed.

property dpmAutomationLevel

public dpmAutomationLevel: pulumi.Output<string | undefined>;

The automation level for host power operations on this host. Can be one of manual or automated. Default: manual.

property dpmEnabled

public dpmEnabled: pulumi.Output<boolean | undefined>;

Enable DPM support for this host. Default: false.

property hostSystemId

public hostSystemId: pulumi.Output<string>;

The managed object ID of the host.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class DrsVmOverride

extends CustomResource

The vsphere_drs_vm_override resource can be used to add a DRS override to a cluster for a specific virtual machine. With this resource, one can enable or disable DRS and control the automation level for a single virtual machine without affecting the rest of the cluster.

For more information on vSphere clusters and DRS, see this page.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

NOTE: vSphere DRS requires a vSphere Enterprise Plus license.

Example Usage

The example below creates a virtual machine in a cluster using the vsphere_virtual_machine resource, creating the virtual machine in the cluster looked up by the vsphere_compute_cluster data source, but also pinning the VM to a host defined by the vsphere_host data source, which is assumed to be a host within the cluster. To ensure that the VM stays on this host and does not need to be migrated back at any point in time, an override is entered using the vsphere_drs_vm_override resource that disables DRS for this virtual machine, ensuring that it does not move.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const host = dc.apply(dc => vsphere.getHost({
    datacenterId: dc.id,
    name: "esxi1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm = new vsphere.VirtualMachine("vm", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    hostSystemId: host.id,
    memory: 2048,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: cluster.resourcePoolId,
});
const drsVmOverride = new vsphere.DrsVmOverride("drs_vm_override", {
    computeClusterId: cluster.id,
    drsEnabled: false,
    virtualMachineId: vm.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/drs_vm_override.html.markdown.

constructor

new DrsVmOverride(name: string, args: DrsVmOverrideArgs, opts?: pulumi.CustomResourceOptions)

Create a DrsVmOverride resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DrsVmOverrideState, opts?: pulumi.CustomResourceOptions): DrsVmOverride

Get an existing DrsVmOverride resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of DrsVmOverride. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the override in. Forces a new resource if changed.

property drsAutomationLevel

public drsAutomationLevel: pulumi.Output<string | undefined>;

Overrides the automation level for this virtual machine in the cluster. Can be one of manual, partiallyAutomated, or fullyAutomated. Default: manual.

property drsEnabled

public drsEnabled: pulumi.Output<boolean | undefined>;

Overrides the default DRS setting for this virtual machine. Can be either true or false. Default: false.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineId

public virtualMachineId: pulumi.Output<string>;

The UUID of the virtual machine to create the override for. Forces a new resource if changed.

class File

extends CustomResource

constructor

new File(name: string, args: FileArgs, opts?: pulumi.CustomResourceOptions)

Create a File resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FileState, opts?: pulumi.CustomResourceOptions): File

Get an existing File resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of File. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property createDirectories

public createDirectories: pulumi.Output<boolean | undefined>;

Create directories in destination_file path parameter if any missing for copy operation.

property datacenter

public datacenter: pulumi.Output<string | undefined>;

The name of a datacenter in which the file will be uploaded to.

property datastore

public datastore: pulumi.Output<string>;

The name of the datastore in which to upload the file to.

property destinationFile

public destinationFile: pulumi.Output<string>;

The path to where the file should be uploaded or copied to on vSphere.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property sourceDatacenter

public sourceDatacenter: pulumi.Output<string | undefined>;

The name of a datacenter in which the file will be copied from. Forces a new resource if changed.

property sourceDatastore

public sourceDatastore: pulumi.Output<string | undefined>;

The name of the datastore in which file will be copied from. Forces a new resource if changed.

property sourceFile

public sourceFile: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Folder

extends CustomResource

constructor

new Folder(name: string, args: FolderArgs, opts?: pulumi.CustomResourceOptions)

Create a Folder resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FolderState, opts?: pulumi.CustomResourceOptions): Folder

Get an existing Folder resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Folder. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value strings to set for folder. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property datacenterId

public datacenterId: pulumi.Output<string | undefined>;

The ID of the datacenter the folder will be created in. Required for all folder types except for datacenter folders. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property path

public path: pulumi.Output<string>;

The path of the folder and any parents, relative to the datacenter and folder type being defined.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property type

public type: pulumi.Output<string>;

The type of folder to create. Allowed options are datacenter for datacenter folders, host for host and cluster folders, vm for virtual machine folders, datastore for datastore folders, and network for network folders. Forces a new resource if changed.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class HaVmOverride

extends CustomResource

The vsphere_ha_vm_override resource can be used to add an override for vSphere HA settings on a cluster for a specific virtual machine. With this resource, one can control specific HA settings so that they are different than the cluster default, accommodating the needs of that specific virtual machine, while not affecting the rest of the cluster.

For more information on vSphere HA, see this page.

NOTE: This resource requires vCenter and is not available on direct ESXi connections.

Example Usage

The example below creates a virtual machine in a cluster using the vsphere_virtual_machine resource, creating the virtual machine in the cluster looked up by the vsphere_compute_cluster data source.

Considering a scenario where this virtual machine is of high value to the application or organization for which it does its work, it’s been determined in the event of a host failure, that this should be one of the first virtual machines to be started by vSphere HA during recovery. Hence, its ha_vm_restart_priority as been set to highest, which, assuming that the default restart priority is medium and no other virtual machine has been assigned the highest priority, will mean that this VM will be started before any other virtual machine in the event of host failure.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: "cluster1",
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vm = new vsphere.VirtualMachine("vm", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    memory: 2048,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: cluster.resourcePoolId,
});
const haVmOverride = new vsphere.HaVmOverride("ha_vm_override", {
    computeClusterId: cluster.id,
    haVmRestartPriority: "highest",
    virtualMachineId: vm.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/ha_vm_override.html.markdown.

constructor

new HaVmOverride(name: string, args: HaVmOverrideArgs, opts?: pulumi.CustomResourceOptions)

Create a HaVmOverride resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HaVmOverrideState, opts?: pulumi.CustomResourceOptions): HaVmOverride

Get an existing HaVmOverride resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of HaVmOverride. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property computeClusterId

public computeClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the override in. Forces a new resource if changed.

property haDatastoreApdRecoveryAction

public haDatastoreApdRecoveryAction: pulumi.Output<string | undefined>;

Controls the action to take on this virtual machine if an APD status on an affected datastore clears in the middle of an APD event. Can be one of useClusterDefault, none or reset. Default: useClusterDefault. [*][tf-vsphere-cluster-resource-version-restrictions]

property haDatastoreApdResponse

public haDatastoreApdResponse: pulumi.Output<string | undefined>;

Controls the action to take on this virtual machine when the cluster has detected loss to all paths to a relevant datastore. Can be one of clusterDefault, disabled, warning, restartConservative, or restartAggressive. Default: clusterDefault. [*][tf-vsphere-cluster-resource-version-restrictions]

property haDatastoreApdResponseDelay

public haDatastoreApdResponseDelay: pulumi.Output<number | undefined>;

Controls the delay in minutes to wait after an APD timeout event to execute the response action defined in ha_datastore_apd_response. Use -1 to use the cluster default. Default: -1. [*][tf-vsphere-cluster-resource-version-restrictions]

property haDatastorePdlResponse

public haDatastorePdlResponse: pulumi.Output<string | undefined>;

Controls the action to take on this virtual machine when the cluster has detected a permanent device loss to a relevant datastore. Can be one of clusterDefault, disabled, warning, or restartAggressive. Default: clusterDefault. [*][tf-vsphere-cluster-resource-version-restrictions]

property haHostIsolationResponse

public haHostIsolationResponse: pulumi.Output<string | undefined>;

The action to take on this virtual machine when a host has detected that it has been isolated from the rest of the cluster. Can be one of clusterIsolationResponse, none, powerOff, or shutdown. Default: clusterIsolationResponse.

property haVmFailureInterval

public haVmFailureInterval: pulumi.Output<number | undefined>;

If a heartbeat from this virtual machine is not received within this configured interval, the virtual machine is marked as failed. The value is in seconds. Default: 30.

property haVmMaximumFailureWindow

public haVmMaximumFailureWindow: pulumi.Output<number | undefined>;

The length of the reset window in which ha_vm_maximum_resets can operate. When this window expires, no more resets are attempted regardless of the setting configured in ha_vm_maximum_resets. -1 means no window, meaning an unlimited reset time is allotted. The value is specified in seconds. Default: -1 (no window).

property haVmMaximumResets

public haVmMaximumResets: pulumi.Output<number | undefined>;

The maximum number of resets that HA will perform to this virtual machine when responding to a failure event. Default: 3

property haVmMinimumUptime

public haVmMinimumUptime: pulumi.Output<number | undefined>;

The time, in seconds, that HA waits after powering on this virtual machine before monitoring for heartbeats. Default: 120 (2 minutes).

property haVmMonitoring

public haVmMonitoring: pulumi.Output<string | undefined>;

The type of virtual machine monitoring to use when HA is enabled in the cluster. Can be one of vmMonitoringDisabled, vmMonitoringOnly, or vmAndAppMonitoring. Default: vmMonitoringDisabled.

property haVmMonitoringUseClusterDefaults

public haVmMonitoringUseClusterDefaults: pulumi.Output<boolean | undefined>;

Determines whether or not the cluster’s default settings or the VM override settings specified in this resource are used for virtual machine monitoring. The default is true (use cluster defaults) - set to false to have overrides take effect.

property haVmRestartPriority

public haVmRestartPriority: pulumi.Output<string | undefined>;

The restart priority for the virtual machine when vSphere detects a host failure. Can be one of clusterRestartPriority, lowest, low, medium, high, or highest. Default: clusterRestartPriority.

property haVmRestartTimeout

public haVmRestartTimeout: pulumi.Output<number | undefined>;

The maximum time, in seconds, that vSphere HA will wait for this virtual machine to be ready. Use -1 to specify the cluster default. Default: -1. [*][tf-vsphere-cluster-resource-version-restrictions]

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineId

public virtualMachineId: pulumi.Output<string>;

The UUID of the virtual machine to create the override for. Forces a new resource if changed.

class HostPortGroup

extends CustomResource

The vsphere_host_port_group resource can be used to manage vSphere standard port groups on an ESXi host. These port groups are connected to standard virtual switches, which can be managed by the vsphere_host_virtual_switch resource.

For an overview on vSphere networking concepts, see this page.

Example Usages

Create a virtual switch and bind a port group to it:

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const esxiHost = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}));
const switchHostVirtualSwitch = new vsphere.HostVirtualSwitch("switch", {
    activeNics: ["vmnic0"],
    hostSystemId: esxiHost.id,
    networkAdapters: [
        "vmnic0",
        "vmnic1",
    ],
    standbyNics: ["vmnic1"],
});
const pg = new vsphere.HostPortGroup("pg", {
    hostSystemId: esxiHost.id,
    virtualSwitchName: switchHostVirtualSwitch.name,
});

Create a port group with VLAN set and some overrides:

This example sets the trunk mode VLAN (4095, which passes through all tags) and sets allow_promiscuous to ensure that all traffic is seen on the port. The latter setting overrides the implicit default of false set on the virtual switch.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const esxiHost = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}));
const switchHostVirtualSwitch = new vsphere.HostVirtualSwitch("switch", {
    activeNics: ["vmnic0"],
    hostSystemId: esxiHost.id,
    networkAdapters: [
        "vmnic0",
        "vmnic1",
    ],
    standbyNics: ["vmnic1"],
});
const pg = new vsphere.HostPortGroup("pg", {
    allowPromiscuous: true,
    hostSystemId: esxiHost.id,
    virtualSwitchName: switchHostVirtualSwitch.name,
    vlanId: 4095,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/host_port_group.html.markdown.

constructor

new HostPortGroup(name: string, args: HostPortGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a HostPortGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HostPortGroupState, opts?: pulumi.CustomResourceOptions): HostPortGroup

Get an existing HostPortGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of HostPortGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property activeNics

public activeNics: pulumi.Output<string[] | undefined>;

List of active network adapters used for load balancing.

property allowForgedTransmits

public allowForgedTransmits: pulumi.Output<boolean | undefined>;

Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.

property allowMacChanges

public allowMacChanges: pulumi.Output<boolean | undefined>;

Controls whether or not the Media Access Control (MAC) address can be changed.

property allowPromiscuous

public allowPromiscuous: pulumi.Output<boolean | undefined>;

Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.

property checkBeacon

public checkBeacon: pulumi.Output<boolean | undefined>;

Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.

property computedPolicy

public computedPolicy: pulumi.Output<{[key: string]: any}>;

A map with a full set of the [policy options][host-vswitch-policy-options] computed from defaults and overrides, explaining the effective policy for this port group.

property failback

public failback: pulumi.Output<boolean | undefined>;

If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.

property hostSystemId

public hostSystemId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the host to set the port group up on. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property key

public key: pulumi.Output<string>;

The key for this port group as returned from the vSphere API.

property name

public name: pulumi.Output<string>;

The name of the port group. Forces a new resource if changed.

property notifySwitches

public notifySwitches: pulumi.Output<boolean | undefined>;

If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.

property ports

public ports: pulumi.Output<{
    key: string;
    macAddresses: string[];
    type: string;
}>;

A list of ports that currently exist and are used on this port group.

property shapingAverageBandwidth

public shapingAverageBandwidth: pulumi.Output<number | undefined>;

The average bandwidth in bits per second if traffic shaping is enabled.

property shapingBurstSize

public shapingBurstSize: pulumi.Output<number | undefined>;

The maximum burst size allowed in bytes if traffic shaping is enabled.

property shapingEnabled

public shapingEnabled: pulumi.Output<boolean | undefined>;

Enable traffic shaping on this virtual switch or port group.

property shapingPeakBandwidth

public shapingPeakBandwidth: pulumi.Output<number | undefined>;

The peak bandwidth during bursts in bits per second if traffic shaping is enabled.

property standbyNics

public standbyNics: pulumi.Output<string[] | undefined>;

List of standby network adapters used for failover.

property teamingPolicy

public teamingPolicy: pulumi.Output<string | undefined>;

The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualSwitchName

public virtualSwitchName: pulumi.Output<string>;

The name of the virtual switch to bind this port group to. Forces a new resource if changed.

property vlanId

public vlanId: pulumi.Output<number | undefined>;

The VLAN ID/trunk mode for this port group. An ID of 0 denotes no tagging, an ID of 1-4094 tags with the specific ID, and an ID of 4095 enables trunk mode, allowing the guest to manage its own tagging. Default: 0.

class HostVirtualSwitch

extends CustomResource

constructor

new HostVirtualSwitch(name: string, args: HostVirtualSwitchArgs, opts?: pulumi.CustomResourceOptions)

Create a HostVirtualSwitch resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HostVirtualSwitchState, opts?: pulumi.CustomResourceOptions): HostVirtualSwitch

Get an existing HostVirtualSwitch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of HostVirtualSwitch. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property activeNics

public activeNics: pulumi.Output<string[]>;

The list of active network adapters used for load balancing.

property allowForgedTransmits

public allowForgedTransmits: pulumi.Output<boolean | undefined>;

Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own. Default: true.

property allowMacChanges

public allowMacChanges: pulumi.Output<boolean | undefined>;

Controls whether or not the Media Access Control (MAC) address can be changed. Default: true.

property allowPromiscuous

public allowPromiscuous: pulumi.Output<boolean | undefined>;

Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port. Default: false.

property beaconInterval

public beaconInterval: pulumi.Output<number | undefined>;

The interval, in seconds, that a NIC beacon packet is sent out. This can be used with check_beacon to offer link failure capability beyond link status only. Default: 1.

property checkBeacon

public checkBeacon: pulumi.Output<boolean | undefined>;

Enable beacon probing - this requires that the beacon_interval option has been set in the bridge options. If this is set to false, only link status is used to check for failed NICs. Default: false.

property failback

public failback: pulumi.Output<boolean | undefined>;

If set to true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up. Default: true.

property hostSystemId

public hostSystemId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the host to set the virtual switch up on. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property linkDiscoveryOperation

public linkDiscoveryOperation: pulumi.Output<string | undefined>;

Whether to advertise or listen for link discovery traffic. Default: listen.

property linkDiscoveryProtocol

public linkDiscoveryProtocol: pulumi.Output<string | undefined>;

The discovery protocol type. Valid types are cpd and lldp. Default: cdp.

property mtu

public mtu: pulumi.Output<number | undefined>;

The maximum transmission unit (MTU) for the virtual switch. Default: 1500.

property name

public name: pulumi.Output<string>;

The name of the virtual switch. Forces a new resource if changed.

property networkAdapters

public networkAdapters: pulumi.Output<string[]>;

The network interfaces to bind to the bridge.

property notifySwitches

public notifySwitches: pulumi.Output<boolean | undefined>;

If set to true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. Default: true.

property numberOfPorts

public numberOfPorts: pulumi.Output<number | undefined>;

The number of ports to create with this virtual switch. Default: 128.

property shapingAverageBandwidth

public shapingAverageBandwidth: pulumi.Output<number | undefined>;

The average bandwidth in bits per second if traffic shaping is enabled. Default: 0

property shapingBurstSize

public shapingBurstSize: pulumi.Output<number | undefined>;

The maximum burst size allowed in bytes if shaping is enabled. Default: 0

property shapingEnabled

public shapingEnabled: pulumi.Output<boolean | undefined>;

Set to true to enable the traffic shaper for ports managed by this virtual switch. Default: false.

property shapingPeakBandwidth

public shapingPeakBandwidth: pulumi.Output<number | undefined>;

The peak bandwidth during bursts in bits per second if traffic shaping is enabled. Default: 0

property standbyNics

public standbyNics: pulumi.Output<string[]>;

The list of standby network adapters used for failover.

property teamingPolicy

public teamingPolicy: pulumi.Output<string | undefined>;

The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit. Default: loadbalance_srcid.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class License

extends CustomResource

Provides a VMware vSphere license resource. This can be used to add and remove license keys.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const licenseKey = new vsphere.License("licenseKey", {
    labels: {
        VpxClientLicenseLabel: "Hello World",
        Workflow: "Hello World",
    },
    licenseKey: "452CQ-2EK54-K8742-00000-00000",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/license.html.markdown.

constructor

new License(name: string, args: LicenseArgs, opts?: pulumi.CustomResourceOptions)

Create a License resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LicenseState, opts?: pulumi.CustomResourceOptions): License

Get an existing License resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of License. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property editionKey

public editionKey: pulumi.Output<string>;

The product edition of the license key.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<{[key: string]: any} | undefined>;

A map of key/value pairs to be attached as labels (tags) to the license key.

property licenseKey

public licenseKey: pulumi.Output<string>;

The license key to add.

property name

public name: pulumi.Output<string>;

The display name for the license.

property total

public total: pulumi.Output<number>;

Total number of units (example: CPUs) contained in the license.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property used

public used: pulumi.Output<number>;

The number of units (example: CPUs) assigned to this license.

class NasDatastore

extends CustomResource

constructor

new NasDatastore(name: string, args: NasDatastoreArgs, opts?: pulumi.CustomResourceOptions)

Create a NasDatastore resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NasDatastoreState, opts?: pulumi.CustomResourceOptions): NasDatastore

Get an existing NasDatastore resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of NasDatastore. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accessMode

public accessMode: pulumi.Output<string | undefined>;

Access mode for the mount point. Can be one of readOnly or readWrite. Note that readWrite does not necessarily mean that the datastore will be read-write depending on the permissions of the actual share. Default: readWrite. Forces a new resource if changed.

property accessible

public accessible: pulumi.Output<boolean>;

The connectivity status of the datastore. If this is false, some other computed attributes may be out of date.

property capacity

public capacity: pulumi.Output<number>;

Maximum capacity of the datastore, in megabytes.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value strings to set on datasource resource. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property datastoreClusterId

public datastoreClusterId: pulumi.Output<string | undefined>;

The [managed object ID][docs-about-morefs] of a datastore cluster to put this datastore in. Conflicts with folder.

property folder

public folder: pulumi.Output<string | undefined>;

The path to the datastore folder to put the datastore in.

property freeSpace

public freeSpace: pulumi.Output<number>;

Available space of this datastore, in megabytes.

property hostSystemIds

public hostSystemIds: pulumi.Output<string[]>;

The [managed object IDs][docs-about-morefs] of the hosts to mount the datastore on.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property maintenanceMode

public maintenanceMode: pulumi.Output<string>;

The current maintenance mode state of the datastore.

property multipleHostAccess

public multipleHostAccess: pulumi.Output<boolean>;

If true, more than one host in the datacenter has been configured with access to the datastore.

property name

public name: pulumi.Output<string>;

The name of the datastore. Forces a new resource if changed.

property protocolEndpoint

public protocolEndpoint: pulumi.Output<string>;

Indicates that this NAS volume is a protocol endpoint. This field is only populated if the host supports virtual datastores.

property remoteHosts

public remoteHosts: pulumi.Output<string[]>;

The hostnames or IP addresses of the remote server or servers. Only one element should be present for NFS v3 but multiple can be present for NFS v4.1. Forces a new resource if changed.

property remotePath

public remotePath: pulumi.Output<string>;

The remote path of the mount point. Forces a new resource if changed.

property securityType

public securityType: pulumi.Output<string | undefined>;

The security type to use when using NFS v4.1. Can be one of AUTH_SYS, SEC_KRB5, or SEC_KRB5I. Forces a new resource if changed.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property type

public type: pulumi.Output<string | undefined>;

The type of NAS volume. Can be one of NFS (to denote v3) or NFS41 (to denote NFS v4.1). Default: NFS. Forces a new resource if changed.

property uncommittedSpace

public uncommittedSpace: pulumi.Output<number>;

Total additional storage space, in megabytes, potentially used by all virtual machines on this datastore.

property url

public url: pulumi.Output<string>;

The unique locator for the datastore.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Provider

extends ProviderResource

The provider type for the vsphere package. By default, resources use package-wide configuration settings, however an explicit Provider instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the documentation for more information.

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/index.html.markdown.

constructor

new Provider(name: string, args: ProviderArgs, opts?: pulumi.ResourceOptions)

Create a Provider resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Provider. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ResourcePool

extends CustomResource

The vsphere_resource_pool resource can be used to create and manage resource pools in standalone hosts or on compute clusters.

For more information on vSphere resource pools, see this page.

Example Usage

The following example sets up a resource pool in a compute cluster which uses the default settings for CPU and memory reservations, shares, and limits. The compute cluster needs to already exist in vSphere.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const cluster = config.get("cluster") || "cluster1";
const datacenter = config.get("datacenter") || "dc1";

const dc = pulumi.output(vsphere.getDatacenter({
    name: datacenter,
}));
const computeCluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: cluster,
}));
const resourcePool = new vsphere.ResourcePool("resource_pool", {
    parentResourcePoolId: computeCluster.resourcePoolId,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/resource_pool.html.markdown.

constructor

new ResourcePool(name: string, args: ResourcePoolArgs, opts?: pulumi.CustomResourceOptions)

Create a ResourcePool resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ResourcePoolState, opts?: pulumi.CustomResourceOptions): ResourcePool

Get an existing ResourcePool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ResourcePool. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property cpuExpandable

public cpuExpandable: pulumi.Output<boolean | undefined>;

Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default: true

property cpuLimit

public cpuLimit: pulumi.Output<number | undefined>;

The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to -1 for unlimited. Default: -1

property cpuReservation

public cpuReservation: pulumi.Output<number | undefined>;

Amount of CPU (MHz) that is guaranteed available to the resource pool. Default: 0

property cpuShareLevel

public cpuShareLevel: pulumi.Output<string | undefined>;

The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of low, normal, high, or custom. When low, normal, or high are specified values in cpu_shares will be ignored. Default: normal

property cpuShares

public cpuShares: pulumi.Output<number>;

The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set, cpu_share_level must be custom.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

A list of custom attributes to set on this resource.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property memoryExpandable

public memoryExpandable: pulumi.Output<boolean | undefined>;

Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default: true

property memoryLimit

public memoryLimit: pulumi.Output<number | undefined>;

The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to -1 for unlimited. Default: -1

property memoryReservation

public memoryReservation: pulumi.Output<number | undefined>;

Amount of CPU (MHz) that is guaranteed available to the resource pool. Default: 0

property memoryShareLevel

public memoryShareLevel: pulumi.Output<string | undefined>;

The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of low, normal, high, or custom. When low, normal, or high are specified values in memory_shares will be ignored. Default: normal

property memoryShares

public memoryShares: pulumi.Output<number>;

The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set, memory_share_level must be custom.

property name

public name: pulumi.Output<string>;

The name of the resource pool.

property parentResourcePoolId

public parentResourcePoolId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class StorageDrsVmOverride

extends CustomResource

The vsphere_storage_drs_vm_override 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.

Example Usage

The example below builds on the Storage DRS example in the vsphere_virtual_machine resource. However, rather than use the output of the vsphere_datastore_cluster data source for the location of the virtual machine, we instead get what is assumed to be a member datastore using the vsphere_datastore data source and put the virtual machine there instead. We then use the vsphere_storage_drs_vm_override resource to ensure that Storage DRS does not apply to this virtual machine, and hence the VM will never be migrated off of the datastore.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const dc = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const memberDatastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore-cluster1-member1",
}));
const datastoreCluster = dc.apply(dc => vsphere.getDatastoreCluster({
    datacenterId: dc.id,
    name: "datastore-cluster1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "public",
}));
const pool = dc.apply(dc => vsphere.getResourcePool({
    datacenterId: dc.id,
    name: "cluster1/Resources",
}));
const vm = new vsphere.VirtualMachine("vm", {
    datastoreId: memberDatastore.id,
    disks: [{
        label: "disk0",
        size: 20,
    }],
    guestId: "other3xLinux64Guest",
    memory: 1024,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: pool.id,
});
const drsVmOverride = new vsphere.StorageDrsVmOverride("drs_vm_override", {
    datastoreClusterId: datastoreCluster.id,
    sdrsEnabled: "false",
    virtualMachineId: vm.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/storage_drs_vm_override.html.markdown.

constructor

new StorageDrsVmOverride(name: string, args: StorageDrsVmOverrideArgs, opts?: pulumi.CustomResourceOptions)

Create a StorageDrsVmOverride resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: StorageDrsVmOverrideState, opts?: pulumi.CustomResourceOptions): StorageDrsVmOverride

Get an existing StorageDrsVmOverride resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

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.

property datastoreClusterId

public datastoreClusterId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the datastore cluster to put the override in. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property sdrsAutomationLevel

public sdrsAutomationLevel: pulumi.Output<string | undefined>;

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][tf-vsphere-datastore-cluster-sdrs-levels].

property sdrsEnabled

public sdrsEnabled: pulumi.Output<string | undefined>;

Overrides the default Storage DRS setting for this virtual machine. When not specified, the datastore cluster setting is used.

property sdrsIntraVmAffinity

public sdrsIntraVmAffinity: 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.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineId

public virtualMachineId: pulumi.Output<string>;

The UUID of the virtual machine to create the override for. Forces a new resource if changed.

class Tag

extends CustomResource

constructor

new Tag(name: string, args: TagArgs, opts?: pulumi.CustomResourceOptions)

Create a Tag resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TagState, opts?: pulumi.CustomResourceOptions): Tag

Get an existing Tag resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Tag. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property categoryId

public categoryId: pulumi.Output<string>;

The unique identifier of the parent category in which this tag will be created. Forces a new resource if changed.

property description

public description: pulumi.Output<string | undefined>;

A description for the tag.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The display name of the tag. The name must be unique within its category.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TagCategory

extends CustomResource

constructor

new TagCategory(name: string, args: TagCategoryArgs, opts?: pulumi.CustomResourceOptions)

Create a TagCategory resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TagCategoryState, opts?: pulumi.CustomResourceOptions): TagCategory

Get an existing TagCategory resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of TagCategory. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property associableTypes

public associableTypes: pulumi.Output<string[]>;

A list object types that this category is valid to be assigned to. For a full list, click here.

property cardinality

public cardinality: pulumi.Output<string>;

The number of tags that can be assigned from this category to a single object at once. Can be one of SINGLE (object can only be assigned one tag in this category), to MULTIPLE (object can be assigned multiple tags in this category). Forces a new resource if changed.

property description

public description: pulumi.Output<string | undefined>;

A description for the category.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the category.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VappContainer

extends CustomResource

The vsphere_vapp_container resource can be used to create and manage vApps.

For more information on vSphere vApps, see this page.

Example Usage

The basic example below sets up a vApp container in a compute cluster which uses the default settings for CPU and memory reservations, shares, and limits. The compute cluster needs to already exist in vSphere.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const cluster = config.get("cluster") || "cluster1";
const datacenter = config.get("datacenter") || "dc1";

const dc = pulumi.output(vsphere.getDatacenter({
    name: datacenter,
}));
const computeCluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: cluster,
}));
const vappContainer = new vsphere.VappContainer("vapp_container", {
    parentResourcePoolId: computeCluster.id,
});

Example with virtual machine

The below example builds off the basic example, but includes a virtual machine in the new vApp container. To accomplish this, the resource_pool_id of the virtual machine is set to the id of the vApp container.

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const config = new pulumi.Config();
const cluster = config.get("cluster") || "cluster1";
const datacenter = config.get("datacenter") || "dc1";

const dc = pulumi.output(vsphere.getDatacenter({
    name: datacenter,
}));
const computeCluster = dc.apply(dc => vsphere.getComputeCluster({
    datacenterId: dc.id,
    name: cluster,
}));
const datastore = dc.apply(dc => vsphere.getDatastore({
    datacenterId: dc.id,
    name: "datastore1",
}));
const network = dc.apply(dc => vsphere.getNetwork({
    datacenterId: dc.id,
    name: "network1",
}));
const vappContainer = new vsphere.VappContainer("vapp_container", {
    parentResourcePoolId: computeCluster.id,
});
const vm = new vsphere.VirtualMachine("vm", {
    datastoreId: datastore.id,
    disks: [{
        label: "disk0",
        size: 1,
    }],
    guestId: "ubuntu64Guest",
    memory: 1024,
    networkInterfaces: [{
        networkId: network.id,
    }],
    numCpus: 2,
    resourcePoolId: vappContainer.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/vapp_container.html.markdown.

constructor

new VappContainer(name: string, args: VappContainerArgs, opts?: pulumi.CustomResourceOptions)

Create a VappContainer resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VappContainerState, opts?: pulumi.CustomResourceOptions): VappContainer

Get an existing VappContainer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VappContainer. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property cpuExpandable

public cpuExpandable: pulumi.Output<boolean | undefined>;

Determines if the reservation on a vApp container can grow beyond the specified value if the parent resource pool has unreserved resources. Default: true

property cpuLimit

public cpuLimit: pulumi.Output<number | undefined>;

The CPU utilization of a vApp container will not exceed this limit, even if there are available resources. Set to -1 for unlimited. Default: -1

property cpuReservation

public cpuReservation: pulumi.Output<number | undefined>;

Amount of CPU (MHz) that is guaranteed available to the vApp container. Default: 0

property cpuShareLevel

public cpuShareLevel: pulumi.Output<string | undefined>;

The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of low, normal, high, or custom. When low, normal, or high are specified values in cpu_shares will be ignored. Default: normal

property cpuShares

public cpuShares: pulumi.Output<number>;

The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set, cpu_share_level must be custom.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

A list of custom attributes to set on this resource.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property memoryExpandable

public memoryExpandable: pulumi.Output<boolean | undefined>;

Determines if the reservation on a vApp container can grow beyond the specified value if the parent resource pool has unreserved resources. Default: true

property memoryLimit

public memoryLimit: pulumi.Output<number | undefined>;

The CPU utilization of a vApp container will not exceed this limit, even if there are available resources. Set to -1 for unlimited. Default: -1

property memoryReservation

public memoryReservation: pulumi.Output<number | undefined>;

Amount of CPU (MHz) that is guaranteed available to the vApp container. Default: 0

property memoryShareLevel

public memoryShareLevel: pulumi.Output<string | undefined>;

The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of low, normal, high, or custom. When low, normal, or high are specified values in memory_shares will be ignored. Default: normal

property memoryShares

public memoryShares: pulumi.Output<number>;

The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set, memory_share_level must be custom.

property name

public name: pulumi.Output<string>;

The name of the vApp container.

property parentFolderId

public parentFolderId: pulumi.Output<string | undefined>;

The [managed object ID][docs-about-morefs] of the vApp container’s parent folder.

property parentResourcePoolId

public parentResourcePoolId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a vApp container from one parent resource pool to another, both must share a common root resource pool or the move will fail.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VappEntity

extends CustomResource

constructor

new VappEntity(name: string, args: VappEntityArgs, opts?: pulumi.CustomResourceOptions)

Create a VappEntity resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VappEntityState, opts?: pulumi.CustomResourceOptions): VappEntity

Get an existing VappEntity resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VappEntity. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property containerId

public containerId: pulumi.Output<string>;

[Managed object ID|docs-about-morefs] of the vApp container the entity is a member of.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

A list of custom attributes to set on this resource.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property startAction

public startAction: pulumi.Output<string | undefined>;

How to start the entity. Valid settings are none or powerOn. If set to none, then the entity does not participate in auto-start. Default: powerOn

property startDelay

public startDelay: pulumi.Output<number | undefined>;

Delay in seconds before continuing with the next entity in the order of entities to be started. Default: 120

property startOrder

public startOrder: pulumi.Output<number | undefined>;

Order to start and stop target in vApp. Default: 1

property stopAction

public stopAction: pulumi.Output<string | undefined>;

Defines the stop action for the entity. Can be set to none, powerOff, guestShutdown, or suspend. If set to none, then the entity does not participate in auto-stop. Default: powerOff

property stopDelay

public stopDelay: pulumi.Output<number | undefined>;

Delay in seconds before continuing with the next entity in the order sequence. This is only used if the stopAction is guestShutdown. Default: 120

property tags

public tags: pulumi.Output<string[] | undefined>;

A list of tag IDs to apply to this object.

property targetId

public targetId: pulumi.Output<string>;

[Managed object ID|docs-about-morefs] of the entity to power on or power off. This can be a virtual machine or a vApp.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property waitForGuest

public waitForGuest: pulumi.Output<boolean | undefined>;

Determines if the VM should be marked as being started when VMware Tools are ready instead of waiting for start_delay. This property has no effect for vApps. Default: false

class VirtualDisk

extends CustomResource

The vsphere_virtual_disk resource can be used to create virtual disks outside of any given vsphere_virtual_machine resource. These disks can be attached to a virtual machine by creating a disk block with the attach parameter.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const myDisk = new vsphere.VirtualDisk("myDisk", {
    datacenter: "Datacenter",
    datastore: "local",
    size: 2,
    type: "thin",
    vmdkPath: "myDisk.vmdk",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/virtual_disk.html.markdown.

constructor

new VirtualDisk(name: string, args: VirtualDiskArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualDisk resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualDiskState, opts?: pulumi.CustomResourceOptions): VirtualDisk

Get an existing VirtualDisk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VirtualDisk. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property adapterType

public adapterType: pulumi.Output<string | undefined>;

The adapter type for this virtual disk. Can be one of ide, lsiLogic, or busLogic. Default: lsiLogic.

property createDirectories

public createDirectories: pulumi.Output<boolean | undefined>;

Tells the resource to create any directories that are a part of the vmdk_path parameter if they are missing. Default: false.

property datacenter

public datacenter: pulumi.Output<string | undefined>;

The name of the datacenter in which to create the disk. Can be omitted when when ESXi or if there is only one datacenter in your infrastructure.

property datastore

public datastore: pulumi.Output<string>;

The name of the datastore in which to create the disk.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property size

public size: pulumi.Output<number>;

Size of the disk (in GB).

property type

public type: pulumi.Output<string | undefined>;

The type of disk to create. Can be one of eagerZeroedThick, lazy, or thin. Default: eagerZeroedThick. For information on what each kind of disk provisioning policy means, click [here][docs-vmware-vm-disk-provisioning].

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vmdkPath

public vmdkPath: pulumi.Output<string>;

The path, including filename, of the virtual disk to be created. This needs to end in .vmdk.

class VirtualMachine

extends CustomResource

constructor

new VirtualMachine(name: string, args: VirtualMachineArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualMachine resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualMachineState, opts?: pulumi.CustomResourceOptions): VirtualMachine

Get an existing VirtualMachine resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VirtualMachine. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property alternateGuestName

public alternateGuestName: pulumi.Output<string | undefined>;

The guest name for the operating system when guest_id is other or other-64.

property annotation

public annotation: pulumi.Output<string | undefined>;

A user-provided description of the virtual machine. The default is no annotation.

property bootDelay

public bootDelay: pulumi.Output<number | undefined>;

The number of milliseconds to wait before starting the boot sequence. The default is no delay.

property bootRetryDelay

public bootRetryDelay: pulumi.Output<number | undefined>;

The number of milliseconds to wait before retrying the boot sequence. This only valid if boot_retry_enabled is true. Default: 10000 (10 seconds).

property bootRetryEnabled

public bootRetryEnabled: pulumi.Output<boolean | undefined>;

If set to true, a virtual machine that fails to boot will try again after the delay defined in boot_retry_delay. Default: false.

property cdrom

public cdrom: pulumi.Output<{
    clientDevice: undefined | false | true;
    datastoreId: undefined | string;
    deviceAddress: string;
    key: number;
    path: undefined | string;
} | undefined>;

A specification for a CDROM device on this virtual machine. See CDROM options below.

property changeVersion

public changeVersion: pulumi.Output<string>;

A unique identifier for a given version of the last configuration applied, such the timestamp of the last update to the configuration.

property clone

public clone: pulumi.Output<{
    customize: undefined | {
        dnsServerLists: string[];
        dnsSuffixLists: string[];
        ipv4Gateway: undefined | string;
        ipv6Gateway: undefined | string;
        linuxOptions: undefined | {
            domain: string;
            hostName: string;
            hwClockUtc: undefined | false | true;
            timeZone: undefined | string;
        };
        networkInterfaces: {
            dnsDomain: undefined | string;
            dnsServerLists: string[];
            ipv4Address: undefined | string;
            ipv4Netmask: undefined | number;
            ipv6Address: undefined | string;
            ipv6Netmask: undefined | number;
        }[];
        timeout: undefined | number;
        windowsOptions: undefined | {
            adminPassword: undefined | string;
            autoLogon: undefined | false | true;
            autoLogonCount: undefined | number;
            computerName: string;
            domainAdminPassword: undefined | string;
            domainAdminUser: undefined | string;
            fullName: undefined | string;
            joinDomain: undefined | string;
            organizationName: undefined | string;
            productKey: undefined | string;
            runOnceCommandLists: string[];
            timeZone: undefined | number;
            workgroup: undefined | string;
        };
        windowsSysprepText: undefined | string;
    };
    linkedClone: undefined | false | true;
    templateUuid: string;
    timeout: undefined | number;
} | undefined>;

When specified, the VM will be created as a clone of a specified template. Optional customization options can be submitted as well. See creating a virtual machine from a template for more details.

property cpuHotAddEnabled

public cpuHotAddEnabled: pulumi.Output<boolean | undefined>;

Allow CPUs to be added to this virtual machine while it is running.

property cpuHotRemoveEnabled

public cpuHotRemoveEnabled: pulumi.Output<boolean | undefined>;

Allow CPUs to be removed to this virtual machine while it is running.

property cpuLimit

public cpuLimit: pulumi.Output<number | undefined>;

The maximum amount of CPU (in MHz) that this virtual machine can consume, regardless of available resources. The default is no limit.

property cpuPerformanceCountersEnabled

public cpuPerformanceCountersEnabled: pulumi.Output<boolean | undefined>;

Enable CPU performance counters on this virtual machine. Default: false.

property cpuReservation

public cpuReservation: pulumi.Output<number | undefined>;

The amount of CPU (in MHz) that this virtual machine is guaranteed. The default is no reservation.

property cpuShareCount

public cpuShareCount: pulumi.Output<number>;

The number of CPU shares allocated to the virtual machine when the cpu_share_level is custom.

property cpuShareLevel

public cpuShareLevel: pulumi.Output<string | undefined>;

The allocation level for CPU resources. Can be one of high, low, normal, or custom. Default: custom.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value strings to set for virtual machine. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property datastoreClusterId

public datastoreClusterId: pulumi.Output<string | undefined>;

The [managed object reference ID][docs-about-morefs] of the datastore cluster ID to use. This setting applies to entire virtual machine and implies that you wish to use Storage DRS with this virtual machine. See the section on virtual machine migration for details on changing this value.

property datastoreId

public datastoreId: pulumi.Output<string>;

The datastore ID that the ISO is located in. Requried for using a datastore ISO. Conflicts with client_device.

property defaultIpAddress

public defaultIpAddress: pulumi.Output<string>;

The IP address selected by Terraform to be used for the provisioner.

property disks

public disks: pulumi.Output<{
    attach: undefined | false | true;
    datastoreId: undefined | string;
    deviceAddress: string;
    diskMode: undefined | string;
    diskSharing: undefined | string;
    eagerlyScrub: undefined | false | true;
    ioLimit: undefined | number;
    ioReservation: undefined | number;
    ioShareCount: undefined | number;
    ioShareLevel: undefined | string;
    keepOnRemove: undefined | false | true;
    key: number;
    label: undefined | string;
    name: undefined | string;
    path: string;
    size: undefined | number;
    thinProvisioned: undefined | false | true;
    unitNumber: undefined | number;
    uuid: string;
    writeThrough: undefined | false | true;
}[]>;

A specification for a virtual disk device on this virtual machine. See disk options below.

property efiSecureBootEnabled

public efiSecureBootEnabled: pulumi.Output<boolean | undefined>;

When the firmware type is set to is efi, this enables EFI secure boot. Default: false.

property enableDiskUuid

public enableDiskUuid: pulumi.Output<boolean | undefined>;

Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. Default: false.

property enableLogging

public enableLogging: pulumi.Output<boolean | undefined>;

Enable logging of virtual machine events to a log file stored in the virtual machine directory. Default: false.

property eptRviMode

public eptRviMode: pulumi.Output<string | undefined>;

The EPT/RVI (hardware memory virtualization) setting for this virtual machine. Can be one of automatic, on, or off. Default: automatic.

property extraConfig

public extraConfig: pulumi.Output<{[key: string]: any} | undefined>;

Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata.

property firmware

public firmware: pulumi.Output<string | undefined>;

The firmware interface to use on the virtual machine. Can be one of bios or EFI. Default: bios.

property folder

public folder: pulumi.Output<string | undefined>;

The path to the folder to put this virtual machine in, relative to the datacenter that the resource pool is in.

property forcePowerOff

public forcePowerOff: pulumi.Output<boolean | undefined>;

If a guest shutdown failed or timed out while updating or destroying (see shutdown_wait_timeout), force the power-off of the virtual machine. Default: true.

property guestId

public guestId: pulumi.Output<string | undefined>;

The guest ID for the operating system type. For a full list of possible values, see [here][vmware-docs-guest-ids]. Default: other-64.

property guestIpAddresses

public guestIpAddresses: pulumi.Output<string[]>;

The current list of IP addresses on this machine, including the value of default_ip_address. If VMware tools is not running on the virtual machine, or if the VM is powered off, this list will be empty. * moid: The [managed object reference ID][docs-about-morefs] of the created virtual machine.

property hostSystemId

public hostSystemId: pulumi.Output<string>;

An optional [managed object reference ID][docs-about-morefs] of a host to put this virtual machine on. See the section on virtual machine migration for details on changing this value. If a host_system_id is not supplied, vSphere will select a host in the resource pool to place the virtual machine, according to any defaults or DRS policies in place.

property hvMode

public hvMode: pulumi.Output<string | undefined>;

The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff. Default: hvAuto.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ignoredGuestIps

public ignoredGuestIps: pulumi.Output<string[] | undefined>;

List of IP addresses to ignore while waiting for an available IP address using either of the waiters. Any IP addresses in this list will be ignored if they show up so that the waiter will continue to wait for a real IP address. Default: [].

property imported

public imported: pulumi.Output<boolean>;

This is flagged if the virtual machine has been imported, or the state has been migrated from a previous version of the resource. It influences the behavior of the first post-import apply operation. See the section on importing below.

property latencySensitivity

public latencySensitivity: pulumi.Output<string | undefined>;

Controls the scheduling delay of the virtual machine. Use a higher sensitivity for applications that require lower latency, such as VOIP, media player applications, or applications that require frequent access to mouse or keyboard devices. Can be one of low, normal, medium, or high.

property memory

public memory: pulumi.Output<number | undefined>;

The size of the virtual machine’s memory, in MB. Default: 1024 (1 GB).

property memoryHotAddEnabled

public memoryHotAddEnabled: pulumi.Output<boolean | undefined>;

Allow memory to be added to this virtual machine while it is running.

property memoryLimit

public memoryLimit: pulumi.Output<number | undefined>;

The maximum amount of memory (in MB) that this virtual machine can consume, regardless of available resources. The default is no limit.

property memoryReservation

public memoryReservation: pulumi.Output<number | undefined>;

The amount of memory (in MB) that this virtual machine is guaranteed. The default is no reservation.

property memoryShareCount

public memoryShareCount: pulumi.Output<number>;

The number of memory shares allocated to the virtual machine when the memory_share_level is custom.

property memoryShareLevel

public memoryShareLevel: pulumi.Output<string | undefined>;

The allocation level for memory resources. Can be one of high, low, normal, or custom. Default: custom.

property migrateWaitTimeout

public migrateWaitTimeout: pulumi.Output<number | undefined>;

The amount of time, in minutes, to wait for a virtual machine migration to complete before failing. Default: 10 minutes. Also see the section on virtual machine migration.

property moid

public moid: pulumi.Output<string>;

The machine object ID from VMWare

property name

public name: pulumi.Output<string>;

An alias for both label and path, the latter when using attach. Required if not using label.

property nestedHvEnabled

public nestedHvEnabled: pulumi.Output<boolean | undefined>;

Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest. Default: false.

property networkInterfaces

public networkInterfaces: pulumi.Output<{
    adapterType: undefined | string;
    bandwidthLimit: undefined | number;
    bandwidthReservation: undefined | number;
    bandwidthShareCount: number;
    bandwidthShareLevel: undefined | string;
    deviceAddress: string;
    key: number;
    macAddress: string;
    networkId: string;
    useStaticMac: undefined | false | true;
}[]>;

A specification for a virtual NIC on this virtual machine. See network interface options below.

property numCoresPerSocket

public numCoresPerSocket: pulumi.Output<number | undefined>;

The number of cores to distribute among the CPUs in this virtual machine. If specified, the value supplied to num_cpus must be evenly divisible by this value. Default: 1.

property numCpus

public numCpus: pulumi.Output<number | undefined>;

The number of virtual processors to assign to this virtual machine. Default: 1.

property rebootRequired

public rebootRequired: pulumi.Output<boolean>;

Value internal to Terraform used to determine if a configuration set change requires a reboot.

property resourcePoolId

public resourcePoolId: pulumi.Output<string>;

The [managed object reference ID][docs-about-morefs] of the resource pool to put this virtual machine in. See the section on virtual machine migration for details on changing this value.

property runToolsScriptsAfterPowerOn

public runToolsScriptsAfterPowerOn: pulumi.Output<boolean | undefined>;

Enable the execution of post-power-on scripts when VMware tools is installed. Default: true.

property runToolsScriptsAfterResume

public runToolsScriptsAfterResume: pulumi.Output<boolean | undefined>;

Enable the execution of post-resume scripts when VMware tools is installed. Default: true.

property runToolsScriptsBeforeGuestReboot

public runToolsScriptsBeforeGuestReboot: pulumi.Output<boolean | undefined>;

Enable the execution of pre-reboot scripts when VMware tools is installed. Default: false.

property runToolsScriptsBeforeGuestShutdown

public runToolsScriptsBeforeGuestShutdown: pulumi.Output<boolean | undefined>;

Enable the execution of pre-shutdown scripts when VMware tools is installed. Default: true.

property runToolsScriptsBeforeGuestStandby

public runToolsScriptsBeforeGuestStandby: pulumi.Output<boolean | undefined>;

Enable the execution of pre-standby scripts when VMware tools is installed. Default: true.

property scsiBusSharing

public scsiBusSharing: pulumi.Output<string | undefined>;

Mode for sharing the SCSI bus. The modes are physicalSharing, virtualSharing, and noSharing. Default: noSharing.

property scsiControllerCount

public scsiControllerCount: pulumi.Output<number | undefined>;

The number of SCSI controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers.

property scsiType

public scsiType: pulumi.Output<string | undefined>;

The type of SCSI bus this virtual machine will have. Can be one of lsilogic (LSI Logic Parallel), lsilogic-sas (LSI Logic SAS) or pvscsi (VMware Paravirtual). Defualt: pvscsi.

property shutdownWaitTimeout

public shutdownWaitTimeout: pulumi.Output<number | undefined>;

The amount of time, in minutes, to wait for a graceful guest shutdown when making necessary updates to the virtual machine. If force_power_off is set to true, the VM will be force powered-off after this timeout, otherwise an error is returned. Default: 3 minutes.

property swapPlacementPolicy

public swapPlacementPolicy: pulumi.Output<string | undefined>;

The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory. Default: inherit.

property syncTimeWithHost

public syncTimeWithHost: pulumi.Output<boolean | undefined>;

Enable guest clock synchronization with the host. Requires VMware tools to be installed. Default: false.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property uuid

public uuid: pulumi.Output<string>;

The UUID of the virtual disk’s VMDK file. This is used to track the virtual disk on the virtual machine.

property vapp

public vapp: pulumi.Output<{
    properties: undefined | {[key: string]: string};
} | undefined>;

Optional vApp configuration. The only sub-key available is properties, which is a key/value map of properties for virtual machines imported from OVF or OVA files. See Using vApp properties to supply OVF/OVA configuration for more details.

property vappTransports

public vappTransports: pulumi.Output<string[]>;

Computed value which is only valid for cloned virtual machines. A list of vApp transport methods supported by the source virtual machine or template.

property vmwareToolsStatus

public vmwareToolsStatus: pulumi.Output<string>;

The state of VMware tools in the guest. This will determine the proper course of action for some device operations.

property vmxPath

public vmxPath: pulumi.Output<string>;

The path of the virtual machine’s configuration file in the VM’s datastore.

property waitForGuestIpTimeout

public waitForGuestIpTimeout: pulumi.Output<number | undefined>;

The amount of time, in minutes, to wait for an available guest IP address on this virtual machine. This should only be used if your version of VMware Tools does not allow the wait_for_guest_net_timeout waiter to be used. A value less than 1 disables the waiter. Default: 0.

property waitForGuestNetRoutable

public waitForGuestNetRoutable: pulumi.Output<boolean | undefined>;

Controls whether or not the guest network waiter waits for a routable address. When false, the waiter does not wait for a default gateway, nor are IP addresses checked against any discovered default gateways as part of its success criteria. This property is ignored if the wait_for_guest_ip_timeout waiter is used. Default: true.

property waitForGuestNetTimeout

public waitForGuestNetTimeout: pulumi.Output<number | undefined>;

The amount of time, in minutes, to wait for an available IP address on this virtual machine’s NICs. Older versions of VMware Tools do not populate this property. In those cases, this waiter can be disabled and the wait_for_guest_ip_timeout waiter can be used instead. A value less than 1 disables the waiter. Default: 5 minutes.

class VirtualMachineSnapshot

extends CustomResource

The vsphere_virtual_machine_snapshot resource can be used to manage snapshots for a virtual machine.

For more information on managing snapshots and how they work in VMware, see here.

NOTE: A snapshot in VMware differs from traditional disk snapshots, and can contain the actual running state of the virtual machine, data for all disks that have not been set to be independent from the snapshot (including ones that have been attached via the attach parameter to the vsphere_virtual_machine disk block), and even the configuration of the virtual machine at the time of the snapshot. Virtual machine, disk activity, and configuration changes post-snapshot are not included in the original state. Use this resource with care! Neither VMware nor HashiCorp recommends retaining snapshots for a extended period of time and does NOT recommend using them as as backup feature. For more information on the limitation of virtual machine snapshots, see here.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const demo1 = new vsphere.VirtualMachineSnapshot("demo1", {
    consolidate: true,
    description: "This is Demo Snapshot",
    memory: true,
    quiesce: true,
    removeChildren: false,
    snapshotName: "Snapshot Name",
    virtualMachineUuid: "9aac5551-a351-4158-8c5c-15a71e8ec5c9",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/virtual_machine_snapshot.html.markdown.

constructor

new VirtualMachineSnapshot(name: string, args: VirtualMachineSnapshotArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualMachineSnapshot resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualMachineSnapshotState, opts?: pulumi.CustomResourceOptions): VirtualMachineSnapshot

Get an existing VirtualMachineSnapshot resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VirtualMachineSnapshot. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property consolidate

public consolidate: pulumi.Output<boolean | undefined>;

If set to true, the delta disks involved in this snapshot will be consolidated into the parent when this resource is destroyed.

property description

public description: pulumi.Output<string>;

A description for the snapshot.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property memory

public memory: pulumi.Output<boolean>;

If set to true, a dump of the internal state of the virtual machine is included in the snapshot.

property quiesce

public quiesce: pulumi.Output<boolean>;

If set to true, and the virtual machine is powered on when the snapshot is taken, VMware Tools is used to quiesce the file system in the virtual machine.

property removeChildren

public removeChildren: pulumi.Output<boolean | undefined>;

If set to true, the entire snapshot subtree is removed when this resource is destroyed.

property snapshotName

public snapshotName: pulumi.Output<string>;

The name of the snapshot.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualMachineUuid

public virtualMachineUuid: pulumi.Output<string>;

The virtual machine UUID.

class VmfsDatastore

extends CustomResource

constructor

new VmfsDatastore(name: string, args: VmfsDatastoreArgs, opts?: pulumi.CustomResourceOptions)

Create a VmfsDatastore resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VmfsDatastoreState, opts?: pulumi.CustomResourceOptions): VmfsDatastore

Get an existing VmfsDatastore resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VmfsDatastore. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accessible

public accessible: pulumi.Output<boolean>;

The connectivity status of the datastore. If this is false, some other computed attributes may be out of date.

property capacity

public capacity: pulumi.Output<number>;

Maximum capacity of the datastore, in megabytes.

property customAttributes

public customAttributes: pulumi.Output<{[key: string]: any} | undefined>;

Map of custom attribute ids to attribute value string to set on datastore resource. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property datastoreClusterId

public datastoreClusterId: pulumi.Output<string | undefined>;

The [managed object ID][docs-about-morefs] of a datastore cluster to put this datastore in. Conflicts with folder.

property disks

public disks: pulumi.Output<string[]>;

The disks to use with the datastore.

property folder

public folder: pulumi.Output<string | undefined>;

The path to the datastore folder to put the datastore in.

property freeSpace

public freeSpace: pulumi.Output<number>;

Available space of this datastore, in megabytes.

property hostSystemId

public hostSystemId: pulumi.Output<string>;

The [managed object ID][docs-about-morefs] of the host to set the datastore up on. Note that this is not necessarily the only host that the datastore will be set up on - see here for more info. Forces a new resource if changed.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property maintenanceMode

public maintenanceMode: pulumi.Output<string>;

The current maintenance mode state of the datastore.

property multipleHostAccess

public multipleHostAccess: pulumi.Output<boolean>;

If true, more than one host in the datacenter has been configured with access to the datastore.

property name

public name: pulumi.Output<string>;

The name of the datastore. Forces a new resource if changed.

property tags

public tags: pulumi.Output<string[] | undefined>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

property uncommittedSpace

public uncommittedSpace: pulumi.Output<number>;

Total additional storage space, in megabytes, potentially used by all virtual machines on this datastore.

property url

public url: pulumi.Output<string>;

The unique locator for the datastore.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getComputeCluster

function getCustomAttribute

function getDatacenter

getDatacenter(args?: GetDatacenterArgs, opts?: pulumi.InvokeOptions): Promise<GetDatacenterResult>

The vsphere_datacenter data source can be used to discover the ID of a vSphere datacenter. This can then be used with resources or data sources that require a datacenter, such as the vsphere_host data source.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/datacenter.html.markdown.

function getDatastore

getDatastore(args: GetDatastoreArgs, opts?: pulumi.InvokeOptions): Promise<GetDatastoreResult>

The vsphere_datastore data source can be used to discover the ID of a datastore in vSphere. This is useful to fetch the ID of a datastore that you want to use to create virtual machines in using the vsphere_virtual_machine resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const datastore = datacenter.apply(datacenter => vsphere.getDatastore({
    datacenterId: datacenter.id,
    name: "datastore1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/datastore.html.markdown.

function getDatastoreCluster

getDatastoreCluster(args: GetDatastoreClusterArgs, opts?: pulumi.InvokeOptions): Promise<GetDatastoreClusterResult>

The vsphere_datastore_cluster 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_nas_datastore or vsphere_vmfs_datastore resources, or create virtual machines in using the vsphere_virtual_machine resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const datastoreCluster = vsphere_datacenter_dc.id.apply(id => vsphere.getDatastoreCluster({
    datacenterId: id,
    name: "datastore-cluster1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/datastore_cluster.html.markdown.

function getDistributedVirtualSwitch

function getEnv

getEnv(vars: string[]): string | undefined

function getEnvBoolean

getEnvBoolean(vars: string[]): boolean | undefined

function getEnvNumber

getEnvNumber(vars: string[]): number | undefined

function getFolder

getFolder(args: GetFolderArgs, opts?: pulumi.InvokeOptions): Promise<GetFolderResult>

The vsphere_folder data source can be used to get the general attributes of a vSphere inventory folder. Paths are absolute and include must include the datacenter.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const folder = pulumi.output(vsphere.getFolder({
    path: "/dc1/datastore/folder1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/folder.html.markdown.

function getHost

getHost(args: GetHostArgs, opts?: pulumi.InvokeOptions): Promise<GetHostResult>

The vsphere_host data source can be used to discover the ID of a vSphere host. This can then be used with resources or data sources that require a host managed object reference ID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const host = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/host.html.markdown.

function getNetwork

function getResourcePool

getResourcePool(args?: GetResourcePoolArgs, opts?: pulumi.InvokeOptions): Promise<GetResourcePoolResult>

The vsphere_resource_pool 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_virtual_machine resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const pool = datacenter.apply(datacenter => vsphere.getResourcePool({
    datacenterId: datacenter.id,
    name: "resource-pool-1",
}));

Specifying the root resource pool for a standalone host

NOTE: Fetching the root resource pool for a cluster can now be done directly via the vsphere_compute_cluster data source.

All compute resources in vSphere (clusters, standalone hosts, and standalone ESXi) have a resource pool, even if one has not been explicitly created. This resource pool is referred to as the root resource pool and can be looked up by specifying the path as per the example below:

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",
}));

For more information on the root resource pool, see Managing Resource Pools in the vSphere documentation.

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/resource_pool.html.markdown.

function getTag

function getTagCategory

function getVappContainer

getVappContainer(args: GetVappContainerArgs, opts?: pulumi.InvokeOptions): Promise<GetVappContainerResult>

The vsphere_vapp_container data source can be used to discover the ID of a vApp container in vSphere. This is useful to fetch the ID of a vApp container that you want to use to create virtual machines in using the vsphere_virtual_machine resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const pool = datacenter.apply(datacenter => vsphere.getVappContainer({
    datacenterId: datacenter.id,
    name: "vapp-container-1",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/vapp_container.html.markdown.

function getVersion

getVersion(): string

function getVirtualMachine

getVirtualMachine(args: GetVirtualMachineArgs, opts?: pulumi.InvokeOptions): Promise<GetVirtualMachineResult>

The vsphere_virtual_machine data source can be used to find the UUID of an existing virtual machine or template. Its most relevant purpose is for finding the UUID of a template to be used as the source for cloning into a new vsphere_virtual_machine resource. It also reads the guest ID so that can be supplied as well.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const template = datacenter.apply(datacenter => vsphere.getVirtualMachine({
    datacenterId: datacenter.id,
    name: "test-vm-template",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/virtual_machine.html.markdown.

function getVmfsDisks

getVmfsDisks(args: GetVmfsDisksArgs, opts?: pulumi.InvokeOptions): Promise<GetVmfsDisksResult>

The vsphere_vmfs_disks data source can be used to discover the storage devices available on an ESXi host. This data source can be combined with the vsphere_vmfs_datastore resource to create VMFS datastores based off a set of discovered disks.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const host = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}));
const available = host.apply(host => vsphere.getVmfsDisks({
    filter: "mpx.vmhba1:C0:T[12]:L0",
    hostSystemId: host.id,
    rescan: true,
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/d/vmfs_disks.html.markdown.

interface ComputeClusterArgs

The set of arguments for constructing a ComputeCluster resource.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

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.

property datacenterId

datacenterId: pulumi.Input<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the cluster in. Forces a new resource if changed.

property dpmAutomationLevel

dpmAutomationLevel?: pulumi.Input<string>;

The automation level for host power operations in this cluster. Can be one of manual or automated. Default: manual.

property dpmEnabled

dpmEnabled?: pulumi.Input<boolean>;

Enable DPM support for DRS in this cluster. Requires drs_enabled to be true in order to be effective. Default: false.

property dpmThreshold

dpmThreshold?: pulumi.Input<number>;

A value between 1 and 5 indicating the threshold of load within the cluster that influences host power operations. This affects both power on and power off operations - a lower setting will tolerate more of a surplus/deficit than a higher setting. Default: 3.

property drsAdvancedOptions

drsAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

A key/value map that specifies advanced options for DRS and DPM.

property drsAutomationLevel

drsAutomationLevel?: pulumi.Input<string>;

The default automation level for all virtual machines in this cluster. Can be one of manual, partiallyAutomated, or fullyAutomated. Default: manual.

property drsEnablePredictiveDrs

drsEnablePredictiveDrs?: pulumi.Input<boolean>;

When true, enables DRS to use data from [vRealize Operations Manager][ref-vsphere-vro] to make proactive DRS recommendations. *

property drsEnableVmOverrides

drsEnableVmOverrides?: pulumi.Input<boolean>;

Allow individual DRS overrides to be set for virtual machines in the cluster. Default: true.

property drsEnabled

drsEnabled?: pulumi.Input<boolean>;

Enable DRS for this cluster. Default: false.

property drsMigrationThreshold

drsMigrationThreshold?: pulumi.Input<number>;

A value between 1 and 5 indicating the threshold of imbalance tolerated between hosts. A lower setting will tolerate more imbalance while a higher setting will tolerate less. Default: 3.

property folder

folder?: pulumi.Input<string>;

The name of the folder to locate the cluster in.

property forceEvacuateOnDestroy

forceEvacuateOnDestroy?: pulumi.Input<boolean>;

Force removal of all hosts in the cluster during destroy and make them standalone hosts. Use of this flag mainly exists for testing and is not recommended in normal use.

property haAdmissionControlFailoverHostSystemIds

haAdmissionControlFailoverHostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

Defines the [managed object IDs][docs-about-morefs] of hosts to use as dedicated failover hosts. These hosts are kept as available as possible - admission control will block access to the host, and DRS will ignore the host when making recommendations.

property haAdmissionControlHostFailureTolerance

haAdmissionControlHostFailureTolerance?: pulumi.Input<number>;

The maximum number of failed hosts that admission control tolerates when making decisions on whether to permit virtual machine operations. The maximum is one less than the number of hosts in the cluster. Default: 1. *

property haAdmissionControlPerformanceTolerance

haAdmissionControlPerformanceTolerance?: pulumi.Input<number>;

The percentage of resource reduction that a cluster of virtual machines can tolerate in case of a failover. A value of 0 produces warnings only, whereas a value of 100 disables the setting. Default: 100 (disabled).

property haAdmissionControlPolicy

haAdmissionControlPolicy?: pulumi.Input<string>;

The type of admission control policy to use with vSphere HA. Can be one of resourcePercentage, slotPolicy, failoverHosts, or disabled. Default: resourcePercentage.

property haAdmissionControlResourcePercentageAutoCompute

haAdmissionControlResourcePercentageAutoCompute?: pulumi.Input<boolean>;

Automatically determine available resource percentages by subtracting the average number of host resources represented by the ha_admission_control_host_failure_tolerance setting from the total amount of resources in the cluster. Disable to supply user-defined values. Default: true. *

property haAdmissionControlResourcePercentageCpu

haAdmissionControlResourcePercentageCpu?: pulumi.Input<number>;

Controls the user-defined percentage of CPU resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlResourcePercentageMemory

haAdmissionControlResourcePercentageMemory?: pulumi.Input<number>;

Controls the user-defined percentage of memory resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlSlotPolicyExplicitCpu

haAdmissionControlSlotPolicyExplicitCpu?: pulumi.Input<number>;

Controls the user-defined CPU slot size, in MHz. Default: 32.

property haAdmissionControlSlotPolicyExplicitMemory

haAdmissionControlSlotPolicyExplicitMemory?: pulumi.Input<number>;

Controls the user-defined memory slot size, in MB. Default: 100.

property haAdmissionControlSlotPolicyUseExplicitSize

haAdmissionControlSlotPolicyUseExplicitSize?: pulumi.Input<boolean>;

Controls whether or not you wish to supply explicit values to CPU and memory slot sizes. The default is false, which tells vSphere to gather a automatic average based on all powered-on virtual machines currently in the cluster.

property haAdvancedOptions

haAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

A key/value map that specifies advanced options for vSphere HA.

property haDatastoreApdRecoveryAction

haDatastoreApdRecoveryAction?: pulumi.Input<string>;

Controls the action to take on virtual machines if an APD status on an affected datastore clears in the middle of an APD event. Can be one of none or reset. Default: none. *

property haDatastoreApdResponse

haDatastoreApdResponse?: pulumi.Input<string>;

Controls the action to take on virtual machines when the cluster has detected loss to all paths to a relevant datastore. Can be one of disabled, warning, restartConservative, or restartAggressive. Default: disabled. *

property haDatastoreApdResponseDelay

haDatastoreApdResponseDelay?: pulumi.Input<number>;

Controls the delay in minutes to wait after an APD timeout event to execute the response action defined in ha_datastore_apd_response. Default: 3 minutes. *

property haDatastorePdlResponse

haDatastorePdlResponse?: pulumi.Input<string>;

Controls the action to take on virtual machines when the cluster has detected a permanent device loss to a relevant datastore. Can be one of disabled, warning, or restartAggressive. Default: disabled. *

property haEnabled

haEnabled?: pulumi.Input<boolean>;

Enable vSphere HA for this cluster. Default: false.

property haHeartbeatDatastoreIds

haHeartbeatDatastoreIds?: pulumi.Input<pulumi.Input<string>[]>;

The list of managed object IDs for preferred datastores to use for HA heartbeating. This setting is only useful when ha_heartbeat_datastore_policy is set to either userSelectedDs or allFeasibleDsWithUserPreference.

property haHeartbeatDatastorePolicy

haHeartbeatDatastorePolicy?: pulumi.Input<string>;

The selection policy for HA heartbeat datastores. Can be one of allFeasibleDs, userSelectedDs, or allFeasibleDsWithUserPreference. Default: allFeasibleDsWithUserPreference.

property haHostIsolationResponse

haHostIsolationResponse?: pulumi.Input<string>;

The action to take on virtual machines when a host has detected that it has been isolated from the rest of the cluster. Can be one of none, powerOff, or shutdown. Default: none.

property haHostMonitoring

haHostMonitoring?: pulumi.Input<string>;

Global setting that controls whether vSphere HA remediates virtual machines on host failure. Can be one of enabled or disabled. Default: enabled.

property haVmComponentProtection

haVmComponentProtection?: pulumi.Input<string>;

Controls vSphere VM component protection for virtual machines in this cluster. Can be one of enabled or disabled. Default: enabled. *

property haVmDependencyRestartCondition

haVmDependencyRestartCondition?: pulumi.Input<string>;

The condition used to determine whether or not virtual machines in a certain restart priority class are online, allowing HA to move on to restarting virtual machines on the next priority. Can be one of none, poweredOn, guestHbStatusGreen, or appHbStatusGreen. The default is none, which means that a virtual machine is considered ready immediately after a host is found to start it on. *

property haVmFailureInterval

haVmFailureInterval?: pulumi.Input<number>;

If a heartbeat from a virtual machine is not received within this configured interval, the virtual machine is marked as failed. The value is in seconds. Default: 30.

property haVmMaximumFailureWindow

haVmMaximumFailureWindow?: pulumi.Input<number>;

The length of the reset window in which ha_vm_maximum_resets can operate. When this window expires, no more resets are attempted regardless of the setting configured in ha_vm_maximum_resets. -1 means no window, meaning an unlimited reset time is allotted. The value is specified in seconds. Default: -1 (no window).

property haVmMaximumResets

haVmMaximumResets?: pulumi.Input<number>;

The maximum number of resets that HA will perform to a virtual machine when responding to a failure event. Default: 3

property haVmMinimumUptime

haVmMinimumUptime?: pulumi.Input<number>;

The time, in seconds, that HA waits after powering on a virtual machine before monitoring for heartbeats. Default: 120 (2 minutes).

property haVmMonitoring

haVmMonitoring?: pulumi.Input<string>;

The type of virtual machine monitoring to use when HA is enabled in the cluster. Can be one of vmMonitoringDisabled, vmMonitoringOnly, or vmAndAppMonitoring. Default: vmMonitoringDisabled.

property haVmRestartAdditionalDelay

haVmRestartAdditionalDelay?: pulumi.Input<number>;

Additional delay in seconds after ready condition is met. A VM is considered ready at this point. Default: 0 (no delay). *

property haVmRestartPriority

haVmRestartPriority?: pulumi.Input<string>;

The default restart priority for affected virtual machines when vSphere detects a host failure. Can be one of lowest, low, medium, high, or highest. Default: medium.

property haVmRestartTimeout

haVmRestartTimeout?: pulumi.Input<number>;

The maximum time, in seconds, that vSphere HA will wait for virtual machines in one priority to be ready before proceeding with the next priority. Default: 600 (10 minutes). *

property hostClusterExitTimeout

hostClusterExitTimeout?: pulumi.Input<number>;

The timeout for each host maintenance mode operation when removing hosts from a cluster. The value is specified in seconds. Default: 3600 (1 hour).

property hostSystemIds

hostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property name

name?: pulumi.Input<string>;

The name of the cluster.

property proactiveHaAutomationLevel

proactiveHaAutomationLevel?: pulumi.Input<string>;

Determines how the host quarantine, maintenance mode, or virtual machine migration recommendations made by proactive HA are to be handled. Can be one of Automated or Manual. Default: Manual. *

property proactiveHaEnabled

proactiveHaEnabled?: pulumi.Input<boolean>;

Enables Proactive HA. Default: false. *

property proactiveHaModerateRemediation

proactiveHaModerateRemediation?: pulumi.Input<string>;

The configured remediation for moderately degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to MaintenanceMode when proactive_ha_severe_remediation is set to QuarantineMode. Default: QuarantineMode. *

property proactiveHaProviderIds

proactiveHaProviderIds?: pulumi.Input<pulumi.Input<string>[]>;

The list of IDs for health update providers configured for this cluster. *

property proactiveHaSevereRemediation

proactiveHaSevereRemediation?: pulumi.Input<string>;

The configured remediation for severely degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to QuarantineMode when proactive_ha_moderate_remediation is set to MaintenanceMode. Default: QuarantineMode. *

property tags

tags?: pulumi.Input<pulumi.Input<string>[]>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

interface ComputeClusterHostGroupArgs

The set of arguments for constructing a ComputeClusterHostGroup resource.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property hostSystemIds

hostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property name

name?: pulumi.Input<string>;

The name of the host group. This must be unique in the cluster. Forces a new resource if changed.

interface ComputeClusterHostGroupState

Input properties used for looking up and filtering ComputeClusterHostGroup resources.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property hostSystemIds

hostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property name

name?: pulumi.Input<string>;

The name of the host group. This must be unique in the cluster. Forces a new resource if changed.

interface ComputeClusterState

Input properties used for looking up and filtering ComputeCluster resources.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

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.

property datacenterId

datacenterId?: pulumi.Input<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the cluster in. Forces a new resource if changed.

property dpmAutomationLevel

dpmAutomationLevel?: pulumi.Input<string>;

The automation level for host power operations in this cluster. Can be one of manual or automated. Default: manual.

property dpmEnabled

dpmEnabled?: pulumi.Input<boolean>;

Enable DPM support for DRS in this cluster. Requires drs_enabled to be true in order to be effective. Default: false.

property dpmThreshold

dpmThreshold?: pulumi.Input<number>;

A value between 1 and 5 indicating the threshold of load within the cluster that influences host power operations. This affects both power on and power off operations - a lower setting will tolerate more of a surplus/deficit than a higher setting. Default: 3.

property drsAdvancedOptions

drsAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

A key/value map that specifies advanced options for DRS and DPM.

property drsAutomationLevel

drsAutomationLevel?: pulumi.Input<string>;

The default automation level for all virtual machines in this cluster. Can be one of manual, partiallyAutomated, or fullyAutomated. Default: manual.

property drsEnablePredictiveDrs

drsEnablePredictiveDrs?: pulumi.Input<boolean>;

When true, enables DRS to use data from [vRealize Operations Manager][ref-vsphere-vro] to make proactive DRS recommendations. *

property drsEnableVmOverrides

drsEnableVmOverrides?: pulumi.Input<boolean>;

Allow individual DRS overrides to be set for virtual machines in the cluster. Default: true.

property drsEnabled

drsEnabled?: pulumi.Input<boolean>;

Enable DRS for this cluster. Default: false.

property drsMigrationThreshold

drsMigrationThreshold?: pulumi.Input<number>;

A value between 1 and 5 indicating the threshold of imbalance tolerated between hosts. A lower setting will tolerate more imbalance while a higher setting will tolerate less. Default: 3.

property folder

folder?: pulumi.Input<string>;

The name of the folder to locate the cluster in.

property forceEvacuateOnDestroy

forceEvacuateOnDestroy?: pulumi.Input<boolean>;

Force removal of all hosts in the cluster during destroy and make them standalone hosts. Use of this flag mainly exists for testing and is not recommended in normal use.

property haAdmissionControlFailoverHostSystemIds

haAdmissionControlFailoverHostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

Defines the [managed object IDs][docs-about-morefs] of hosts to use as dedicated failover hosts. These hosts are kept as available as possible - admission control will block access to the host, and DRS will ignore the host when making recommendations.

property haAdmissionControlHostFailureTolerance

haAdmissionControlHostFailureTolerance?: pulumi.Input<number>;

The maximum number of failed hosts that admission control tolerates when making decisions on whether to permit virtual machine operations. The maximum is one less than the number of hosts in the cluster. Default: 1. *

property haAdmissionControlPerformanceTolerance

haAdmissionControlPerformanceTolerance?: pulumi.Input<number>;

The percentage of resource reduction that a cluster of virtual machines can tolerate in case of a failover. A value of 0 produces warnings only, whereas a value of 100 disables the setting. Default: 100 (disabled).

property haAdmissionControlPolicy

haAdmissionControlPolicy?: pulumi.Input<string>;

The type of admission control policy to use with vSphere HA. Can be one of resourcePercentage, slotPolicy, failoverHosts, or disabled. Default: resourcePercentage.

property haAdmissionControlResourcePercentageAutoCompute

haAdmissionControlResourcePercentageAutoCompute?: pulumi.Input<boolean>;

Automatically determine available resource percentages by subtracting the average number of host resources represented by the ha_admission_control_host_failure_tolerance setting from the total amount of resources in the cluster. Disable to supply user-defined values. Default: true. *

property haAdmissionControlResourcePercentageCpu

haAdmissionControlResourcePercentageCpu?: pulumi.Input<number>;

Controls the user-defined percentage of CPU resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlResourcePercentageMemory

haAdmissionControlResourcePercentageMemory?: pulumi.Input<number>;

Controls the user-defined percentage of memory resources in the cluster to reserve for failover. Default: 100.

property haAdmissionControlSlotPolicyExplicitCpu

haAdmissionControlSlotPolicyExplicitCpu?: pulumi.Input<number>;

Controls the user-defined CPU slot size, in MHz. Default: 32.

property haAdmissionControlSlotPolicyExplicitMemory

haAdmissionControlSlotPolicyExplicitMemory?: pulumi.Input<number>;

Controls the user-defined memory slot size, in MB. Default: 100.

property haAdmissionControlSlotPolicyUseExplicitSize

haAdmissionControlSlotPolicyUseExplicitSize?: pulumi.Input<boolean>;

Controls whether or not you wish to supply explicit values to CPU and memory slot sizes. The default is false, which tells vSphere to gather a automatic average based on all powered-on virtual machines currently in the cluster.

property haAdvancedOptions

haAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

A key/value map that specifies advanced options for vSphere HA.

property haDatastoreApdRecoveryAction

haDatastoreApdRecoveryAction?: pulumi.Input<string>;

Controls the action to take on virtual machines if an APD status on an affected datastore clears in the middle of an APD event. Can be one of none or reset. Default: none. *

property haDatastoreApdResponse

haDatastoreApdResponse?: pulumi.Input<string>;

Controls the action to take on virtual machines when the cluster has detected loss to all paths to a relevant datastore. Can be one of disabled, warning, restartConservative, or restartAggressive. Default: disabled. *

property haDatastoreApdResponseDelay

haDatastoreApdResponseDelay?: pulumi.Input<number>;

Controls the delay in minutes to wait after an APD timeout event to execute the response action defined in ha_datastore_apd_response. Default: 3 minutes. *

property haDatastorePdlResponse

haDatastorePdlResponse?: pulumi.Input<string>;

Controls the action to take on virtual machines when the cluster has detected a permanent device loss to a relevant datastore. Can be one of disabled, warning, or restartAggressive. Default: disabled. *

property haEnabled

haEnabled?: pulumi.Input<boolean>;

Enable vSphere HA for this cluster. Default: false.

property haHeartbeatDatastoreIds

haHeartbeatDatastoreIds?: pulumi.Input<pulumi.Input<string>[]>;

The list of managed object IDs for preferred datastores to use for HA heartbeating. This setting is only useful when ha_heartbeat_datastore_policy is set to either userSelectedDs or allFeasibleDsWithUserPreference.

property haHeartbeatDatastorePolicy

haHeartbeatDatastorePolicy?: pulumi.Input<string>;

The selection policy for HA heartbeat datastores. Can be one of allFeasibleDs, userSelectedDs, or allFeasibleDsWithUserPreference. Default: allFeasibleDsWithUserPreference.

property haHostIsolationResponse

haHostIsolationResponse?: pulumi.Input<string>;

The action to take on virtual machines when a host has detected that it has been isolated from the rest of the cluster. Can be one of none, powerOff, or shutdown. Default: none.

property haHostMonitoring

haHostMonitoring?: pulumi.Input<string>;

Global setting that controls whether vSphere HA remediates virtual machines on host failure. Can be one of enabled or disabled. Default: enabled.

property haVmComponentProtection

haVmComponentProtection?: pulumi.Input<string>;

Controls vSphere VM component protection for virtual machines in this cluster. Can be one of enabled or disabled. Default: enabled. *

property haVmDependencyRestartCondition

haVmDependencyRestartCondition?: pulumi.Input<string>;

The condition used to determine whether or not virtual machines in a certain restart priority class are online, allowing HA to move on to restarting virtual machines on the next priority. Can be one of none, poweredOn, guestHbStatusGreen, or appHbStatusGreen. The default is none, which means that a virtual machine is considered ready immediately after a host is found to start it on. *

property haVmFailureInterval

haVmFailureInterval?: pulumi.Input<number>;

If a heartbeat from a virtual machine is not received within this configured interval, the virtual machine is marked as failed. The value is in seconds. Default: 30.

property haVmMaximumFailureWindow

haVmMaximumFailureWindow?: pulumi.Input<number>;

The length of the reset window in which ha_vm_maximum_resets can operate. When this window expires, no more resets are attempted regardless of the setting configured in ha_vm_maximum_resets. -1 means no window, meaning an unlimited reset time is allotted. The value is specified in seconds. Default: -1 (no window).

property haVmMaximumResets

haVmMaximumResets?: pulumi.Input<number>;

The maximum number of resets that HA will perform to a virtual machine when responding to a failure event. Default: 3

property haVmMinimumUptime

haVmMinimumUptime?: pulumi.Input<number>;

The time, in seconds, that HA waits after powering on a virtual machine before monitoring for heartbeats. Default: 120 (2 minutes).

property haVmMonitoring

haVmMonitoring?: pulumi.Input<string>;

The type of virtual machine monitoring to use when HA is enabled in the cluster. Can be one of vmMonitoringDisabled, vmMonitoringOnly, or vmAndAppMonitoring. Default: vmMonitoringDisabled.

property haVmRestartAdditionalDelay

haVmRestartAdditionalDelay?: pulumi.Input<number>;

Additional delay in seconds after ready condition is met. A VM is considered ready at this point. Default: 0 (no delay). *

property haVmRestartPriority

haVmRestartPriority?: pulumi.Input<string>;

The default restart priority for affected virtual machines when vSphere detects a host failure. Can be one of lowest, low, medium, high, or highest. Default: medium.

property haVmRestartTimeout

haVmRestartTimeout?: pulumi.Input<number>;

The maximum time, in seconds, that vSphere HA will wait for virtual machines in one priority to be ready before proceeding with the next priority. Default: 600 (10 minutes). *

property hostClusterExitTimeout

hostClusterExitTimeout?: pulumi.Input<number>;

The timeout for each host maintenance mode operation when removing hosts from a cluster. The value is specified in seconds. Default: 3600 (1 hour).

property hostSystemIds

hostSystemIds?: pulumi.Input<pulumi.Input<string>[]>;

The [managed object IDs][docs-about-morefs] of the hosts to put in the cluster.

property name

name?: pulumi.Input<string>;

The name of the cluster.

property proactiveHaAutomationLevel

proactiveHaAutomationLevel?: pulumi.Input<string>;

Determines how the host quarantine, maintenance mode, or virtual machine migration recommendations made by proactive HA are to be handled. Can be one of Automated or Manual. Default: Manual. *

property proactiveHaEnabled

proactiveHaEnabled?: pulumi.Input<boolean>;

Enables Proactive HA. Default: false. *

property proactiveHaModerateRemediation

proactiveHaModerateRemediation?: pulumi.Input<string>;

The configured remediation for moderately degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to MaintenanceMode when proactive_ha_severe_remediation is set to QuarantineMode. Default: QuarantineMode. *

property proactiveHaProviderIds

proactiveHaProviderIds?: pulumi.Input<pulumi.Input<string>[]>;

The list of IDs for health update providers configured for this cluster. *

property proactiveHaSevereRemediation

proactiveHaSevereRemediation?: pulumi.Input<string>;

The configured remediation for severely degraded hosts. Can be one of MaintenanceMode or QuarantineMode. Note that this cannot be set to QuarantineMode when proactive_ha_moderate_remediation is set to MaintenanceMode. Default: QuarantineMode. *

property resourcePoolId

resourcePoolId?: pulumi.Input<string>;

The managed object ID of the cluster’s root resource pool.

property tags

tags?: pulumi.Input<pulumi.Input<string>[]>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

interface ComputeClusterVmAffinityRuleArgs

The set of arguments for constructing a ComputeClusterVmAffinityRule resource.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property virtualMachineIds

virtualMachineIds: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines to run on the same host together.

interface ComputeClusterVmAffinityRuleState

Input properties used for looking up and filtering ComputeClusterVmAffinityRule resources.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property virtualMachineIds

virtualMachineIds?: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines to run on the same host together.

interface ComputeClusterVmAntiAffinityRuleArgs

The set of arguments for constructing a ComputeClusterVmAntiAffinityRule resource.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property virtualMachineIds

virtualMachineIds: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines to run on hosts different from each other.

interface ComputeClusterVmAntiAffinityRuleState

Input properties used for looking up and filtering ComputeClusterVmAntiAffinityRule resources.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property virtualMachineIds

virtualMachineIds?: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines to run on hosts different from each other.

interface ComputeClusterVmDependencyRuleArgs

The set of arguments for constructing a ComputeClusterVmDependencyRule resource.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property dependencyVmGroupName

dependencyVmGroupName: pulumi.Input<string>;

The name of the VM group that this rule depends on. The VMs defined in the group specified by vm_group_name will not be started until the VMs in this group are started.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property vmGroupName

vmGroupName: pulumi.Input<string>;

The name of the VM group that is the subject of this rule. The VMs defined in this group will not be started until the VMs in the group specified by dependency_vm_group_name are started.

interface ComputeClusterVmDependencyRuleState

Input properties used for looking up and filtering ComputeClusterVmDependencyRule resources.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property dependencyVmGroupName

dependencyVmGroupName?: pulumi.Input<string>;

The name of the VM group that this rule depends on. The VMs defined in the group specified by vm_group_name will not be started until the VMs in this group are started.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property vmGroupName

vmGroupName?: pulumi.Input<string>;

The name of the VM group that is the subject of this rule. The VMs defined in this group will not be started until the VMs in the group specified by dependency_vm_group_name are started.

interface ComputeClusterVmGroupArgs

The set of arguments for constructing a ComputeClusterVmGroup resource.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property name

name?: pulumi.Input<string>;

The name of the VM group. This must be unique in the cluster. Forces a new resource if changed.

property virtualMachineIds

virtualMachineIds?: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines in this group.

interface ComputeClusterVmGroupState

Input properties used for looking up and filtering ComputeClusterVmGroup resources.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property name

name?: pulumi.Input<string>;

The name of the VM group. This must be unique in the cluster. Forces a new resource if changed.

property virtualMachineIds

virtualMachineIds?: pulumi.Input<pulumi.Input<string>[]>;

The UUIDs of the virtual machines in this group.

interface ComputeClusterVmHostRuleArgs

The set of arguments for constructing a ComputeClusterVmHostRule resource.

property affinityHostGroupName

affinityHostGroupName?: pulumi.Input<string>;

When this field is used, the virtual machines defined in vm_group_name will be run on the hosts defined in this host group.

property antiAffinityHostGroupName

antiAffinityHostGroupName?: pulumi.Input<string>;

When this field is used, the virtual machines defined in vm_group_name will not be run on the hosts defined in this host group.

property computeClusterId

computeClusterId: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property vmGroupName

vmGroupName: pulumi.Input<string>;

The name of the virtual machine group to use with this rule.

interface ComputeClusterVmHostRuleState

Input properties used for looking up and filtering ComputeClusterVmHostRule resources.

property affinityHostGroupName

affinityHostGroupName?: pulumi.Input<string>;

When this field is used, the virtual machines defined in vm_group_name will be run on the hosts defined in this host group.

property antiAffinityHostGroupName

antiAffinityHostGroupName?: pulumi.Input<string>;

When this field is used, the virtual machines defined in vm_group_name will not be run on the hosts defined in this host group.

property computeClusterId

computeClusterId?: pulumi.Input<string>;

The [managed object reference ID][docs-about-morefs] of the cluster to put the group in. Forces a new resource if changed.

property enabled

enabled?: pulumi.Input<boolean>;

Enable this rule in the cluster. Default: true.

property mandatory

mandatory?: pulumi.Input<boolean>;

When this value is true, prevents any virtual machine operations that may violate this rule. Default: false.

property name

name?: pulumi.Input<string>;

The name of the rule. This must be unique in the cluster.

property vmGroupName

vmGroupName?: pulumi.Input<string>;

The name of the virtual machine group to use with this rule.

interface CustomAttributeArgs

The set of arguments for constructing a CustomAttribute resource.

property managedObjectType

managedObjectType?: pulumi.Input<string>;

The object type that this attribute may be applied to. If not set, the custom attribute may be applied to any object type. For a full list, click here. Forces a new resource if changed.

property name

name?: pulumi.Input<string>;

The name of the custom attribute.

interface CustomAttributeState

Input properties used for looking up and filtering CustomAttribute resources.

property managedObjectType

managedObjectType?: pulumi.Input<string>;

The object type that this attribute may be applied to. If not set, the custom attribute may be applied to any object type. For a full list, click here. Forces a new resource if changed.

property name

name?: pulumi.Input<string>;

The name of the custom attribute.

interface DatacenterArgs

The set of arguments for constructing a Datacenter resource.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

Map of custom attribute ids to value strings to set for datacenter resource. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property folder

folder?: pulumi.Input<string>;

The folder where the datacenter should be created. Forces a new resource if changed.

property name

name?: pulumi.Input<string>;

The name of the datacenter. This name needs to be unique within the folder. Forces a new resource if changed.

property tags

tags?: pulumi.Input<pulumi.Input<string>[]>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

interface DatacenterState

Input properties used for looking up and filtering Datacenter resources.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

Map of custom attribute ids to value strings to set for datacenter resource. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.

property folder

folder?: pulumi.Input<string>;

The folder where the datacenter should be created. Forces a new resource if changed.

property moid

moid?: pulumi.Input<string>;

[Managed object ID][docs-about-morefs] of this datacenter.

property name

name?: pulumi.Input<string>;

The name of the datacenter. This name needs to be unique within the folder. Forces a new resource if changed.

property tags

tags?: pulumi.Input<pulumi.Input<string>[]>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

interface DatastoreClusterArgs

The set of arguments for constructing a DatastoreCluster resource.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

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.

property datacenterId

datacenterId: pulumi.Input<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the datastore cluster in. Forces a new resource if changed.

property folder

folder?: pulumi.Input<string>;

The name of the folder to locate the datastore cluster in.

property name

name?: pulumi.Input<string>;

The name of the datastore cluster.

property sdrsAdvancedOptions

sdrsAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

Advanced configuration options for storage DRS.

property sdrsAutomationLevel

sdrsAutomationLevel?: pulumi.Input<string>;

The global automation level for all virtual machines in this datastore cluster. Default: manual.

property sdrsDefaultIntraVmAffinity

sdrsDefaultIntraVmAffinity?: pulumi.Input<boolean>;

When true, all disks in a single virtual machine will be kept on the same datastore. Default: true.

property sdrsEnabled

sdrsEnabled?: pulumi.Input<boolean>;

Enable Storage DRS for this datastore cluster. Default: false.

property sdrsFreeSpaceThreshold

sdrsFreeSpaceThreshold?: pulumi.Input<number>;

The free space threshold to use. When set to utilization, drs_space_utilization_threshold is used, and when set to freeSpace, drs_free_space_threshold is used. Default: utilization.

property sdrsFreeSpaceThresholdMode

sdrsFreeSpaceThresholdMode?: pulumi.Input<string>;

The free space threshold to use. When set to utilization, drs_space_utilization_threshold is used, and when set to freeSpace, drs_free_space_threshold is used.

property sdrsFreeSpaceUtilizationDifference

sdrsFreeSpaceUtilizationDifference?: pulumi.Input<number>;

The threshold, in percent, of difference between space utilization in datastores before storage DRS makes decisions to balance the space. Default: 5 percent.

property sdrsIoBalanceAutomationLevel

sdrsIoBalanceAutomationLevel?: pulumi.Input<string>;

Overrides the default automation settings when correcting I/O load imbalances.

property sdrsIoLatencyThreshold

sdrsIoLatencyThreshold?: pulumi.Input<number>;

The I/O latency threshold, in milliseconds, that storage DRS uses to make recommendations to move disks from this datastore. Default: 15 seconds.

property sdrsIoLoadBalanceEnabled

sdrsIoLoadBalanceEnabled?: pulumi.Input<boolean>;

Enable I/O load balancing for this datastore cluster. Default: true.

property sdrsIoLoadImbalanceThreshold

sdrsIoLoadImbalanceThreshold?: pulumi.Input<number>;

The difference between load in datastores in the cluster before storage DRS makes recommendations to balance the load. Default: 5 percent.

property sdrsIoReservableIopsThreshold

sdrsIoReservableIopsThreshold?: 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. Note that this setting should only be set if sdrs_io_reservable_percent_threshold cannot make an accurate estimate of the capacity of the datastores in your cluster, and should be set to roughly 50-60% of the worst case peak performance of the backing LUNs.

property sdrsIoReservablePercentThreshold

sdrsIoReservablePercentThreshold?: 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. Default: 60 percent.

property sdrsIoReservableThresholdMode

sdrsIoReservableThresholdMode?: pulumi.Input<string>;

The reservable IOPS threshold setting to use, sdrs_io_reservable_percent_threshold in the event of automatic, or sdrs_io_reservable_iops_threshold in the event of manual. Default: automatic.

property sdrsLoadBalanceInterval

sdrsLoadBalanceInterval?: pulumi.Input<number>;

The storage DRS poll interval, in minutes. Default: 480 minutes.

property sdrsPolicyEnforcementAutomationLevel

sdrsPolicyEnforcementAutomationLevel?: pulumi.Input<string>;

Overrides the default automation settings when correcting storage and VM policy violations.

property sdrsRuleEnforcementAutomationLevel

sdrsRuleEnforcementAutomationLevel?: pulumi.Input<string>;

Overrides the default automation settings when correcting affinity rule violations.

property sdrsSpaceBalanceAutomationLevel

sdrsSpaceBalanceAutomationLevel?: pulumi.Input<string>;

Overrides the default automation settings when correcting disk space imbalances.

property sdrsSpaceUtilizationThreshold

sdrsSpaceUtilizationThreshold?: pulumi.Input<number>;

The threshold, in percent of used space, that storage DRS uses to make decisions to migrate VMs out of a datastore.

property sdrsVmEvacuationAutomationLevel

sdrsVmEvacuationAutomationLevel?: pulumi.Input<string>;

Overrides the default automation settings when generating recommendations for datastore evacuation.

property tags

tags?: pulumi.Input<pulumi.Input<string>[]>;

The IDs of any tags to attach to this resource. See [here][docs-applying-tags] for a reference on how to apply tags.

interface DatastoreClusterState

Input properties used for looking up and filtering DatastoreCluster resources.

property customAttributes

customAttributes?: pulumi.Input<{[key: string]: any}>;

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.

property datacenterId

datacenterId?: pulumi.Input<string>;

The [managed object ID][docs-about-morefs] of the datacenter to create the datastore cluster in. Forces a new resource if changed.

property folder

folder?: pulumi.Input<string>;

The name of the folder to locate the datastore cluster in.

property name

name?: pulumi.Input<string>;

The name of the datastore cluster.

property sdrsAdvancedOptions

sdrsAdvancedOptions?: pulumi.Input<{[key: string]: any}>;

Advanced configuration options for storage DRS.

property sdrsAutomationLevel

sdrsAutomationLevel?: pulumi.Input<string>;

The global automation level for all virtual machines in this datastore cluster. Default: manual.