From 9ee1c346d71e9a88f609b54a749bae738f5d54f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Fri, 5 Dec 2025 16:20:40 +0800 Subject: [PATCH] fix(region): baidu storage info (#23901) --- pkg/compute/guestdrivers/baidu.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkg/compute/guestdrivers/baidu.go b/pkg/compute/guestdrivers/baidu.go index 069727f554..55473ce1fa 100644 --- a/pkg/compute/guestdrivers/baidu.go +++ b/pkg/compute/guestdrivers/baidu.go @@ -57,6 +57,17 @@ func (self *SBaiduGuestDriver) ChooseHostStorage(host *models.SHost, guest *mode return chooseHostStorage(self, host, diskConfig.Backend, storageIds), nil } +func (self *SBaiduGuestDriver) GetStorageTypes() []string { + return []string{ + api.STORAGE_BAIDU_SSD, + api.STORAGE_BAIDU_PREMIUM_SSD, + api.STORAGE_BAIDU_HDD, + api.STORAGE_BAIDU_ENHANCED_SSD_PL1, + api.STORAGE_BAIDU_ENHANCED_SSD_PL2, + api.STORAGE_BAIDU_ENHANCED_SSD_PL3, + } +} + func (self *SBaiduGuestDriver) GetComputeQuotaKeys(scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, brand string) models.SComputeResourceKeys { keys := models.SComputeResourceKeys{} keys.SBaseProjectQuotaKeys = quotas.OwnerIdProjectQuotaKeys(scope, ownerId) @@ -81,6 +92,24 @@ func (self *SBaiduGuestDriver) GetInstanceCapability() cloudprovider.SInstanceCa Changeable: false, }, }, + Storages: cloudprovider.Storage{ + DataDisk: []cloudprovider.StorageInfo{ + {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 32765, MinSizeGb: 5, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + }, + SysDisk: []cloudprovider.StorageInfo{ + {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 32765, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 32765, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + }, + }, } }