This happens when no container has been started yet and the
lxc/ directory has not yet been created in the cpuset
cgroup.
my $cores = $conf->{cores};
if (!$had_cpuset && $cores) {
- my $cpuset = PVE::CpuSet->new_from_cgroup('lxc', 'effective_cpus');
+ my $cpuset = eval { PVE::CpuSet->new_from_cgroup('lxc', 'effective_cpus') };
+ $cpuset = PVE::CpuSet->new_from_cgroup('', 'effective_cpus') if !$cpuset;
my @members = $cpuset->members();
while (scalar(@members) > $cores) {
my $randidx = int(rand(scalar(@members)));