mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(region): managed vm migrate info (#21754)
This commit is contained in:
@@ -1417,9 +1417,8 @@ func (self *SManagedVirtualizedGuestDriver) requestMigrate(ctx context.Context,
|
||||
return false, nil
|
||||
}
|
||||
hostId := iVM.GetIHostId()
|
||||
log.Debugf("guest %s migrate from %s -> %s", guest.Name, hostExternalId, hostId)
|
||||
if len(hostId) > 0 && hostId != hostExternalId {
|
||||
hostExternalId = hostId
|
||||
log.Debugf("guest %s migrate from %s -> %s", guest.Name, guest.HostId, host.Id)
|
||||
if len(hostId) > 0 && hostId == hostExternalId {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
|
||||
@@ -357,6 +357,7 @@ func (self *SInstance) DetachDisk(ctx context.Context, diskId string) error {
|
||||
func (self *SInstance) MigrateVM(hostId string) error {
|
||||
input := api.GuestMigrateInput{}
|
||||
input.PreferHost = hostId
|
||||
input.PreferHostId = hostId
|
||||
_, err := self.host.zone.region.perform(&modules.Servers, self.Id, "migrate", input)
|
||||
return err
|
||||
}
|
||||
@@ -364,6 +365,7 @@ func (self *SInstance) MigrateVM(hostId string) error {
|
||||
func (self *SInstance) LiveMigrateVM(hostId string) error {
|
||||
input := api.GuestLiveMigrateInput{}
|
||||
input.PreferHost = hostId
|
||||
input.PreferHostId = hostId
|
||||
skipCpuCheck := true
|
||||
input.SkipCpuCheck = &skipCpuCheck
|
||||
_, err := self.host.zone.region.perform(&modules.Servers, self.Id, "live-migrate", input)
|
||||
|
||||
Reference in New Issue
Block a user