mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): validate is reserve all cpus
This commit is contained in:
@@ -4274,9 +4274,14 @@ func (hh *SHost) PerformReserveCpus(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !sets.NewInt(allCores...).HasAll(cs.ToSlice()...) {
|
||||
hSets := sets.NewInt(allCores...)
|
||||
cSlice := cs.ToSlice()
|
||||
if !hSets.HasAll(cSlice...) {
|
||||
return nil, httperrors.NewInputParameterError("Host cores not contains input %v", input.Cpus)
|
||||
}
|
||||
if hSets.Len() == len(cSlice) {
|
||||
return nil, httperrors.NewInputParameterError("Can't reserve host all cpus")
|
||||
}
|
||||
|
||||
if input.Mems != "" {
|
||||
mems, err := cpuset.Parse(input.Mems)
|
||||
|
||||
Reference in New Issue
Block a user