How to set up cluster groups
▶ Watch on YouTube (opens in a new tab)
Cluster members can be assigned to Cluster groups. By default, all cluster members belong to the default group.
To create a cluster group, use the lxc cluster group create command. For example:
lxc cluster group create gpuTo assign a cluster member to one or more groups, use the lxc cluster group assign command. This command removes the specified cluster member from all the cluster groups it currently is a member of and then adds it to the specified group or groups.
For example, to assign server1 to only the gpu group, use the following command:
lxc cluster group assign server1 gpuTo assign server1 to the gpu group and also keep it in the default group, use the following command:
lxc cluster group assign server1 default,gpuTo add a cluster member to a specific group without removing it from other groups, use the lxc cluster group add command.
For example, to add server1 to the gpu group and also keep it in the default group, use the following command:
lxc cluster group add server1 gpuLaunch an instance on a cluster group member
With cluster groups, you can target an instance to run on one of the members of the cluster group, instead of targeting it to run on a specific member.
Note
scheduler.instancemust be set to eitherall(the default) orgroupto allow instances to be targeted to a cluster group.See Automatic placement of instances for more information.
To launch an instance on a member of a cluster group, follow the instructions in Launch an instance on a specific cluster member, but use the group name prefixed with @ for the --target flag. For example:
lxc launch ubuntu:24.04 c1 --target=@gpu