import * as pulumi from "@pulumi/pulumi"; /** * Manages a High Availability rule in a Proxmox VE cluster (PVE 9+). HA rules replace the legacy HA groups and provide node affinity and resource affinity capabilities. * * > **Note:** This resource requires Proxmox VE 9.0 or later. In PVE 9, HA groups * have been replaced by HA rules, which provide node affinity and resource affinity * capabilities. For PVE 8 and earlier, use * `proxmoxve.Hagroup` instead. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * // Node Affinity Rule: assign VMs to preferred nodes with priorities. * // Non-strict rules allow failover to other nodes; strict rules do not. * const preferNode1 = new proxmoxve.Harule("prefer_node1", { * rule: "prefer-node1", * type: "node-affinity", * comment: "Prefer node1 for these VMs", * resources: [ * "vm:100", * "vm:101", * ], * nodes: { * node1: 2, * node2: 1, * node3: 1, * }, * strict: false, * }); * // Resource Affinity Rule (Positive): keep resources together on the same node. * const keepTogether = new proxmoxve.Harule("keep_together", { * rule: "db-cluster-together", * type: "resource-affinity", * comment: "Keep database replicas on the same node", * resources: [ * "vm:200", * "vm:201", * ], * affinity: "positive", * }); * // Resource Affinity Rule (Negative / Anti-Affinity): keep resources on * // separate nodes for high availability. * const keepApart = new proxmoxve.Harule("keep_apart", { * rule: "db-cluster-apart", * type: "resource-affinity", * comment: "Spread database replicas across nodes", * resources: [ * "vm:200", * "vm:201", * "vm:202", * ], * affinity: "negative", * }); * ``` * * ## Import * * !/usr/bin/env sh * HA rules can be imported using their name, e.g.: * * ```sh * $ pulumi import proxmoxve:index/harule:Harule example prefer-node1 * ``` */ export declare class Harule extends pulumi.CustomResource { /** * Get an existing Harule 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?: HaruleState, opts?: pulumi.CustomResourceOptions): Harule; /** * Returns true if the given object is an instance of Harule. 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 Harule; /** * The resource affinity type (resource-affinity only). `positive` keeps resources on the same node, `negative` keeps them on separate nodes. */ readonly affinity: pulumi.Output; /** * The comment associated with this rule. */ readonly comment: pulumi.Output; /** * Whether the HA rule is disabled. Defaults to `false`. */ readonly disable: pulumi.Output; /** * The member nodes for this rule (node-affinity only). They are provided as a map, where the keys are the node names and the values represent their priority: integers for known priorities or `null` for unset priorities. */ readonly nodes: pulumi.Output<{ [key: string]: number; } | undefined>; /** * The set of HA resource IDs that this rule applies to (e.g. `vm:100`, `ct:101`). The resources must already be managed by HA. */ readonly resources: pulumi.Output; /** * The identifier of the High Availability rule to manage. */ readonly rule: pulumi.Output; /** * Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to `false`. */ readonly strict: pulumi.Output; /** * The HA rule type. Must be `node-affinity` or `resource-affinity`. */ readonly type: pulumi.Output; /** * Create a Harule 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: HaruleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Harule resources. */ export interface HaruleState { /** * The resource affinity type (resource-affinity only). `positive` keeps resources on the same node, `negative` keeps them on separate nodes. */ affinity?: pulumi.Input; /** * The comment associated with this rule. */ comment?: pulumi.Input; /** * Whether the HA rule is disabled. Defaults to `false`. */ disable?: pulumi.Input; /** * The member nodes for this rule (node-affinity only). They are provided as a map, where the keys are the node names and the values represent their priority: integers for known priorities or `null` for unset priorities. */ nodes?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The set of HA resource IDs that this rule applies to (e.g. `vm:100`, `ct:101`). The resources must already be managed by HA. */ resources?: pulumi.Input[] | undefined>; /** * The identifier of the High Availability rule to manage. */ rule?: pulumi.Input; /** * Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to `false`. */ strict?: pulumi.Input; /** * The HA rule type. Must be `node-affinity` or `resource-affinity`. */ type?: pulumi.Input; } /** * The set of arguments for constructing a Harule resource. */ export interface HaruleArgs { /** * The resource affinity type (resource-affinity only). `positive` keeps resources on the same node, `negative` keeps them on separate nodes. */ affinity?: pulumi.Input; /** * The comment associated with this rule. */ comment?: pulumi.Input; /** * Whether the HA rule is disabled. Defaults to `false`. */ disable?: pulumi.Input; /** * The member nodes for this rule (node-affinity only). They are provided as a map, where the keys are the node names and the values represent their priority: integers for known priorities or `null` for unset priorities. */ nodes?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The set of HA resource IDs that this rule applies to (e.g. `vm:100`, `ct:101`). The resources must already be managed by HA. */ resources: pulumi.Input[]>; /** * The identifier of the High Availability rule to manage. */ rule: pulumi.Input; /** * Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to `false`. */ strict?: pulumi.Input; /** * The HA rule type. Must be `node-affinity` or `resource-affinity`. */ type: pulumi.Input; } //# sourceMappingURL=harule.d.ts.map