storage

package
v0.0.0-...-632707f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageCephFSContents    = ContentContainerTemplate & ContentISO & ContentBackup & ContentSnippet
	StorageCephFSImageFormat = ContentNone
	StorageCephFSShared      = AllowShareNever
	StorageCephFSSnapshots   = AllowSnapshotAll
	StorageCephFSClones      = AllowCloneNever
)
View Source
const (
	DefaultStorageCephFSUsername   = ""
	DefaultStorageCephFSUseFUSE    = false
	DefaultStorageCephFSServerPath = "/"
)
View Source
const (
	StorageCIFSContents    = ContentQEMUData & ContentContainerData & ContentContainerTemplate & ContentISO & ContentBackup & ContentSnippet
	StorageCIFSImageFormat = ImageFormatRaw & ImageFormatQcow2 & ImageFormatVMDK
	StorageCIFSShared      = AllowShareForced
	StorageCIFSSnapshots   = AllowSnapshotQcow2
	StorageCIFSClones      = AllowCloneQcow2
)
View Source
const (
	DefaultStorageCIFSSMBVersion      = SMBVersion30
	DefaultStorageCIFSDomain          = ""
	DefaultStorageCIFSUsername        = ""
	DefaultStorageCIFSPassword        = ""
	DefaultStorageCIFSLocalPathCreate = false
)
View Source
const (
	StorageDirContent       = ContentQEMUData & ContentContainerData & ContentISO & ContentContainerTemplate & ContentBackup & ContentSnippet
	StorageDirImageFormat   = ImageFormatRaw & ImageFormatQcow2 & ImageFormatVMDK
	StorageDirAllowShare    = AllowShareNever
	StorageDirAllowSnapshot = AllowSnapshotQcow2
	StorageDirAllowClone    = AllowCloneQcow2
)
View Source
const (
	DefaultStorageDirLocalPathCreate = true
	DefaultStorageDirLocalIsManaged  = false
)
View Source
const (
	StorageDRBDContents    = ContentQEMUData & ContentContainerData
	StorageDRBDImageFormat = ImageFormatRaw
	StorageDRBDShared      = AllowShareForced
	StorageDRBDSnapshots   = AllowSnapshotNever
	StorageDRBDClones      = AllowCloneNever
)
View Source
const (
	StorageGlusterFSContents    = ContentQEMUData & ContentContainerTemplate & ContentISO & ContentBackup & ContentSnippet
	StorageGlusterFSImageFormat = ImageFormatRaw & ImageFormatQcow2 & ImageFormatVMDK
	StorageGlusterFSShared      = AllowShareForced
	StorageGlusterFSSnapshots   = AllowSnapshotQcow2
	StorageGlusterFSClones      = AllowSnapshotQcow2
)
View Source
const (
	DefaultStorageGlusterFSBackupServer = ""
	DefaultStorageGlusterFSTransport    = GlusterFSTransportNone
)
View Source
const (
	StorageISCSIKernelContents    = ContentQEMUData
	StorageISCSIKernelImageFormat = ImageFormatRaw
	StorageISCSIKernelShared      = AllowShareForced
	StorageISCSIKernelSnapshots   = AllowSnapshotNever
	StorageISCSIKernelClones      = AllowCloneNever
)
View Source
const (
	StorageISCSIUserContents    = ContentQEMUData
	StorageISCSIUserImageFormat = ImageFormatRaw
	StorageISCSIUserShared      = AllowShareForced
	StorageISCSIUserSnapshots   = AllowSnapshotNever
	StorageISCSIUserClones      = AllowCloneNever
)
View Source
const (
	StorageLVMContent       = ContentQEMUData & ContentContainerData
	StorageLVMImageFormat   = ImageFormatRaw
	StorageLVMAllowShare    = AllowSharePossible
	StorageLVMAllowSnapshot = AllowSnapshotNever
	StorageLVMAllowClone    = AllowCloneNever
)
View Source
const (
	DefaultStorageLVMBaseStorage          = ""
	DefaultStorageLVMSafeRemove           = false
	DefaultStorageLVMSafeRemoveThroughput = -10485760
	DefaultStorageLVMTaggedOnly           = false
)
View Source
const (
	StorageLVMThinContents    = ContentQEMUData & ContentContainerData
	StorageLVMThinImageFormat = ImageFormatRaw
	StorageLVMThinShared      = AllowShareNever
	StorageLVMThinSnapshots   = AllowSnapshotAll
	StorageLVMThinClones      = AllowCloneAll
)
View Source
const (
	StorageNFSContents    = ContentQEMUData & ContentContainerData & ContentContainerTemplate & ContentISO & ContentBackup & ContentSnippet
	StorageNFSImageFormat = ImageFormatRaw & ImageFormatQcow2 & ImageFormatVMDK
	StorageNFSShared      = AllowShareForced
	StorageNFSSnapshots   = AllowSnapshotQcow2
	StorageNFSClones      = AllowCloneQcow2
)
View Source
const (
	DefaultStorageNFSVersion         = NFSVersionNone
	DefaultStorageNFSLocalPathCreate = false
)
View Source
const (
	StorageRBDContents    = ContentQEMUData & ContentContainerData
	StorageRBDImageFormat = ImageFormatRaw
	StorageRBDShared      = AllowShareForced
	StorageRBDSnapshots   = AllowSnapshotAll
	StorageRBDClones      = AllowCloneAll
)
View Source
const (
	DefaultStorageRBDUsername = ""
	DefaultStorageRBDUseKRBD  = false
	DefaultStorageRBDPoolName = "rbd"
)
View Source
const (
	StorageZFSContents    = ContentQEMUData & ContentContainerData
	StorageZFSImageFormat = ImageFormatRaw & ImageFormatSubVolume
	StorageZFSShared      = AllowShareNever
	StorageZFSSnapshots   = AllowSnapshotAll
	StorageZFSClones      = AllowCloneAll
)
View Source
const (
	DefaultStorageZFSBlockSize  = "8192"
	DefaultStorageZFSUseSparse  = false
	DefaultStorageZFSMountPoint = ""
)
View Source
const (
	StorageZFSOverISCSIKernelContents    = ContentQEMUData
	StorageZFSOverISCSIKernelImageFormat = ImageFormatRaw
	StorageZFSOverISCSIKernelShared      = AllowShareForced
	StorageZFSOverISCSIKernelSnapshots   = AllowSnapshotAll
	StorageZFSOverISCSIKernelClones      = AllowCloneAll
)
View Source
const (
	DefaultStorageZFSOverISCSIUseSparse            = false
	DefaultStorageZFSOverISCSIWriteCache           = true
	DefaultStorageZFSOverISCSICOMSTARHostGroup     = ""
	DefaultStorageZFSOverISCSICOMSTARTargetGroup   = ""
	DefaultStorageZFSOverISCSILIOTargetPortalGroup = ""
)
View Source
const (
	DefaultStorageDRBDRedundancy uint = 2
)
View Source
const (
	ErrInvalidKind = errors.ClientError("unsupported storage type")
)

Variables

View Source
var DefaultStorageCephFSMonitorHosts = []string{}
View Source
var DefaultStorageRBDMonitorHosts = []string{}

Functions

This section is empty.

Types

type AllowClone

type AllowClone int
const (
	AllowCloneNever AllowClone = iota
	AllowCloneQcow2
	AllowCloneAll
)

type AllowShare

type AllowShare int
const (
	AllowShareNever AllowShare = iota
	AllowSharePossible
	AllowShareForced
)

type AllowSnapshot

type AllowSnapshot int
const (
	AllowSnapshotNever AllowSnapshot = iota
	AllowSnapshotQcow2
	AllowSnapshotAll
)

type Content

type Content int
const (
	ContentUnknown Content = 1 << iota

	// ContentQEMUData represents QEMU virtual machine image files. It's treated as the internal "images" type, which shows up as "Disk image" in the UI.
	ContentQEMUData

	// ContentContainerData represents LXC container filesystems. It's treated as the internal "rootdir" type, which shows up  as "ISO image" in the UI.
	ContentContainerData

	// ContentISO represents ISO image files. It's treated as the internal "iso" type, which shows up as "ISO files" in the UI.
	ContentISO

	// ContentContainerTemplate represents LXC container template files. It's treated as the internal "vztml" type, which shows up as  "Container template" in the UI.
	ContentContainerTemplate

	// ContentBackup represents QEMU and LXC backup files. It's treated as the internal "backup" type, which shows up as "VZDump backup file" in the UI.
	ContentBackup

	// ContentSnippet represents snippet files like guest hook scripts. It's treated as the internal "snippets" type, which shows up as "Snippets" in the UI.
	ContentSnippet
)
const ContentNone Content = 0

func (Content) Marshal

func (obj Content) Marshal() (string, error)

func (Content) String

func (obj Content) String() string

func (*Content) Unmarshal

func (obj *Content) Unmarshal(s string) error

func (*Content) UnmarshalJSON

func (obj *Content) UnmarshalJSON(b []byte) error

type GlusterFSTransport

type GlusterFSTransport string
const (
	GlusterFSTransportNone GlusterFSTransport = ""
	GlusterFSTransportTCP  GlusterFSTransport = "tcp"
	GlusterFSTransportUNIX GlusterFSTransport = "unix"
	GlusterFSTransportRDMA GlusterFSTransport = "rdma"
)

func (GlusterFSTransport) IsUnknown

func (obj GlusterFSTransport) IsUnknown() bool

func (GlusterFSTransport) IsValid

func (obj GlusterFSTransport) IsValid() bool

func (GlusterFSTransport) Marshal

func (obj GlusterFSTransport) Marshal() (string, error)

func (*GlusterFSTransport) Unmarshal

func (obj *GlusterFSTransport) Unmarshal(s string) error

func (*GlusterFSTransport) UnmarshalJSON

func (obj *GlusterFSTransport) UnmarshalJSON(b []byte) error

type ISCSIProvider

type ISCSIProvider string
const (
	ISCSIProviderCOMSTAR ISCSIProvider = "comstar"
	ISCSIProviderISTGT   ISCSIProvider = "istgt"
	ISCSIProviderIET     ISCSIProvider = "iet"
	ISCSIProviderLIO     ISCSIProvider = "LIO"
)

func (ISCSIProvider) IsUnknown

func (obj ISCSIProvider) IsUnknown() bool

func (ISCSIProvider) IsValid

func (obj ISCSIProvider) IsValid() bool

func (ISCSIProvider) Marshal

func (obj ISCSIProvider) Marshal() (string, error)

func (*ISCSIProvider) Unmarshal

func (obj *ISCSIProvider) Unmarshal(s string) error

func (*ISCSIProvider) UnmarshalJSON

func (obj *ISCSIProvider) UnmarshalJSON(b []byte) error

type ImageFormat

type ImageFormat int
const (
	ImageFormatRaw ImageFormat = 1 << iota
	ImageFormatQcow2
	ImageFormatVMDK
	ImageFormatSubVolume
)
const ImageFormatUnknown ImageFormat = -1

func (ImageFormat) Marshal

func (obj ImageFormat) Marshal() (string, error)

func (*ImageFormat) Unmarshal

func (obj *ImageFormat) Unmarshal(s string) error

func (*ImageFormat) UnmarshalJSON

func (obj *ImageFormat) UnmarshalJSON(b []byte) error

type Kind

type Kind string
const (
	KindDir          Kind = "dir"
	KindLVM          Kind = "lvm"
	KindLVMThin      Kind = "lvmthin"
	KindZFS          Kind = "zfspool"
	KindNFS          Kind = "nfs"
	KindCIFS         Kind = "cifs"
	KindGlusterFS    Kind = "glusterfs"
	KindISCSIKernel  Kind = "iscsi"
	KindISCSIUser    Kind = "iscsidirect"
	KindCephFS       Kind = "cephfs"
	KindRBD          Kind = "rbd"
	KindDRBD         Kind = "drbd"
	KindZFSOverISCSI Kind = "zfs"
)

func (Kind) IsUnknown

func (obj Kind) IsUnknown() bool

func (Kind) IsValid

func (obj Kind) IsValid() bool

func (Kind) Marshal

func (obj Kind) Marshal() (string, error)

func (Kind) String

func (obj Kind) String() string

func (*Kind) Unmarshal

func (obj *Kind) Unmarshal(s string) error

func (*Kind) UnmarshalJSON

func (obj *Kind) UnmarshalJSON(b []byte) error

type NFSVersion

type NFSVersion string
const (
	NFSVersionNone NFSVersion = ""
	NFSVersion30   NFSVersion = "3"
	NFSVersion40   NFSVersion = "4"
	NFSVersion41   NFSVersion = "4.1"
	NFSVersion42   NFSVersion = "4.2"
)

func (NFSVersion) IsUnknown

func (obj NFSVersion) IsUnknown() bool

func (NFSVersion) IsValid

func (obj NFSVersion) IsValid() bool

func (NFSVersion) Marshal

func (obj NFSVersion) Marshal() (string, error)

func (*NFSVersion) Unmarshal

func (obj *NFSVersion) Unmarshal(s string) error

func (*NFSVersion) UnmarshalJSON

func (obj *NFSVersion) UnmarshalJSON(b []byte) error

type Properties

type Properties struct {
	Content Content
	Shared  bool
	Enabled bool

	ImageFormat     ImageFormat
	MaxBackupsPerVM uint

	Nodes []string

	Digest string
}

type SMBVersion

type SMBVersion string
const (
	SMBVersion20 SMBVersion = "2.0"
	SMBVersion21 SMBVersion = "2.1"
	SMBVersion30 SMBVersion = "3.0"
)

func (SMBVersion) IsUnknown

func (obj SMBVersion) IsUnknown() bool

func (SMBVersion) IsValid

func (obj SMBVersion) IsValid() bool

func (SMBVersion) Marshal

func (obj SMBVersion) Marshal() (string, error)

func (*SMBVersion) Unmarshal

func (obj *SMBVersion) Unmarshal(s string) error

func (*SMBVersion) UnmarshalJSON

func (obj *SMBVersion) UnmarshalJSON(b []byte) error

type Storage

type Storage interface {
	Name() string
	Kind() Kind

	Content() Content
	Shared() bool
	Enabled() bool

	ImageFormat() ImageFormat
	MaxBackupsPerVM() uint

	Nodes() []string

	Digest() string
}

type StorageCIFS

type StorageCIFS interface {
	Storage

	Server() string
	SMBVersion() SMBVersion

	Domain() string
	Username() string
	Password() string

	ServerShare() string
	LocalPath() string
	LocalPathCreate() bool
}

type StorageCIFSProperties

type StorageCIFSProperties struct {
	Server     string
	SMBVersion SMBVersion

	Domain   string
	Username string
	Password string

	ServerShare     string
	LocalPath       string
	LocalPathCreate bool
}

func NewStorageCIFSProperties

func NewStorageCIFSProperties(
	props types.Properties,
) (*StorageCIFSProperties, error)

type StorageCephFS

type StorageCephFS interface {
	Storage

	MonitorHosts() []string
	Username() string

	// Mount CephFS through FUSE.
	UseFUSE() bool

	ServerPath() string
	LocalPath() string
}

type StorageCephFSProperties

type StorageCephFSProperties struct {
	MonitorHosts []string
	Username     string

	UseFUSE bool

	ServerPath string
	LocalPath  string
}

func NewStorageCephFSProperties

func NewStorageCephFSProperties(
	props types.Properties,
) (*StorageCephFSProperties, error)

type StorageDRBD

type StorageDRBD interface {
	Storage

	Redundancy() uint
}

type StorageDRBDProperties

type StorageDRBDProperties struct {
	Redundancy uint
}

func NewStorageDRBDProperties

func NewStorageDRBDProperties(
	props types.Properties,
) (*StorageDRBDProperties, error)

type StorageDir

type StorageDir interface {
	Storage

	// Filesytem path.
	LocalPath() string

	// Create the directory if it doesn't exist.
	LocalPathCreate() bool

	// Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted.
	LocalPathIsManaged() bool
}

type StorageDirProperties

type StorageDirProperties struct {
	LocalPath          string
	LocalPathCreate    bool
	LocalPathIsManaged bool
}

func NewStorageDirProperties

func NewStorageDirProperties(
	props types.Properties,
) (*StorageDirProperties, error)

type StorageGlusterFS

type StorageGlusterFS interface {
	Storage

	MainServer() string
	BackupServer() string
	Transport() GlusterFSTransport

	Volume() string
}

type StorageGlusterFSProperties

type StorageGlusterFSProperties struct {
	MainServer   string
	BackupServer string
	Transport    GlusterFSTransport

	Volume string
}

func NewStorageGlusterFSProperties

func NewStorageGlusterFSProperties(
	props types.Properties,
) (*StorageGlusterFSProperties, error)

type StorageISCSIKernel

type StorageISCSIKernel interface {
	Storage

	Portal() string
	Target() string
}

type StorageISCSIKernelProperties

type StorageISCSIKernelProperties struct {
	Portal string
	Target string
}

func NewStorageISCSIKernelProperties

func NewStorageISCSIKernelProperties(
	props types.Properties,
) (*StorageISCSIKernelProperties, error)

type StorageISCSIUser

type StorageISCSIUser interface {
	Storage

	// iSCSI target
	Portal() string

	// iSCSI portal (IP or DNS name with optional port).
	Target() string
}

type StorageISCSIUserProperties

type StorageISCSIUserProperties struct {
	Portal string
	Target string
}

func NewStorageISCSIUserProperties

func NewStorageISCSIUserProperties(
	props types.Properties,
) (*StorageISCSIUserProperties, error)

type StorageLVM

type StorageLVM interface {
	Storage

	// Base volume. This volume is automatically activated.
	BaseStorage() string

	// Volume group name.
	VolumeGroup() string

	// Zero-out data when removing LVs.
	SafeRemove() bool

	// Limit the thoughput of the data stream, in bytes per second. If the value is positive, tries to keep the overall rate at the specified value for the whole session. If the value is negative, it is an upper limit for each read/write system call pair. In other words, the negative number will never exceed that limit, the positive number will exceed it to make good for previous underutilization
	SafeRemoveThroughput() int

	// Only use logical volumes tagged with 'pve-vm-ID'.
	TaggedOnly() bool
}

type StorageLVMProperties

type StorageLVMProperties struct {
	BaseStorage          string
	VolumeGroup          string
	SafeRemove           bool
	SafeRemoveThroughput int
	TaggedOnly           bool
}

func NewStorageLVMProperties

func NewStorageLVMProperties(
	props types.Properties,
) (*StorageLVMProperties, error)

type StorageLVMThin

type StorageLVMThin interface {
	Storage

	VolumeGroup() string
	ThinPool() string
}

type StorageLVMThinProperties

type StorageLVMThinProperties struct {
	VolumeGroup string
	ThinPool    string
}

func NewStorageLVMThinProperties

func NewStorageLVMThinProperties(
	props types.Properties,
) (*StorageLVMThinProperties, error)

type StorageNFS

type StorageNFS interface {
	Storage

	Server() string
	NFSVersion() NFSVersion

	ServerPath() string
	LocalPath() string
	LocalPathCreate() bool
}

type StorageNFSProperties

type StorageNFSProperties struct {
	Server     string
	NFSVersion NFSVersion

	ServerPath      string
	LocalPath       string
	LocalPathCreate bool
}

func NewStorageNFSProperties

func NewStorageNFSProperties(
	props types.Properties,
) (*StorageNFSProperties, error)

type StorageRBD

type StorageRBD interface {
	Storage

	MonitorHosts() []string
	Username() string

	// Always access rbd through krbd kernel module
	UseKRBD() bool

	PoolName() string
}

type StorageRBDProperties

type StorageRBDProperties struct {
	MonitorHosts []string
	Username     string

	UseKRBD bool

	PoolName string
}

func NewStorageRBDProperties

func NewStorageRBDProperties(
	props types.Properties,
) (*StorageRBDProperties, error)

type StorageZFS

type StorageZFS interface {
	Storage

	PoolName() string

	BlockSize() string
	UseSparse() bool

	LocalPath() string
}

type StorageZFSOverISCSI

type StorageZFSOverISCSI interface {
	Storage

	Portal() string
	Target() string

	PoolName() string

	BlockSize() string
	UseSparse() bool
	WriteCache() bool

	ISCSIProvider() ISCSIProvider

	COMSTARHostGroup() string
	COMSTARTargetGroup() string
	LIOTargetPortalGroup() string
}

type StorageZFSOverISCSIProperties

type StorageZFSOverISCSIProperties struct {
	Portal string
	Target string

	PoolName string

	BlockSize  string
	UseSparse  bool
	WriteCache bool

	ISCSIProvider ISCSIProvider

	COMSTARHostGroup     string
	COMSTARTargetGroup   string
	LIOTargetPortalGroup string
}

func NewStorageZFSOverISCSIProperties

func NewStorageZFSOverISCSIProperties(
	props types.Properties,
) (*StorageZFSOverISCSIProperties, error)

type StorageZFSProperties

type StorageZFSProperties struct {
	PoolName  string
	BlockSize string
	UseSparse bool
	LocalPath string
}

func NewStorageZFSProperties

func NewStorageZFSProperties(
	props types.Properties,
) (*StorageZFSProperties, error)

Jump to

Keyboard shortcuts

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