storageman

package
v0.0.0-...-2b29b9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 68 Imported by: 13

Documentation

Index

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 DeleteLocalSnapshot(snapshotDir, snapshotId, diskPath, convertSnapshot string, blockStream bool) error

func DoInstancePackBackup

func DoInstancePackBackup(ctx context.Context, backupInfo SStoragePackInstanceBackup) (string, error)

func EnsureBackupDir

func EnsureBackupDir() (string, error)

func GatherHostStorageStats

func GatherHostStorageStats(reportSharedStorages []string) api.SHostPingInput

func GetRootPartTotalCapacity

func GetRootPartTotalCapacity() int

func GetRootPartUsedCapacity

func GetRootPartUsedCapacity() int

func Init

func Init(host hostutils.IHost) error

func Stop

func Stop()

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

type SBaseDisk struct {
	Id      string
	Storage IStorage
}

func NewBaseDisk

func NewBaseDisk(storage IStorage, id string) *SBaseDisk

func (*SBaseDisk) CleanupSnapshots

func (d *SBaseDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) ConvertSnapshot

func (d *SBaseDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error

func (*SBaseDisk) CreateFromImageFuse

func (d *SBaseDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error

func (*SBaseDisk) CreateFromRbdSnapshot

func (d *SBaseDisk) CreateFromRbdSnapshot(ctx context.Context, napshotUrl, srcDiskId, srcPool string) error

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 (d *SBaseDisk) CreateFromUrl(ctx context.Context, url string, size int64, callback func(progress, progressMbps float64, totalSizeMb int64)) error

func (*SBaseDisk) CreateSnapshot

func (d *SBaseDisk) CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error

func (*SBaseDisk) DeleteAllSnapshot

func (d *SBaseDisk) DeleteAllSnapshot(skipRecycle bool) error

func (*SBaseDisk) DeleteSnapshot

func (d *SBaseDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo) error

func (*SBaseDisk) DeployGuestFs

func (d *SBaseDisk) DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *desc.SGuestDesc,
	deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error)

func (*SBaseDisk) DiskDeleteSnapshot

func (d *SBaseDisk) DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) DiskSnapshot

func (d *SBaseDisk) DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) DoDeleteSnapshot

func (d *SBaseDisk) DoDeleteSnapshot(snapshotId string) error

func (*SBaseDisk) FormatFs

func (d *SBaseDisk) FormatFs(fsFormat string, fsFeatures *api.DiskFsFeatures, uuid string, diskInfo *deployapi.DiskInfo)

func (*SBaseDisk) GetBackupDir

func (d *SBaseDisk) GetBackupDir() string

func (*SBaseDisk) GetContainerStorageDriver

func (d *SBaseDisk) GetContainerStorageDriver() (container_storage.IContainerStorage, error)

func (*SBaseDisk) GetDiskSetupScripts

func (d *SBaseDisk) GetDiskSetupScripts(diskIndex int) string

func (*SBaseDisk) GetFormat

func (d *SBaseDisk) GetFormat() (string, error)

func (*SBaseDisk) GetId

func (d *SBaseDisk) GetId() string

func (*SBaseDisk) GetPath

func (d *SBaseDisk) GetPath() string

func (*SBaseDisk) GetSnapshotLocation

func (d *SBaseDisk) GetSnapshotLocation() string

func (*SBaseDisk) GetSnapshotPath

func (d *SBaseDisk) GetSnapshotPath(snapshotId string) string

func (*SBaseDisk) GetStorage

func (d *SBaseDisk) GetStorage() IStorage

func (*SBaseDisk) GetType

func (d *SBaseDisk) GetType() string

func (*SBaseDisk) GetZoneId

func (d *SBaseDisk) GetZoneId() string

func (*SBaseDisk) OnRebuildRoot

func (d *SBaseDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error

func (*SBaseDisk) PostCreateFromImageFuse

func (d *SBaseDisk) PostCreateFromImageFuse()

func (*SBaseDisk) PreResize

func (d *SBaseDisk) PreResize(ctx context.Context, sizeMb int64) error

func (*SBaseDisk) PrepareMigrate

func (d *SBaseDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)

func (*SBaseDisk) PrepareSaveToGlance

func (d *SBaseDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) RebuildSlaveDisk

func (d *SBaseDisk) RebuildSlaveDisk(diskUri string) error

func (*SBaseDisk) ResetFromSnapshot

func (d *SBaseDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) Resize

func (d *SBaseDisk) Resize(context.Context, interface{}) (jsonutils.JSONObject, error)

func (*SBaseDisk) ResizeFs

func (d *SBaseDisk) ResizeFs(diskInfo *deployapi.DiskInfo) error

func (*SBaseDisk) RollbackDiskOnSnapshotFail

func (d *SBaseDisk) RollbackDiskOnSnapshotFail(snapshotId string) error

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 NewCLVMDisk(storage IStorage, id string) *SCLVMDisk

func (*SCLVMDisk) CreateFromImageFuse

func (d *SCLVMDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error

func (*SCLVMDisk) GetType

func (d *SCLVMDisk) GetType() string

func (*SCLVMDisk) PrepareMigrate

func (d *SCLVMDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)

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 SDiskMigrate struct {
	DiskId             string
	Disk               IDisk
	SrcStorageId       string
	TemplateId         string
	OutChainSnaps      []jsonutils.JSONObject
	SnapsChain         []jsonutils.JSONObject
	DiskBackingFile    string
	SnapshotsUri       string
	DiskUri            string
	SysDiskHasTemplate bool

	Storage IStorage
}

type SDiskReset

type SDiskReset struct {
	SnapshotId    string
	BackingDiskId string
	Input         jsonutils.JSONObject
}

type SGPFSDisk

type SGPFSDisk struct {
	SNasDisk
}

func NewGPFSDisk

func NewGPFSDisk(storage IStorage, id string) *SGPFSDisk

func (*SGPFSDisk) GetType

func (d *SGPFSDisk) GetType() string

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 NewLVMDisk(storage IStorage, id string) *SLVMDisk

func (*SLVMDisk) ConvertSnapshot

func (d *SLVMDisk) ConvertSnapshot(convertSnapshot string, encryptInfo apis.SEncryptInfo) error

func (*SLVMDisk) CreateFromImageFuse

func (d *SLVMDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error

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) Delete

func (d *SLVMDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLVMDisk) DeleteAllSnapshot

func (d *SLVMDisk) DeleteAllSnapshot(skipRecycle bool) error

func (*SLVMDisk) DeleteSnapshot

func (d *SLVMDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo) error

func (*SLVMDisk) DiskBackup

func (d *SLVMDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLVMDisk) DoDeleteSnapshot

func (d *SLVMDisk) DoDeleteSnapshot(snapshotId string) error

func (*SLVMDisk) GetBackupName

func (d *SLVMDisk) GetBackupName(backupId string) string

func (*SLVMDisk) GetBackupPath

func (d *SLVMDisk) GetBackupPath(backupId string) string

func (*SLVMDisk) GetDiskDesc

func (d *SLVMDisk) GetDiskDesc() jsonutils.JSONObject

func (*SLVMDisk) GetDiskSetupScripts

func (d *SLVMDisk) GetDiskSetupScripts(idx int) string

func (*SLVMDisk) GetImageCachePrefix

func (d *SLVMDisk) GetImageCachePrefix() string

func (*SLVMDisk) GetLvPath

func (d *SLVMDisk) GetLvPath() string

/dev/<vg>/<lvm>

func (*SLVMDisk) GetPath

func (d *SLVMDisk) GetPath() string

func (*SLVMDisk) GetSnapshotDir

func (d *SLVMDisk) GetSnapshotDir() string

func (*SLVMDisk) GetSnapshotName

func (d *SLVMDisk) GetSnapshotName(snapshotId string) string

The LVM logical volume name is limited to 64 characters.

func (*SLVMDisk) GetSnapshotPath

func (d *SLVMDisk) GetSnapshotPath(snapshotId string) string

func (*SLVMDisk) GetSnapshotPrefix

func (d *SLVMDisk) GetSnapshotPrefix() string

func (*SLVMDisk) GetType

func (d *SLVMDisk) GetType() string

func (*SLVMDisk) IsFile

func (d *SLVMDisk) IsFile() bool

func (*SLVMDisk) OnRebuildRoot

func (d *SLVMDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error

func (*SLVMDisk) PostCreateFromImageFuse

func (d *SLVMDisk) PostCreateFromImageFuse()

func (*SLVMDisk) PreResize

func (d *SLVMDisk) PreResize(ctx context.Context, sizeMb int64) error

func (*SLVMDisk) PrepareMigrate

func (d *SLVMDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)

func (*SLVMDisk) PrepareSaveToGlance

func (d *SLVMDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLVMDisk) Probe

func (d *SLVMDisk) Probe() error

func (*SLVMDisk) RebuildSlaveDisk

func (d *SLVMDisk) RebuildSlaveDisk(diskUri string) error

func (*SLVMDisk) ResetFromSnapshot

func (d *SLVMDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLVMDisk) Resize

func (d *SLVMDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLVMDisk) RollbackDiskOnSnapshotFail

func (d *SLVMDisk) RollbackDiskOnSnapshotFail(snapshotId string) error

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()

func (*SLVMImageCache) Remove

func (c *SLVMImageCache) Remove(ctx context.Context) error

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 (d *SLocalDisk) CreateFromUrl(ctx context.Context, url string, size int64, callback func(progress, progressMbps float64, totalSizeMb int64)) error

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 (d *SLocalDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)

func (*SLocalDisk) PrepareSaveToGlance

func (d *SLocalDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SLocalDisk) Probe

func (d *SLocalDisk) Probe() error

func (*SLocalDisk) 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()

func (*SLocalImageCache) Remove

func (l *SLocalImageCache) Remove(ctx context.Context) error

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 SNFSDisk

type SNFSDisk struct {
	SNasDisk
}

func NewNFSDisk

func NewNFSDisk(storage IStorage, id string) *SNFSDisk

func (*SNFSDisk) GetType

func (d *SNFSDisk) GetType() string

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 NewNVMEDisk(storage IStorage, id string) *SNVMEDisk

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) Delete

func (s *SNVMEDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SNVMEDisk) DiskBackup

func (d *SNVMEDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SNVMEDisk) GetDiskDesc

func (d *SNVMEDisk) GetDiskDesc() jsonutils.JSONObject

func (*SNVMEDisk) GetSnapshotDir

func (d *SNVMEDisk) GetSnapshotDir() string

func (*SNVMEDisk) IsFile

func (d *SNVMEDisk) IsFile() bool

func (*SNVMEDisk) Probe

func (d *SNVMEDisk) Probe() error

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 (*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 NewNasDisk(storage IStorage, id string) *SNasDisk

func (*SNasDisk) CreateFromImageFuse

func (d *SNasDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error

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 (d *SNasDisk) GetSnapshotLocation() string

func (*SNasDisk) ResetFromSnapshot

func (d *SNasDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

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 NewRBDDisk(storage IStorage, id string) *SRBDDisk

func (*SRBDDisk) CleanupSnapshots

func (d *SRBDDisk) CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) ConvertSnapshot

func (d *SRBDDisk) ConvertSnapshot(convertSnapshotId string, encryptInfo apis.SEncryptInfo) error

func (*SRBDDisk) CreateFromImageFuse

func (d *SRBDDisk) CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error

func (*SRBDDisk) CreateFromRbdSnapshot

func (d *SRBDDisk) CreateFromRbdSnapshot(ctx context.Context, snapshot, srcDiskId, srcPool string) error

func (*SRBDDisk) CreateFromTemplate

func (d *SRBDDisk) CreateFromTemplate(ctx context.Context, imageId string, format string, size int64, encryptInfo *apis.SEncryptInfo) (jsonutils.JSONObject, error)

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) Delete

func (d *SRBDDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) DeleteAllSnapshot

func (d *SRBDDisk) DeleteAllSnapshot(skipRecycle bool) error

func (*SRBDDisk) DeleteSnapshot

func (d *SRBDDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo) error

func (*SRBDDisk) DiskBackup

func (d *SRBDDisk) DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) DiskDeleteSnapshot

func (d *SRBDDisk) DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) DiskSnapshot

func (d *SRBDDisk) DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) GetDiskDesc

func (d *SRBDDisk) GetDiskDesc() jsonutils.JSONObject

func (*SRBDDisk) GetDiskSetupScripts

func (d *SRBDDisk) GetDiskSetupScripts(idx int) string

func (*SRBDDisk) GetFormat

func (d *SRBDDisk) GetFormat() (string, error)

func (*SRBDDisk) GetPath

func (d *SRBDDisk) GetPath() string

func (*SRBDDisk) GetSnapshotDir

func (d *SRBDDisk) GetSnapshotDir() string

func (*SRBDDisk) GetType

func (d *SRBDDisk) GetType() string

func (*SRBDDisk) IsFile

func (d *SRBDDisk) IsFile() bool

func (*SRBDDisk) OnRebuildRoot

func (d *SRBDDisk) OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error

func (*SRBDDisk) PostCreateFromImageFuse

func (d *SRBDDisk) PostCreateFromImageFuse()

func (*SRBDDisk) PrepareMigrate

func (d *SRBDDisk) PrepareMigrate(liveMigrate bool) ([]string, string, bool, error)

func (*SRBDDisk) PrepareSaveToGlance

func (d *SRBDDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) Probe

func (d *SRBDDisk) Probe() error

func (*SRBDDisk) ResetFromSnapshot

func (d *SRBDDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SRBDDisk) Resize

func (d *SRBDDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

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()

func (*SRbdImageCache) Remove

func (r *SRbdImageCache) Remove(ctx context.Context) error

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 NewSLVMDisk(storage IStorage, id string) *SSLVMDisk

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) Delete

func (d *SSLVMDisk) Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SSLVMDisk) DeleteSnapshot

func (d *SSLVMDisk) DeleteSnapshot(snapshotId, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo) error

func (*SSLVMDisk) GetDiskDesc

func (d *SSLVMDisk) GetDiskDesc() jsonutils.JSONObject

func (*SSLVMDisk) GetPath

func (d *SSLVMDisk) GetPath() string

func (*SSLVMDisk) GetType

func (d *SSLVMDisk) GetType() string

func (*SSLVMDisk) PostCreateFromImageFuse

func (d *SSLVMDisk) PostCreateFromImageFuse()

func (*SSLVMDisk) PreResize

func (d *SSLVMDisk) PreResize(ctx context.Context, sizeMb int64) error

func (*SSLVMDisk) PrepareSaveToGlance

func (d *SSLVMDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SSLVMDisk) Probe

func (d *SSLVMDisk) Probe() error

func (*SSLVMDisk) ResetFromSnapshot

func (d *SSLVMDisk) ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SSLVMDisk) Resize

func (d *SSLVMDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

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 SStorageBackup struct {
	BackupId                string
	BackupLocalPath         string
	BackupStorageId         string
	BackupStorageAccessInfo *jsonutils.JSONDict
}

type SStorageDeleteSnapshot

type SStorageDeleteSnapshot struct {
	DiskId          string
	SnapshotId      string
	ConvertSnapshot string
	BlockStream     bool
	EncryptInfo     apis.SEncryptInfo
}

type SStorageDeleteSnapshots

type SStorageDeleteSnapshots struct {
	DiskId      string
	SnapshotIds []string
}

type SStorageManager

type SStorageManager struct {
	Storages     []IStorage
	AgentStorage IStorage

	LocalStorageImagecacheManager IImageCacheManger

	LVMStorageImagecacheManagers        map[string]IImageCacheManger
	SharedLVMStorageImagecacheManagers  map[string]IImageCacheManger
	RbdStorageImagecacheManagers        map[string]IImageCacheManger
	SharedFileStorageImagecacheManagers 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 SStoragePackBackup struct {
	PackageName             string
	BackupId                string
	BackupStorageId         string
	BackupStorageAccessInfo *jsonutils.JSONDict
	Metadata                api.DiskBackupPackMetadata
}

type SStoragePackInstanceBackup

type SStoragePackInstanceBackup struct {
	PackageName             string
	BackupStorageId         string
	BackupStorageAccessInfo *jsonutils.JSONDict
	BackupIds               []string
	Metadata                api.InstanceBackupPackMetadata
}

type SStorageSaveToGlanceInfo

type SStorageSaveToGlanceInfo struct {
	UserCred mcclient.TokenCredential
	DiskInfo *jsonutils.JSONDict
}

type SStorageUnpackInstanceBackup

type SStorageUnpackInstanceBackup struct {
	PackageName             string
	BackupStorageId         string
	BackupStorageAccessInfo *jsonutils.JSONDict
	MetadataOnly            *bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL