mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-29 03:51:54 +08:00
fix(region): huawei storage type
This commit is contained in:
@@ -68,6 +68,7 @@ const (
|
||||
STORAGE_HUAWEI_SAS = "SAS" // 高IO云硬盘
|
||||
STORAGE_HUAWEI_SATA = "SATA" // 普通IO云硬盘
|
||||
STORAGE_HUAWEI_GPSSD = "GPSSD" // 通用型SSD
|
||||
STORAGE_HUAWEI_ESSD = "ESSD" // 急速型SSD
|
||||
|
||||
// openstack
|
||||
STORAGE_OPENSTACK_ISCSI = "iscsi"
|
||||
|
||||
@@ -64,7 +64,13 @@ func (self *SHuaweiGuestDriver) GetMinimalSysDiskSizeGb() int {
|
||||
}
|
||||
|
||||
func (self *SHuaweiGuestDriver) GetStorageTypes() []string {
|
||||
return []string{api.STORAGE_HUAWEI_SATA, api.STORAGE_HUAWEI_SAS, api.STORAGE_HUAWEI_SSD}
|
||||
return []string{
|
||||
api.STORAGE_HUAWEI_SATA,
|
||||
api.STORAGE_HUAWEI_SAS,
|
||||
api.STORAGE_HUAWEI_SSD,
|
||||
api.STORAGE_HUAWEI_GPSSD,
|
||||
api.STORAGE_HUAWEI_ESSD,
|
||||
}
|
||||
}
|
||||
|
||||
func (self *SHuaweiGuestDriver) ChooseHostStorage(host *models.SHost, guest *models.SGuest, diskConfig *api.DiskConfig, storageIds []string) (*models.SStorage, error) {
|
||||
|
||||
@@ -46,7 +46,7 @@ func (self *SHuaweiHostDriver) GetHypervisor() string {
|
||||
// 系统盘必须至少40G
|
||||
func (self *SHuaweiHostDriver) ValidateDiskSize(storage *models.SStorage, sizeGb int) error {
|
||||
switch storage.StorageType {
|
||||
case api.STORAGE_HUAWEI_SSD, api.STORAGE_HUAWEI_SATA, api.STORAGE_HUAWEI_SAS:
|
||||
case api.STORAGE_HUAWEI_SSD, api.STORAGE_HUAWEI_SATA, api.STORAGE_HUAWEI_SAS, api.STORAGE_HUAWEI_ESSD, api.STORAGE_HUAWEI_GPSSD:
|
||||
if sizeGb < 10 || sizeGb > 32768 {
|
||||
return fmt.Errorf("The %s disk size must be in the range of 10G ~ 32768GB", storage.StorageType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user