mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix disk create from snapshot
This commit is contained in:
@@ -1431,6 +1431,8 @@ func fillDiskConfigBySnapshot(userCred mcclient.TokenCredential, diskConfig *api
|
||||
diskConfig.DiskType = snapshot.DiskType
|
||||
diskConfig.SizeMb = snapshot.Size
|
||||
diskConfig.Backend = storage.StorageType
|
||||
diskConfig.Fs = ""
|
||||
diskConfig.Mountpoint = ""
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -730,12 +730,16 @@ func (s *SKVMGuestInstance) SyncStatus() {
|
||||
func (s *SKVMGuestInstance) CheckBlockOrRunning(jobs int) {
|
||||
var status = compute.VM_RUNNING
|
||||
if jobs > 0 {
|
||||
mirrorStatus := s.MirrorJobStatus()
|
||||
if mirrorStatus.InProcess() {
|
||||
if s.IsMaster() {
|
||||
mirrorStatus := s.MirrorJobStatus()
|
||||
if mirrorStatus.InProcess() {
|
||||
status = compute.VM_BLOCK_STREAM
|
||||
} else if mirrorStatus.IsFailed() {
|
||||
status = compute.VM_BLOCK_STREAM_FAIL
|
||||
s.SyncMirrorJobFailed("Block job missing")
|
||||
}
|
||||
} else {
|
||||
status = compute.VM_BLOCK_STREAM
|
||||
} else if mirrorStatus.IsFailed() {
|
||||
status = compute.VM_BLOCK_STREAM_FAIL
|
||||
s.SyncMirrorJobFailed("Block job missing")
|
||||
}
|
||||
}
|
||||
_, err := hostutils.UpdateServerStatus(context.Background(), s.Id, status)
|
||||
|
||||
Reference in New Issue
Block a user