diff --git a/lxd/api_cluster.go b/lxd/api_cluster.go index 98a0cbc8b42e..e68379a4cdb7 100644 --- a/lxd/api_cluster.go +++ b/lxd/api_cluster.go @@ -35,6 +35,7 @@ import ( "github.com/canonical/lxd/lxd/lifecycle" "github.com/canonical/lxd/lxd/node" "github.com/canonical/lxd/lxd/operations" + "github.com/canonical/lxd/lxd/project/limits" "github.com/canonical/lxd/lxd/request" "github.com/canonical/lxd/lxd/response" "github.com/canonical/lxd/lxd/scriptlet" @@ -3355,7 +3356,9 @@ func evacuateInstances(ctx context.Context, opts evacuateOpts) error { return fmt.Errorf("Failed getting cluster members: %w", err) } - candidateMembers, err = tx.GetCandidateMembers(ctx, allMembers, []int{inst.Architecture()}, "", nil, opts.s.GlobalConfig.OfflineThreshold()) + clusterGroupsAllowed := limits.GetRestrictedClusterGroups(&instProject) + + candidateMembers, err = tx.GetCandidateMembers(ctx, allMembers, []int{inst.Architecture()}, "", clusterGroupsAllowed, opts.s.GlobalConfig.OfflineThreshold()) if err != nil { return err }