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:
wanyaoqi
2026-03-19 11:45:08 +08:00
committed by GitHub
parent 9f752de9cb
commit dfaf5bca39
2 changed files with 12 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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))