Documentation
¶
Index ¶
Constants ¶
View Source
const (
GB uint64 = 1024 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capacity ¶ added in v0.8.0
type Capacity struct {
// MaxVolumeSize is the size of the largest volume that
// currently can be created, considering alignment and
// fragmentation.
MaxVolumeSize uint64
// Available is the sum of all PMEM that could be used for
// volumes.
Available uint64
// Managed is all PMEM that is managed by the driver.
Managed uint64
// Total is all PMEM found by the driver.
Total uint64
}
Capacity contains information about PMEM. All sizes count bytes.
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 {
// GetName returns current device manager's operation mode
GetMode() api.DeviceMode
// GetCapacity returns information about local capacity.
GetCapacity() (Capacity, error)
// CreateDevice creates a new block device with give name, size and namespace mode
// Possible errors: ErrNotEnoughSpace, ErrDeviceExists
CreateDevice(name string, size uint64) 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
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(pmemPercentage uint) (PmemDeviceManager, error)
NewPmemDeviceManagerLVM Instantiates a new LVM based pmem device manager
func NewPmemDeviceManagerLVMForVGs ¶ added in v0.6.0
func NewPmemDeviceManagerLVMForVGs(volumeGroups []string) (PmemDeviceManager, error)
func NewPmemDeviceManagerNdctl ¶
func NewPmemDeviceManagerNdctl(pmemPercentage uint) (PmemDeviceManager, error)
NewPmemDeviceManagerNdctl Instantiates a new ndctl based pmem device manager FIXME(avalluri): consider pmemPercentage while calculating available space
Click to show internal directories.
Click to hide internal directories.