Documentation
¶
Index ¶
Constants ¶
View Source
const ( PoolTypeDirectory = "directory" PoolTypeCeph = "ceph" BusTypeVirtio = "virtio" BusTypeIde = "ide" BusTypeScsi = "scsi" BusTypeSata = "sata" DiskFormatIso = "iso" DiskFormatQcow2 = "qcow2" DiskFormatRaw = "raw" DiskKindDisk = "disk" DiskKindLun = "lun" DiskKindCdrom = "cdrom" )
Variables ¶
This section is empty.
Functions ¶
func ConfigSpec ¶
ConfigSpec returns the hcl spec for the storage pools configuration
Types ¶
type Authentication ¶
Authentication provides credentials
type Ceph ¶
type Ceph struct {
Pool string `codec:"pool"` // Name of the ceph storage pool
Hosts []string `codec:"hosts"` // List of ceph hosts
Authentication Authentication `codec:"authentication"` // Autentication for ceph connection
}
Ceph provides configuration for ceph rbd storage pools
type Config ¶
type Config struct {
// Default is the name of the storage pool that is the default
Default string `codec:"default"`
// Directory provides directory storage pool configuration
Directory map[string]Directory `codec:"directory"`
// Ceph provides ceph storage pool configuration
Ceph map[string]Ceph `codec:"ceph"`
}
Config provides configuration for storage pools
type Directory ¶
type Directory struct {
Path string `codec:"path"` // Local path of the storage pool
}
Directory provides configuration for local directory storage pools
type Options ¶
type Options struct {
Chained bool // Volume is chained to a parent volume
Sparse bool // Volume should be sparse (full capacity not allocated)
Size uint64 // Size of the volume in bytes
Source Source // Describes the source of the volume
Target Target // Options for the target to be created
}
Options are supported options for AddVolume
type Pool ¶
type Pool interface {
// AddVolume adds a new volume to the storage pool.
AddVolume(name string, opts Options) (*Volume, error)
// GetVolume retrieves a volume from the storage pool if it exists.
GetVolume(name string) (*Volume, error)
// DeleteVolume deletes a volume from the storage pool.
DeleteVolume(name string) error
// ListVolumes returns the name of the volumes in the pool.
ListVolumes() ([]string, error)
// Name returns the name of the storage pool.
Name() string
// Type returns the type of the storage pool.
Type() string
// DefaultImageFormat returns the default image format for the pool.
DefaultImageFormat() string
}
Pool defines the required interface for supporting storage pools.
type Storage ¶
type Storage interface {
// DefaultPool returns the default storage pool
DefaultPool() (Pool, error)
// GetPool returns the requested storage pool by name
GetPool(name string) (Pool, error)
// ListPools returns a list of available storage pool names
ListPools() []string
// ImageHandler returns an image handler
ImageHandler() image_tools.ImageHandler
// DefaultDiskDriver provides the name of the default disk driver
DefaultDiskDriver() string
// GenerateDeviceName generates a new device name for a disk
GenerateDeviceName(busType string, existingDevices []string) string
// Fingerprint adds fingerprint information for available storage pools
Fingerprint(attrs map[string]*structs.Attribute)
}
Storage defines the required interface for support storage
type Target ¶
type Target struct {
Format string // Format of the created volume ("raw", "qcow2", etc.)
}
Target includes options for volume creation
type Volume ¶
type Volume struct {
Pool string // Name of the pool containing volume
Name string // Name of the volume
Kind string // Kind of attachment (disk, cdrom, etc)
Driver string // Driver for attachment
Format string // Format of the image
DeviceName string // Device name of the attachment
BusType string // Bus type used by the attachment (ide, sata, scsi, etc)
Primary bool // Primary disk for booting
Block string // Block device to pass through as attachment
Size uint64 // Size of the volume
}
Click to show internal directories.
Click to hide internal directories.