New-PveClusterHaResources
Create a new HA resource.
API: POST /cluster/ha/resources, Proxmox VE API viewer
Syntax
Section titled “Syntax”New-PveClusterHaResources [-PveTicket <PveTicket>] [-AutoRebalance <bool>] [-Comment <string>] [-Failback <bool>] [-Group <string>] [-MaxRelocate <int>] [-MaxRestart <int>] -Sid <string> [-State <string>] [-Type <string>] [<CommonParameters>]Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
-PveTicket |
PveTicket |
No | Ticket data connection. |
-AutoRebalance |
bool |
No | HA resource may be migrated during automatic rebalancing. |
-Comment |
string |
No | Description. |
-Failback |
bool |
No | Automatically migrate HA resource to the node with the highest priority according to their node affinity rules, if a node with a higher priority than the current node comes online. |
-Group |
string |
No | The HA group identifier. |
-MaxRelocate |
int |
No | Maximal number of resource relocate tries when a resource fails to start. |
-MaxRestart |
int |
No | Maximal number of tries to restart the resource on a node after its start failed. When reached, the HA manager will try to relocate the resource to an eligible node. |
-Sid |
string |
Yes | HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100). |
-State |
string |
No | Requested resource state. Values: started, stopped, enabled, disabled, ignored. |
-Type |
string |
No | Resource type. Values: ct, vm. |
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.
Output
Section titled “Output”A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.