Skip to content

Commit 433b7e3

Browse files
committed
incusd/instance/utils: Don't fail instance startup due to incomplete CPU baseline
If a server is temporarily unresponsive or unable to provide its CPU information, we should just skip it during baseline calculation, not completely fail the instance startup because of it. Signed-off-by: Stéphane Graber <[email protected]>
1 parent 00248d7 commit 433b7e3

File tree

1 file changed

+3
-1
lines changed
  • internal/server/instance/drivers

1 file changed

+3
-1
lines changed

internal/server/instance/drivers/util.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/lxc/incus/v6/internal/server/state"
2323
internalUtil "github.com/lxc/incus/v6/internal/util"
2424
"github.com/lxc/incus/v6/shared/api"
25+
"github.com/lxc/incus/v6/shared/logger"
2526
"github.com/lxc/incus/v6/shared/resources"
2627
"github.com/lxc/incus/v6/shared/units"
2728
)
@@ -52,7 +53,8 @@ func GetClusterCPUFlags(ctx context.Context, s *state.State, servers []string, a
5253
// Get node resources.
5354
res, err := getNodeResources(s, node.Name, node.Address)
5455
if err != nil {
55-
return nil, fmt.Errorf("Failed to get resources for %s: %w", node.Name, err)
56+
logger.Errorf("Failed to get resources for CPU baseline on %q: %v", node.Name, err)
57+
continue
5658
}
5759

5860
// Skip if not the correct architecture.

0 commit comments

Comments
 (0)