mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: Fix that fail to create vm with unforced instance group
1. This is a bug because of latest modify about scheduler's instance_group_predicate. Should set minFree as zero when founding that host can't be used to create vm with requested forced instance group. 2. Fix some little error of instance group. 3. Add PerformEnable and PerformDisable for instance group. 4. Clean scheduler desc cache after having attached or detached guests and groups and enabled group. Cleaning was necessary when disable group because disabled group is prohibited. 5. Add package 'golang.org/x/sync/errgroup'.
This commit is contained in:
@@ -78,6 +78,7 @@ func (p *SForcedGroupPredicate) Execute(u *core.Unit, c core.Candidater) (bool,
|
||||
h.AppendPredicateFailMsg(fmt.Sprintf(
|
||||
"the number of guests with same instance group '%s' in this host has reached the upper limit",
|
||||
instanceGroups[id].GetName()))
|
||||
minFree = 0
|
||||
break
|
||||
}
|
||||
} else {
|
||||
@@ -87,10 +88,6 @@ func (p *SForcedGroupPredicate) Execute(u *core.Unit, c core.Candidater) (bool,
|
||||
minFree = free
|
||||
}
|
||||
}
|
||||
// show that minFree shoule be zero
|
||||
if minFree == math.MaxInt32 {
|
||||
minFree = 0
|
||||
}
|
||||
// chose the min capacity of groups
|
||||
h.SetCapacity(int64(minFree))
|
||||
return h.GetResult()
|
||||
|
||||
Reference in New Issue
Block a user