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

Cookiefamily

Renowned Member
Jan 29, 2020
142
41
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