mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-05-07 06:02:09 +08:00
fix(glance): cache images to ceph add brand filter (#24473)
* fix(glance): cache images to ceph add brand filter * fix(region): iso image support default uefi boot mod
This commit is contained in:
@@ -1848,7 +1848,7 @@ func (manager *SGuestManager) validateCreateData(
|
||||
input.Machine = api.VM_MACHINE_TYPE_Q35
|
||||
}
|
||||
|
||||
if imageDiskFormat != "iso" {
|
||||
if imageDiskFormat != imageapi.IMAGE_DISK_FORMAT_ISO {
|
||||
var imgSupportUEFI *bool
|
||||
var imgSupportBIOS *bool
|
||||
if desc, ok := imgProperties[imageapi.IMAGE_UEFI_SUPPORT]; ok {
|
||||
@@ -1886,6 +1886,15 @@ func (manager *SGuestManager) validateCreateData(
|
||||
input.Bios = "BIOS"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if input.Bios == "" {
|
||||
// if ISO support uefi and not specified boot mode
|
||||
// set default boot mode uefi
|
||||
if desc, ok := imgProperties[imageapi.IMAGE_UEFI_SUPPORT]; ok && desc == "true" {
|
||||
input.Bios = "UEFI"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(imgProperties) == 0 {
|
||||
|
||||
@@ -32,8 +32,9 @@ func GetRegionCephStorages() (map[string]*computeapi.RbdStorageConf, error) {
|
||||
q := struct {
|
||||
Scope string `json:"scope"`
|
||||
StorageType string `json:"storage_type"`
|
||||
Brand string `json:"brand"`
|
||||
}{
|
||||
"system", computeapi.STORAGE_RBD,
|
||||
"system", computeapi.STORAGE_RBD, computeapi.ONECLOUD_BRAND_ONECLOUD,
|
||||
}
|
||||
|
||||
res, err := compute.Storages.List(auth.GetAdminSession(context.Background(), options.Options.Region), jsonutils.Marshal(q))
|
||||
|
||||
Reference in New Issue
Block a user