import * as pulumi from "@pulumi/pulumi"; /** * The `vsphere.ComputeClusterVmAntiAffinityRule` resource can be used to * manage virtual machine anti-affinity rules in a cluster, either created by the * [`vsphere.ComputeCluster`][tf-vsphere-cluster-resource] resource or looked up * by the [`vsphere.ComputeCluster`][tf-vsphere-cluster-data-source] data source. * * [tf-vsphere-cluster-resource]: /docs/providers/vsphere/r/compute_cluster.html * [tf-vsphere-cluster-data-source]: /docs/providers/vsphere/d/compute_cluster.html * * An anti-affinity rule places a group of virtual machines across different * hosts within a cluster, and is useful for preventing single points of failure in * application cluster scenarios. When configured, vSphere 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. * * > An anti-affinity rule can only be used to place virtual machines on separate * _non-specific_ hosts. Specific hosts cannot be specified with this rule. * To enable this capability, use VM-Host Groups, see the * [`vsphere.ComputeClusterVmHostRule`][tf-vsphere-cluster-vm-host-rule-resource] * resource. * * [tf-vsphere-cluster-vm-host-rule-resource]: /docs/providers/vsphere/r/compute_cluster_vm_host_rule.html * * > **NOTE:** This resource requires vCenter and is not available on * direct ESXi host connections. * * ## Import * * An existing rule can be imported into this resource by supplying * both the path to the cluster, and the name the rule. If the name or cluster is * not found, or if the rule is of a different type, an error will be returned. An * example is below: * * [docs-import]: https://developer.hashicorp.com/terraform/cli/import * * ```sh * terraform import vsphere_compute_cluster_vm_anti_affinity_rule.vm_anti_affinity_rule \ * '{"compute_cluster_path": "/dc-01/host/cluster-01", \ * "name": "vm-anti-affinity-rule"}' * ``` */ export declare class ComputeClusterVmAntiAffinityRule extends pulumi.CustomResource { /** * Get an existing ComputeClusterVmAntiAffinityRule 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?: ComputeClusterVmAntiAffinityRuleState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmAntiAffinityRule; /** * 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. */ static isInstance(obj: any): obj is ComputeClusterVmAntiAffinityRule; /** * The [managed object reference * ID][docs-about-morefs] of the cluster to put the group in. Forces a new * resource if changed. * * [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider */ readonly computeClusterId: pulumi.Output; /** * Enable this rule in the cluster. Default: `true`. */ readonly enabled: pulumi.Output; /** * When this value is `true`, prevents any virtual * machine operations that may violate this rule. Default: `false`. * * > **NOTE:** The namespace for rule names on this resource (defined by the * `name` argument) is shared with all rules in the cluster - consider * this when naming your rules. */ readonly mandatory: pulumi.Output; /** * The name of the rule. This must be unique in the cluster. */ readonly name: pulumi.Output; /** * The UUIDs of the virtual machines to run * on hosts different from each other. */ readonly virtualMachineIds: pulumi.Output; /** * Create a ComputeClusterVmAntiAffinityRule 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: ComputeClusterVmAntiAffinityRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ComputeClusterVmAntiAffinityRule resources. */ export interface ComputeClusterVmAntiAffinityRuleState { /** * The [managed object reference * ID][docs-about-morefs] of the cluster to put the group in. Forces a new * resource if changed. * * [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider */ computeClusterId?: pulumi.Input; /** * Enable this rule in the cluster. Default: `true`. */ enabled?: pulumi.Input; /** * When this value is `true`, prevents any virtual * machine operations that may violate this rule. Default: `false`. * * > **NOTE:** The namespace for rule names on this resource (defined by the * `name` argument) is shared with all rules in the cluster - consider * this when naming your rules. */ mandatory?: pulumi.Input; /** * The name of the rule. This must be unique in the cluster. */ name?: pulumi.Input; /** * The UUIDs of the virtual machines to run * on hosts different from each other. */ virtualMachineIds?: pulumi.Input[]>; } /** * The set of arguments for constructing a ComputeClusterVmAntiAffinityRule resource. */ export interface ComputeClusterVmAntiAffinityRuleArgs { /** * The [managed object reference * ID][docs-about-morefs] of the cluster to put the group in. Forces a new * resource if changed. * * [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider */ computeClusterId: pulumi.Input; /** * Enable this rule in the cluster. Default: `true`. */ enabled?: pulumi.Input; /** * When this value is `true`, prevents any virtual * machine operations that may violate this rule. Default: `false`. * * > **NOTE:** The namespace for rule names on this resource (defined by the * `name` argument) is shared with all rules in the cluster - consider * this when naming your rules. */ mandatory?: pulumi.Input; /** * The name of the rule. This must be unique in the cluster. */ name?: pulumi.Input; /** * The UUIDs of the virtual machines to run * on hosts different from each other. */ virtualMachineIds: pulumi.Input[]>; }