Adding HA resources to an existing HA affinity rule and outdated manpages

Cookiefamily

Renowned Member
Jan 29, 2020
160
43
68
Germany
Hi,
in the past we used ha-manager add $VMID --group $groupname to be able to assign a VM to what then was a "rule" (HA Groups). With PVE 9 HA Groups have been removed in favor of affinity rules which do offer more functionality - But I am wondering how I can add a HA resource (e.g. vm:123) to an already existing rule via the CLI?

Funnily enough, autocompletion for the ha-manager add/set command still suggest the --group parameter. Also, the manpage for ha-manager still describes the --group option for the add and set subcommand. It also still has all the commands for creating/removing/editing groups explained.
 
Hi!

The HA groups are deprecated and will be removed eventually by Proxmox VE 10. The reason that the group API endpoints and parameters still exist is because of the state, where not all nodes have been upgraded yet and therefore only a part of the cluster can understand HA rules. As soon as all of the HA groups have been successfully migrated to HA rules, these API endpoints are "soft"-disabled in the sense that these will return that HA groups are not supported on the cluster anymore.
 
In addition to what @dakralex said, the API for HA rules is indeed a bit different than the one for groups was. So the way to do it right now is to run ha-manager rules set <type> <rule name> --resources vm:100,vm:101,vm:102, listing the all of the resources that should be part of the rule. This will overwrite the entire list of resources, not add to it.

If that's a feature you'd like to see, please feel free to open a feature request.
 
  • Like
Reactions: Cookiefamily
Just found this thread looking for a solution. I have a Proxmox cluster primarily used for VDI that has multiple nodes, but not every node has the same model GPU inside. I'm an NVIDIA GRID license holder. Previously, I was able to assign VMs to the following groups:

general - General purpose VMs with no vGPU resources required. They could be on any Node.
nvidia-rtx - VMs that have lower end RTX-based vGPUs available on certain nodes.
nvidia-bw - VMs that have higher end vGPUs with more VRAM requirements that is available on other nodes.

I have a hook-script that enabled HA and assigned the VM's affinity group on pre-start which ran post-linked clone creation.

How can this be done now?
 
I have a hook-script that enabled HA and assigned the VM's affinity group on pre-start which ran post-linked clone creation.

How can this be done now?
This comment in BZ 7260 [0] does state how HA resources can be added by adding items to the existing HA resources list of the node affinity rule.

However, is there a specific use case why this is done in the pre-start hook-script instead of the HA resources being permanently HA-enabled and in the node affinity rule?

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=7260#c1