Cluster

Subsections of Cluster

cluster status

Options

optiondescriptionAllowed values
output-formatformat the output to one of table, json or yamlstring

Examples

  • Show cluster status
proxcli cluster status

Cluster log

Options

optiondescriptionAllowed values
output-formatformat the output to one of table, json or yamlstring
max-itemsmax number of log lines we grab from nodesinteger
proxmox-nodescomma separated list of nodes issuing the log linesstring
severitiesfilter logs by severities. this option is a coma separated list of severities labels (panic,alert,critical,error,warning,notice,info,debug)string

Examples

  • Show cluster log
proxcli cluster log
  • Show errors searching in the last 1000 logs lines
proxcli cluster log --severities critical,error,warning --max-items 1000

High availibility

Definition

High Availability ensures that a VM will stay running even if an individual node is shut down. This means that if the device is either powered off or has any sort of issue, the VM will automatically migrate to another node and start there. This will use all nodes to ensure the VMs configured will stay running as close to 100% of the time as possible.

source: https://www.wundertech.net/how-to-set-up-a-cluster-in-proxmox/

Virtual machine HA in proxmox depend on two concepts:

  • groups
  • resources

An HA group is a logical configuration specifying on which nodes the vm can be migrated when a proxmox node fail. HA resouces is a virtual machine associated with an HA group. Several resources can be created and associated with a group.

Subsections of High availibility

Cluster ha groups

Subsections of Cluster ha groups

List cluster HA group

Options

optiondescriptionAllowed values

Examples

  • list cluster ha groups
proxcli cluster ha groups list

Create an HA cluster group

Options

optiondescriptionAllowed values
groupCluster ha group name to be createdstring
proxmox-nodesOn which proxmox nodes the group should applystring
restrictedThe CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior.N/A
nofailbackResources bound to restricted groups may only run on nodes defined by the group. The resource will be placed in the stopped state if no group node member is online. Resources on unrestricted groups may run on any cluster node if all group members are offline, but they will migrate back as soon as a group member comes online. One can implement a preferred node behavior using an unrestricted group with only one member.N/A

Examples

  • create an HA group for application powerdns. the group will use proxmox nodes pve1 and pve2 and make sure the group resources will stay on those 2 nodes
proxcli cluster ha groups create --group powerdns --nofailback --proxmox-nodes "pve1,pve2"

Delete an HA cluster group

Options

optiondescriptionAllowed values
groupCluster ha group name to be deletedstring
Note

It is impossible to delete a group with associated resources. You must first delete resources from group and then delete the group

Examples

  • delete a cluster HA group
proxcli cluster ha groups delete --group powerdns

Cluster HA resources

Subsections of Cluster HA resources

List cluster ha resource

Options

optiondescriptionAllowed values

Examples

  • List cluster resources
proxcli cluster ha resources list

Add cluster ha resource

Options

optiondescriptionAllowed values
groupthe cluster ha group this resource belong tostring
vmidthe virtual machine id you want to assign to the resourcestring
namethe cluster ha resource namestring
commentadditional information for this resourceN/A
stateRequested resource state. The CRM reads this state and acts accordingly. Please note that enabled is just an alias for started. (disabledenabled
max-relocateMaximal number of service relocate tries when a service failes to startintegrer
max-restartMaximal number of tries to restart the service on a node after its start failed.integer

Examples

  • create a cluster ha resource with minimal informations
proxcli cluster ha resources add --group gitlab --vmid 105

Delete cluster ha resource

Options

optiondescriptionAllowed values
vmidthe virtual machine id you want to remove from resourcesstring
filter-nameA regex applied on virtual machine name used to select matching virtual machines to remove from resourcesstring

Examples

  • Delete a single cluster ha resource by virtual machine id
proxcli cluster ha resources delete --vmid 105
  • Delete all cluster ha resources (not recomended)
proxcli cluster ha resources delete --filter-name "^.*$"

Migrate cluster ha resource

Options

optiondescriptionAllowed values
vmidThe virtual machine id to migrateinteger
filter-namea regex on virtual machines name used to select multiples virtual machines to be migratedstring
proxmox-nodethe target node to migrate the virtual machines tostring
blockwait for each resources to finish migration before starting another one (sequential mode)string
Note

vmid and filter-name are mutualy exclusive

Examples

  • migrate a cluster ha resource to another node
proxcli cluster ha resources migrate --vmid 125 --proxmox-node pve1
  • migrate multiple cluster ha resources to another node
proxcli cluster ha resources migrate --filter-name "^b4p-powerdns" --proxmox-node pve1
  • migrate multiple cluster ha resources to another node waiting for each resource to finish migration
proxcli cluster ha resources migrate --filter-name "^b4p-powerdns" --proxmox-node pve1 --block

Relocate cluster ha resource

Options

optiondescriptionAllowed values
vmidThe virtual machine id to be relocatedinteger
filter-namea regex on virtual machines name used to select multiples virtual machines to be relocatedstring
proxmox-nodethe target node to relocate the virtual machines tostring
blockwait for each resources to finish relocation before starting another one (sequential mode)string
Note

vmid and filter-name are mutualy exclusive

Examples

  • relocate a cluster ha resource to another node
proxcli cluster ha resources relocate --vmid 125 --proxmox-node pve1
  • relocate multiple cluster ha resources to another node
proxcli cluster ha resources relocate --filter-name "^b4p-powerdns" --proxmox-node pve1
  • relocate multiple cluster ha resources to another node waiting for each resource to finish relocation
proxcli cluster ha resources relocate --filter-name "^b4p-powerdns" --proxmox-node pve1 --block