mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: 转换非标准存储类型到lrs
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/osprofile"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
billing_api "yunion.io/x/onecloud/pkg/apis/billing"
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
@@ -358,6 +359,9 @@ func (self *SInstance) getStorageInfoByUri(uri string) (*SStorage, *SClassicStor
|
||||
zone: self.host.zone,
|
||||
storageType: storageaccounts[i].Sku.Name,
|
||||
}
|
||||
if !utils.IsInStringArray(storage.storageType, STORAGETYPES) {
|
||||
storage.storageType = STORAGE_STD_LRS
|
||||
}
|
||||
return &storage, nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,13 @@ type Capabilitie struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
var STORAGETYPES = []string{"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"}
|
||||
const (
|
||||
STORAGE_STD_LRS = "Standard_LRS"
|
||||
STORAGE_PRE_LRS = "Premium_LRS"
|
||||
STORAGE_STD_SSD = "StandardSSD_LRS"
|
||||
)
|
||||
|
||||
var STORAGETYPES = []string{STORAGE_STD_LRS, STORAGE_PRE_LRS, STORAGE_STD_SSD}
|
||||
|
||||
type SStorage struct {
|
||||
zone *SZone
|
||||
|
||||
Reference in New Issue
Block a user