import * as pulumi from "@pulumi/pulumi"; /** * The `vsphere.HaVmOverride` 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][ref-vsphere-ha-clusters]. * * [ref-vsphere-ha-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-availability.html * * > **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.VirtualMachine` resource, creating the * virtual machine in the cluster looked up by the * `vsphere.ComputeCluster` 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, it * `haVmRestartPriority` has 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. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore1", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "network1", * datacenterId: datacenter.id, * })); * const vm = new vsphere.VirtualMachine("vm", { * name: "test", * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreId: datastore.then(datastore => datastore.id), * numCpus: 2, * memory: 2048, * guestId: "otherLinux64Guest", * networkInterfaces: [{ * networkId: network.then(network => network.id), * }], * disks: [{ * label: "disk0", * size: 20, * }], * }); * const haVmOverride = new vsphere.HaVmOverride("ha_vm_override", { * computeClusterId: cluster.then(cluster => cluster.id), * virtualMachineId: vm.id, * haVmRestartPriority: "highest", * }); * ``` * * ## Import * * An existing override can be imported into this resource by * * supplying both the path to the cluster, and the path to the virtual machine, to * * `pulumi import`. If no override exists, an error will be given. An example * * is below: * * [docs-import]: https://developer.hashicorp.com/terraform/cli/import * * ```sh * $ pulumi import vsphere:index/haVmOverride:HaVmOverride ha_vm_override \ * ``` * * '{"compute_cluster_path": "/dc1/host/cluster1", \ * * "virtual_machine_path": "/dc1/vm/srv1"}' */ export declare class HaVmOverride extends pulumi.CustomResource { /** * Get an existing HaVmOverride resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: HaVmOverrideState, opts?: pulumi.CustomResourceOptions): HaVmOverride; /** * 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. */ static isInstance(obj: any): obj is HaVmOverride; /** * The managed object ID of the cluster. */ readonly computeClusterId: pulumi.Output; /** * 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. */ readonly haDatastoreApdRecoveryAction: pulumi.Output; /** * 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. */ readonly haDatastoreApdResponse: pulumi.Output; /** * Controls the delay in seconds to wait after an APD timeout event to execute the response action defined in * ha_datastore_apd_response. Specify -1 to use the cluster setting. */ readonly haDatastoreApdResponseDelay: pulumi.Output; /** * 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. */ readonly haDatastorePdlResponse: pulumi.Output; /** * The action to take on this virtual machine when a host is isolated from the rest of the cluster. Can be one of * clusterIsolationResponse, none, powerOff, or shutdown. */ readonly haHostIsolationResponse: pulumi.Output; /** * 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. */ readonly haVmFailureInterval: pulumi.Output; /** * The length of the reset window in which haVmMaximumResets 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. */ readonly haVmMaximumFailureWindow: pulumi.Output; /** * The maximum number of resets that HA will perform to this virtual machine when responding to a failure event. */ readonly haVmMaximumResets: pulumi.Output; /** * The time, in seconds, that HA waits after powering on this virtual machine before monitoring for heartbeats. */ readonly haVmMinimumUptime: pulumi.Output; /** * The type of virtual machine monitoring to use for this virtual machine. Can be one of vmMonitoringDisabled, * vmMonitoringOnly, or vmAndAppMonitoring. */ readonly haVmMonitoring: pulumi.Output; /** * 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. */ readonly haVmMonitoringUseClusterDefaults: pulumi.Output; /** * The restart priority for this virtual machine when vSphere detects a host failure. Can be one of clusterRestartPriority, * lowest, low, medium, high, or highest. */ readonly haVmRestartPriority: pulumi.Output; /** * The maximum time, in seconds, that vSphere HA will wait for the virtual machine to be ready. Use -1 to use the cluster * default. */ readonly haVmRestartTimeout: pulumi.Output; /** * The managed object ID of the virtual machine. */ readonly virtualMachineId: pulumi.Output; /** * Create a HaVmOverride resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HaVmOverrideArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HaVmOverride resources. */ export interface HaVmOverrideState { /** * The managed object ID of the cluster. */ computeClusterId?: pulumi.Input; /** * 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. */ haDatastoreApdRecoveryAction?: pulumi.Input; /** * 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. */ haDatastoreApdResponse?: pulumi.Input; /** * Controls the delay in seconds to wait after an APD timeout event to execute the response action defined in * ha_datastore_apd_response. Specify -1 to use the cluster setting. */ haDatastoreApdResponseDelay?: pulumi.Input; /** * 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. */ haDatastorePdlResponse?: pulumi.Input; /** * The action to take on this virtual machine when a host is isolated from the rest of the cluster. Can be one of * clusterIsolationResponse, none, powerOff, or shutdown. */ haHostIsolationResponse?: pulumi.Input; /** * 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. */ haVmFailureInterval?: pulumi.Input; /** * The length of the reset window in which haVmMaximumResets 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. */ haVmMaximumFailureWindow?: pulumi.Input; /** * The maximum number of resets that HA will perform to this virtual machine when responding to a failure event. */ haVmMaximumResets?: pulumi.Input; /** * The time, in seconds, that HA waits after powering on this virtual machine before monitoring for heartbeats. */ haVmMinimumUptime?: pulumi.Input; /** * The type of virtual machine monitoring to use for this virtual machine. Can be one of vmMonitoringDisabled, * vmMonitoringOnly, or vmAndAppMonitoring. */ haVmMonitoring?: pulumi.Input; /** * 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. */ haVmMonitoringUseClusterDefaults?: pulumi.Input; /** * The restart priority for this virtual machine when vSphere detects a host failure. Can be one of clusterRestartPriority, * lowest, low, medium, high, or highest. */ haVmRestartPriority?: pulumi.Input; /** * The maximum time, in seconds, that vSphere HA will wait for the virtual machine to be ready. Use -1 to use the cluster * default. */ haVmRestartTimeout?: pulumi.Input; /** * The managed object ID of the virtual machine. */ virtualMachineId?: pulumi.Input; } /** * The set of arguments for constructing a HaVmOverride resource. */ export interface HaVmOverrideArgs { /** * The managed object ID of the cluster. */ computeClusterId: pulumi.Input; /** * 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. */ haDatastoreApdRecoveryAction?: pulumi.Input; /** * 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. */ haDatastoreApdResponse?: pulumi.Input; /** * Controls the delay in seconds to wait after an APD timeout event to execute the response action defined in * ha_datastore_apd_response. Specify -1 to use the cluster setting. */ haDatastoreApdResponseDelay?: pulumi.Input; /** * 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. */ haDatastorePdlResponse?: pulumi.Input; /** * The action to take on this virtual machine when a host is isolated from the rest of the cluster. Can be one of * clusterIsolationResponse, none, powerOff, or shutdown. */ haHostIsolationResponse?: pulumi.Input; /** * 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. */ haVmFailureInterval?: pulumi.Input; /** * The length of the reset window in which haVmMaximumResets 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. */ haVmMaximumFailureWindow?: pulumi.Input; /** * The maximum number of resets that HA will perform to this virtual machine when responding to a failure event. */ haVmMaximumResets?: pulumi.Input; /** * The time, in seconds, that HA waits after powering on this virtual machine before monitoring for heartbeats. */ haVmMinimumUptime?: pulumi.Input; /** * The type of virtual machine monitoring to use for this virtual machine. Can be one of vmMonitoringDisabled, * vmMonitoringOnly, or vmAndAppMonitoring. */ haVmMonitoring?: pulumi.Input; /** * 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. */ haVmMonitoringUseClusterDefaults?: pulumi.Input; /** * The restart priority for this virtual machine when vSphere detects a host failure. Can be one of clusterRestartPriority, * lowest, low, medium, high, or highest. */ haVmRestartPriority?: pulumi.Input; /** * The maximum time, in seconds, that vSphere HA will wait for the virtual machine to be ready. Use -1 to use the cluster * default. */ haVmRestartTimeout?: pulumi.Input; /** * The managed object ID of the virtual machine. */ virtualMachineId: pulumi.Input; }