guest add metadata cpu mode

- live migrate if guest cpu mode is qemu, do not check host cpu mode
- disk name generation replace '_' to '-'
This commit is contained in:
wanyaoqi
2020-03-20 15:04:46 +08:00
parent 64698288ec
commit f4d86b4fb2
6 changed files with 22 additions and 5 deletions
@@ -15,6 +15,7 @@
package guest
import (
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/scheduler/algorithm/predicates"
"yunion.io/x/onecloud/pkg/scheduler/core"
)
@@ -45,7 +46,7 @@ func (p *MigratePredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
return h.GetResult()
}
if schedData.LiveMigrate {
if schedData.LiveMigrate && schedData.CpuMode != compute.CPU_MODE_QEMU {
host := c.Getter().Host()
if schedData.CpuDesc != host.CpuDesc {
h.Exclude(predicates.ErrHostCpuModelIsNotMatchForLiveMigrate)