import * as pulumi from "@pulumi/pulumi"; /** * Provides a resource to create, read, update, and delete VM-Host Affinity policies. VM-Host Affinity policies ensure that VMs in specific categories are placed on hosts in specified categories. This enables better control over VM placement for compliance, performance, or licensing requirements. For more information on VM-Host Affinity Policies, see the [AHV Administration Guide](https://portal.nutanix.com/page/documents/details?targetId=AHV-Admin-Guide-v11_0:ahv-affinity-policies.html). * * ## Example Usage * * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nutanix from "@pierskarsenbarg/nutanix"; * * // Create VM categories * const vmAffinityCategory = new nutanix.CategoryV2("vm_affinity_category", { * key: "vm-host-affinity", * value: "vm-affinity-group-1", * }); * // Create host categories * const hostAffinityCategory = new nutanix.CategoryV2("host_affinity_category", { * key: "vm-host-affinity", * value: "host-affinity-group-1", * }); * // Create VM-Host Affinity policy * const example = new nutanix.VmHostAffinityPolicyV2("example", { * name: "vm-host-affinity-policy", * description: "Policy to place VMs on specific hosts", * vmCategories: [vmAffinityCategory.id], * hostCategories: [hostAffinityCategory.id], * }); * ``` * * * ## Example Import * * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nutanix from "@pierskarsenbarg/nutanix"; * * // First, get the ext_id of the policy * const policies = nutanix.getVmHostAffinityPoliciesV2({}); * // Create the configuration * const imported = new nutanix.VmHostAffinityPolicyV2("imported", {}); * ``` * * * See detailed information in [Nutanix VM-Host Affinity Policies V4](https://developers.nutanix.com/api-reference?namespace=vmm&version=v4.2#tag/VmHostAffinityPolicies) */ export declare class VmHostAffinityPolicyV2 extends pulumi.CustomResource { /** * Get an existing VmHostAffinityPolicyV2 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?: VmHostAffinityPolicyV2State, opts?: pulumi.CustomResourceOptions): VmHostAffinityPolicyV2; /** * Returns true if the given object is an instance of VmHostAffinityPolicyV2. 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 VmHostAffinityPolicyV2; /** * The timestamp when the policy was created. */ readonly createTime: pulumi.Output; /** * Information about the entity that created the policy. */ readonly createdBy: pulumi.Output<{ [key: string]: string; }>; /** * A description of the VM-Host Affinity policy. */ readonly description: pulumi.Output; /** * The external identifier of the policy. */ readonly extId: pulumi.Output; /** * List of host category external IDs that define where the VMs can be placed. Hosts with these categories will be used for VM placement. */ readonly hostCategories: pulumi.Output; /** * Information about the entity that last updated the policy. */ readonly lastUpdatedBy: pulumi.Output<{ [key: string]: string; }>; /** * The name of the VM-Host Affinity policy. */ readonly name: pulumi.Output; /** * Number of VMs which are compliant with the VM-host affinity policy. */ readonly numCompliantVms: pulumi.Output; /** * Number of hosts associated with the VM-host affinity policy. */ readonly numHosts: pulumi.Output; /** * Number of VMs which are not compliant with the VM-host affinity policy. */ readonly numNonCompliantVms: pulumi.Output; /** * Number of VMs associated with the VM-host affinity policy. */ readonly numVms: pulumi.Output; /** * The timestamp when the policy was last updated. */ readonly updateTime: pulumi.Output; /** * List of VM category external IDs that this policy applies to. VMs with these categories will be subject to the affinity placement rules. */ readonly vmCategories: pulumi.Output; /** * Create a VmHostAffinityPolicyV2 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: VmHostAffinityPolicyV2Args, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VmHostAffinityPolicyV2 resources. */ export interface VmHostAffinityPolicyV2State { /** * The timestamp when the policy was created. */ createTime?: pulumi.Input; /** * Information about the entity that created the policy. */ createdBy?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * A description of the VM-Host Affinity policy. */ description?: pulumi.Input; /** * The external identifier of the policy. */ extId?: pulumi.Input; /** * List of host category external IDs that define where the VMs can be placed. Hosts with these categories will be used for VM placement. */ hostCategories?: pulumi.Input[] | undefined>; /** * Information about the entity that last updated the policy. */ lastUpdatedBy?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The name of the VM-Host Affinity policy. */ name?: pulumi.Input; /** * Number of VMs which are compliant with the VM-host affinity policy. */ numCompliantVms?: pulumi.Input; /** * Number of hosts associated with the VM-host affinity policy. */ numHosts?: pulumi.Input; /** * Number of VMs which are not compliant with the VM-host affinity policy. */ numNonCompliantVms?: pulumi.Input; /** * Number of VMs associated with the VM-host affinity policy. */ numVms?: pulumi.Input; /** * The timestamp when the policy was last updated. */ updateTime?: pulumi.Input; /** * List of VM category external IDs that this policy applies to. VMs with these categories will be subject to the affinity placement rules. */ vmCategories?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a VmHostAffinityPolicyV2 resource. */ export interface VmHostAffinityPolicyV2Args { /** * A description of the VM-Host Affinity policy. */ description?: pulumi.Input; /** * List of host category external IDs that define where the VMs can be placed. Hosts with these categories will be used for VM placement. */ hostCategories: pulumi.Input[]>; /** * The name of the VM-Host Affinity policy. */ name?: pulumi.Input; /** * List of VM category external IDs that this policy applies to. VMs with these categories will be subject to the affinity placement rules. */ vmCategories: pulumi.Input[]>; } //# sourceMappingURL=vmHostAffinityPolicyV2.d.ts.map