Skip to content

New-PveClusterHaRules

Create HA rule.

API: POST /cluster/ha/rules, Proxmox VE API viewer

New-PveClusterHaRules
[-PveTicket <PveTicket>]
-Rule <string>
-Type <string>
[-Affinity <string>]
[-Comment <string>]
[-Disable <bool>]
[-Nodes <string>]
-Resources <string>
[-Strict <bool>]
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Rule string Yes HA rule identifier.
-Type string Yes HA rule type. Values: node-affinity, resource-affinity.
-Affinity string No Describes whether the HA resources are supposed to be placed on the given nodes (‘positive’), or are supposed to be placed on any but the given nodes (‘negative’). Values: positive, negative.
-Comment string No HA rule description.
-Disable bool No Whether the HA rule is disabled.
-Nodes string No List of cluster node names with optional priority.
-Resources string Yes List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).
-Strict bool No Describes whether the node affinity rule is strict or non-strict.

Every parameter also binds by property name from the pipeline, so an object with node and vmid properties (the output of Get-PveGuest, for one) fills -Node and -Vmid. Without -PveTicket the cmdlet uses the last connection, see Connection.

A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.