Documentation ¶
Index ¶
- Constants
- Variables
- func CleanImageCachefiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func CleanRecycleDiskfiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func CleanupDirOrFile(path string)
- func ConvertDiskFsFeaturesToDeploy(fsFeatures *api.DiskFsFeatures) *deployapi.FsFeatures
- func ConvertLVMDisk(vgName, lvName string, encryptInfo apis.SEncryptInfo) error
- func DeleteLocalSnapshot(snapshotDir, snapshotId, diskPath, convertSnapshot string, blockStream bool) error
- func DoInstancePackBackup(ctx context.Context, backupInfo SStoragePackInstanceBackup) (string, error)
- func DoInstanceUnpackBackup(ctx context.Context, backupInfo SStorageUnpackInstanceBackup) ([]string, *api.InstanceBackupPackMetadata, error)
- func EnsureBackupDir() (string, error)
- func GatherHostStorageStats(reportSharedStorages []string) api.SHostPingInput
- func GetRootPartTotalCapacity() int
- func GetRootPartUsedCapacity() int
- func Init(host hostutils.IHost) error
- func Stop()
- func TryDeactivateBackingLvs(backingFile string)
- type IDisk
- type IDiskCreator
- 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) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error
- func (d *SBaseDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
- func (d *SBaseDisk) CreateFromRbdSnapshot(ctx context.Context, napshotUrl, srcDiskId, srcPool string) error
- func (d *SBaseDisk) CreateFromSnapshotLocation(ctx context.Context, location string, size int64, ...) (jsonutils.JSONObject, 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) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, ...) error
- func (d *SBaseDisk) DeleteAllSnapshot(skipRecycle bool) error
- func (d *SBaseDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, ...) error
- func (d *SBaseDisk) DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *desc.SGuestDesc, ...) (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 string, fsFeatures *api.DiskFsFeatures, uuid string, ...)
- func (d *SBaseDisk) GetBackupDir() string
- func (d *SBaseDisk) GetContainerStorageDriver() (container_storage.IContainerStorage, error)
- 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) GetSnapshotPath(snapshotId string) 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) PostCreateFromImageFuse()
- func (d *SBaseDisk) PreResize(ctx context.Context, sizeMb int64) error
- func (d *SBaseDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)
- func (d *SBaseDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) RebuildSlaveDisk(diskUri string) error
- func (d *SBaseDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) Resize(context.Context, interface{}) (jsonutils.JSONObject, error)
- func (d *SBaseDisk) ResizeFs(diskInfo *deployapi.DiskInfo) error
- func (d *SBaseDisk) RollbackDiskOnSnapshotFail(snapshotId string) error
- type SBaseImageCacheManager
- type SBaseStorage
- func (s *SBaseStorage) BindMountStoragePath(sPath string) error
- 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) DiskMigrate(context.Context, interface{}) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) GetAvailSizeMb() int
- func (s *SBaseStorage) GetBackupDir() string
- func (s *SBaseStorage) GetCapacityMb() int
- func (s *SBaseStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
- func (d *SBaseStorage) GetDisksPath() ([]string, error)
- func (s *SBaseStorage) GetFreeSizeMb() int
- func (s *SBaseStorage) GetFuseMountPath() string
- func (s *SBaseStorage) GetFuseTmpPath() string
- 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) Lvmlockd() bool
- 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 *SStorageBackup) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SBaseStorage) SyncStorageSize() (api.SHostStorageStat, error)
- type SCLVMDisk
- type SCLVMStorage
- func (s *SCLVMStorage) Accessible() error
- func (s *SCLVMStorage) CreateDisk(diskId string) IDisk
- func (s *SCLVMStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SCLVMStorage) IsLocal() bool
- func (s *SCLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SCLVMStorage) StorageType() string
- type SCLVMStorageFactory
- type SDiskBackup
- type SDiskCleanupSnapshots
- type SDiskCreateByDiskinfo
- type SDiskMigrate
- type SDiskReset
- type SGPFSDisk
- type SGPFSStorage
- type SGPFSStorageFactory
- type SHostDatastore
- type SLVMDisk
- func (d *SLVMDisk) ConvertSnapshot(convertSnapshot string, encryptInfo apis.SEncryptInfo) error
- func (d *SLVMDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
- func (d *SLVMDisk) CreateFromTemplate(ctx context.Context, imageId, format string, sizeMb int64, ...) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) CreateRaw(ctx context.Context, sizeMB int, diskFormat string, fsFormat string, ...) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, ...) error
- func (d *SLVMDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) DeleteAllSnapshot(skipRecycle bool) error
- func (d *SLVMDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, ...) error
- func (d *SLVMDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) DoDeleteSnapshot(snapshotId string) error
- func (d *SLVMDisk) GetBackupName(backupId string) string
- func (d *SLVMDisk) GetBackupPath(backupId string) string
- func (d *SLVMDisk) GetDiskDesc() jsonutils.JSONObject
- func (d *SLVMDisk) GetDiskSetupScripts(idx int) string
- func (d *SLVMDisk) GetImageCachePrefix() string
- func (d *SLVMDisk) GetLvPath() string
- func (d *SLVMDisk) GetPath() string
- func (d *SLVMDisk) GetSnapshotDir() string
- func (d *SLVMDisk) GetSnapshotName(snapshotId string) string
- func (d *SLVMDisk) GetSnapshotPath(snapshotId string) string
- func (d *SLVMDisk) GetSnapshotPrefix() string
- func (d *SLVMDisk) GetType() string
- func (d *SLVMDisk) IsFile() bool
- func (d *SLVMDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
- func (d *SLVMDisk) PostCreateFromImageFuse()
- func (d *SLVMDisk) PreResize(ctx context.Context, sizeMb int64) error
- func (d *SLVMDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)
- func (d *SLVMDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) Probe() error
- func (d *SLVMDisk) RebuildSlaveDisk(diskUri string) error
- func (d *SLVMDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLVMDisk) RollbackDiskOnSnapshotFail(snapshotId string) error
- type SLVMImageCache
- func (c *SLVMImageCache) Acquire(ctx context.Context, input api.CacheImageInput, ...) error
- func (c *SLVMImageCache) GetAccessDirectory() (string, error)
- func (c *SLVMImageCache) GetDesc() *remotefile.SImageDesc
- func (c *SLVMImageCache) GetImageId() string
- func (c *SLVMImageCache) GetName() string
- func (c *SLVMImageCache) GetPath() string
- func (c *SLVMImageCache) Load() error
- func (r *SLVMImageCache) Release()
- func (c *SLVMImageCache) Remove(ctx context.Context) error
- type SLVMImageCacheManager
- func (c *SLVMImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, ...) (IImageCache, error)
- func (c *SLVMImageCacheManager) CleanImageCachefiles(ctx context.Context)
- func (c *SLVMImageCacheManager) DeactiveImageCacahe(ctx context.Context, imageId string) error
- func (c *SLVMImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SLVMImageCacheManager) IsLocal() bool
- func (c *SLVMImageCacheManager) LoadImageCache(imageId string)
- func (c *SLVMImageCacheManager) Lvmlockd() bool
- func (c *SLVMImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SLVMImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
- func (c *SLVMImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
- type SLVMStorage
- func (s *SLVMStorage) Accessible() error
- func (s *SLVMStorage) CleanRecycleDiskfiles(ctx context.Context)
- func (s *SLVMStorage) CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, ...) (*hostapi.ServerCloneDiskFromStorageResponse, error)
- func (s *SLVMStorage) CreateDisk(diskId string) IDisk
- func (s *SLVMStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SLVMStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
- func (s *SLVMStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SLVMStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
- func (s *SLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLVMStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SLVMStorage) DestinationPrepareMigrate(ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, ...) error
- func (s *SLVMStorage) Detach() error
- func (s *SLVMStorage) GetAvailSizeMb() int
- func (s *SLVMStorage) GetComposedName() string
- func (s *SLVMStorage) GetDiskById(diskId string) (IDisk, error)
- func (d *SLVMStorage) GetDisksPath() ([]string, error)
- func (s *SLVMStorage) GetFreeSizeMb() int
- func (s *SLVMStorage) GetFuseMountPath() string
- func (s *SLVMStorage) GetFuseTmpPath() string
- func (s *SLVMStorage) GetImgsaveBackupPath() string
- func (s *SLVMStorage) GetMediumType() (string, error)
- func (s *SLVMStorage) GetSnapshotDir() string
- func (s *SLVMStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
- func (s *SLVMStorage) GetUsedSizeMb() (int64, error)
- func (s *SLVMStorage) IsLocal() bool
- func (s *SLVMStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
- func (s *SLVMStorage) SaveToGlance(ctx context.Context, input interface{}) (jsonutils.JSONObject, error)
- func (s *SLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SLVMStorage) StorageBackup(ctx context.Context, params *SStorageBackup) (jsonutils.JSONObject, error)
- func (s *SLVMStorage) StorageType() string
- func (s *SLVMStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
- func (s *SLVMStorage) SyncStorageSize() (api.SHostStorageStat, error)
- type SLocalDisk
- func (d *SLocalDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) 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 string, 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, blockStream bool, ...) error
- func (d *SLocalDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) DoDeleteSnapshot(snapshotId string) error
- func (d *SLocalDisk) GetContainerStorageDriver() (container_storage.IContainerStorage, error)
- 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) GetSnapshotPath(snapshotId string) 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, string, bool, error)
- func (d *SLocalDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SLocalDisk) Probe() error
- func (d *SLocalDisk) RebuildSlaveDisk(diskUri string) 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) ResizeLoopDevice(partDev string) (string, error)
- func (d *SLocalDisk) RollbackDiskOnSnapshotFail(snapshotId string) error
- func (d *SLocalDisk) UmountFuseImage()
- type SLocalImageCache
- func (l *SLocalImageCache) Acquire(ctx context.Context, input api.CacheImageInput, ...) error
- func (l *SLocalImageCache) GetAccessDirectory() (string, 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) 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) CleanImageCachefiles(ctx context.Context)
- func (c *SLocalImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SLocalImageCacheManager) IsLocal() bool
- 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)
- func (c *SLocalImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
- type SLocalStorage
- func (s *SLocalStorage) Accessible() error
- func (s *SLocalStorage) CleanRecycleDiskfiles(ctx context.Context)
- 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) (jsonutils.JSONObject, 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) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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) DiskMigrate(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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) GetImgsaveBackupPath() string
- func (s *SLocalStorage) GetMediumType() (string, error)
- func (s *SLocalStorage) GetSnapshotDir() string
- func (s *SLocalStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
- func (s *SLocalStorage) IsLocal() bool
- func (s *SLocalStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
- func (s *SLocalStorage) SaveToGlance(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 SNVMEDisk
- func (d *SNVMEDisk) CreateRaw(ctx context.Context, sizeMb int, diskFormat string, fsFormat string, ...) (jsonutils.JSONObject, error)
- func (s *SNVMEDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SNVMEDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SNVMEDisk) GetDiskDesc() jsonutils.JSONObject
- func (d *SNVMEDisk) GetSnapshotDir() string
- func (d *SNVMEDisk) IsFile() bool
- func (d *SNVMEDisk) Probe() error
- type SNVMEStorage
- func (s *SNVMEStorage) Accessible() error
- func (s *SNVMEStorage) CleanRecycleDiskfiles(ctx context.Context)
- func (s *SNVMEStorage) CreateDisk(diskId string) IDisk
- func (s *SNVMEStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
- func (s *SNVMEStorage) CreateDiskFromSnapshot(context.Context, IDisk, *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SNVMEStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
- func (s *SNVMEStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SNVMEStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SNVMEStorage) Detach() error
- func (s *SNVMEStorage) GetAvailSizeMb() int
- func (s *SNVMEStorage) GetCapacityMb() int
- func (s *SNVMEStorage) GetComposedName() string
- func (s *SNVMEStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SNVMEStorage) GetFuseMountPath() string
- func (s *SNVMEStorage) GetFuseTmpPath() string
- func (s *SNVMEStorage) GetImgsaveBackupPath() string
- func (s *SNVMEStorage) GetSnapshotDir() string
- func (s *SNVMEStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
- func (s *SNVMEStorage) IsLocal() bool
- func (s *SNVMEStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
- func (s *SNVMEStorage) SaveToGlance(context.Context, interface{}) (jsonutils.JSONObject, error)
- func (s *SNVMEStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SNVMEStorage) StorageType() string
- func (s *SNVMEStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
- func (s *SNVMEStorage) SyncStorageSize() (api.SHostStorageStat, error)
- 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, ...) (jsonutils.JSONObject, 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) (jsonutils.JSONObject, 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) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) 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, diskFormat 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, blockStream 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, string, bool, 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) GetAccessDirectory() (string, 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) CleanImageCachefiles(ctx context.Context)
- func (c *SRbdImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
- func (c *SRbdImageCacheManager) GetPath() string
- func (c *SRbdImageCacheManager) IsLocal() bool
- 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)
- func (c *SRbdImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
- type SRbdImageCacheManagerFactory
- type SRbdStorage
- func (s *SRbdStorage) Accessible() error
- func (s *SRbdStorage) CleanRecycleDiskfiles(ctx context.Context)
- 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) (jsonutils.JSONObject, error)
- func (s *SRbdStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
- func (s *SRbdStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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) GetCapacityMb() int
- 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) IsLocal() bool
- 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 SSLVMDisk
- func (d *SSLVMDisk) CreateFromSnapshotLocation(ctx context.Context, snapshotLocation string, size int64, ...) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) CreateFromTemplate(ctx context.Context, imageId, format string, sizeMb int64, ...) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) CreateRaw(ctx context.Context, sizeMb int, diskFormat string, fsFormat string, ...) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, ...) error
- func (d *SSLVMDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, ...) error
- func (d *SSLVMDisk) GetDiskDesc() jsonutils.JSONObject
- func (d *SSLVMDisk) GetPath() string
- func (d *SSLVMDisk) GetType() string
- func (d *SSLVMDisk) PostCreateFromImageFuse()
- func (d *SSLVMDisk) PreResize(ctx context.Context, sizeMb int64) error
- func (d *SSLVMDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) Probe() error
- func (d *SSLVMDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (d *SSLVMDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- type SSLVMStorage
- func (s *SSLVMStorage) Accessible() error
- func (s *SSLVMStorage) CreateDisk(diskId string) IDisk
- func (s *SSLVMStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
- func (s *SSLVMStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
- func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
- func (s *SSLVMStorage) GetDiskById(diskId string) (IDisk, error)
- func (s *SSLVMStorage) IsLocal() bool
- func (s *SSLVMStorage) Lvmlockd() bool
- func (s *SSLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
- func (s *SSLVMStorage) StorageType() string
- type SSLVMStorageFactory
- type SStorageBackup
- type SStorageDeleteSnapshot
- type SStorageDeleteSnapshots
- type SStorageManager
- func (s *SStorageManager) AddRbdStorageImagecache(imagecachePath string, storage IStorage, storagecacheId string)
- func (s *SStorageManager) AddSharedLVMStorageImagecache(imagecachePath string, storage IStorage, storagecacheId string)
- func (s *SStorageManager) GetDiskById(diskId string) (IDisk, error)
- 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) GetTotalLocalCapacity() int
- func (s *SStorageManager) GetZoneId() string
- func (s *SStorageManager) InitLVMStorageImageCache(storagecacheId, vg string, storage IStorage)
- func (s *SStorageManager) InitSharedFileStorageImagecache(storagecacheId, path string, storage IStorage)
- 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 ( PackageDiskFilename = "disk" PackageMetadataFilename = "metadata" )
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 IMAGECACHE_PREFIX = "imagecache_"
View Source
const MINIMAL_FREE_SPACE = 128
Variables ¶
View Source
var DELETEING_SNAPSHOTS = sync.Map{}
Functions ¶
func CleanImageCachefiles ¶
func CleanImageCachefiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func CleanRecycleDiskfiles ¶
func CleanRecycleDiskfiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func CleanupDirOrFile ¶
func CleanupDirOrFile(path string)
func ConvertDiskFsFeaturesToDeploy ¶
func ConvertDiskFsFeaturesToDeploy(fsFeatures *api.DiskFsFeatures) *deployapi.FsFeatures
func ConvertLVMDisk ¶
func ConvertLVMDisk(vgName, lvName string, encryptInfo apis.SEncryptInfo) error
func DeleteLocalSnapshot ¶
func DoInstancePackBackup ¶
func DoInstancePackBackup(ctx context.Context, backupInfo SStoragePackInstanceBackup) (string, error)
func DoInstanceUnpackBackup ¶
func DoInstanceUnpackBackup(ctx context.Context, backupInfo SStorageUnpackInstanceBackup) ([]string, *api.InstanceBackupPackMetadata, error)
func EnsureBackupDir ¶
func GatherHostStorageStats ¶
func GatherHostStorageStats(reportSharedStorages []string) api.SHostPingInput
func GetRootPartTotalCapacity ¶
func GetRootPartTotalCapacity() int
func GetRootPartUsedCapacity ¶
func GetRootPartUsedCapacity() int
func TryDeactivateBackingLvs ¶
func TryDeactivateBackingLvs(backingFile string)
Types ¶
type IDisk ¶
type IDisk interface { GetType() string GetId() string Probe() error GetPath() string GetFormat() (string, error) GetDiskDesc() jsonutils.JSONObject GetDiskSetupScripts(idx int) string OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error GetSnapshotDir() string DoDeleteSnapshot(snapshotId string) error GetSnapshotLocation() string GetSnapshotPath(snapshotId string) string RollbackDiskOnSnapshotFail(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) PreResize(ctx context.Context, sizeMb int64) 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, string, bool, error) RebuildSlaveDisk(diskUri 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) (jsonutils.JSONObject, 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, diskFormat string, fsFormat string, fsFeatures *api.DiskFsFeatures, 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, blockStream bool, encryptInfo apis.SEncryptInfo) error DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *desc.SGuestDesc, deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error // GetBackupDir() string DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) IsFile() bool GetContainerStorageDriver() (container_storage.IContainerStorage, error) }
type IDiskCreator ¶
type IDiskCreator interface {
CreateRawDisk(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
}
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 // GetAccessDirectory is used by container's volume mount GetAccessDirectory() (string, error) }
type IImageCacheManger ¶
type IImageCacheManger interface { GetId() string GetPath() string SetStoragecacheId(string) Lvmlockd() bool IsLocal() bool // for diskhandler PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error) RemoveImage(ctx context.Context, imageId string) 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) CleanImageCachefiles(ctx context.Context) }
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) IsLocal() bool Lvmlockd() bool SetPath(string) GetPath() string GetSnapshotDir() string GetSnapshotPathByIds(diskId, snapshotId string) string DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) IsSnapshotExist(diskId, snapshotId string) (bool, error) GetBackupDir() string StorageBackup(ctx context.Context, params *SStorageBackup) (jsonutils.JSONObject, error) StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) GetFreeSizeMb() int GetCapacityMb() int // Find owner disks first, if not found, call create disk GetDiskById(diskId string) (IDisk, error) CreateDisk(diskId string) IDisk RemoveDisk(IDisk) GetDisksPath() ([]string, error) // *SDiskCreateByDiskinfo CreateDiskByDiskinfo(context.Context, interface{}) (jsonutils.JSONObject, error) SaveToGlance(context.Context, interface{}) (jsonutils.JSONObject, error) CreateDiskFromSnapshot(context.Context, IDisk, *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error CreateDiskFromBackup(context.Context, IDisk, *SDiskCreateByDiskinfo) error DiskMigrate(context.Context, interface{}) (jsonutils.JSONObject, 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, diskSnapsChain, outChainSnaps jsonutils.JSONObject, rebaseDisks bool, diskDesc *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, sysDiskHasTemplate bool) error Accessible() error Detach() error CleanRecycleDiskfiles(ctx context.Context) }
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) CleanupSnapshots ¶
func (*SBaseDisk) ConvertSnapshot ¶
func (d *SBaseDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error
func (*SBaseDisk) CreateFromImageFuse ¶
func (*SBaseDisk) CreateFromRbdSnapshot ¶
func (*SBaseDisk) CreateFromSnapshotLocation ¶
func (d *SBaseDisk) CreateFromSnapshotLocation(ctx context.Context, location string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)
func (*SBaseDisk) CreateFromTemplate ¶
func (*SBaseDisk) CreateFromUrl ¶
func (*SBaseDisk) CreateSnapshot ¶
func (d *SBaseDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
func (*SBaseDisk) DeleteAllSnapshot ¶
func (*SBaseDisk) DeleteSnapshot ¶
func (*SBaseDisk) DeployGuestFs ¶
func (d *SBaseDisk) DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *desc.SGuestDesc, deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error)
func (*SBaseDisk) DiskDeleteSnapshot ¶
func (*SBaseDisk) DiskSnapshot ¶
func (*SBaseDisk) DoDeleteSnapshot ¶
func (*SBaseDisk) GetBackupDir ¶
func (*SBaseDisk) GetContainerStorageDriver ¶
func (d *SBaseDisk) GetContainerStorageDriver() (container_storage.IContainerStorage, error)
func (*SBaseDisk) GetDiskSetupScripts ¶
func (*SBaseDisk) GetSnapshotLocation ¶
func (*SBaseDisk) GetSnapshotPath ¶
func (*SBaseDisk) GetStorage ¶
func (*SBaseDisk) OnRebuildRoot ¶
func (*SBaseDisk) PostCreateFromImageFuse ¶
func (d *SBaseDisk) PostCreateFromImageFuse()
func (*SBaseDisk) PrepareMigrate ¶
func (*SBaseDisk) PrepareSaveToGlance ¶
func (*SBaseDisk) RebuildSlaveDisk ¶
func (*SBaseDisk) ResetFromSnapshot ¶
func (*SBaseDisk) RollbackDiskOnSnapshotFail ¶
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) Lvmlockd ¶
func (c *SBaseImageCacheManager) Lvmlockd() bool
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) BindMountStoragePath ¶
func (s *SBaseStorage) BindMountStoragePath(sPath string) error
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, diskSnapsChain, outChainSnaps jsonutils.JSONObject, rebaseDisks bool, diskinfo *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, sysDiskHasTemplate bool, ) error
func (*SBaseStorage) DiskMigrate ¶
func (s *SBaseStorage) DiskMigrate(context.Context, interface{}) (jsonutils.JSONObject, error)
func (*SBaseStorage) GetAvailSizeMb ¶
func (s *SBaseStorage) GetAvailSizeMb() int
func (*SBaseStorage) GetBackupDir ¶
func (s *SBaseStorage) GetBackupDir() string
func (*SBaseStorage) GetCapacityMb ¶
func (s *SBaseStorage) GetCapacityMb() int
func (*SBaseStorage) GetCloneTargetDiskPath ¶
func (s *SBaseStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
func (*SBaseStorage) GetDisksPath ¶
func (d *SBaseStorage) GetDisksPath() ([]string, error)
func (*SBaseStorage) GetFreeSizeMb ¶
func (s *SBaseStorage) GetFreeSizeMb() int
func (*SBaseStorage) GetFuseMountPath ¶
func (s *SBaseStorage) GetFuseMountPath() string
func (*SBaseStorage) GetFuseTmpPath ¶
func (s *SBaseStorage) GetFuseTmpPath() string
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) Lvmlockd ¶
func (s *SBaseStorage) Lvmlockd() bool
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 *SStorageBackup) (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 SCLVMDisk ¶
type SCLVMDisk struct {
SLVMDisk
}
func NewCLVMDisk ¶
func (*SCLVMDisk) CreateFromImageFuse ¶
type SCLVMStorage ¶
type SCLVMStorage struct {
*SLVMStorage
}
func NewCLVMStorage ¶
func NewCLVMStorage(manager *SStorageManager, vgName string) *SCLVMStorage
func (*SCLVMStorage) Accessible ¶
func (s *SCLVMStorage) Accessible() error
func (*SCLVMStorage) CreateDisk ¶
func (s *SCLVMStorage) CreateDisk(diskId string) IDisk
func (*SCLVMStorage) GetDiskById ¶
func (s *SCLVMStorage) GetDiskById(diskId string) (IDisk, error)
func (*SCLVMStorage) IsLocal ¶
func (s *SCLVMStorage) IsLocal() bool
func (*SCLVMStorage) SetStorageInfo ¶
func (s *SCLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SCLVMStorage) StorageType ¶
func (s *SCLVMStorage) StorageType() string
type SCLVMStorageFactory ¶
type SCLVMStorageFactory struct { }
func (*SCLVMStorageFactory) NewStorage ¶
func (factory *SCLVMStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage
func (*SCLVMStorageFactory) StorageType ¶
func (factory *SCLVMStorageFactory) StorageType() string
type SDiskBackup ¶
type SDiskBackup struct { SnapshotId string `json:"snapshot_id"` SnapshotLocation string `json:"snapshot_location"` 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 SDiskMigrate ¶
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) IsLocal ¶
func (s *SGPFSStorage) IsLocal() bool
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 SLVMDisk ¶
type SLVMDisk struct {
SBaseDisk
}
func NewLVMDisk ¶
func (*SLVMDisk) ConvertSnapshot ¶
func (d *SLVMDisk) ConvertSnapshot(convertSnapshot string, encryptInfo apis.SEncryptInfo) error
func (*SLVMDisk) CreateFromImageFuse ¶
func (*SLVMDisk) CreateFromTemplate ¶
func (d *SLVMDisk) CreateFromTemplate( ctx context.Context, imageId, format string, sizeMb int64, encryptInfo *apis.SEncryptInfo, ) (jsonutils.JSONObject, error)
func (*SLVMDisk) CreateRaw ¶
func (d *SLVMDisk) CreateRaw(ctx context.Context, sizeMB int, diskFormat string, fsFormat string, fsFeatures *api.DiskFsFeatures, encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error)
func (*SLVMDisk) CreateSnapshot ¶
func (d *SLVMDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
func (*SLVMDisk) DeleteAllSnapshot ¶
func (*SLVMDisk) DeleteSnapshot ¶
func (*SLVMDisk) DiskBackup ¶
func (*SLVMDisk) DoDeleteSnapshot ¶
func (*SLVMDisk) GetBackupName ¶
func (*SLVMDisk) GetBackupPath ¶
func (*SLVMDisk) GetDiskDesc ¶
func (d *SLVMDisk) GetDiskDesc() jsonutils.JSONObject
func (*SLVMDisk) GetDiskSetupScripts ¶
func (*SLVMDisk) GetImageCachePrefix ¶
func (*SLVMDisk) GetSnapshotDir ¶
func (*SLVMDisk) GetSnapshotName ¶
The LVM logical volume name is limited to 64 characters.
func (*SLVMDisk) GetSnapshotPath ¶
func (*SLVMDisk) GetSnapshotPrefix ¶
func (*SLVMDisk) OnRebuildRoot ¶
func (*SLVMDisk) PostCreateFromImageFuse ¶
func (d *SLVMDisk) PostCreateFromImageFuse()
func (*SLVMDisk) PrepareMigrate ¶
func (*SLVMDisk) PrepareSaveToGlance ¶
func (*SLVMDisk) RebuildSlaveDisk ¶
func (*SLVMDisk) ResetFromSnapshot ¶
func (*SLVMDisk) RollbackDiskOnSnapshotFail ¶
type SLVMImageCache ¶
type SLVMImageCache struct { Manager IImageCacheManger // contains filtered or unexported fields }
func NewLVMImageCache ¶
func NewLVMImageCache(imageId string, imagecacheManager IImageCacheManger) *SLVMImageCache
func (*SLVMImageCache) Acquire ¶
func (c *SLVMImageCache) Acquire( ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64), ) error
func (*SLVMImageCache) GetAccessDirectory ¶
func (c *SLVMImageCache) GetAccessDirectory() (string, error)
func (*SLVMImageCache) GetDesc ¶
func (c *SLVMImageCache) GetDesc() *remotefile.SImageDesc
func (*SLVMImageCache) GetImageId ¶
func (c *SLVMImageCache) GetImageId() string
func (*SLVMImageCache) GetName ¶
func (c *SLVMImageCache) GetName() string
func (*SLVMImageCache) GetPath ¶
func (c *SLVMImageCache) GetPath() string
func (*SLVMImageCache) Load ¶
func (c *SLVMImageCache) Load() error
func (*SLVMImageCache) Release ¶
func (r *SLVMImageCache) Release()
type SLVMImageCacheManager ¶
type SLVMImageCacheManager struct { SBaseImageCacheManager // contains filtered or unexported fields }
func NewLVMImageCacheManager ¶
func NewLVMImageCacheManager(manager IStorageManager, cachePath, storagecacheId string, storage IStorage, lvmlockd bool) *SLVMImageCacheManager
func (*SLVMImageCacheManager) AcquireImage ¶
func (c *SLVMImageCacheManager) AcquireImage( ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64), ) (IImageCache, error)
func (*SLVMImageCacheManager) CleanImageCachefiles ¶
func (c *SLVMImageCacheManager) CleanImageCachefiles(ctx context.Context)
func (*SLVMImageCacheManager) DeactiveImageCacahe ¶
func (c *SLVMImageCacheManager) DeactiveImageCacahe(ctx context.Context, imageId string) error
func (*SLVMImageCacheManager) DeleteImageCache ¶
func (c *SLVMImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SLVMImageCacheManager) IsLocal ¶
func (c *SLVMImageCacheManager) IsLocal() bool
func (*SLVMImageCacheManager) LoadImageCache ¶
func (c *SLVMImageCacheManager) LoadImageCache(imageId string)
func (*SLVMImageCacheManager) Lvmlockd ¶
func (c *SLVMImageCacheManager) Lvmlockd() bool
func (*SLVMImageCacheManager) PrefetchImageCache ¶
func (c *SLVMImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SLVMImageCacheManager) ReleaseImage ¶
func (c *SLVMImageCacheManager) ReleaseImage(ctx context.Context, imageId string)
func (*SLVMImageCacheManager) RemoveImage ¶
func (c *SLVMImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
type SLVMStorage ¶
type SLVMStorage struct {
SBaseStorage
}
func NewLVMStorage ¶
func NewLVMStorage(manager *SStorageManager, vgName string) *SLVMStorage
func (*SLVMStorage) Accessible ¶
func (s *SLVMStorage) Accessible() error
func (*SLVMStorage) CleanRecycleDiskfiles ¶
func (s *SLVMStorage) CleanRecycleDiskfiles(ctx context.Context)
func (*SLVMStorage) CloneDiskFromStorage ¶
func (s *SLVMStorage) CloneDiskFromStorage( ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool, ) (*hostapi.ServerCloneDiskFromStorageResponse, error)
func (*SLVMStorage) CreateDisk ¶
func (s *SLVMStorage) CreateDisk(diskId string) IDisk
func (*SLVMStorage) CreateDiskFromBackup ¶
func (s *SLVMStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SLVMStorage) CreateDiskFromExistingPath ¶
func (s *SLVMStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
func (*SLVMStorage) CreateDiskFromSnapshot ¶
func (s *SLVMStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SLVMStorage) CreateSnapshotFormUrl ¶
func (s *SLVMStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
func (*SLVMStorage) DeleteSnapshot ¶
func (s *SLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLVMStorage) DeleteSnapshots ¶
func (s *SLVMStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLVMStorage) DestinationPrepareMigrate ¶
func (s *SLVMStorage) DestinationPrepareMigrate( ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string, disksBackingFile, diskSnapsChain, outChainSnaps jsonutils.JSONObject, rebaseDisks bool, diskinfo *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, sysDiskHasTemplate bool, ) error
func (*SLVMStorage) Detach ¶
func (s *SLVMStorage) Detach() error
func (*SLVMStorage) GetAvailSizeMb ¶
func (s *SLVMStorage) GetAvailSizeMb() int
func (*SLVMStorage) GetComposedName ¶
func (s *SLVMStorage) GetComposedName() string
func (*SLVMStorage) GetDiskById ¶
func (s *SLVMStorage) GetDiskById(diskId string) (IDisk, error)
func (*SLVMStorage) GetDisksPath ¶
func (d *SLVMStorage) GetDisksPath() ([]string, error)
func (*SLVMStorage) GetFreeSizeMb ¶
func (s *SLVMStorage) GetFreeSizeMb() int
func (*SLVMStorage) GetFuseMountPath ¶
func (s *SLVMStorage) GetFuseMountPath() string
func (*SLVMStorage) GetFuseTmpPath ¶
func (s *SLVMStorage) GetFuseTmpPath() string
func (*SLVMStorage) GetImgsaveBackupPath ¶
func (s *SLVMStorage) GetImgsaveBackupPath() string
func (*SLVMStorage) GetMediumType ¶
func (s *SLVMStorage) GetMediumType() (string, error)
func (*SLVMStorage) GetSnapshotDir ¶
func (s *SLVMStorage) GetSnapshotDir() string
func (*SLVMStorage) GetSnapshotPathByIds ¶
func (s *SLVMStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
func (*SLVMStorage) GetUsedSizeMb ¶
func (s *SLVMStorage) GetUsedSizeMb() (int64, error)
func (*SLVMStorage) IsLocal ¶
func (s *SLVMStorage) IsLocal() bool
func (*SLVMStorage) IsSnapshotExist ¶
func (s *SLVMStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
func (*SLVMStorage) SaveToGlance ¶
func (s *SLVMStorage) SaveToGlance(ctx context.Context, input interface{}) (jsonutils.JSONObject, error)
func (*SLVMStorage) SetStorageInfo ¶
func (s *SLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SLVMStorage) StorageBackup ¶
func (s *SLVMStorage) StorageBackup(ctx context.Context, params *SStorageBackup) (jsonutils.JSONObject, error)
func (*SLVMStorage) StorageType ¶
func (s *SLVMStorage) StorageType() string
func (*SLVMStorage) SyncStorageInfo ¶
func (s *SLVMStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
func (*SLVMStorage) SyncStorageSize ¶
func (s *SLVMStorage) SyncStorageSize() (api.SHostStorageStat, error)
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) ConvertSnapshot ¶
func (d *SLocalDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) 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 string, fsFormat string, fsFeatures *api.DiskFsFeatures, encryptInfo *apis.SEncryptInfo, diskId 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, blockStream bool, encryptInfo apis.SEncryptInfo) 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) GetContainerStorageDriver ¶
func (d *SLocalDisk) GetContainerStorageDriver() (container_storage.IContainerStorage, error)
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) GetSnapshotPath ¶
func (d *SLocalDisk) GetSnapshotPath(snapshotId string) 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 (*SLocalDisk) PrepareSaveToGlance ¶
func (d *SLocalDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SLocalDisk) Probe ¶
func (d *SLocalDisk) Probe() error
func (*SLocalDisk) RebuildSlaveDisk ¶
func (d *SLocalDisk) RebuildSlaveDisk(diskUri string) 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) ResizeLoopDevice ¶
func (d *SLocalDisk) ResizeLoopDevice(partDev string) (string, error)
func (*SLocalDisk) RollbackDiskOnSnapshotFail ¶
func (d *SLocalDisk) RollbackDiskOnSnapshotFail(snapshotId string) 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) GetAccessDirectory ¶
func (l *SLocalImageCache) GetAccessDirectory() (string, 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) 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, storage IStorage) *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) CleanImageCachefiles ¶
func (c *SLocalImageCacheManager) CleanImageCachefiles(ctx context.Context)
func (*SLocalImageCacheManager) DeleteImageCache ¶
func (c *SLocalImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
func (*SLocalImageCacheManager) IsLocal ¶
func (c *SLocalImageCacheManager) IsLocal() bool
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)
func (*SLocalImageCacheManager) RemoveImage ¶
func (c *SLocalImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
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) CleanRecycleDiskfiles ¶
func (s *SLocalStorage) CleanRecycleDiskfiles(ctx context.Context)
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) (jsonutils.JSONObject, 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) DeleteSnapshot ¶
func (s *SLocalStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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, diskSnapsChain, outChainSnaps jsonutils.JSONObject, rebaseDisks bool, diskinfo *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo, sysDiskHasTemplate bool, ) error
func (*SLocalStorage) Detach ¶
func (s *SLocalStorage) Detach() error
func (*SLocalStorage) DiskMigrate ¶
func (s *SLocalStorage) DiskMigrate(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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) GetImgsaveBackupPath ¶
func (s *SLocalStorage) GetImgsaveBackupPath() string
func (*SLocalStorage) GetMediumType ¶
func (s *SLocalStorage) GetMediumType() (string, error)
func (*SLocalStorage) GetSnapshotDir ¶
func (s *SLocalStorage) GetSnapshotDir() string
func (*SLocalStorage) GetSnapshotPathByIds ¶
func (s *SLocalStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
func (*SLocalStorage) IsLocal ¶
func (s *SLocalStorage) IsLocal() bool
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) 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) IsLocal ¶
func (s *SNFSStorage) IsLocal() bool
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 SNVMEDisk ¶
type SNVMEDisk struct {
SBaseDisk
}
func NewNVMEDisk ¶
func (*SNVMEDisk) CreateRaw ¶
func (d *SNVMEDisk) CreateRaw(ctx context.Context, sizeMb int, diskFormat string, fsFormat string, fsFeatures *api.DiskFsFeatures, encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error)
func (*SNVMEDisk) DiskBackup ¶
func (*SNVMEDisk) GetDiskDesc ¶
func (d *SNVMEDisk) GetDiskDesc() jsonutils.JSONObject
func (*SNVMEDisk) GetSnapshotDir ¶
type SNVMEStorage ¶
type SNVMEStorage struct { SBaseStorage // contains filtered or unexported fields }
func (*SNVMEStorage) Accessible ¶
func (s *SNVMEStorage) Accessible() error
func (*SNVMEStorage) CleanRecycleDiskfiles ¶
func (s *SNVMEStorage) CleanRecycleDiskfiles(ctx context.Context)
func (*SNVMEStorage) CreateDisk ¶
func (s *SNVMEStorage) CreateDisk(diskId string) IDisk
func (*SNVMEStorage) CreateDiskFromExistingPath ¶
func (s *SNVMEStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
func (*SNVMEStorage) CreateDiskFromSnapshot ¶
func (s *SNVMEStorage) CreateDiskFromSnapshot(context.Context, IDisk, *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SNVMEStorage) CreateSnapshotFormUrl ¶
func (s *SNVMEStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
func (*SNVMEStorage) DeleteSnapshot ¶
func (s *SNVMEStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SNVMEStorage) DeleteSnapshots ¶
func (s *SNVMEStorage) DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SNVMEStorage) Detach ¶
func (s *SNVMEStorage) Detach() error
func (*SNVMEStorage) GetAvailSizeMb ¶
func (s *SNVMEStorage) GetAvailSizeMb() int
func (*SNVMEStorage) GetCapacityMb ¶
func (s *SNVMEStorage) GetCapacityMb() int
func (*SNVMEStorage) GetComposedName ¶
func (s *SNVMEStorage) GetComposedName() string
func (*SNVMEStorage) GetDiskById ¶
func (s *SNVMEStorage) GetDiskById(diskId string) (IDisk, error)
func (*SNVMEStorage) GetFuseMountPath ¶
func (s *SNVMEStorage) GetFuseMountPath() string
func (*SNVMEStorage) GetFuseTmpPath ¶
func (s *SNVMEStorage) GetFuseTmpPath() string
func (*SNVMEStorage) GetImgsaveBackupPath ¶
func (s *SNVMEStorage) GetImgsaveBackupPath() string
func (*SNVMEStorage) GetSnapshotDir ¶
func (s *SNVMEStorage) GetSnapshotDir() string
func (*SNVMEStorage) GetSnapshotPathByIds ¶
func (s *SNVMEStorage) GetSnapshotPathByIds(diskId, snapshotId string) string
func (*SNVMEStorage) IsLocal ¶
func (s *SNVMEStorage) IsLocal() bool
func (*SNVMEStorage) IsSnapshotExist ¶
func (s *SNVMEStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)
func (*SNVMEStorage) SaveToGlance ¶
func (s *SNVMEStorage) SaveToGlance(context.Context, interface{}) (jsonutils.JSONObject, error)
func (*SNVMEStorage) SetStorageInfo ¶
func (s *SNVMEStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SNVMEStorage) StorageType ¶
func (s *SNVMEStorage) StorageType() string
func (*SNVMEStorage) SyncStorageInfo ¶
func (s *SNVMEStorage) SyncStorageInfo() (jsonutils.JSONObject, error)
func (*SNVMEStorage) SyncStorageSize ¶
func (s *SNVMEStorage) SyncStorageSize() (api.SHostStorageStat, error)
type SNasDisk ¶
type SNasDisk struct {
SLocalDisk
}
func NewNasDisk ¶
func (*SNasDisk) CreateFromImageFuse ¶
func (*SNasDisk) CreateFromSnapshotLocation ¶
func (d *SNasDisk) CreateFromSnapshotLocation(ctx context.Context, snapshotLocation string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)
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) (jsonutils.JSONObject, 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) ConvertSnapshot ¶
func (d *SRBDDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error
func (*SRBDDisk) CreateFromImageFuse ¶
func (*SRBDDisk) CreateFromRbdSnapshot ¶
func (*SRBDDisk) CreateFromTemplate ¶
func (*SRBDDisk) CreateRaw ¶
func (d *SRBDDisk) CreateRaw(ctx context.Context, sizeMb int, diskFormat string, fsFormat string, fsFeatures *api.DiskFsFeatures, encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error)
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) GetAccessDirectory ¶
func (r *SRbdImageCache) GetAccessDirectory() (string, 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) CleanImageCachefiles ¶
func (c *SRbdImageCacheManager) CleanImageCachefiles(ctx context.Context)
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) IsLocal ¶
func (c *SRbdImageCacheManager) IsLocal() bool
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)
func (*SRbdImageCacheManager) RemoveImage ¶
func (c *SRbdImageCacheManager) RemoveImage(ctx context.Context, imageId string) error
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) CleanRecycleDiskfiles ¶
func (s *SRbdStorage) CleanRecycleDiskfiles(ctx context.Context)
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) (jsonutils.JSONObject, error)
func (*SRbdStorage) CreateSnapshotFormUrl ¶
func (s *SRbdStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error
func (*SRbdStorage) DeleteSnapshot ¶
func (s *SRbdStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, 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) GetCapacityMb ¶
func (s *SRbdStorage) GetCapacityMb() int
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) IsLocal ¶
func (s *SRbdStorage) IsLocal() bool
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 SSLVMDisk ¶
type SSLVMDisk struct {
SLVMDisk
}
shared lvm
func NewSLVMDisk ¶
func (*SSLVMDisk) CreateFromSnapshotLocation ¶
func (d *SSLVMDisk) CreateFromSnapshotLocation(ctx context.Context, snapshotLocation string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)
func (*SSLVMDisk) CreateFromTemplate ¶
func (d *SSLVMDisk) CreateFromTemplate( ctx context.Context, imageId, format string, sizeMb int64, encryptInfo *apis.SEncryptInfo, ) (jsonutils.JSONObject, error)
func (*SSLVMDisk) CreateRaw ¶
func (d *SSLVMDisk) CreateRaw(ctx context.Context, sizeMb int, diskFormat string, fsFormat string, fsFeatures *api.DiskFsFeatures, encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error)
func (*SSLVMDisk) CreateSnapshot ¶
func (d *SSLVMDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
func (*SSLVMDisk) DeleteSnapshot ¶
func (*SSLVMDisk) GetDiskDesc ¶
func (d *SSLVMDisk) GetDiskDesc() jsonutils.JSONObject
func (*SSLVMDisk) PostCreateFromImageFuse ¶
func (d *SSLVMDisk) PostCreateFromImageFuse()
func (*SSLVMDisk) PrepareSaveToGlance ¶
func (*SSLVMDisk) ResetFromSnapshot ¶
type SSLVMStorage ¶
type SSLVMStorage struct { *SLVMStorage // contains filtered or unexported fields }
func NewSLVMStorage ¶
func NewSLVMStorage(manager *SStorageManager, vgName string) *SSLVMStorage
func (*SSLVMStorage) Accessible ¶
func (s *SSLVMStorage) Accessible() error
func (*SSLVMStorage) CreateDisk ¶
func (s *SSLVMStorage) CreateDisk(diskId string) IDisk
func (*SSLVMStorage) CreateDiskFromBackup ¶
func (s *SSLVMStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error
func (*SSLVMStorage) CreateDiskFromSnapshot ¶
func (s *SSLVMStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)
func (*SSLVMStorage) DeleteSnapshot ¶
func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
func (*SSLVMStorage) GetDiskById ¶
func (s *SSLVMStorage) GetDiskById(diskId string) (IDisk, error)
func (*SSLVMStorage) IsLocal ¶
func (s *SSLVMStorage) IsLocal() bool
func (*SSLVMStorage) Lvmlockd ¶
func (s *SSLVMStorage) Lvmlockd() bool
func (*SSLVMStorage) SetStorageInfo ¶
func (s *SSLVMStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
func (*SSLVMStorage) StorageType ¶
func (s *SSLVMStorage) StorageType() string
type SSLVMStorageFactory ¶
type SSLVMStorageFactory struct { }
func (*SSLVMStorageFactory) NewStorage ¶
func (factory *SSLVMStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage
func (*SSLVMStorageFactory) StorageType ¶
func (factory *SSLVMStorageFactory) StorageType() string
type SStorageBackup ¶
type SStorageDeleteSnapshot ¶
type SStorageDeleteSnapshots ¶
type SStorageManager ¶
type SStorageManager struct { Storages []IStorage AgentStorage IStorage LocalStorageImagecacheManager IImageCacheManger LVMStorageImagecacheManagers map[string]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) AddSharedLVMStorageImagecache ¶
func (s *SStorageManager) AddSharedLVMStorageImagecache(imagecachePath string, storage IStorage, storagecacheId string)
func (*SStorageManager) GetDiskById ¶
func (s *SStorageManager) GetDiskById(diskId string) (IDisk, error)
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) GetTotalLocalCapacity ¶
func (s *SStorageManager) GetTotalLocalCapacity() int
func (*SStorageManager) GetZoneId ¶
func (s *SStorageManager) GetZoneId() string
func (*SStorageManager) InitLVMStorageImageCache ¶
func (s *SStorageManager) InitLVMStorageImageCache(storagecacheId, vg string, storage IStorage)
func (*SStorageManager) InitSharedFileStorageImagecache ¶
func (s *SStorageManager) InitSharedFileStorageImagecache(storagecacheId, path string, storage IStorage)
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 ¶
- backup.go
- core.go
- disk_agent.go
- disk_base.go
- disk_clvm.go
- disk_local.go
- disk_lvm.go
- disk_nas.go
- disk_nvme.go
- disk_rbd.go
- disk_slvm.go
- doc.go
- imagecache_base.go
- imagecache_clean.go
- imagecache_local.go
- imagecache_lvm.go
- imagecache_rbd.go
- imagecachemanager_agent.go
- imagecachemanager_base.go
- imagecachemanager_local.go
- imagecachemanager_lvm.go
- imagecachemanager_rbd.go
- storage_agent.go
- storage_base.go
- storage_clvm.go
- storage_gpfs.go
- storage_local.go
- storage_lvm.go
- storage_nas.go
- storage_nfs.go
- storage_nvme.go
- storage_rbd.go
- storage_slvm.go
- storagehelper.go
Click to show internal directories.
Click to hide internal directories.