pmdmanager

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid invalid argument passed
	ErrInvalid = os.ErrInvalid

	// ErrPermission no permission to complete the task
	ErrPermission = os.ErrPermission

	// ErrDeviceExists device with given id already exists
	ErrDeviceExists = errors.New("device exists")

	// ErrDeviceNotFound device does not exists
	ErrDeviceNotFound = errors.New("device not found")

	// ErrDeviceInUse device is in use
	ErrDeviceInUse = errors.New("device in use")

	// ErrDeviceNotReady device not ready yet
	ErrDeviceNotReady = errors.New("device not ready")

	// ErrNotEnoughSpace no space to create the device
	ErrNotEnoughSpace = errors.New("not enough space")
)

Functions

This section is empty.

Types

type PmemDeviceInfo

type PmemDeviceInfo struct {
	//VolumeId is name of the block device
	VolumeId string
	//Path actual device path
	Path string
	//Size size allocated for block device
	Size uint64
}

PmemDeviceInfo represents a block device

type PmemDeviceManager

type PmemDeviceManager interface {
	// GetCapacity returns the available maximum capacity that can be assigned to a Device/Volume
	GetCapacity() (map[string]uint64, error)

	// CreateDevice creates a new block device with give name, size and namespace mode
	// Possible errors: ErrNotEnoughSpace, ErrInvalid, ErrDeviceExists
	CreateDevice(name string, size uint64, nsmode string) error

	// GetDevice returns the block device information for given name
	// Possible errors: ErrDeviceNotFound
	GetDevice(name string) (*PmemDeviceInfo, error)

	// DeleteDevice deletes an existing block device with give name.
	// If 'flush' is 'true', then the device data is zeroed before deleting the device
	// Possible errors: ErrDeviceInUse, ErrPermission
	DeleteDevice(name string, flush bool) error

	// ListDevices returns all the block devices information that was created by this device manager
	ListDevices() ([]*PmemDeviceInfo, error)
}

PmemDeviceManager interface to manage the PMEM block devices

func NewPmemDeviceManagerLVM

func NewPmemDeviceManagerLVM() (PmemDeviceManager, error)

NewPmemDeviceManagerLVM Instantiates a new LVM based pmem device manager The pre-requisite for this manager is that all the pmem regions which should be managed by this LMV manager are devided into namespaces and grouped as volume groups.

func NewPmemDeviceManagerLVMForVGs added in v0.6.0

func NewPmemDeviceManagerLVMForVGs(volumeGroups []string) (PmemDeviceManager, error)

func NewPmemDeviceManagerNdctl

func NewPmemDeviceManagerNdctl() (PmemDeviceManager, error)

NewPmemDeviceManagerNdctl Instantiates a new ndctl based pmem device manager

Jump to

Keyboard shortcuts

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