Skip to content

Resource: proxmox_harule

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.

Warning

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 proxmox_hagroup instead.

Schema

Required

  • resources (Set of String) 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.
  • rule (String) The identifier of the High Availability rule to manage.
  • type (String) The HA rule type. Must be node-affinity or resource-affinity.

Optional

  • affinity (String) The resource affinity type (resource-affinity only). positive keeps resources on the same node, negative keeps them on separate nodes.
  • comment (String) The comment associated with this rule.
  • disable (Boolean) Whether the HA rule is disabled. Defaults to false.
  • nodes (Map of Number) 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.
  • strict (Boolean) Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.

Read-Only

  • id (String) The unique identifier of this resource.