From 451d289903201de5f92d7bf4cce5778ca7dc8d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 15 Oct 2025 17:25:14 +0800 Subject: [PATCH] fix(region): valid essd pl0 disk resize (#23547) --- pkg/apis/compute/storage_const.go | 2 +- pkg/compute/hostdrivers/aliyun.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/apis/compute/storage_const.go b/pkg/apis/compute/storage_const.go index 53c3c80ca4..c719a04ce5 100644 --- a/pkg/apis/compute/storage_const.go +++ b/pkg/apis/compute/storage_const.go @@ -184,7 +184,7 @@ var ( } STORAGE_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_SHEEPDOG, STORAGE_RBD, STORAGE_DOCKER, STORAGE_NAS, STORAGE_VSAN, STORAGE_NFS, - STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3, + STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD_PL0, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3, STORAGE_EPHEMERAL_SSD, STORAGE_CLOUD_EFFICIENCY, STORAGE_STANDARD_LRS, STORAGE_STANDARDSSD_LRS, STORAGE_PREMIUM_LRS, STORAGE_GP2_SSD, STORAGE_GP3_SSD, STORAGE_IO1_SSD, STORAGE_ST1_HDD, STORAGE_SC1_HDD, STORAGE_STANDARD_HDD, diff --git a/pkg/compute/hostdrivers/aliyun.go b/pkg/compute/hostdrivers/aliyun.go index 2c64a17211..23da26e2b5 100644 --- a/pkg/compute/hostdrivers/aliyun.go +++ b/pkg/compute/hostdrivers/aliyun.go @@ -50,12 +50,15 @@ func (self *SAliyunHostDriver) ValidateDiskSize(storage *models.SStorage, sizeGb case api.STORAGE_CLOUD_EFFICIENCY, api.STORAGE_CLOUD_SSD, api.STORAGE_CLOUD_ESSD: minGB = 20 maxGB = 32768 + case api.STORAGE_CLOUD_ESSD_PL0: + minGB = 1 + maxGB = 65536 case api.STORAGE_CLOUD_ESSD_PL2: minGB = 461 - maxGB = 32768 + maxGB = 65536 case api.STORAGE_CLOUD_ESSD_PL3: minGB = 1261 - maxGB = 32768 + maxGB = 65536 case api.STORAGE_PUBLIC_CLOUD: minGB = 5 maxGB = 2000 @@ -66,7 +69,8 @@ func (self *SAliyunHostDriver) ValidateDiskSize(storage *models.SStorage, sizeGb minGB = 10 maxGB = 32768 default: - return fmt.Errorf("Not support resize %s disk", storage.StorageType) + minGB = 1 + maxGB = 65536 } if sizeGb < minGB || sizeGb > maxGB { return fmt.Errorf("The %s disk size must be in the range of %dG ~ %dGB", storage.StorageType, minGB, maxGB)