volume

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrVolumeInUse

func IsErrVolumeInUse(err error) bool

func Label

func Label(ID string) string

given an ID, compute the volume's label

Types

type Disk

type Disk interface {
	// Path to this disk on the VCH
	MountPath() (string, error)

	// Path to the disk on the datastore
	DiskPath() url.URL
}

type ErrVolumeInUse

type ErrVolumeInUse struct {
	Msg string
}

func (*ErrVolumeInUse) Error

func (e *ErrVolumeInUse) Error() string

type Volume

type Volume struct {
	// Identifies the volume
	ID string

	// Label is the computed label of the Volume.  This is set by the runtime.
	Label string

	// The volumestore the volume lives on. (e.g the datastore + vch + configured vol directory)
	Store *url.URL

	// Metadata the volume is included with.  Is persisted along side the volume vmdk.
	Info map[string][]byte

	// Namespace in the storage layer to look up this volume.
	SelfLink *url.URL

	// Backing device
	Device Disk

	CopyMode executor.CopyMode
}

Volume is the handle to identify a volume on the backing store. The URI namespace used to identify the Volume in the storage layer has the following path scheme:

`/storage/volumes/<volume store identifier, usually the vch uuid>/<volume id>`

func NewVolume

func NewVolume(store *url.URL, ID string, info map[string][]byte, device Disk, copyMode executor.CopyMode) (*Volume, error)

NewVolume creates a Volume

func (*Volume) Parse

func (v *Volume) Parse(u *url.URL) error

type VolumeExistsError

type VolumeExistsError struct {
	Msg string
}

VolumeExistsError : custom error type for when a create operation targets and already occupied ID

func (VolumeExistsError) Error

func (e VolumeExistsError) Error() string

type VolumeStoreNotFoundError

type VolumeStoreNotFoundError struct {
	Msg string
}

VolumeStoreNotFoundError : custom error type for when we fail to find a target volume store

func (VolumeStoreNotFoundError) Error

func (e VolumeStoreNotFoundError) Error() string

type VolumeStorer

type VolumeStorer interface {
	// Creates a volume on the given volume store, of the given size, with the given metadata.
	VolumeCreate(op trace.Operation, ID string, store *url.URL, capacityKB uint64, info map[string][]byte) (*Volume, error)

	// Destroys a volume
	VolumeDestroy(op trace.Operation, vol *Volume) error

	// Lists all volumes
	VolumesList(op trace.Operation) ([]*Volume, error)

	// The interfaces necessary for Import and Export
	storage.Resolver
	storage.Importer
	storage.Exporter
}

VolumeStorer is an interface to create, remove, enumerate, and get Volumes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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