mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): use qcow2 format on raw disk cache image (#15548)
This commit is contained in:
@@ -1407,6 +1407,13 @@ func (self *SDisk) GetFsFormat() string {
|
||||
return self.FsFormat
|
||||
}
|
||||
|
||||
func (self *SDisk) GetCacheImageFormat() string {
|
||||
if self.DiskFormat == "raw" {
|
||||
return "qcow2"
|
||||
}
|
||||
return self.DiskFormat
|
||||
}
|
||||
|
||||
func (manager *SDiskManager) getDisksByStorage(storage *SStorage) ([]SDisk, error) {
|
||||
disks := make([]SDisk, 0)
|
||||
q := manager.Query().Equals("storage_id", storage.Id)
|
||||
|
||||
@@ -46,7 +46,7 @@ func (self *DiskCreateTask) OnInit(ctx context.Context, obj db.IStandaloneModel,
|
||||
self.SetStage("OnStorageCacheImageComplete", nil)
|
||||
input := api.CacheImageInput{
|
||||
ImageId: imageId,
|
||||
Format: disk.DiskFormat,
|
||||
Format: disk.GetCacheImageFormat(),
|
||||
ParentTaskId: self.GetTaskId(),
|
||||
}
|
||||
guest := disk.GetGuest()
|
||||
|
||||
Reference in New Issue
Block a user