1. Packages
  2. Proxmox Virtual Environment (Proxmox VE)
  3. API Docs
  4. Harule
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.0.0
published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
proxmoxve logo
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.0.0
published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski

    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.

    Create Harule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Harule(name: string, args: HaruleArgs, opts?: CustomResourceOptions);
    @overload
    def Harule(resource_name: str,
               args: HaruleArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Harule(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               resources: Optional[Sequence[str]] = None,
               rule: Optional[str] = None,
               type: Optional[str] = None,
               affinity: Optional[str] = None,
               comment: Optional[str] = None,
               disable: Optional[bool] = None,
               nodes: Optional[Mapping[str, int]] = None,
               strict: Optional[bool] = None)
    func NewHarule(ctx *Context, name string, args HaruleArgs, opts ...ResourceOption) (*Harule, error)
    public Harule(string name, HaruleArgs args, CustomResourceOptions? opts = null)
    public Harule(String name, HaruleArgs args)
    public Harule(String name, HaruleArgs args, CustomResourceOptions options)
    
    type: proxmoxve:Harule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args HaruleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args HaruleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args HaruleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HaruleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HaruleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var haruleResource = new ProxmoxVE.Index.Harule("haruleResource", new()
    {
        Resources = new[]
        {
            "string",
        },
        Rule = "string",
        Type = "string",
        Affinity = "string",
        Comment = "string",
        Disable = false,
        Nodes = 
        {
            { "string", 0 },
        },
        Strict = false,
    });
    
    example, err := proxmoxve.NewHarule(ctx, "haruleResource", &proxmoxve.HaruleArgs{
    	Resources: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Rule:     pulumi.String("string"),
    	Type:     pulumi.String("string"),
    	Affinity: pulumi.String("string"),
    	Comment:  pulumi.String("string"),
    	Disable:  pulumi.Bool(false),
    	Nodes: pulumi.IntMap{
    		"string": pulumi.Int(0),
    	},
    	Strict: pulumi.Bool(false),
    })
    
    var haruleResource = new Harule("haruleResource", HaruleArgs.builder()
        .resources("string")
        .rule("string")
        .type("string")
        .affinity("string")
        .comment("string")
        .disable(false)
        .nodes(Map.of("string", 0))
        .strict(false)
        .build());
    
    harule_resource = proxmoxve.Harule("haruleResource",
        resources=["string"],
        rule="string",
        type="string",
        affinity="string",
        comment="string",
        disable=False,
        nodes={
            "string": 0,
        },
        strict=False)
    
    const haruleResource = new proxmoxve.Harule("haruleResource", {
        resources: ["string"],
        rule: "string",
        type: "string",
        affinity: "string",
        comment: "string",
        disable: false,
        nodes: {
            string: 0,
        },
        strict: false,
    });
    
    type: proxmoxve:Harule
    properties:
        affinity: string
        comment: string
        disable: false
        nodes:
            string: 0
        resources:
            - string
        rule: string
        strict: false
        type: string
    

    Harule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Harule resource accepts the following input properties:

    Resources List<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.
    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 bool
    Whether the HA rule is disabled. Defaults to false.
    Nodes Dictionary<string, int>
    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 bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    Resources []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.
    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 bool
    Whether the HA rule is disabled. Defaults to false.
    Nodes map[string]int
    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 bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    resources List<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.
    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<String,Integer>
    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.
    resources 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.
    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 {[key: string]: 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.
    resources Sequence[str]
    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 str
    The identifier of the High Availability rule to manage.
    type str
    The HA rule type. Must be node-affinity or resource-affinity.
    affinity str
    The resource affinity type (resource-affinity only). positive keeps resources on the same node, negative keeps them on separate nodes.
    comment str
    The comment associated with this rule.
    disable bool
    Whether the HA rule is disabled. Defaults to false.
    nodes Mapping[str, int]
    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 bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    resources List<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.
    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<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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Harule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Harule Resource

    Get an existing Harule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: HaruleState, opts?: CustomResourceOptions): Harule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            affinity: Optional[str] = None,
            comment: Optional[str] = None,
            disable: Optional[bool] = None,
            nodes: Optional[Mapping[str, int]] = None,
            resources: Optional[Sequence[str]] = None,
            rule: Optional[str] = None,
            strict: Optional[bool] = None,
            type: Optional[str] = None) -> Harule
    func GetHarule(ctx *Context, name string, id IDInput, state *HaruleState, opts ...ResourceOption) (*Harule, error)
    public static Harule Get(string name, Input<string> id, HaruleState? state, CustomResourceOptions? opts = null)
    public static Harule get(String name, Output<String> id, HaruleState state, CustomResourceOptions options)
    resources:  _:    type: proxmoxve:Harule    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    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 bool
    Whether the HA rule is disabled. Defaults to false.
    Nodes Dictionary<string, int>
    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.
    Resources List<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.
    Strict bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    Type string
    The HA rule type. Must be node-affinity or resource-affinity.
    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 bool
    Whether the HA rule is disabled. Defaults to false.
    Nodes map[string]int
    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.
    Resources []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.
    Strict bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    Type string
    The HA rule type. Must be node-affinity or resource-affinity.
    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<String,Integer>
    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.
    resources List<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.
    strict Boolean
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    type String
    The HA rule type. Must be node-affinity or resource-affinity.
    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 {[key: string]: 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.
    resources 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.
    strict boolean
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    type string
    The HA rule type. Must be node-affinity or resource-affinity.
    affinity str
    The resource affinity type (resource-affinity only). positive keeps resources on the same node, negative keeps them on separate nodes.
    comment str
    The comment associated with this rule.
    disable bool
    Whether the HA rule is disabled. Defaults to false.
    nodes Mapping[str, int]
    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.
    resources Sequence[str]
    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 str
    The identifier of the High Availability rule to manage.
    strict bool
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    type str
    The HA rule type. Must be node-affinity or resource-affinity.
    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<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.
    resources List<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.
    strict Boolean
    Whether the node affinity rule is strict (node-affinity only). When strict, resources cannot run on nodes not listed. Defaults to false.
    type String
    The HA rule type. Must be node-affinity or resource-affinity.

    Package Details

    Repository
    proxmoxve muhlba91/pulumi-proxmoxve
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the proxmox Terraform Provider.
    proxmoxve logo
    Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.0.0
    published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
      Try Pulumi Cloud free. Your team will thank you.