mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
虚拟机启动时如果已经启动,会丢失start的osplog事件
This commit is contained in:
@@ -1101,6 +1101,7 @@ type DiskInfo struct {
|
||||
MediumType string
|
||||
Driver string
|
||||
Cache string
|
||||
DiskType string
|
||||
}
|
||||
|
||||
func (self *SDisk) ToDiskInfo() DiskInfo {
|
||||
@@ -1110,6 +1111,7 @@ func (self *SDisk) ToDiskInfo() DiskInfo {
|
||||
MountPoint: self.GetMountPoint(),
|
||||
Format: self.DiskFormat,
|
||||
Size: int64(self.DiskSize),
|
||||
DiskType: self.DiskType,
|
||||
}
|
||||
storage := self.GetStorage()
|
||||
if storage == nil {
|
||||
|
||||
@@ -3913,6 +3913,7 @@ func (self *SGuest) GetSpec(checkStatus bool) *jsonutils.JSONDict {
|
||||
diskSpec.Set("size", jsonutils.NewInt(info.Size))
|
||||
diskSpec.Set("backend", jsonutils.NewString(info.Backend))
|
||||
diskSpec.Set("medium_type", jsonutils.NewString(info.MediumType))
|
||||
diskSpec.Set("disk_type", jsonutils.NewString(info.DiskType))
|
||||
diskSpecs.Add(diskSpec)
|
||||
}
|
||||
spec.Set("disk", diskSpecs)
|
||||
|
||||
@@ -48,8 +48,9 @@ func (self *GuestStartTask) startStart(ctx context.Context, guest *models.SGuest
|
||||
self.onStartGuestFailed(ctx, guest, err)
|
||||
} else {
|
||||
if result != nil && jsonutils.QueryBoolean(result, "is_running", false) {
|
||||
guest.SetStatus(self.UserCred, models.VM_RUNNING, "start")
|
||||
self.taskComplete(ctx, guest)
|
||||
self.OnStartComplete(ctx, guest, nil)
|
||||
// guest.SetStatus(self.UserCred, models.VM_RUNNING, "start")
|
||||
// self.taskComplete(ctx, guest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user