mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
feat(region): disable synchronization of some special storage
This commit is contained in:
@@ -231,6 +231,8 @@ type ICloudStorage interface {
|
||||
GetMountPoint() string
|
||||
|
||||
IsSysDiskStore() bool
|
||||
|
||||
DisableSync() bool
|
||||
}
|
||||
|
||||
type ICloudHost interface {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
)
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ const (
|
||||
)
|
||||
|
||||
type SClassicStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
region *SRegion
|
||||
|
||||
AccountType string
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,7 +34,7 @@ var StorageTypes = []string{
|
||||
}
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
type SStorage struct {
|
||||
zone *SZone
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
storageType string // volume_type 目前支持“SSD”,“SAS”和“SATA”三种
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
)
|
||||
|
||||
type SNovaStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
host *SHypervisor
|
||||
zone *SZone
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ type SExtraSpecs struct {
|
||||
}
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
Name string
|
||||
ExtraSpecs SExtraSpecs
|
||||
|
||||
@@ -33,7 +33,7 @@ var QCLOUD_LOCAL_STORAGE_TYPES = []string{
|
||||
}
|
||||
|
||||
type SLocalStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
available bool
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
)
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
available bool
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package multicloud
|
||||
|
||||
type SStorageBase struct {
|
||||
SResourceBase
|
||||
}
|
||||
|
||||
func (s *SStorageBase) DisableSync() bool {
|
||||
return false
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
zone *SZone
|
||||
storageType string
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ type SPool struct {
|
||||
}
|
||||
|
||||
type SStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
region *SRegion
|
||||
|
||||
ZStackBasic
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
)
|
||||
|
||||
type SLocalStorage struct {
|
||||
multicloud.SResourceBase
|
||||
multicloud.SStorageBase
|
||||
region *SRegion
|
||||
|
||||
primaryStorageID string
|
||||
|
||||
Reference in New Issue
Block a user