mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
fix: openstack image: vmdk -> qcow2
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/util/imagetools"
|
||||
"yunion.io/x/onecloud/pkg/util/qemuimg"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -268,7 +269,7 @@ func (region *SRegion) GetImageByName(name string) (*SImage, error) {
|
||||
func (region *SRegion) CreateImage(imageName string, osType string, osDist string, minDiskGb int, minRam int) (*SImage, error) {
|
||||
params := map[string]interface{}{
|
||||
"container_format": "bare",
|
||||
"disk_format": "vmdk",
|
||||
"disk_format": string(qemuimg.QCOW2),
|
||||
"name": imageName,
|
||||
"min_disk": minDiskGb,
|
||||
"min_ram": minRam,
|
||||
|
||||
@@ -119,7 +119,7 @@ func (cache *SStoragecache) UploadImage(ctx context.Context, userCred mcclient.T
|
||||
func (cache *SStoragecache) uploadImage(ctx context.Context, userCred mcclient.TokenCredential, image *cloudprovider.SImageCreateOption, isForce bool) (string, error) {
|
||||
s := auth.GetAdminSession(ctx, options.Options.Region, "")
|
||||
|
||||
meta, reader, _, err := modules.Images.Download(s, image.ImageId, string(qemuimg.VMDK), false)
|
||||
meta, reader, _, err := modules.Images.Download(s, image.ImageId, string(qemuimg.QCOW2), false)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user