Skip to content

Commit

Permalink
fix(region): cloudpods vm migrate (#21744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Dec 5, 2024
1 parent 46a84f4 commit e6066b5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pkg/compute/guestdrivers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ func (drv *SBaseGuestDriver) IsSupportLiveMigrate() bool {
}

func (drv *SBaseGuestDriver) CheckMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput) error {
return httperrors.NewNotAcceptableError("Not allow for hypervisor %s", guest.GetHypervisor())
return nil
}

func (drv *SBaseGuestDriver) CheckLiveMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestLiveMigrateInput) error {
return httperrors.NewNotAcceptableError("Not allow for hypervisor %s", guest.GetHypervisor())
return nil
}

func (drv *SBaseGuestDriver) RequestMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput, task taskman.ITask) error {
Expand Down
8 changes: 0 additions & 8 deletions pkg/compute/guestdrivers/cloudpods-esxi.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,6 @@ func (self *SCloudpodsESXiGuestDriver) IsSupportLiveMigrate() bool {
return true
}

func (self *SCloudpodsESXiGuestDriver) CheckMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput) error {
return nil
}

func (self *SCloudpodsESXiGuestDriver) CheckLiveMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestLiveMigrateInput) error {
return nil
}

func (self *SCloudpodsESXiGuestDriver) RequestMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput, task taskman.ITask) error {
return self.RequestLiveMigrate(ctx, guest, userCred, api.GuestLiveMigrateInput{PreferHostId: input.PreferHostId}, task)
}
Expand Down
8 changes: 0 additions & 8 deletions pkg/compute/guestdrivers/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,6 @@ func (self *SOpenStackGuestDriver) IsSupportLiveMigrate() bool {
return true
}

func (self *SOpenStackGuestDriver) CheckMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput) error {
return nil
}

func (self *SOpenStackGuestDriver) CheckLiveMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestLiveMigrateInput) error {
return nil
}

func (self *SOpenStackGuestDriver) RequestMigrate(ctx context.Context, guest *models.SGuest, userCred mcclient.TokenCredential, input api.GuestMigrateInput, task taskman.ITask) error {
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
iVM, err := guest.GetIVM(ctx)
Expand Down

0 comments on commit e6066b5

Please sign in to comment.