feat(region): disable synchronization of some special storage

This commit is contained in:
rainzm
2021-03-30 22:45:59 +08:00
parent 8f9b0ad6c7
commit 8009ca8d70
20 changed files with 34 additions and 17 deletions
+2
View File
@@ -231,6 +231,8 @@ type ICloudStorage interface {
GetMountPoint() string
IsSysDiskStore() bool
DisableSync() bool
}
type ICloudHost interface {
+3 -2
View File
@@ -511,8 +511,9 @@ func syncZoneStorages(ctx context.Context, userCred mcclient.TokenCredential, sy
newCacheIds = append(newCacheIds, cachePair)
}
}
syncStorageDisks(ctx, userCred, syncResults, provider, driver, &localStorages[i], remoteStorages[i], syncRange)
if !remoteStorages[i].DisableSync() {
syncStorageDisks(ctx, userCred, syncResults, provider, driver, &localStorages[i], remoteStorages[i], syncRange)
}
}()
}
return newCacheIds
+1 -1
View File
@@ -41,7 +41,7 @@ import (
)
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
}
+1 -1
View File
@@ -41,7 +41,7 @@ import (
)
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
}
+1 -1
View File
@@ -27,7 +27,7 @@ import (
)
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
}
+1 -1
View File
@@ -32,7 +32,7 @@ const (
)
type SClassicStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
region *SRegion
AccountType string
+1 -1
View File
@@ -39,7 +39,7 @@ const (
var STORAGETYPES = []string{STORAGE_STD_LRS, STORAGE_PRE_LRS, STORAGE_STD_SSD}
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
+1 -1
View File
@@ -34,7 +34,7 @@ var StorageTypes = []string{
}
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
}
+1 -1
View File
@@ -55,7 +55,7 @@ import (
var DATASTORE_PROPS = []string{"name", "parent", "info", "summary", "host", "vm"}
type SDatastore struct {
multicloud.SResourceBase
multicloud.SStorageBase
SManagedObject
// vms []cloudprovider.ICloudVM
+4
View File
@@ -144,3 +144,7 @@ func (storage *SStorage) GetMountPoint() string {
func (storage *SStorage) IsSysDiskStore() bool {
return storage.Name != api.STORAGE_GOOGLE_LOCAL_SSD
}
func (storage *SStorage) DisableSync() bool {
return false
}
+1 -1
View File
@@ -28,7 +28,7 @@ import (
type SStorage struct {
zone *SZone
multicloud.SResourceBase
multicloud.SStorageBase
storageType string // volume_type 目前支持“SSD”,“SAS”和“SATA”三种
}
+1
View File
@@ -32,6 +32,7 @@ import (
_ "yunion.io/x/onecloud/pkg/multicloud/qcloud/provider"
_ "yunion.io/x/onecloud/pkg/multicloud/ucloud/provider" // object storages
_ "yunion.io/x/onecloud/pkg/multicloud/zstack/provider" // public clouds
_ "yunion.io/x/onecloud/pkg/multicloud/ecloud/provider" // public clouds
)
func init() {
+1 -1
View File
@@ -25,7 +25,7 @@ import (
)
type SNovaStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
host *SHypervisor
zone *SZone
}
+1 -1
View File
@@ -38,7 +38,7 @@ type SExtraSpecs struct {
}
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
Name string
ExtraSpecs SExtraSpecs
+1 -1
View File
@@ -33,7 +33,7 @@ var QCLOUD_LOCAL_STORAGE_TYPES = []string{
}
type SLocalStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
available bool
+1 -1
View File
@@ -28,7 +28,7 @@ import (
)
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
available bool
+9
View File
@@ -0,0 +1,9 @@
package multicloud
type SStorageBase struct {
SResourceBase
}
func (s *SStorageBase) DisableSync() bool {
return false
}
+1 -1
View File
@@ -26,7 +26,7 @@ import (
)
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
zone *SZone
storageType string
}
+1 -1
View File
@@ -54,7 +54,7 @@ type SPool struct {
}
type SStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
region *SRegion
ZStackBasic
+1 -1
View File
@@ -28,7 +28,7 @@ import (
)
type SLocalStorage struct {
multicloud.SResourceBase
multicloud.SStorageBase
region *SRegion
primaryStorageID string