Documentation ¶
Index ¶
- Constants
- Variables
- func CleanRecycleDiskfiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func GatherHostStorageStats() api.SHostPingInput
- func GetRootPartTotalCapacity() int
- func GetRootPartUsedCapacity() int
- func Init(host hostutils.IHost) error
- func StartSnapshotRecycle(storage IStorage)
- func Stop()
- func StorageRequestSnapshotRecycle(ctx context.Context, userCred mcclient.TokenCredential, storage IStorage)
- type IDisk
- type IImageCache
- type IImageCacheManger
- type IImageCacheMangerFactory
- type INasStorage
- type IStorage
- type IStorageFactory
- type IStorageManager
- type PrepareSaveToGlanceParams
- type SAgentDisk
- type SAgentImageCacheManager
- type SAgentStorage
- func (as *SAgentStorage) AgentDeployGuest(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (as *SAgentStorage) CreateDiskByDiskInfo(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (as *SAgentStorage) GetDiskById(diskId string) (IDisk, error)
- func (as *SAgentStorage) PrepareSaveToGlance(ctx context.Context, taskId string, diskInfo jsonutils.JSONObject) (ret jsonutils.JSONObject, err error)
- func (as *SAgentStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- type SBaseDisk
- func (d *SBaseDisk) CreateFromRbdSnapshot(ctx context.Context, napshotUrl, srcDiskId, srcPool string) error
- func (d *SBaseDisk) CreateFromSnapshotLocation(ctx context.Context, location string, size int64, ...) error
- func (d *SBaseDisk) CreateFromTemplate(context.Context, string, string, int64, *apis.SEncryptInfo) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) CreateFromUrl(ctx context.Context, url string, size int64, ...) error
- func (d *SBaseDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *jsonutils.JSONDict, ...) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) DoDeleteSnapshot(snapshotId string) error
- func (d *SBaseDisk) FormatFs(fsFormat, uuid string, diskInfo *deployapi.DiskInfo)
- func (d *SBaseDisk) GetBackupDir() string
- func (d *SBaseDisk) GetDiskSetupScripts(diskIndex int) string
- func (d *SBaseDisk) GetFormat() (string, error)
- func (d *SBaseDisk) GetId() string
- func (d *SBaseDisk) GetPath() string
- func (d *SBaseDisk) GetSnapshotLocation() string
- func (d *SBaseDisk) GetStorage() IStorage
- func (d *SBaseDisk) GetType() string
- func (d *SBaseDisk) GetZoneId() string
- func (d *SBaseDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
- func (d *SBaseDisk) Probe() error
- func (d *SBaseDisk) Resize(context.Context, interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) ResizeFs(diskInfo *deployapi.DiskInfo) error
- type SBaseImageCacheManager
- type SBaseStorage
- func (s *SBaseStorage) CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, ...) (*hostapi.ServerCloneDiskFromStorageResponse, error)
- func (s *SBaseStorage) CreateDiskByDiskinfo(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SBaseStorage) CreateDiskFromSnpashot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) CreateDiskFromTemplate(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) CreateRawDisk(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error
- func (s *SBaseStorage) DestinationPrepareMigrate(ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, ...) error
- func (s *SBaseStorage) GetAvailSizeMb() int
- func (s *SBaseStorage) GetBackupDir() string
- func (s *SBaseStorage) GetCapacity() int
- func (s *SBaseStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
- func (s *SBaseStorage) GetFreeSizeMb() int
- func (s *SBaseStorage) GetId() string
- func (s *SBaseStorage) GetName(generateName func() string) string
- func (s *SBaseStorage) GetPath() string
- func (s *SBaseStorage) GetStorageConf() *jsonutils.JSONDict
- func (s *SBaseStorage) GetStorageName() string
- func (s *SBaseStorage) GetStoragecacheId() string
- func (s *SBaseStorage) GetTotalSizeMb() int
- func (s *SBaseStorage) GetUsedSizeMb() int
- func (s *SBaseStorage) GetZoneId() string
- func (s *SBaseStorage) RemoveDisk(d IDisk)
- func (s *SBaseStorage) SetPath(p string)
- func (s *SBaseStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SBaseStorage) SetStoragecacheId(storagecacheId string)
- func (s *SBaseStorage) StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) SyncStorageSize() (api.SHostStorageStat, error)
- type SDiskBakcup
- type SDiskCleanupSnapshots
- type SDiskCreateByDiskinfo
- type SDiskReset
- type SGPFSDisk
- type SGPFSStorage
- type SGPFSStorageFactory
- type SHostDatastore
- type SLocalDisk
- func (d *SLocalDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
- func (d *SLocalDisk) CreateFromTemplate(ctx context.Context, imageId, format string, size int64, ...) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) CreateFromUrl(ctx context.Context, url string, size int64, ...) error
- func (d *SLocalDisk) CreateRaw(ctx context.Context, sizeMB int, diskFormat, fsFormat string, ...) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, ...) error
- func (d *SLocalDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) DeleteAllSnapshot(skipRecycle bool) error
- func (d *SLocalDisk) DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error
- func (d *SLocalDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) DoDeleteSnapshot(snapshotId string) error
- func (d *SLocalDisk) GetBackupDir() string
- func (d *SLocalDisk) GetDiskDesc() jsonutils.JSONObject
- func (d *SLocalDisk) GetDiskSetupScripts(diskIndex int) string
- func (d *SLocalDisk) GetFormat() (string, error)
- func (d *SLocalDisk) GetPath() string
- func (d *SLocalDisk) GetSnapshotDir() string
- func (d *SLocalDisk) GetSnapshotLocation() string
- func (d *SLocalDisk) IsFile() bool
- func (d *SLocalDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
- func (d *SLocalDisk) PostCreateFromImageFuse()
- func (d *SLocalDisk) PrepareMigrate(liveMigrate bool) (string, error)
- func (d *SLocalDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) Probe() error
- func (d *SLocalDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) UmountFuseImage()
- type SLocalImageCache
- func (l *SLocalImageCache) Acquire(ctx context.Context, input api.CacheImageInput, ...) error
- func (l *SLocalImageCache) GetDesc() *remotefile.SImageDesc
- func (l *SLocalImageCache) GetImageId() string
- func (l *SLocalImageCache) GetInfPath() string
- func (l *SLocalImageCache) GetName() string
- func (l *SLocalImageCache) GetPath() string
- func (l *SLocalImageCache) GetSize() int64
- func (l *SLocalImageCache) GetTmpPath() string
- func (l *SLocalImageCache) Load() error
- func (l *SLocalImageCache) Release()
- func (l *SLocalImageCache) Remove(ctx context.Context) error
- type SLocalImageCacheManager
- func (c *SLocalImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, ...) (IImageCache, error)
- func (c *SLocalImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SLocalImageCacheManager) LoadImageCache(imageId string)
- func (c *SLocalImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SLocalImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
- type SLocalStorage
- func (s *SLocalStorage) Accessible() error
- func (s *SLocalStorage) CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, ...) (*hostapi.ServerCloneDiskFromStorageResponse, error)
- func (s *SLocalStorage) CreateDisk(diskId string) IDisk
- func (s *SLocalStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SLocalStorage) CreateDiskFromExistingPath(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SLocalStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SLocalStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
- func (s *SLocalStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error
- func (s *SLocalStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLocalStorage) DestinationPrepareMigrate(ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, ...) error
- func (s *SLocalStorage) Detach() error
- func (s *SLocalStorage) GetAvailSizeMb() int
- func (s *SLocalStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
- func (s *SLocalStorage) GetComposedName() string
- func (s *SLocalStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SLocalStorage) GetFuseMountPath() string
- func (s *SLocalStorage) GetFuseTmpPath() string
- func (s *SLocalStorage) GetImgsaveBackupPath() string
- func (s *SLocalStorage) GetSnapshotDir() string
- func (s *SLocalStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
- func (s *SLocalStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
- func (s *SLocalStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLocalStorage) StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLocalStorage) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLocalStorage) StorageType() string
- func (s *SLocalStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
- type SNFSDisk
- type SNFSStorage
- type SNFSStorageFactory
- type SNasDisk
- func (d *SNasDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
- func (d *SNasDisk) CreateFromSnapshotLocation(ctx context.Context, snapshotLocation string, size int64, ...) error
- func (d *SNasDisk) CreateFromTemplate(ctx context.Context, imageId, format string, size int64, ...) (jsonutils.JSONObject, error)
- func (d *SNasDisk) GetSnapshotLocation() string
- func (d *SNasDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- type SNasStorage
- func (s *SNasStorage) CreateDisk(diskId string) IDisk
- func (s *SNasStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SNasStorage) GetComposedName() string
- func (s *SNasStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SNasStorage) GetSnapshotDir() string
- func (s *SNasStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
- type SRBDDisk
- func (d *SRBDDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
- func (d *SRBDDisk) CreateFromRbdSnapshot(ctx context.Context, snapshot, srcDiskId, srcPool string) error
- func (d *SRBDDisk) CreateFromTemplate(ctx context.Context, imageId string, format string, size int64, ...) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) CreateRaw(ctx context.Context, sizeMb int, diskFromat string, fsFormat string, ...) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, ...) error
- func (d *SRBDDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) DeleteAllSnapshot(skipRecycle bool) error
- func (d *SRBDDisk) DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error
- func (d *SRBDDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) GetDiskDesc() jsonutils.JSONObject
- func (d *SRBDDisk) GetDiskSetupScripts(idx int) string
- func (d *SRBDDisk) GetFormat() (string, error)
- func (d *SRBDDisk) GetPath() string
- func (d *SRBDDisk) GetSnapshotDir() string
- func (d *SRBDDisk) GetType() string
- func (d *SRBDDisk) IsFile() bool
- func (d *SRBDDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
- func (d *SRBDDisk) PostCreateFromImageFuse()
- func (d *SRBDDisk) PrepareMigrate(liveMigrate bool) (string, error)
- func (d *SRBDDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) Probe() error
- func (d *SRBDDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SRBDDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- type SRbdImageCache
- func (r *SRbdImageCache) Acquire(ctx context.Context, input api.CacheImageInput, ...) error
- func (r *SRbdImageCache) GetDesc() *remotefile.SImageDesc
- func (r *SRbdImageCache) GetImageId() string
- func (r *SRbdImageCache) GetName() string
- func (r *SRbdImageCache) GetPath() string
- func (r *SRbdImageCache) Load() error
- func (r *SRbdImageCache) Release()
- func (r *SRbdImageCache) Remove(ctx context.Context) error
- type SRbdImageCacheManager
- func (c *SRbdImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, ...) (IImageCache, error)
- func (c *SRbdImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SRbdImageCacheManager) GetPath() string
- func (c *SRbdImageCacheManager) LoadImageCache(imageId string)
- func (c *SRbdImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SRbdImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
- type SRbdImageCacheManagerFactory
- type SRbdStorage
- func (s *SRbdStorage) Accessible() error
- func (s *SRbdStorage) CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, ...) (*hostapi.ServerCloneDiskFromStorageResponse, error)
- func (s *SRbdStorage) CreateDisk(diskId string) IDisk
- func (s *SRbdStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SRbdStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
- func (s *SRbdStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SRbdStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
- func (s *SRbdStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SRbdStorage) Detach() error
- func (s *SRbdStorage) GetBackupDir() string
- func (s *SRbdStorage) GetClient() (*cephutils.CephClient, error)
- func (s *SRbdStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
- func (s *SRbdStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SRbdStorage) GetDiskPath(diskId string) string
- func (s *SRbdStorage) GetFuseMountPath() string
- func (s *SRbdStorage) GetFuseTmpPath() string
- func (s *SRbdStorage) GetImgsaveBackupPath() string
- func (s *SRbdStorage) GetSnapshotDir() string
- func (s *SRbdStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
- func (s *SRbdStorage) IsImageExist(name string) (bool, error)
- func (s *SRbdStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
- func (s *SRbdStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SRbdStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SRbdStorage) StorageType() string
- func (s *SRbdStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
- func (s *SRbdStorage) SyncStorageSize() (api.SHostStorageStat, error)
- type SRbdStorageFactory
- type SStorageBackup
- type SStorageManager
- func (s *SStorageManager) AddRbdStorageImagecache(imagecachePath string, storage IStorage, storagecacheId string)
- func (s *SStorageManager) GetDiskByPath(diskPath string) (IDisk, error)
- func (s *SStorageManager) GetHostId() string
- func (s *SStorageManager) GetKubeletConfig() kubelet.KubeletConfig
- func (s *SStorageManager) GetStorage(storageId string) IStorage
- func (s *SStorageManager) GetStorageByPath(sPath string) (IStorage, error)
- func (s *SStorageManager) GetStorageDisk(storageId, diskId string) IDisk
- func (s *SStorageManager) GetStoragecacheById(scId string) IImageCacheManger
- func (s *SStorageManager) GetStoragesByPath(sPath string) ([]IStorage, error)
- func (s *SStorageManager) GetTotalCapacity() int
- func (s *SStorageManager) GetZoneId() string
- func (s *SStorageManager) InitSharedFileStorageImagecache(storagecacheId, path string)
- func (s *SStorageManager) InitSharedStorageImageCache(storageType, storagecacheId, imagecachePath string, storage IStorage)
- func (s *SStorageManager) NewSharedStorageInstance(mountPoint, storageType string) IStorage
- func (s *SStorageManager) Remove(storage IStorage)
- type SStoragePackBackup
- type SStoragePackInstanceBackup
- type SStorageSaveToGlanceInfo
- type SStorageUnpackInstanceBackup
Constants ¶
View Source
const ( ErrStorageTimeout = constError("storage accessible check timeout") TempBindMountPath = "/opt/cloud/workspace/temp-bind" )
View Source
const ( RBD_FEATURE = 3 RBD_ORDER = 22 //为rbd对应到rados中每个对象的大小,默认为4MB )
View Source
const (
CHECK_TIMEOUT = 3600 * time.Second
)
View Source
const MINIMAL_FREE_SPACE = 128
Variables ¶
View Source
var DELETEING_SNAPSHOTS = sync.Map{}
Functions ¶
func CleanRecycleDiskfiles ¶
func CleanRecycleDiskfiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func GatherHostStorageStats ¶
func GatherHostStorageStats() api.SHostPingInput
func GetRootPartTotalCapacity ¶
func GetRootPartTotalCapacity() int
func GetRootPartUsedCapacity ¶
func GetRootPartUsedCapacity() int
func StartSnapshotRecycle ¶
func StartSnapshotRecycle(storage IStorage)
func StorageRequestSnapshotRecycle ¶
func StorageRequestSnapshotRecycle(ctx context.Context, userCred mcclient.TokenCredential, storage IStorage)
Types ¶
type IDisk ¶
type IDisk interface { GetType() string GetId() string Probe() error GetPath() string GetFormat() (string, error) GetSnapshotDir() string GetDiskDesc() jsonutils.JSONObject GetDiskSetupScripts(idx int) string GetSnapshotLocation() string OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error DoDeleteSnapshot(snapshotId string) error GetStorage() IStorage DeleteAllSnapshot(skipRecycle bool) error DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) PrepareMigrate(liveMigrate bool) (string, error) CreateFromUrl(ctx context.Context, url string, size int64, callback func(progress, progressMbps float64, totalSizeMb int64)) error CreateFromTemplate(context.Context, string, string, int64, *apis.SEncryptInfo) (jsonutils.JSONObject, error) CreateFromSnapshotLocation(ctx context.Context, location string, size int64, encryptInfo *apis.SEncryptInfo) error CreateFromRbdSnapshot(ctx context.Context, snapshotId, srcDiskId, srcPool string) error CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error CreateRaw(ctx context.Context, sizeMb int, diskFromat string, fsFormat string, encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error) PostCreateFromImageFuse() CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *jsonutils.JSONDict, deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error) GetBackupDir() string DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) IsFile() bool }
type IImageCache ¶
type IImageCache interface { GetPath() string GetName() string Load() error Acquire(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) error Release() Remove(ctx context.Context) error GetImageId() string GetDesc() *remotefile.SImageDesc }
type IImageCacheManger ¶
type IImageCacheManger interface { GetId() string GetPath() string SetStoragecacheId(string) // for diskhandler PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error) AcquireImage(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) (IImageCache, error) ReleaseImage(ctx context.Context, imageId string) LoadImageCache(imageId string) }
func NewImageCacheManager ¶
func NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string, storageType string) IImageCacheManger
type IImageCacheMangerFactory ¶
type IImageCacheMangerFactory interface { NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string) IImageCacheManger StorageType() string }
type INasStorage ¶
type INasStorage interface { StorageType() string // contains filtered or unexported methods }
type IStorage ¶
type IStorage interface { GetId() string GetStorageName() string GetZoneId() string SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error SyncStorageInfo() (jsonutils.JSONObject, error) SyncStorageSize() (api.SHostStorageStat, error) StorageType() string GetStorageConf() *jsonutils.JSONDict GetStoragecacheId() string SetStoragecacheId(storagecacheId string) SetPath(string) GetPath() string GetSnapshotDir() string GetSnapshotPathByIds(diskId, snapshotId string) string DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) IsSnapshotExist(diskId, snapshotId string) (bool, error) GetBackupDir() string StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) GetFreeSizeMb() int GetCapacity() int // Find owner disks first, if not found, call create disk GetDiskById(diskId string) (IDisk, error) CreateDisk(diskId string) IDisk RemoveDisk(IDisk) // *SDiskCreateByDiskinfo CreateDiskByDiskinfo(context.Context, interface{}) (jsonutils.JSONObject, error) SaveToGlance(context.Context, interface{}) (jsonutils.JSONObject, error) CreateDiskFromSnapshot(context.Context, IDisk, *SDiskCreateByDiskinfo) error CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error CreateDiskFromBackup(context.Context, IDisk, *SDiskCreateByDiskinfo) error // GetCloneTargetDiskPath generate target disk path by target disk id GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string // CloneDiskFromStorage clone disk from other storage CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool) (*hostapi.ServerCloneDiskFromStorageResponse, error) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error DeleteDiskfile(diskPath string, skipRecycle bool) error GetFuseTmpPath() string GetFuseMountPath() string GetImgsaveBackupPath() string DestinationPrepareMigrate(ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, disksBackingFile, srcSnapshots jsonutils.JSONObject, rebaseDisks bool, diskDesc jsonutils.JSONObject, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo) error Accessible() error Detach() error }
func NewStorage ¶
func NewStorage(manager *SStorageManager, mountPoint, storageType string) IStorage
type IStorageFactory ¶
type IStorageFactory interface { NewStorage(manager *SStorageManager, mountPoint string) IStorage StorageType() string }
type IStorageManager ¶
type IStorageManager interface {
GetZoneId() string
}
type PrepareSaveToGlanceParams ¶
type PrepareSaveToGlanceParams struct { TaskId string DiskInfo jsonutils.JSONObject }
type SAgentDisk ¶
type SAgentDisk struct {
SLocalDisk
}
func NewAgentDisk ¶
func NewAgentDisk(storage IStorage, id string) *SAgentDisk
func (*SAgentDisk) PrepareSaveToGlance ¶
func (sd *SAgentDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SAgentDisk) Resize ¶
func (sd *SAgentDisk) Resize(ctx context.Context, diskInfo interface{}) (jsonutils.JSONObject, error)
type SAgentImageCacheManager ¶
type SAgentImageCacheManager struct {
// contains filtered or unexported fields
}
func NewAgentImageCacheManager ¶
func NewAgentImageCacheManager(manger IImageCacheManger) *SAgentImageCacheManager
func (*SAgentImageCacheManager) DeleteImageCache ¶
func (c *SAgentImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SAgentImageCacheManager) PrefetchImageCache ¶
func (c *SAgentImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
type SAgentStorage ¶
type SAgentStorage struct { SLocalStorage // contains filtered or unexported fields }
func NewAgentStorage ¶
func NewAgentStorage(manager *SStorageManager, agent iagent.IAgent, path string) *SAgentStorage
func (*SAgentStorage) AgentDeployGuest ¶
func (as *SAgentStorage) AgentDeployGuest(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SAgentStorage) CreateDiskByDiskInfo ¶
func (as *SAgentStorage) CreateDiskByDiskInfo(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SAgentStorage) GetDiskById ¶
func (as *SAgentStorage) GetDiskById(diskId string) (IDisk, error)
func (*SAgentStorage) PrepareSaveToGlance ¶
func (as *SAgentStorage) PrepareSaveToGlance(ctx context.Context, taskId string, diskInfo jsonutils.JSONObject) ( ret jsonutils.JSONObject, err error)
func (*SAgentStorage) SaveToGlance ¶
func (as *SAgentStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
type SBaseDisk ¶
func NewBaseDisk ¶
func (*SBaseDisk) CreateFromRbdSnapshot ¶
func (*SBaseDisk) CreateFromSnapshotLocation ¶
func (*SBaseDisk) CreateFromTemplate ¶
func (*SBaseDisk) CreateFromUrl ¶
func (*SBaseDisk) DeployGuestFs ¶
func (d *SBaseDisk) DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *jsonutils.JSONDict, deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error)
func (*SBaseDisk) DiskBackup ¶
func (*SBaseDisk) DiskDeleteSnapshot ¶
func (*SBaseDisk) DiskSnapshot ¶
func (*SBaseDisk) DoDeleteSnapshot ¶
func (*SBaseDisk) GetBackupDir ¶
func (*SBaseDisk) GetDiskSetupScripts ¶
func (*SBaseDisk) GetSnapshotLocation ¶
func (*SBaseDisk) GetStorage ¶
func (*SBaseDisk) OnRebuildRoot ¶
type SBaseImageCacheManager ¶
type SBaseImageCacheManager struct {
// contains filtered or unexported fields
}
func (*SBaseImageCacheManager) GetId ¶
func (c *SBaseImageCacheManager) GetId() string
func (*SBaseImageCacheManager) GetPath ¶
func (c *SBaseImageCacheManager) GetPath() string
func (*SBaseImageCacheManager) GetStorageManager ¶
func (c *SBaseImageCacheManager) GetStorageManager() IStorageManager
func (*SBaseImageCacheManager) SetStoragecacheId ¶
func (c *SBaseImageCacheManager) SetStoragecacheId(scid string)
type SBaseStorage ¶
type SBaseStorage struct { Manager *SStorageManager StorageId string Path string StorageName string StorageConf *jsonutils.JSONDict StoragecacheId string Disks []IDisk DiskLock *sync.Mutex // contains filtered or unexported fields }
func NewBaseStorage ¶
func NewBaseStorage(manager *SStorageManager, path string) *SBaseStorage
func (*SBaseStorage) CloneDiskFromStorage ¶
func (s *SBaseStorage) CloneDiskFromStorage( ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool, ) (*hostapi.ServerCloneDiskFromStorageResponse, error)
func (*SBaseStorage) CreateDiskByDiskinfo ¶
func (s *SBaseStorage) CreateDiskByDiskinfo(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SBaseStorage) CreateDiskFromBackup ¶
func (s *SBaseStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SBaseStorage) CreateDiskFromSnpashot ¶
func (s *SBaseStorage) CreateDiskFromSnpashot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SBaseStorage) CreateDiskFromTemplate ¶
func (s *SBaseStorage) CreateDiskFromTemplate(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SBaseStorage) CreateRawDisk ¶
func (s *SBaseStorage) CreateRawDisk(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SBaseStorage) DeleteDiskfile ¶
func (s *SBaseStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error
func (*SBaseStorage) DestinationPrepareMigrate ¶
func (s *SBaseStorage) DestinationPrepareMigrate( ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, disksBackingFile, srcSnapshots jsonutils.JSONObject, rebaseDisks bool, diskinfo jsonutils.JSONObject, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, ) error
func (*SBaseStorage) GetAvailSizeMb ¶
func (s *SBaseStorage) GetAvailSizeMb() int
func (*SBaseStorage) GetBackupDir ¶
func (s *SBaseStorage) GetBackupDir() string
func (*SBaseStorage) GetCapacity ¶
func (s *SBaseStorage) GetCapacity() int
func (*SBaseStorage) GetCloneTargetDiskPath ¶
func (s *SBaseStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
func (*SBaseStorage) GetFreeSizeMb ¶
func (s *SBaseStorage) GetFreeSizeMb() int
func (*SBaseStorage) GetId ¶
func (s *SBaseStorage) GetId() string
func (*SBaseStorage) GetName ¶
func (s *SBaseStorage) GetName(generateName func() string) string
func (*SBaseStorage) GetPath ¶
func (s *SBaseStorage) GetPath() string
func (*SBaseStorage) GetStorageConf ¶
func (s *SBaseStorage) GetStorageConf() *jsonutils.JSONDict
func (*SBaseStorage) GetStorageName ¶
func (s *SBaseStorage) GetStorageName() string
func (*SBaseStorage) GetStoragecacheId ¶
func (s *SBaseStorage) GetStoragecacheId() string
func (*SBaseStorage) GetTotalSizeMb ¶
func (s *SBaseStorage) GetTotalSizeMb() int
func (*SBaseStorage) GetUsedSizeMb ¶
func (s *SBaseStorage) GetUsedSizeMb() int
func (*SBaseStorage) GetZoneId ¶
func (s *SBaseStorage) GetZoneId() string
func (*SBaseStorage) RemoveDisk ¶
func (s *SBaseStorage) RemoveDisk(d IDisk)
func (*SBaseStorage) SetPath ¶
func (s *SBaseStorage) SetPath(p string)
func (*SBaseStorage) SetStorageInfo ¶
func (s *SBaseStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SBaseStorage) SetStoragecacheId ¶
func (s *SBaseStorage) SetStoragecacheId(storagecacheId string)
func (*SBaseStorage) StorageBackup ¶
func (s *SBaseStorage) StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SBaseStorage) StorageBackupRecovery ¶
func (s *SBaseStorage) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SBaseStorage) SyncStorageSize ¶
func (s *SBaseStorage) SyncStorageSize() (api.SHostStorageStat, error)
type SDiskBakcup ¶
type SDiskBakcup struct { SnapshotId string `json:"snapshot_id"` BackupId string `json:"backup_id"` BackupStorageId string `json:"backup_storage_id"` BackupStorageAccessInfo *jsonutils.JSONDict `json:"backup_storage_access_info"` EncryptKeyId string `json:"encrypt_key_id"` UserCred mcclient.TokenCredential }
type SDiskCleanupSnapshots ¶
type SDiskCleanupSnapshots struct { ConvertSnapshots []jsonutils.JSONObject DeleteSnapshots []jsonutils.JSONObject }
type SDiskCreateByDiskinfo ¶
type SDiskCreateByDiskinfo struct { DiskId string Disk IDisk DiskInfo api.DiskAllocateInput Storage IStorage }
func (*SDiskCreateByDiskinfo) String ¶
func (i *SDiskCreateByDiskinfo) String() string
type SDiskReset ¶
type SDiskReset struct { SnapshotId string BackingDiskId string Input jsonutils.JSONObject }
type SGPFSStorage ¶
type SGPFSStorage struct {
SNasStorage
}
func NewGPFSStorage ¶
func NewGPFSStorage(manager *SStorageManager, path string) *SGPFSStorage
func (*SGPFSStorage) StorageType ¶
func (s *SGPFSStorage) StorageType() string
type SGPFSStorageFactory ¶
type SGPFSStorageFactory struct { }
func (*SGPFSStorageFactory) NewStorage ¶
func (factory *SGPFSStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage
func (*SGPFSStorageFactory) StorageType ¶
func (factory *SGPFSStorageFactory) StorageType() string
type SHostDatastore ¶
type SHostDatastore struct { HostIp string Datastore vcenter.SVCenterAccessInfo }
type SLocalDisk ¶
type SLocalDisk struct { SBaseDisk // contains filtered or unexported fields }
func NewLocalDisk ¶
func NewLocalDisk(storage IStorage, id string) *SLocalDisk
func (*SLocalDisk) CleanupSnapshots ¶
func (d *SLocalDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) CreateFromImageFuse ¶
func (d *SLocalDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
func (*SLocalDisk) CreateFromTemplate ¶
func (d *SLocalDisk) CreateFromTemplate(ctx context.Context, imageId, format string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)
func (*SLocalDisk) CreateFromUrl ¶
func (*SLocalDisk) CreateRaw ¶
func (d *SLocalDisk) CreateRaw(ctx context.Context, sizeMB int, diskFormat, fsFormat string, encryptInfo *apis.SEncryptInfo, uuid string, back string) (jsonutils.JSONObject, error)
func (*SLocalDisk) CreateSnapshot ¶
func (d *SLocalDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
func (*SLocalDisk) Delete ¶
func (d *SLocalDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) DeleteAllSnapshot ¶
func (d *SLocalDisk) DeleteAllSnapshot(skipRecycle bool) error
func (*SLocalDisk) DeleteSnapshot ¶
func (d *SLocalDisk) DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error
func (*SLocalDisk) DiskBackup ¶
func (d *SLocalDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) DoDeleteSnapshot ¶
func (d *SLocalDisk) DoDeleteSnapshot(snapshotId string) error
func (*SLocalDisk) GetBackupDir ¶
func (d *SLocalDisk) GetBackupDir() string
func (*SLocalDisk) GetDiskDesc ¶
func (d *SLocalDisk) GetDiskDesc() jsonutils.JSONObject
func (*SLocalDisk) GetDiskSetupScripts ¶
func (d *SLocalDisk) GetDiskSetupScripts(diskIndex int) string
func (*SLocalDisk) GetFormat ¶
func (d *SLocalDisk) GetFormat() (string, error)
func (*SLocalDisk) GetPath ¶
func (d *SLocalDisk) GetPath() string
func (*SLocalDisk) GetSnapshotDir ¶
func (d *SLocalDisk) GetSnapshotDir() string
func (*SLocalDisk) GetSnapshotLocation ¶
func (d *SLocalDisk) GetSnapshotLocation() string
func (*SLocalDisk) IsFile ¶
func (d *SLocalDisk) IsFile() bool
func (*SLocalDisk) OnRebuildRoot ¶
func (d *SLocalDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
func (*SLocalDisk) PostCreateFromImageFuse ¶
func (d *SLocalDisk) PostCreateFromImageFuse()
func (*SLocalDisk) PrepareMigrate ¶
func (d *SLocalDisk) PrepareMigrate(liveMigrate bool) (string, error)
func (*SLocalDisk) PrepareSaveToGlance ¶
func (d *SLocalDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) Probe ¶
func (d *SLocalDisk) Probe() error
func (*SLocalDisk) ResetFromSnapshot ¶
func (d *SLocalDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) Resize ¶
func (d *SLocalDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) UmountFuseImage ¶
func (d *SLocalDisk) UmountFuseImage()
type SLocalImageCache ¶
type SLocalImageCache struct { Manager IImageCacheManger Size int64 Desc *remotefile.SImageDesc // contains filtered or unexported fields }
func NewLocalImageCache ¶
func NewLocalImageCache(imageId string, imagecacheManager IImageCacheManger) *SLocalImageCache
func (*SLocalImageCache) Acquire ¶
func (l *SLocalImageCache) Acquire(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) error
func (*SLocalImageCache) GetDesc ¶
func (l *SLocalImageCache) GetDesc() *remotefile.SImageDesc
func (*SLocalImageCache) GetImageId ¶
func (l *SLocalImageCache) GetImageId() string
func (*SLocalImageCache) GetInfPath ¶
func (l *SLocalImageCache) GetInfPath() string
func (*SLocalImageCache) GetName ¶
func (l *SLocalImageCache) GetName() string
func (*SLocalImageCache) GetPath ¶
func (l *SLocalImageCache) GetPath() string
func (*SLocalImageCache) GetSize ¶
func (l *SLocalImageCache) GetSize() int64
func (*SLocalImageCache) GetTmpPath ¶
func (l *SLocalImageCache) GetTmpPath() string
func (*SLocalImageCache) Load ¶
func (l *SLocalImageCache) Load() error
func (*SLocalImageCache) Release ¶
func (l *SLocalImageCache) Release()
type SLocalImageCacheManager ¶
type SLocalImageCacheManager struct { SBaseImageCacheManager // contains filtered or unexported fields }
func NewLocalImageCacheManager ¶
func NewLocalImageCacheManager(manager IStorageManager, cachePath string, storagecacheId string) *SLocalImageCacheManager
func (*SLocalImageCacheManager) AcquireImage ¶
func (c *SLocalImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) (IImageCache, error)
func (*SLocalImageCacheManager) DeleteImageCache ¶
func (c *SLocalImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SLocalImageCacheManager) LoadImageCache ¶
func (c *SLocalImageCacheManager) LoadImageCache(imageId string)
func (*SLocalImageCacheManager) PrefetchImageCache ¶
func (c *SLocalImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SLocalImageCacheManager) ReleaseImage ¶
func (c *SLocalImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
type SLocalStorage ¶
type SLocalStorage struct { SBaseStorage Index int }
func NewLocalStorage ¶
func NewLocalStorage(manager *SStorageManager, path string, index int) *SLocalStorage
func (*SLocalStorage) Accessible ¶
func (s *SLocalStorage) Accessible() error
func (*SLocalStorage) CloneDiskFromStorage ¶
func (s *SLocalStorage) CloneDiskFromStorage( ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool, ) (*hostapi.ServerCloneDiskFromStorageResponse, error)
func (*SLocalStorage) CreateDisk ¶
func (s *SLocalStorage) CreateDisk(diskId string) IDisk
func (*SLocalStorage) CreateDiskFromBackup ¶
func (s *SLocalStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SLocalStorage) CreateDiskFromExistingPath ¶
func (s *SLocalStorage) CreateDiskFromExistingPath( ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo, ) error
func (*SLocalStorage) CreateDiskFromSnapshot ¶
func (s *SLocalStorage) CreateDiskFromSnapshot( ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo, ) error
func (*SLocalStorage) CreateSnapshotFormUrl ¶
func (s *SLocalStorage) CreateSnapshotFormUrl( ctx context.Context, snapshotUrl, diskId, snapshotPath string, ) error
func (*SLocalStorage) DeleteDiskfile ¶
func (s *SLocalStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error
func (*SLocalStorage) DeleteSnapshots ¶
func (s *SLocalStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalStorage) DestinationPrepareMigrate ¶
func (s *SLocalStorage) DestinationPrepareMigrate( ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, disksBackingFile, srcSnapshots jsonutils.JSONObject, rebaseDisks bool, diskinfo jsonutils.JSONObject, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, ) error
func (*SLocalStorage) Detach ¶
func (s *SLocalStorage) Detach() error
func (*SLocalStorage) GetAvailSizeMb ¶
func (s *SLocalStorage) GetAvailSizeMb() int
func (*SLocalStorage) GetCloneTargetDiskPath ¶
func (s *SLocalStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
func (*SLocalStorage) GetComposedName ¶
func (s *SLocalStorage) GetComposedName() string
func (*SLocalStorage) GetDiskById ¶
func (s *SLocalStorage) GetDiskById(diskId string) (IDisk, error)
func (*SLocalStorage) GetFuseMountPath ¶
func (s *SLocalStorage) GetFuseMountPath() string
func (*SLocalStorage) GetFuseTmpPath ¶
func (s *SLocalStorage) GetFuseTmpPath() string
func (*SLocalStorage) GetImgsaveBackupPath ¶
func (s *SLocalStorage) GetImgsaveBackupPath() string
func (*SLocalStorage) GetSnapshotDir ¶
func (s *SLocalStorage) GetSnapshotDir() string
func (*SLocalStorage) GetSnapshotPathByIds ¶
func (s *SLocalStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
func (*SLocalStorage) IsSnapshotExist ¶
func (s *SLocalStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
func (*SLocalStorage) SaveToGlance ¶
func (s *SLocalStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalStorage) StorageBackup ¶
func (s *SLocalStorage) StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalStorage) StorageBackupRecovery ¶
func (s *SLocalStorage) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalStorage) StorageType ¶
func (s *SLocalStorage) StorageType() string
func (*SLocalStorage) SyncStorageInfo ¶
func (s *SLocalStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
type SNFSStorage ¶
type SNFSStorage struct {
SNasStorage
}
func NewNFSStorage ¶
func NewNFSStorage(manager *SStorageManager, path string) *SNFSStorage
func (*SNFSStorage) Detach ¶
func (s *SNFSStorage) Detach() error
func (*SNFSStorage) SetStorageInfo ¶
func (s *SNFSStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SNFSStorage) StorageType ¶
func (s *SNFSStorage) StorageType() string
func (*SNFSStorage) SyncStorageInfo ¶
func (s *SNFSStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
type SNFSStorageFactory ¶
type SNFSStorageFactory struct { }
func (*SNFSStorageFactory) NewStorage ¶
func (factory *SNFSStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage
func (*SNFSStorageFactory) StorageType ¶
func (factory *SNFSStorageFactory) StorageType() string
type SNasDisk ¶
type SNasDisk struct {
SLocalDisk
}
func NewNasDisk ¶
func (*SNasDisk) CreateFromImageFuse ¶
func (*SNasDisk) CreateFromSnapshotLocation ¶
func (*SNasDisk) CreateFromTemplate ¶
func (d *SNasDisk) CreateFromTemplate(ctx context.Context, imageId, format string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)
func (*SNasDisk) GetSnapshotLocation ¶
func (*SNasDisk) ResetFromSnapshot ¶
type SNasStorage ¶
type SNasStorage struct { SLocalStorage // contains filtered or unexported fields }
func NewNasStorage ¶
func NewNasStorage(manager *SStorageManager, path string, ins INasStorage) *SNasStorage
func (*SNasStorage) CreateDisk ¶
func (s *SNasStorage) CreateDisk(diskId string) IDisk
func (*SNasStorage) CreateDiskFromSnapshot ¶
func (s *SNasStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SNasStorage) GetComposedName ¶
func (s *SNasStorage) GetComposedName() string
func (*SNasStorage) GetDiskById ¶
func (s *SNasStorage) GetDiskById(diskId string) (IDisk, error)
func (*SNasStorage) GetSnapshotDir ¶
func (s *SNasStorage) GetSnapshotDir() string
func (*SNasStorage) SyncStorageInfo ¶
func (s *SNasStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
type SRBDDisk ¶
type SRBDDisk struct {
SBaseDisk
}
func NewRBDDisk ¶
func (*SRBDDisk) CleanupSnapshots ¶
func (*SRBDDisk) CreateFromImageFuse ¶
func (*SRBDDisk) CreateFromRbdSnapshot ¶
func (*SRBDDisk) CreateFromTemplate ¶
func (*SRBDDisk) CreateSnapshot ¶
func (d *SRBDDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
func (*SRBDDisk) DeleteAllSnapshot ¶
func (*SRBDDisk) DeleteSnapshot ¶
func (*SRBDDisk) DiskBackup ¶
func (*SRBDDisk) DiskDeleteSnapshot ¶
func (*SRBDDisk) DiskSnapshot ¶
func (*SRBDDisk) GetDiskDesc ¶
func (d *SRBDDisk) GetDiskDesc() jsonutils.JSONObject
func (*SRBDDisk) GetDiskSetupScripts ¶
func (*SRBDDisk) GetSnapshotDir ¶
func (*SRBDDisk) OnRebuildRoot ¶
func (*SRBDDisk) PostCreateFromImageFuse ¶
func (d *SRBDDisk) PostCreateFromImageFuse()
func (*SRBDDisk) PrepareMigrate ¶
func (*SRBDDisk) PrepareSaveToGlance ¶
func (*SRBDDisk) ResetFromSnapshot ¶
type SRbdImageCache ¶
type SRbdImageCache struct { Manager IImageCacheManger // contains filtered or unexported fields }
func NewRbdImageCache ¶
func NewRbdImageCache(imageId string, imagecacheManager IImageCacheManger) *SRbdImageCache
func (*SRbdImageCache) Acquire ¶
func (r *SRbdImageCache) Acquire(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) error
func (*SRbdImageCache) GetDesc ¶
func (r *SRbdImageCache) GetDesc() *remotefile.SImageDesc
func (*SRbdImageCache) GetImageId ¶
func (r *SRbdImageCache) GetImageId() string
func (*SRbdImageCache) GetName ¶
func (r *SRbdImageCache) GetName() string
func (*SRbdImageCache) GetPath ¶
func (r *SRbdImageCache) GetPath() string
func (*SRbdImageCache) Load ¶
func (r *SRbdImageCache) Load() error
func (*SRbdImageCache) Release ¶
func (r *SRbdImageCache) Release()
type SRbdImageCacheManager ¶
type SRbdImageCacheManager struct { SBaseImageCacheManager Pool, Prefix string // contains filtered or unexported fields }
func NewRbdImageCacheManager ¶
func NewRbdImageCacheManager(manager IStorageManager, cachePath string, storage IStorage, storagecacheId string) *SRbdImageCacheManager
func (*SRbdImageCacheManager) AcquireImage ¶
func (c *SRbdImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, callback func(float64, float64, int64)) (IImageCache, error)
func (*SRbdImageCacheManager) DeleteImageCache ¶
func (c *SRbdImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SRbdImageCacheManager) GetPath ¶
func (c *SRbdImageCacheManager) GetPath() string
func (*SRbdImageCacheManager) LoadImageCache ¶
func (c *SRbdImageCacheManager) LoadImageCache(imageId string)
func (*SRbdImageCacheManager) PrefetchImageCache ¶
func (c *SRbdImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SRbdImageCacheManager) ReleaseImage ¶
func (c *SRbdImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
type SRbdImageCacheManagerFactory ¶
type SRbdImageCacheManagerFactory struct { }
func (*SRbdImageCacheManagerFactory) NewImageCacheManager ¶
func (factory *SRbdImageCacheManagerFactory) NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string) IImageCacheManger
func (*SRbdImageCacheManagerFactory) StorageType ¶
func (factory *SRbdImageCacheManagerFactory) StorageType() string
type SRbdStorage ¶
type SRbdStorage struct { SBaseStorage // contains filtered or unexported fields }
func NewRBDStorage ¶
func NewRBDStorage(manager *SStorageManager, path string) *SRbdStorage
func (*SRbdStorage) Accessible ¶
func (s *SRbdStorage) Accessible() error
func (*SRbdStorage) CloneDiskFromStorage ¶
func (s *SRbdStorage) CloneDiskFromStorage( ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool, ) (*hostapi.ServerCloneDiskFromStorageResponse, error)
func (*SRbdStorage) CreateDisk ¶
func (s *SRbdStorage) CreateDisk(diskId string) IDisk
func (*SRbdStorage) CreateDiskFromBackup ¶
func (s *SRbdStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SRbdStorage) CreateDiskFromExistingPath ¶
func (s *SRbdStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
func (*SRbdStorage) CreateDiskFromSnapshot ¶
func (s *SRbdStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SRbdStorage) CreateSnapshotFormUrl ¶
func (s *SRbdStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
func (*SRbdStorage) DeleteSnapshots ¶
func (s *SRbdStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SRbdStorage) Detach ¶
func (s *SRbdStorage) Detach() error
func (*SRbdStorage) GetBackupDir ¶
func (s *SRbdStorage) GetBackupDir() string
func (*SRbdStorage) GetClient ¶
func (s *SRbdStorage) GetClient() (*cephutils.CephClient, error)
func (*SRbdStorage) GetCloneTargetDiskPath ¶
func (s *SRbdStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
func (*SRbdStorage) GetDiskById ¶
func (s *SRbdStorage) GetDiskById(diskId string) (IDisk, error)
func (*SRbdStorage) GetDiskPath ¶
func (s *SRbdStorage) GetDiskPath(diskId string) string
func (*SRbdStorage) GetFuseMountPath ¶
func (s *SRbdStorage) GetFuseMountPath() string
func (*SRbdStorage) GetFuseTmpPath ¶
func (s *SRbdStorage) GetFuseTmpPath() string
func (*SRbdStorage) GetImgsaveBackupPath ¶
func (s *SRbdStorage) GetImgsaveBackupPath() string
func (*SRbdStorage) GetSnapshotDir ¶
func (s *SRbdStorage) GetSnapshotDir() string
func (*SRbdStorage) GetSnapshotPathByIds ¶
func (s *SRbdStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
func (*SRbdStorage) IsImageExist ¶
func (s *SRbdStorage) IsImageExist(name string) (bool, error)
func (*SRbdStorage) IsSnapshotExist ¶
func (s *SRbdStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
func (*SRbdStorage) SaveToGlance ¶
func (s *SRbdStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SRbdStorage) SetStorageInfo ¶
func (s *SRbdStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SRbdStorage) StorageType ¶
func (s *SRbdStorage) StorageType() string
func (*SRbdStorage) SyncStorageInfo ¶
func (s *SRbdStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
func (*SRbdStorage) SyncStorageSize ¶
func (s *SRbdStorage) SyncStorageSize() (api.SHostStorageStat, error)
type SRbdStorageFactory ¶
type SRbdStorageFactory struct { }
func (*SRbdStorageFactory) NewStorage ¶
func (factory *SRbdStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage
func (*SRbdStorageFactory) StorageType ¶
func (factory *SRbdStorageFactory) StorageType() string
type SStorageBackup ¶
type SStorageManager ¶
type SStorageManager struct { Storages []IStorage AgentStorage IStorage LocalStorageImagecacheManager IImageCacheManger RbdStorageImagecacheManagers map[string]IImageCacheManger // contains filtered or unexported fields }
func GetManager ¶
func GetManager() *SStorageManager
func Manager ¶
func Manager() *SStorageManager
func NewStorageManager ¶
func NewStorageManager(host hostutils.IHost) (*SStorageManager, error)
func (*SStorageManager) AddRbdStorageImagecache ¶
func (s *SStorageManager) AddRbdStorageImagecache(imagecachePath string, storage IStorage, storagecacheId string)
func (*SStorageManager) GetDiskByPath ¶
func (s *SStorageManager) GetDiskByPath(diskPath string) (IDisk, error)
func (*SStorageManager) GetHostId ¶
func (s *SStorageManager) GetHostId() string
func (*SStorageManager) GetKubeletConfig ¶
func (s *SStorageManager) GetKubeletConfig() kubelet.KubeletConfig
func (*SStorageManager) GetStorage ¶
func (s *SStorageManager) GetStorage(storageId string) IStorage
func (*SStorageManager) GetStorageByPath ¶
func (s *SStorageManager) GetStorageByPath(sPath string) (IStorage, error)
func (*SStorageManager) GetStorageDisk ¶
func (s *SStorageManager) GetStorageDisk(storageId, diskId string) IDisk
func (*SStorageManager) GetStoragecacheById ¶
func (s *SStorageManager) GetStoragecacheById(scId string) IImageCacheManger
func (*SStorageManager) GetStoragesByPath ¶
func (s *SStorageManager) GetStoragesByPath(sPath string) ([]IStorage, error)
func (*SStorageManager) GetTotalCapacity ¶
func (s *SStorageManager) GetTotalCapacity() int
func (*SStorageManager) GetZoneId ¶
func (s *SStorageManager) GetZoneId() string
func (*SStorageManager) InitSharedFileStorageImagecache ¶
func (s *SStorageManager) InitSharedFileStorageImagecache(storagecacheId, path string)
func (*SStorageManager) InitSharedStorageImageCache ¶
func (s *SStorageManager) InitSharedStorageImageCache(storageType, storagecacheId, imagecachePath string, storage IStorage)
func (*SStorageManager) NewSharedStorageInstance ¶
func (s *SStorageManager) NewSharedStorageInstance(mountPoint, storageType string) IStorage
func (*SStorageManager) Remove ¶
func (s *SStorageManager) Remove(storage IStorage)
type SStoragePackBackup ¶
type SStorageSaveToGlanceInfo ¶
type SStorageSaveToGlanceInfo struct { UserCred mcclient.TokenCredential DiskInfo *jsonutils.JSONDict }
Source Files ¶
- core.go
- disk_agent.go
- disk_base.go
- disk_local.go
- disk_nas.go
- disk_rbd.go
- doc.go
- imagecache_base.go
- imagecache_local.go
- imagecache_rbd.go
- imagecachemanager_agent.go
- imagecachemanager_base.go
- imagecachemanager_local.go
- imagecachemanager_rbd.go
- storage_agent.go
- storage_base.go
- storage_gpfs.go
- storage_local.go
- storage_nas.go
- storage_nfs.go
- storage_rbd.go
- storagehelper.go
Click to show internal directories.
Click to hide internal directories.