mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: 华为云rds使用自身的存储类型
This commit is contained in:
@@ -109,10 +109,10 @@ const (
|
||||
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
|
||||
|
||||
//华为云存储类型
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SSD = "SSD" //超高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SAS = "SAS" //高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SATA = "SATA" //普通IO云硬盘
|
||||
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGH = "ULTRAHIGH" //超高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGHPRO = "ULTRAHIGHPRO"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_COMMON = "COMMON"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_HIGH = "HIGH"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -192,14 +192,6 @@ func (rds *SDBInstance) GetExpiredAt() time.Time {
|
||||
}
|
||||
|
||||
func (rds *SDBInstance) GetStorageType() string {
|
||||
switch rds.Volume.Type {
|
||||
case "COMMON":
|
||||
return api.STORAGE_HUAWEI_SATA
|
||||
case "HIGH":
|
||||
return api.STORAGE_HUAWEI_SAS
|
||||
case "ULTRAHIGH":
|
||||
return api.STORAGE_HUAWEI_SSD
|
||||
}
|
||||
return rds.Volume.Type
|
||||
}
|
||||
|
||||
@@ -419,17 +411,6 @@ func (region *SRegion) CreateIDBInstance(desc *cloudprovider.SManagedDBInstanceC
|
||||
for _, zone := range zones {
|
||||
zoneIds = append(zoneIds, zone.GetId())
|
||||
}
|
||||
storageType := ""
|
||||
switch desc.StorageType {
|
||||
case api.STORAGE_HUAWEI_SAS:
|
||||
storageType = "HIGH"
|
||||
case api.STORAGE_HUAWEI_SSD:
|
||||
storageType = "ULTRAHIGH"
|
||||
case api.STORAGE_HUAWEI_SATA:
|
||||
storageType = "COMMON"
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown storage type %s", desc.StorageType)
|
||||
}
|
||||
|
||||
params := map[string]interface{}{
|
||||
"region": region.ID,
|
||||
@@ -440,7 +421,7 @@ func (region *SRegion) CreateIDBInstance(desc *cloudprovider.SManagedDBInstanceC
|
||||
},
|
||||
"password": desc.Password,
|
||||
"volume": map[string]interface{}{
|
||||
"type": storageType,
|
||||
"type": desc.StorageType,
|
||||
"size": desc.DiskSizeGB,
|
||||
},
|
||||
"vpc_id": desc.VpcId,
|
||||
|
||||
Reference in New Issue
Block a user