mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge branch 'master' into feature/snapshotpolicy_of_disk_sync
This commit is contained in:
@@ -24,6 +24,8 @@ import (
|
||||
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/baremetal"
|
||||
baremetalstatus "yunion.io/x/onecloud/pkg/baremetal/status"
|
||||
"yunion.io/x/onecloud/pkg/baremetal/tasks"
|
||||
baremetaltypes "yunion.io/x/onecloud/pkg/baremetal/types"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/auth"
|
||||
@@ -97,9 +99,12 @@ func handleBaremetalNotify(ctx *Context, bm *baremetal.SBaremetalInstance) {
|
||||
|
||||
// execute BaremetalServerPrepareTask
|
||||
task := bm.GetTask()
|
||||
if task != nil {
|
||||
task.SSHExecute(task, remoteAddr, key, nil)
|
||||
if task == nil {
|
||||
task = tasks.NewBaremetalServerPrepareTask(bm)
|
||||
bm.SyncStatus(baremetalstatus.PREPARE, "")
|
||||
}
|
||||
log.Infof("Get notify from pxe rom os, start exec task: %s", task.GetName())
|
||||
task.SSHExecute(task, remoteAddr, key, nil)
|
||||
ctx.ResponseOk()
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ func (self *BaremetalUnconvertHypervisorTask) OnGuestDeleteCompleteFailed(ctx co
|
||||
func (self *BaremetalUnconvertHypervisorTask) OnPrepareComplete(ctx context.Context, baremetal *models.SHost, body jsonutils.JSONObject) {
|
||||
self.SetStageComplete(ctx, nil)
|
||||
}
|
||||
|
||||
func (self *BaremetalUnconvertHypervisorTask) OnFailSyncstatusComplete(ctx context.Context, baremetal *models.SHost, body jsonutils.JSONObject) {
|
||||
self.SetStageFailed(ctx, "Delete server failed")
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ func (self *SImage) DoCheckStatus(ctx context.Context, userCred mcclient.TokenCr
|
||||
if len(format) > 0 {
|
||||
self.DiskFormat = format
|
||||
}
|
||||
if virtualSizeMB > 0 {
|
||||
if virtualSizeMB > 0 && self.MinDiskMB < virtualSizeMB {
|
||||
self.MinDiskMB = virtualSizeMB
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user