storageman

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrStorageTimeout = constError("storage accessible check timeout")
	TempBindMountPath = "/opt/cloud/workspace/temp-bind"
)
View Source
const (
	RBD_FEATURE = 3
	RBD_ORDER   = 22 //为rbd对应到rados中每个对象的大小,默认为4MB
)
View Source
const (
	CHECK_TIMEOUT = 3600 * time.Second
)
View Source
const MINIMAL_FREE_SPACE = 128

Variables

View Source
var DELETEING_SNAPSHOTS = sync.Map{}

Functions

func CleanRecycleDiskfiles

func CleanRecycleDiskfiles(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

func GatherHostStorageStats

func GatherHostStorageStats() api.SHostPingInput

func GetRootPartTotalCapacity

func GetRootPartTotalCapacity() int

func GetRootPartUsedCapacity

func GetRootPartUsedCapacity() int

func Init

func Init(host hostutils.IHost) error

func StartSnapshotRecycle

func StartSnapshotRecycle(storage IStorage)

func Stop

func Stop()

func StorageRequestSnapshotRecycle

func StorageRequestSnapshotRecycle(ctx context.Context, userCred mcclient.TokenCredential, storage IStorage)

Types

type IDisk

type IDisk interface {
	GetType() string
	GetId() string
	Probe() error
	GetPath() string
	GetFormat() (string, error)
	GetSnapshotDir() string
	GetDiskDesc() jsonutils.JSONObject
	GetDiskSetupScripts(idx int) string
	GetSnapshotLocation() string
	OnRebuildRoot(ctx context.Context, params api.DiskAllocateInput) error
	DoDeleteSnapshot(snapshotId string) error
	GetStorage() IStorage

	DeleteAllSnapshot(skipRecycle bool) error
	DiskSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	DiskDeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	Delete(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	Resize(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	ResetFromSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	CleanupSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

	PrepareMigrate(liveMigrate bool) (string, error)
	CreateFromUrl(ctx context.Context, url string, size int64, callback func(progress, progressMbps float64, totalSizeMb int64)) error
	CreateFromTemplate(context.Context, string, string, int64, *apis.SEncryptInfo) (jsonutils.JSONObject, error)
	CreateFromSnapshotLocation(ctx context.Context, location string, size int64, encryptInfo *apis.SEncryptInfo) error
	CreateFromRbdSnapshot(ctx context.Context, snapshotId, srcDiskId, srcPool string) error
	CreateFromImageFuse(ctx context.Context, url string, size int64, encryptInfo *apis.SEncryptInfo) error
	CreateRaw(ctx context.Context, sizeMb int, diskFromat string, fsFormat string,
		encryptInfo *apis.SEncryptInfo, diskId string, back string) (jsonutils.JSONObject, error)
	PostCreateFromImageFuse()
	CreateSnapshot(snapshotId string, encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg) error
	DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error
	DeployGuestFs(diskInfo *deployapi.DiskInfo, guestDesc *desc.SGuestDesc,
		deployInfo *deployapi.DeployInfo) (jsonutils.JSONObject, error)

	GetBackupDir() string
	DiskBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

	IsFile() bool
}

type IImageCache

type IImageCache interface {
	GetPath() string
	GetName() string
	Load() error
	Acquire(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) error
	Release()
	Remove(ctx context.Context) error
	GetImageId() string

	GetDesc() *remotefile.SImageDesc
}

type IImageCacheManger

type IImageCacheManger interface {
	GetId() string
	GetPath() string
	SetStoragecacheId(string)

	// for diskhandler
	PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)
	DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

	AcquireImage(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) (IImageCache, error)
	ReleaseImage(ctx context.Context, imageId string)
	LoadImageCache(imageId string)
}

func NewImageCacheManager

func NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string, storageType string) IImageCacheManger

type IImageCacheMangerFactory

type IImageCacheMangerFactory interface {
	NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string) IImageCacheManger
	StorageType() string
}

type INasStorage

type INasStorage interface {
	StorageType() string
	// contains filtered or unexported methods
}

type IStorage

type IStorage interface {
	GetId() string
	GetStorageName() string
	GetZoneId() string

	SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error
	SyncStorageInfo() (jsonutils.JSONObject, error)
	SyncStorageSize() (api.SHostStorageStat, error)
	StorageType() string
	GetStorageConf() *jsonutils.JSONDict
	GetStoragecacheId() string
	SetStoragecacheId(storagecacheId string)

	SetPath(string)
	GetPath() string

	GetSnapshotDir() string
	GetSnapshotPathByIds(diskId, snapshotId string) string
	DeleteSnapshots(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	IsSnapshotExist(diskId, snapshotId string) (bool, error)

	GetBackupDir() string
	StorageBackup(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)
	StorageBackupRecovery(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

	GetFreeSizeMb() int
	GetCapacity() int

	// Find owner disks first, if not found, call create disk
	GetDiskById(diskId string) (IDisk, error)
	CreateDisk(diskId string) IDisk
	RemoveDisk(IDisk)

	// *SDiskCreateByDiskinfo
	CreateDiskByDiskinfo(context.Context, interface{}) (jsonutils.JSONObject, error)
	SaveToGlance(context.Context, interface{}) (jsonutils.JSONObject, error)
	CreateDiskFromSnapshot(context.Context, IDisk, *SDiskCreateByDiskinfo) error
	CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error
	CreateDiskFromBackup(context.Context, IDisk, *SDiskCreateByDiskinfo) error

	// GetCloneTargetDiskPath generate target disk path by target disk id
	GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string
	// CloneDiskFromStorage clone disk from other storage
	CloneDiskFromStorage(ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool) (*hostapi.ServerCloneDiskFromStorageResponse, error)

	CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error

	DeleteDiskfile(diskPath string, skipRecycle bool) error
	GetFuseTmpPath() string
	GetFuseMountPath() string
	GetImgsaveBackupPath() string

	DestinationPrepareMigrate(ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string,
		disksBackingFile, srcSnapshots jsonutils.JSONObject, rebaseDisks bool, diskDesc *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo) error

	Accessible() error
	Detach() error
}

func NewStorage

func NewStorage(manager *SStorageManager, mountPoint, storageType string) IStorage

type IStorageFactory

type IStorageFactory interface {
	NewStorage(manager *SStorageManager, mountPoint string) IStorage
	StorageType() string
}

type IStorageManager

type IStorageManager interface {
	GetZoneId() string
}

type PrepareSaveToGlanceParams

type PrepareSaveToGlanceParams struct {
	TaskId   string
	DiskInfo jsonutils.JSONObject
}

type SAgentDisk

type SAgentDisk struct {
	SLocalDisk
}

func NewAgentDisk

func NewAgentDisk(storage IStorage, id string) *SAgentDisk

func (*SAgentDisk) PrepareSaveToGlance

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

func (*SAgentDisk) Resize

func (sd *SAgentDisk) Resize(ctx context.Context, diskInfo interface{}) (jsonutils.JSONObject, error)

type SAgentImageCacheManager

type SAgentImageCacheManager struct {
	// contains filtered or unexported fields
}

func NewAgentImageCacheManager

func NewAgentImageCacheManager(manger IImageCacheManger) *SAgentImageCacheManager

func (*SAgentImageCacheManager) DeleteImageCache

func (c *SAgentImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SAgentImageCacheManager) PrefetchImageCache

func (c *SAgentImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

type SAgentStorage

type SAgentStorage struct {
	SLocalStorage
	// contains filtered or unexported fields
}

func NewAgentStorage

func NewAgentStorage(manager *SStorageManager, agent iagent.IAgent, path string) *SAgentStorage

func (*SAgentStorage) AgentDeployGuest

func (as *SAgentStorage) AgentDeployGuest(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SAgentStorage) CreateDiskByDiskInfo

func (as *SAgentStorage) CreateDiskByDiskInfo(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SAgentStorage) GetDiskById

func (as *SAgentStorage) GetDiskById(diskId string) (IDisk, error)

func (*SAgentStorage) PrepareSaveToGlance

func (as *SAgentStorage) PrepareSaveToGlance(ctx context.Context, taskId string, diskInfo jsonutils.JSONObject) (
	ret jsonutils.JSONObject, err error)

func (*SAgentStorage) SaveToGlance

func (as *SAgentStorage) SaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

type SBaseDisk

type SBaseDisk struct {
	Id      string
	Storage IStorage
}

func NewBaseDisk

func NewBaseDisk(storage IStorage, id string) *SBaseDisk

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

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

func (*SBaseDisk) DeployGuestFs

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

func (*SBaseDisk) DiskBackup

func (d *SBaseDisk) DiskBackup(ctx context.Context, params interface{}) (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, uuid string, diskInfo *deployapi.DiskInfo)

func (*SBaseDisk) GetBackupDir

func (d *SBaseDisk) GetBackupDir() string

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

func (d *SBaseDisk) Probe() 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

type SBaseImageCacheManager

type SBaseImageCacheManager struct {
	// contains filtered or unexported fields
}

func (*SBaseImageCacheManager) GetId

func (c *SBaseImageCacheManager) GetId() string

func (*SBaseImageCacheManager) GetPath

func (c *SBaseImageCacheManager) GetPath() string

func (*SBaseImageCacheManager) GetStorageManager

func (c *SBaseImageCacheManager) GetStorageManager() IStorageManager

func (*SBaseImageCacheManager) SetStoragecacheId

func (c *SBaseImageCacheManager) SetStoragecacheId(scid string)

type SBaseStorage

type SBaseStorage struct {
	Manager        *SStorageManager
	StorageId      string
	Path           string
	StorageName    string
	StorageConf    *jsonutils.JSONDict
	StoragecacheId string

	Disks    []IDisk
	DiskLock *sync.Mutex
	// contains filtered or unexported fields
}

func NewBaseStorage

func NewBaseStorage(manager *SStorageManager, path string) *SBaseStorage

func (*SBaseStorage) CloneDiskFromStorage

func (s *SBaseStorage) CloneDiskFromStorage(
	ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool,
) (*hostapi.ServerCloneDiskFromStorageResponse, error)

func (*SBaseStorage) CreateDiskByDiskinfo

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

func (*SBaseStorage) CreateDiskFromBackup

func (s *SBaseStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error

func (*SBaseStorage) CreateDiskFromSnpashot

func (s *SBaseStorage) CreateDiskFromSnpashot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)

func (*SBaseStorage) CreateDiskFromTemplate

func (s *SBaseStorage) CreateDiskFromTemplate(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)

func (*SBaseStorage) CreateRawDisk

func (s *SBaseStorage) CreateRawDisk(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) (jsonutils.JSONObject, error)

func (*SBaseStorage) DeleteDiskfile

func (s *SBaseStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error

func (*SBaseStorage) DestinationPrepareMigrate

func (s *SBaseStorage) DestinationPrepareMigrate(
	ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string,
	disksBackingFile, srcSnapshots jsonutils.JSONObject, rebaseDisks bool, diskinfo *desc.SGuestDisk, serverId string, idx, totalDiskCount int, encInfo *apis.SEncryptInfo,
) error

func (*SBaseStorage) GetAvailSizeMb

func (s *SBaseStorage) GetAvailSizeMb() int

func (*SBaseStorage) GetBackupDir

func (s *SBaseStorage) GetBackupDir() string

func (*SBaseStorage) GetCapacity

func (s *SBaseStorage) GetCapacity() int

func (*SBaseStorage) GetCloneTargetDiskPath

func (s *SBaseStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string

func (*SBaseStorage) GetFreeSizeMb

func (s *SBaseStorage) GetFreeSizeMb() int

func (*SBaseStorage) GetId

func (s *SBaseStorage) GetId() string

func (*SBaseStorage) GetName

func (s *SBaseStorage) GetName(generateName func() string) string

func (*SBaseStorage) GetPath

func (s *SBaseStorage) GetPath() string

func (*SBaseStorage) GetStorageConf

func (s *SBaseStorage) GetStorageConf() *jsonutils.JSONDict

func (*SBaseStorage) GetStorageName

func (s *SBaseStorage) GetStorageName() string

func (*SBaseStorage) GetStoragecacheId

func (s *SBaseStorage) GetStoragecacheId() string

func (*SBaseStorage) GetTotalSizeMb

func (s *SBaseStorage) GetTotalSizeMb() int

func (*SBaseStorage) GetUsedSizeMb

func (s *SBaseStorage) GetUsedSizeMb() int

func (*SBaseStorage) GetZoneId

func (s *SBaseStorage) GetZoneId() string

func (*SBaseStorage) RemoveDisk

func (s *SBaseStorage) RemoveDisk(d IDisk)

func (*SBaseStorage) SetPath

func (s *SBaseStorage) SetPath(p string)

func (*SBaseStorage) SetStorageInfo

func (s *SBaseStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error

func (*SBaseStorage) SetStoragecacheId

func (s *SBaseStorage) SetStoragecacheId(storagecacheId string)

func (*SBaseStorage) StorageBackup

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

func (*SBaseStorage) StorageBackupRecovery

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

func (*SBaseStorage) SyncStorageSize

func (s *SBaseStorage) SyncStorageSize() (api.SHostStorageStat, error)

type SDiskBakcup

type SDiskBakcup struct {
	SnapshotId              string              `json:"snapshot_id"`
	BackupId                string              `json:"backup_id"`
	BackupStorageId         string              `json:"backup_storage_id"`
	BackupStorageAccessInfo *jsonutils.JSONDict `json:"backup_storage_access_info"`

	EncryptKeyId string `json:"encrypt_key_id"`

	UserCred mcclient.TokenCredential
}

type SDiskCleanupSnapshots

type SDiskCleanupSnapshots struct {
	ConvertSnapshots []jsonutils.JSONObject
	DeleteSnapshots  []jsonutils.JSONObject
}

type SDiskCreateByDiskinfo

type SDiskCreateByDiskinfo struct {
	DiskId   string
	Disk     IDisk
	DiskInfo api.DiskAllocateInput

	Storage IStorage
}

func (*SDiskCreateByDiskinfo) String

func (i *SDiskCreateByDiskinfo) String() string

type SDiskReset

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

type 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) StorageType

func (s *SGPFSStorage) StorageType() string

type SGPFSStorageFactory

type SGPFSStorageFactory struct {
}

func (*SGPFSStorageFactory) NewStorage

func (factory *SGPFSStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage

func (*SGPFSStorageFactory) StorageType

func (factory *SGPFSStorageFactory) StorageType() string

type SHostDatastore

type SHostDatastore struct {
	HostIp    string
	Datastore vcenter.SVCenterAccessInfo
}

type SLocalDisk

type SLocalDisk struct {
	SBaseDisk
	// contains filtered or unexported fields
}

func NewLocalDisk

func NewLocalDisk(storage IStorage, id string) *SLocalDisk

func (*SLocalDisk) CleanupSnapshots

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

func (*SLocalDisk) CreateFromImageFuse

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

func (*SLocalDisk) CreateFromTemplate

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

func (*SLocalDisk) CreateFromUrl

func (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, fsFormat string,
	encryptInfo *apis.SEncryptInfo, uuid string, back string) (jsonutils.JSONObject, error)

func (*SLocalDisk) CreateSnapshot

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

func (*SLocalDisk) Delete

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

func (*SLocalDisk) DeleteAllSnapshot

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

func (*SLocalDisk) DeleteSnapshot

func (d *SLocalDisk) DeleteSnapshot(snapshotId, convertSnapshot string, pendingDelete bool) error

func (*SLocalDisk) DiskBackup

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

func (*SLocalDisk) DoDeleteSnapshot

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

func (*SLocalDisk) GetBackupDir

func (d *SLocalDisk) GetBackupDir() string

func (*SLocalDisk) GetDiskDesc

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

func (*SLocalDisk) GetDiskSetupScripts

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

func (*SLocalDisk) GetFormat

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

func (*SLocalDisk) GetPath

func (d *SLocalDisk) GetPath() string

func (*SLocalDisk) GetSnapshotDir

func (d *SLocalDisk) GetSnapshotDir() string

func (*SLocalDisk) GetSnapshotLocation

func (d *SLocalDisk) GetSnapshotLocation() string

func (*SLocalDisk) IsFile

func (d *SLocalDisk) IsFile() bool

func (*SLocalDisk) OnRebuildRoot

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

func (*SLocalDisk) PostCreateFromImageFuse

func (d *SLocalDisk) PostCreateFromImageFuse()

func (*SLocalDisk) PrepareMigrate

func (d *SLocalDisk) PrepareMigrate(liveMigrate bool) (string, error)

func (*SLocalDisk) PrepareSaveToGlance

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

func (*SLocalDisk) Probe

func (d *SLocalDisk) Probe() error

func (*SLocalDisk) ResetFromSnapshot

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

func (*SLocalDisk) Resize

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

func (*SLocalDisk) UmountFuseImage

func (d *SLocalDisk) UmountFuseImage()

type SLocalImageCache

type SLocalImageCache struct {
	Manager IImageCacheManger
	Size    int64
	Desc    *remotefile.SImageDesc
	// contains filtered or unexported fields
}

func NewLocalImageCache

func NewLocalImageCache(imageId string, imagecacheManager IImageCacheManger) *SLocalImageCache

func (*SLocalImageCache) Acquire

func (l *SLocalImageCache) Acquire(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) error

func (*SLocalImageCache) GetDesc

func (l *SLocalImageCache) GetDesc() *remotefile.SImageDesc

func (*SLocalImageCache) GetImageId

func (l *SLocalImageCache) GetImageId() string

func (*SLocalImageCache) GetInfPath

func (l *SLocalImageCache) GetInfPath() string

func (*SLocalImageCache) GetName

func (l *SLocalImageCache) GetName() string

func (*SLocalImageCache) GetPath

func (l *SLocalImageCache) GetPath() string

func (*SLocalImageCache) GetSize

func (l *SLocalImageCache) GetSize() int64

func (*SLocalImageCache) GetTmpPath

func (l *SLocalImageCache) GetTmpPath() string

func (*SLocalImageCache) Load

func (l *SLocalImageCache) Load() error

func (*SLocalImageCache) Release

func (l *SLocalImageCache) Release()

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) *SLocalImageCacheManager

func (*SLocalImageCacheManager) AcquireImage

func (c *SLocalImageCacheManager) AcquireImage(ctx context.Context, input api.CacheImageInput, callback func(progress, progressMbps float64, totalSizeMb int64)) (IImageCache, error)

func (*SLocalImageCacheManager) DeleteImageCache

func (c *SLocalImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SLocalImageCacheManager) LoadImageCache

func (c *SLocalImageCacheManager) LoadImageCache(imageId string)

func (*SLocalImageCacheManager) PrefetchImageCache

func (c *SLocalImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SLocalImageCacheManager) ReleaseImage

func (c *SLocalImageCacheManager) ReleaseImage(ctx context.Context, imageId string)

type SLocalStorage

type SLocalStorage struct {
	SBaseStorage

	Index int
}

func NewLocalStorage

func NewLocalStorage(manager *SStorageManager, path string, index int) *SLocalStorage

func (*SLocalStorage) Accessible

func (s *SLocalStorage) Accessible() error

func (*SLocalStorage) CloneDiskFromStorage

func (s *SLocalStorage) CloneDiskFromStorage(
	ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool,
) (*hostapi.ServerCloneDiskFromStorageResponse, error)

func (*SLocalStorage) CreateDisk

func (s *SLocalStorage) CreateDisk(diskId string) IDisk

func (*SLocalStorage) CreateDiskFromBackup

func (s *SLocalStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error

func (*SLocalStorage) CreateDiskFromExistingPath

func (s *SLocalStorage) CreateDiskFromExistingPath(
	ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo,
) error

func (*SLocalStorage) CreateDiskFromSnapshot

func (s *SLocalStorage) CreateDiskFromSnapshot(
	ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo,
) error

func (*SLocalStorage) CreateSnapshotFormUrl

func (s *SLocalStorage) CreateSnapshotFormUrl(
	ctx context.Context, snapshotUrl, diskId, snapshotPath string,
) error

func (*SLocalStorage) DeleteDiskfile

func (s *SLocalStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error

func (*SLocalStorage) DeleteSnapshots

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

func (*SLocalStorage) DestinationPrepareMigrate

func (s *SLocalStorage) DestinationPrepareMigrate(
	ctx context.Context, liveMigrate bool, disksUri string, snapshotsUri string,
	disksBackingFile, srcSnapshots jsonutils.JSONObject,
	rebaseDisks bool,
	diskinfo *desc.SGuestDisk,
	serverId string, idx, totalDiskCount int,
	encInfo *apis.SEncryptInfo,
) error

func (*SLocalStorage) Detach

func (s *SLocalStorage) Detach() error

func (*SLocalStorage) GetAvailSizeMb

func (s *SLocalStorage) GetAvailSizeMb() int

func (*SLocalStorage) GetCloneTargetDiskPath

func (s *SLocalStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string

func (*SLocalStorage) GetComposedName

func (s *SLocalStorage) GetComposedName() string

func (*SLocalStorage) GetDiskById

func (s *SLocalStorage) GetDiskById(diskId string) (IDisk, error)

func (*SLocalStorage) GetFuseMountPath

func (s *SLocalStorage) GetFuseMountPath() string

func (*SLocalStorage) GetFuseTmpPath

func (s *SLocalStorage) GetFuseTmpPath() string

func (*SLocalStorage) GetImgsaveBackupPath

func (s *SLocalStorage) GetImgsaveBackupPath() string

func (*SLocalStorage) GetSnapshotDir

func (s *SLocalStorage) GetSnapshotDir() string

func (*SLocalStorage) GetSnapshotPathByIds

func (s *SLocalStorage) GetSnapshotPathByIds(diskId, snapshotId string) string

func (*SLocalStorage) IsSnapshotExist

func (s *SLocalStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)

func (*SLocalStorage) SaveToGlance

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

func (*SLocalStorage) StorageBackup

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

func (*SLocalStorage) StorageBackupRecovery

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

func (*SLocalStorage) StorageType

func (s *SLocalStorage) StorageType() string

func (*SLocalStorage) SyncStorageInfo

func (s *SLocalStorage) SyncStorageInfo() (jsonutils.JSONObject, error)

type 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) SetStorageInfo

func (s *SNFSStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error

func (*SNFSStorage) StorageType

func (s *SNFSStorage) StorageType() string

func (*SNFSStorage) SyncStorageInfo

func (s *SNFSStorage) SyncStorageInfo() (jsonutils.JSONObject, error)

type SNFSStorageFactory

type SNFSStorageFactory struct {
}

func (*SNFSStorageFactory) NewStorage

func (factory *SNFSStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage

func (*SNFSStorageFactory) StorageType

func (factory *SNFSStorageFactory) StorageType() string

type SNasDisk

type SNasDisk struct {
	SLocalDisk
}

func NewNasDisk

func 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) 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) 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) 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, diskFromat string, fsFormat string, 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, pendingDelete bool) 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, 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) 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) DeleteImageCache

func (c *SRbdImageCacheManager) DeleteImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SRbdImageCacheManager) GetPath

func (c *SRbdImageCacheManager) GetPath() string

func (*SRbdImageCacheManager) LoadImageCache

func (c *SRbdImageCacheManager) LoadImageCache(imageId string)

func (*SRbdImageCacheManager) PrefetchImageCache

func (c *SRbdImageCacheManager) PrefetchImageCache(ctx context.Context, data interface{}) (jsonutils.JSONObject, error)

func (*SRbdImageCacheManager) ReleaseImage

func (c *SRbdImageCacheManager) ReleaseImage(ctx context.Context, imageId string)

type SRbdImageCacheManagerFactory

type SRbdImageCacheManagerFactory struct {
}

func (*SRbdImageCacheManagerFactory) NewImageCacheManager

func (factory *SRbdImageCacheManagerFactory) NewImageCacheManager(manager *SStorageManager, cachePath string, storage IStorage, storagecacheId string) IImageCacheManger

func (*SRbdImageCacheManagerFactory) StorageType

func (factory *SRbdImageCacheManagerFactory) StorageType() string

type SRbdStorage

type SRbdStorage struct {
	SBaseStorage
	// contains filtered or unexported fields
}

func NewRBDStorage

func NewRBDStorage(manager *SStorageManager, path string) *SRbdStorage

func (*SRbdStorage) Accessible

func (s *SRbdStorage) Accessible() error

func (*SRbdStorage) CloneDiskFromStorage

func (s *SRbdStorage) CloneDiskFromStorage(
	ctx context.Context, srcStorage IStorage, srcDisk IDisk, targetDiskId string, fullCopy bool,
) (*hostapi.ServerCloneDiskFromStorageResponse, error)

func (*SRbdStorage) CreateDisk

func (s *SRbdStorage) CreateDisk(diskId string) IDisk

func (*SRbdStorage) CreateDiskFromBackup

func (s *SRbdStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error

func (*SRbdStorage) CreateDiskFromExistingPath

func (s *SRbdStorage) CreateDiskFromExistingPath(context.Context, IDisk, *SDiskCreateByDiskinfo) error

func (*SRbdStorage) CreateDiskFromSnapshot

func (s *SRbdStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, input *SDiskCreateByDiskinfo) error

func (*SRbdStorage) CreateSnapshotFormUrl

func (s *SRbdStorage) CreateSnapshotFormUrl(ctx context.Context, snapshotUrl, diskId, snapshotPath string) error

func (*SRbdStorage) DeleteSnapshots

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

func (*SRbdStorage) Detach

func (s *SRbdStorage) Detach() error

func (*SRbdStorage) GetBackupDir

func (s *SRbdStorage) GetBackupDir() string

func (*SRbdStorage) GetClient

func (s *SRbdStorage) GetClient() (*cephutils.CephClient, error)

func (*SRbdStorage) GetCloneTargetDiskPath

func (s *SRbdStorage) GetCloneTargetDiskPath(ctx context.Context, targetDiskId string) string

func (*SRbdStorage) GetDiskById

func (s *SRbdStorage) GetDiskById(diskId string) (IDisk, error)

func (*SRbdStorage) GetDiskPath

func (s *SRbdStorage) GetDiskPath(diskId string) string

func (*SRbdStorage) GetFuseMountPath

func (s *SRbdStorage) GetFuseMountPath() string

func (*SRbdStorage) GetFuseTmpPath

func (s *SRbdStorage) GetFuseTmpPath() string

func (*SRbdStorage) GetImgsaveBackupPath

func (s *SRbdStorage) GetImgsaveBackupPath() string

func (*SRbdStorage) GetSnapshotDir

func (s *SRbdStorage) GetSnapshotDir() string

func (*SRbdStorage) GetSnapshotPathByIds

func (s *SRbdStorage) GetSnapshotPathByIds(diskId, snapshotId string) string

func (*SRbdStorage) IsImageExist

func (s *SRbdStorage) IsImageExist(name string) (bool, error)

func (*SRbdStorage) IsSnapshotExist

func (s *SRbdStorage) IsSnapshotExist(diskId, snapshotId string) (bool, error)

func (*SRbdStorage) SaveToGlance

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

func (*SRbdStorage) SetStorageInfo

func (s *SRbdStorage) SetStorageInfo(storageId, storageName string, conf jsonutils.JSONObject) error

func (*SRbdStorage) StorageType

func (s *SRbdStorage) StorageType() string

func (*SRbdStorage) SyncStorageInfo

func (s *SRbdStorage) SyncStorageInfo() (jsonutils.JSONObject, error)

func (*SRbdStorage) SyncStorageSize

func (s *SRbdStorage) SyncStorageSize() (api.SHostStorageStat, error)

type SRbdStorageFactory

type SRbdStorageFactory struct {
}

func (*SRbdStorageFactory) NewStorage

func (factory *SRbdStorageFactory) NewStorage(manager *SStorageManager, mountPoint string) IStorage

func (*SRbdStorageFactory) StorageType

func (factory *SRbdStorageFactory) StorageType() string

type SStorageBackup

type SStorageBackup struct {
	BackupId                string
	BackupStorageId         string
	BackupStorageAccessInfo *jsonutils.JSONDict
}

type SStorageManager

type SStorageManager struct {
	Storages     []IStorage
	AgentStorage IStorage

	LocalStorageImagecacheManager 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) GetDiskByPath

func (s *SStorageManager) GetDiskByPath(diskPath string) (IDisk, error)

func (*SStorageManager) GetHostId

func (s *SStorageManager) GetHostId() string

func (*SStorageManager) GetKubeletConfig

func (s *SStorageManager) GetKubeletConfig() kubelet.KubeletConfig

func (*SStorageManager) GetStorage

func (s *SStorageManager) GetStorage(storageId string) IStorage

func (*SStorageManager) GetStorageByPath

func (s *SStorageManager) GetStorageByPath(sPath string) (IStorage, error)

func (*SStorageManager) GetStorageDisk

func (s *SStorageManager) GetStorageDisk(storageId, diskId string) IDisk

func (*SStorageManager) GetStoragecacheById

func (s *SStorageManager) GetStoragecacheById(scId string) IImageCacheManger

func (*SStorageManager) GetStoragesByPath

func (s *SStorageManager) GetStoragesByPath(sPath string) ([]IStorage, error)

func (*SStorageManager) GetTotalCapacity

func (s *SStorageManager) GetTotalCapacity() int

func (*SStorageManager) GetZoneId

func (s *SStorageManager) GetZoneId() string

func (*SStorageManager) InitSharedFileStorageImagecache

func (s *SStorageManager) InitSharedFileStorageImagecache(storagecacheId, path string)

func (*SStorageManager) InitSharedStorageImageCache

func (s *SStorageManager) InitSharedStorageImageCache(storageType, storagecacheId, imagecachePath string, storage IStorage)

func (*SStorageManager) NewSharedStorageInstance

func (s *SStorageManager) NewSharedStorageInstance(mountPoint, storageType string) IStorage

func (*SStorageManager) Remove

func (s *SStorageManager) Remove(storage IStorage)

type SStoragePackBackup

type 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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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