storage

package
v0.0.0-...-72cc25f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-2-Clause-Patent Imports: 27 Imported by: 32

Documentation

Index

Constants

View Source
const (
	BdevPciAddrSep = " "
	NilBdevAddress = "<nil>"
)

BdevPciAddrSep defines the separator used between PCI addresses in string lists.

View Source
const (
	ConfBdevSetOptions           = "bdev_set_options"
	ConfBdevNvmeSetOptions       = "bdev_nvme_set_options"
	ConfBdevNvmeSetHotplug       = "bdev_nvme_set_hotplug"
	ConfBdevAioCreate            = "bdev_aio_create"
	ConfBdevNvmeAttachController = C.NVME_CONF_ATTACH_CONTROLLER
	ConfVmdEnable                = C.NVME_CONF_ENABLE_VMD
	ConfSetHotplugBusidRange     = C.NVME_CONF_SET_HOTPLUG_RANGE
	ConfSetAccelProps            = C.NVME_CONF_SET_ACCEL_PROPS
	ConfSetSpdkRpcServer         = C.NVME_CONF_SET_SPDK_RPC_SERVER
	ConfSetAutoFaultyProps       = C.NVME_CONF_SET_AUTO_FAULTY
)

JSON config file constants.

View Source
const (
	AccelEngineNone  = C.NVME_ACCEL_NONE
	AccelEngineSPDK  = C.NVME_ACCEL_SPDK
	AccelEngineDML   = C.NVME_ACCEL_DML
	AccelOptMoveFlag = C.NVME_ACCEL_FLAG_MOVE
	AccelOptCRCFlag  = C.NVME_ACCEL_FLAG_CRC
)

Acceleration related constants for engine setting and optional capabilities.

View Source
const (
	BdevRoleData = C.NVME_ROLE_DATA
	BdevRoleMeta = C.NVME_ROLE_META
	BdevRoleWAL  = C.NVME_ROLE_WAL
	BdevRoleAll  = BdevRoleData | BdevRoleMeta | BdevRoleWAL
)

Role assignments for NVMe SSDs related to type of storage (enables Metadata-on-SSD capability).

View Source
const (
	// NVMeFirmwareQueryMethod is the name of the method used to forward the request to
	// update NVMe device firmware.
	NVMeFirmwareQueryMethod = "NvmeFirmwareQuery"

	// NVMeFirmwareUpdateMethod is the name of the method used to forward the request to
	// update NVMe device firmware.
	NVMeFirmwareUpdateMethod = "NvmeFirmwareUpdate"
)
View Source
const (
	// MinNVMeStorage defines the minimum per-target allocation
	// that may be requested. Requests with smaller amounts will
	// be rounded up.
	MinNVMeStorage = 1 << 30 // 1GiB, from bio_xtream.c

	// MinScmToNVMeRatio defines the minimum-allowable ratio
	// of SCM to NVMe.
	MinScmToNVMeRatio = 0.01 // 1%
	// DefaultScmToNVMeRatio defines the default ratio of
	// SCM to NVMe.
	DefaultScmToNVMeRatio = 0.06

	// BdevOutConfName defines the name of the output file to contain details
	// of bdevs to be used by a DAOS engine.
	BdevOutConfName = "daos_nvme.conf"

	// ControlMetadataSubdir defines the name of the subdirectory to hold control metadata
	ControlMetadataSubdir = "daos_control"
)
View Source
const (
	DefaultSysMemRsvd    = humanize.GiByte * 16  // per-system
	DefaultTgtMemRsvd    = humanize.MiByte * 128 // per-engine-target
	DefaultEngineMemRsvd = humanize.GiByte * 1   // per-engine
)

Memory reservation constant defaults to be used when calculating RAM-disk size for DAOS I/O engine.

View Source
const (
	ScmMsgRebootRequired     = "A reboot is required to process new PMem memory allocation goals."
	ScmMsgNotInited          = "PMem storage could not be accessed"
	ScmMsgClassNotSupported  = "operation unsupported on PMem class"
	ScmMsgIpmctlDiscoverFail = "ipmctl module discovery"
)
View Source
const (
	// ScmFirmwareQueryMethod is the method name used when forwarding the request
	// to query SCM firmware.
	ScmFirmwareQueryMethod = "ScmFirmwareQuery"
	// ScmFirmwareUpdateMethod is the method name used when forwarding the request
	// to update SCM firmware.
	ScmFirmwareUpdateMethod = "ScmFirmwareUpdate"
)

Variables

View Source
var (
	ErrInvalidDcpmCount = errors.New("expected exactly 1 DCPM device")
	ErrNoScmTiers       = errors.New("expected exactly 1 SCM tier in storage configuration")
)
View Source
var (
	// FaultScmNoPMem represents an error where no PMem modules exist.
	FaultScmNoPMem = storageFault(
		code.ScmNoPMem,
		"No PMem modules exist on storage server", "Install PMem modules and retry command")

	// FaultScmConfigTierMissing indicates a Fault when no scm tier is present in engine
	// storage config.
	FaultScmConfigTierMissing = storageFault(
		code.ScmConfigTierMissing,
		"missing scm storage tier in engine storage config",
		"add a scm tier in the first position of the engine storage tiers list in server config file and "+
			"restart daos_server")

	// FaultBdevConfigTierTypeMismatch represents an error where an incompatible mix of
	// emulated and non-emulated NVMe devices are present in the storage config.
	FaultBdevConfigTierTypeMismatch = storageFault(
		code.BdevConfigTierTypeMismatch,
		"bdev tiers found with both emulated and non-emulated NVMe types specified in config",
		"change config tiers to specify either emulated or non-emulated NVMe devices, but not a mix of both")

	// FaultBdevConfigRolesWithDCPM indicates a Fault when bdev roles are specified with DCPM
	// SCM class.
	FaultBdevConfigRolesWithDCPM = storageFault(
		code.BdevConfigRolesWithDCPM,
		"MD-on-SSD roles has been specified in config with scm class set to dcpm",
		"'bdev_roles' are only supported if the scm tier is of class ram so change dcpm tier to ram or "+
			"remove role assignments from bdev tiers then restart daos_server after updating server "+
			"config file")

	// FaultBdevConfigRolesMissing indicates a Fault when bdev roles are specified on some but
	// not all bdev tiers.
	FaultBdevConfigRolesMissing = storageFault(
		code.BdevConfigRolesMissing,
		"bdev tier MD-on-SSD roles have been specified on some but not all bdev tiers in config",
		"set 'bdev_roles' on all bdev tiers in server config file then restart daos_server")

	// FaultBdevConfigRolesWalDataNoMeta indicates an invalid configuration where WAL and Data
	// roles are specified on a bdev tier but not Meta.
	FaultBdevConfigRolesWalDataNoMeta = storageFault(
		code.BdevConfigRolesWalDataNoMeta,
		"WAL and Data MD-on-SSD roles have been specified on a bdev tier without Meta role",
		"set 'bdev_roles` on all bdev tiers in server config file but avoid the unsupported WAL+Data "+
			"combination then restart daos_server")

	// FaultBdevConfigMultiTiersWithoutRoles indicates a Fault when multiple bdev tiers exist
	// but no roles are specified.
	FaultBdevConfigMultiTiersWithoutRoles = storageFault(
		code.BdevConfigMultiTierWithoutRoles,
		"multiple bdev tiers but MD-on-SSD roles have not been specified",
		"set 'bdev_roles` on all bdev tiers or use only a single bdev tier in server config file then "+
			"restart daos_server")

	// FaultBdevConfigBadNrTiersWithRoles indicates a Fault when an invalid number of bdev tiers
	// exist when roles are specified.
	FaultBdevConfigBadNrTiersWithRoles = storageFault(
		code.BdevConfigBadNrTiersWithRoles,
		"only 1, 2 or 3 bdev tiers are supported when MD-on-SSD roles are specified",
		"reduce the number of bdev tiers to 3 or less in server config file then restart daos_server")

	// FaultBdevConfigControlMetadataNoRoles indicates a fault when control_metadata path has
	// been specified in server config file but MD-on-SSD has not been enabled.
	FaultBdevConfigControlMetadataNoRoles = storageFault(
		code.BdevConfigControlMetadataNoRoles,
		"using 'control_metadata.path' requires MD-on-SSD roles",
		"set 'bdev_roles' on bdev tiers in the engine storage section of the server config file then "+
			"restart daos_server")

	// FaultBdevConfigRolesNoControlMetadata indicates a fault when control_metadata path
	// has not been specified in server config file but MD-on-SSD has been enabled.
	FaultBdevConfigRolesNoControlMetadata = storageFault(
		code.BdevConfigRolesNoControlMetadata,
		"'control_metadata.path' is required when MD-on-SSD roles are specified",
		"set 'control_metadata.path' in the engine storage section of the server config file then "+
			"restart daos_server")
)
View Source
var (
	// FaultBdevNonRootVFIODisable indicates VFIO has been disabled but user is not privileged.
	FaultBdevNonRootVFIODisable = storageFault(
		code.BdevNonRootVFIODisable,
		"VFIO can not be disabled if running as non-root user",
		"Either run server as root or do not disable VFIO when invoking the command")

	// FaultBdevNoIOMMU indicates a missing IOMMU capability.
	FaultBdevNoIOMMU = storageFault(
		code.BdevNoIOMMU,
		"IOMMU capability is required to access NVMe devices but no IOMMU capability detected",
		"enable IOMMU per the DAOS Admin Guide")

	// FaultTargetAlreadyMounted represents an error where the target was already mounted.
	FaultTargetAlreadyMounted = storageFault(
		code.StorageTargetAlreadyMounted,
		"request included already-mounted mount target (cannot double-mount)",
		"unmount the target and retry the operation")
)

Functions

func CalcMemForRamdiskSize

func CalcMemForRamdiskSize(log logging.Logger, ramdiskSize, memHuge, memSys uint64, tgtCount, engCount int) (uint64, error)

CalcMemForRamdiskSize returns the minimum RAM required for the input requested RAM-disk size.

func CalcMinHugepages

func CalcMinHugepages(hugepageSizeKb int, numTargets int) (int, error)

CalcMinHugepages returns the minimum number of hugepages that should be requested for the given number of targets.

func CalcRamdiskSize

func CalcRamdiskSize(log logging.Logger, memTotal, memHuge, memSys uint64, tgtCount, engCount int) (uint64, error)

CalcRamdiskSize returns recommended tmpfs RAM-disk size calculated as (total mem - hugepage mem - sys rsvd mem - engine rsvd mem) / nr engines. All values in units of bytes and return value is for a single RAM-disk/engine.

func ControlMetadataEngineDir

func ControlMetadataEngineDir(mdPath string, engineIdx uint) string

ControlMetadataEngineDir generates a properly formatted path to engine specific control plane metadata.

func FaultBdevAccelEngineUnknown

func FaultBdevAccelEngineUnknown(input string, options ...string) *fault.Fault

FaultBdevAccelEngineUnknown creates a Fault when an unrecognized acceleration engine setting is detected.

func FaultBdevConfigBadNrRoles

func FaultBdevConfigBadNrRoles(role string, gotNr, wantNr int) *fault.Fault

FaultBdevConfigBadNrRoles creates a Fault when an unexpected number of roles have been assigned to bdev tiers.

func FaultBdevConfigOptFlagUnknown

func FaultBdevConfigOptFlagUnknown(input string, options ...string) *fault.Fault

FaultBdevConfigOptFlagUnknown creates a Fault when an unrecognized option flag (string) is detected in the engine storage section of the config file.

func FaultBdevNotFound

func FaultBdevNotFound(vmdEnabled bool, bdevs ...string) *fault.Fault

FaultBdevNotFound creates a Fault for the case where no NVMe storage devices match expected PCI addresses. VMD addresses are expected to have backing devices.

func FaultConfigRamdiskUnderMinMem

func FaultConfigRamdiskUnderMinMem(confSize, memRamdiskMin uint64) *fault.Fault

FaultConfigRamdiskUnderMinMem indicates that the tmpfs size requested in config is less than minimum allowed.

func FaultPathAccessDenied

func FaultPathAccessDenied(path string) *fault.Fault

FaultPathAccessDenied represents an error where a mount point or device path for a storage target is inaccessible because of a permissions issue.

func FaultRamdiskBadSize

func FaultRamdiskBadSize(existingSize, calcSize uint64) *fault.Fault

FaultRamdiskBadSize indicates that the already-mounted ramdisk is out of spec with the calculated ramdisk size for the engine.

func FaultRamdiskLowMem

func FaultRamdiskLowMem(memType string, confRamdiskSize, memNeed, memHave uint64) *fault.Fault

FaultRamdiskLowMem indicates that total RAM is insufficient to support given configuration.

func FaultScmInvalidPMem

func FaultScmInvalidPMem(msg string) *fault.Fault

FaultScmInvalidPMem creates a fault for the case where PMem validation has failed.

func FaultScmNotHealthy

func FaultScmNotHealthy(sockID uint) *fault.Fault

FaultScmNotHealthy creates a fault for the case where the PMem region is in an unhealthy state.

func FaultScmNotInterleaved

func FaultScmNotInterleaved(sockID uint) *fault.Fault

FaultScmNotInterleaved creates a fault for the case where the PMem region is in non-interleaved mode, this is unsupported.

func FaultScmPartialCapacity

func FaultScmPartialCapacity(sockID uint) *fault.Fault

FaultScmPartialCapacity creates a fault for the case where the PMem region has only partial free capacity, this is unsupported.

func FaultScmUnknownMemoryMode

func FaultScmUnknownMemoryMode(sockID uint) *fault.Fault

FaultScmUnknownMemoryMode creates a Fault for the case where the PMem region has an unsupported persistent memory type (not AppDirect).

func MockGetTopology

func MockGetTopology(context.Context) (*hardware.Topology, error)

Types

type AccelOptionBits

type AccelOptionBits = OptionBits

AccelOptionBits is a type alias representing acceleration capabilities as a bitset.

func (AccelOptionBits) MarshalYAML

func (obs AccelOptionBits) MarshalYAML() (interface{}, error)

func (*AccelOptionBits) UnmarshalYAML

func (obs *AccelOptionBits) UnmarshalYAML(unmarshal func(interface{}) error) error

type AccelProps

type AccelProps struct {
	Engine  string          `yaml:"engine,omitempty" json:"accel_engine"`
	Options AccelOptionBits `yaml:"options,omitempty" json:"accel_opts"`
}

AccelProps struct describes acceleration engine setting and optional capabilities expressed as a bitset. AccelProps is used both in YAML server config and JSON NVMe config files.

func (*AccelProps) UnmarshalYAML

func (ap *AccelProps) UnmarshalYAML(unmarshal func(interface{}) error) error

type BdevAdminForwarder

type BdevAdminForwarder struct {
	pbin.Forwarder
	// contains filtered or unexported fields
}

func NewBdevAdminForwarder

func NewBdevAdminForwarder(log logging.Logger) *BdevAdminForwarder

func (*BdevAdminForwarder) Format

func (*BdevAdminForwarder) Prepare

func (*BdevAdminForwarder) Scan

func (*BdevAdminForwarder) SendReq

func (f *BdevAdminForwarder) SendReq(method string, fwdReq interface{}, fwdRes interface{}) error

func (*BdevAdminForwarder) WriteConfig

type BdevAutoFaulty

type BdevAutoFaulty struct {
	Enable      bool   `yaml:"enable,omitempty" json:"enable"`
	MaxIoErrs   uint32 `yaml:"max_io_errs,omitempty" json:"max_io_errs"`
	MaxCsumErrs uint32 `yaml:"max_csum_errs,omitempty" json:"max_csum_errs"`
}

BdevAutoFaulty struct describes settings for detection of faulty NVMe devices within the BIO module of the engine process.

type BdevBusRange

type BdevBusRange struct {
	hardware.PCIBus
}

BdevBusRange represents a bus-ID range to be used to filter hot plug events.

func MustNewBdevBusRange

func MustNewBdevBusRange(rangeStr string) *BdevBusRange

MustNewBdevBusRange creates a new BdevBusRange from a string. Panics on error.

func NewBdevBusRange

func NewBdevBusRange(rangeStr string) (*BdevBusRange, error)

NewBdevBusRange creates a new BdevBusRange from a string.

func (*BdevBusRange) MarshalYAML

func (br *BdevBusRange) MarshalYAML() (interface{}, error)

func (*BdevBusRange) String

func (br *BdevBusRange) String() string

func (*BdevBusRange) UnmarshalYAML

func (br *BdevBusRange) UnmarshalYAML(unmarshal func(interface{}) error) error

type BdevConfig

type BdevConfig struct {
	DeviceList    *BdevDeviceList `yaml:"bdev_list,omitempty"`
	DeviceCount   int             `yaml:"bdev_number,omitempty"`
	FileSize      int             `yaml:"bdev_size,omitempty"`
	BusidRange    *BdevBusRange   `yaml:"bdev_busid_range,omitempty"`
	DeviceRoles   BdevRoles       `yaml:"bdev_roles,omitempty"`
	NumaNodeIndex uint            `yaml:"-"`
}

BdevConfig represents a Block Device (NVMe, etc.) configuration entry.

func (*BdevConfig) Validate

func (bc *BdevConfig) Validate(class Class) error

Validate sanity checks engine bdev config parameters and update VOS env.

type BdevDeviceFormatRequest

type BdevDeviceFormatRequest struct {
	Device string
	Class  Class
}

BdevDeviceFormatRequest designs the parameters for a device-specific format.

type BdevDeviceFormatResponse

type BdevDeviceFormatResponse struct {
	Formatted bool
	Error     *fault.Fault
}

BdevDeviceFormatResponse contains device-specific Format operation results.

type BdevDeviceFormatResponses

type BdevDeviceFormatResponses map[string]*BdevDeviceFormatResponse

BdevDeviceFormatResponses is a map of device identifiers to device Format results.

type BdevDeviceList

type BdevDeviceList struct {
	// As this is the most common use case, we'll make the embedded type's methods
	// available directly on the type.
	hardware.PCIAddressSet
	// contains filtered or unexported fields
}

BdevDeviceList represents a set of block device addresses.

func MustNewBdevDeviceList

func MustNewBdevDeviceList(devices ...string) *BdevDeviceList

MustNewBdevDeviceList creates a new BdevDeviceList from a string representation of a set of block device addresses. Panics on error.

func NewBdevDeviceList

func NewBdevDeviceList(devices ...string) (*BdevDeviceList, error)

NewBdevDeviceList creates a new BdevDeviceList from a list of strings.

func (*BdevDeviceList) Devices

func (bdl *BdevDeviceList) Devices() []string

Devices returns a slice of strings representing the block device addresses.

func (*BdevDeviceList) Equals

func (bdl *BdevDeviceList) Equals(other *BdevDeviceList) bool

Equals returns true if the two lists are equivalent.

func (*BdevDeviceList) Len

func (bdl *BdevDeviceList) Len() int

Len returns the number of block devices in the list.

func (*BdevDeviceList) MarshalJSON

func (bdl *BdevDeviceList) MarshalJSON() ([]byte, error)

func (*BdevDeviceList) MarshalYAML

func (bdl *BdevDeviceList) MarshalYAML() (interface{}, error)

func (*BdevDeviceList) PCIAddressSetPtr

func (bdl *BdevDeviceList) PCIAddressSetPtr() *hardware.PCIAddressSet

PCIAddressSetPtr returns a pointer to the underlying hardware.PCIAddressSet.

func (*BdevDeviceList) String

func (bdl *BdevDeviceList) String() string

func (*BdevDeviceList) UnmarshalJSON

func (bdl *BdevDeviceList) UnmarshalJSON(data []byte) error

func (*BdevDeviceList) UnmarshalYAML

func (bdl *BdevDeviceList) UnmarshalYAML(unmarshal func(interface{}) error) error

type BdevFormatRequest

type BdevFormatRequest struct {
	pbin.ForwardableRequest
	Properties   BdevTierProperties
	OwnerUID     int
	OwnerGID     int
	Hostname     string
	VMDEnabled   bool
	ScannedBdevs NvmeControllers // VMD needs address mapping for backing devices.
}

BdevFormatRequest defines the parameters for a Format operation.

func BdevFormatRequestFromConfig

func BdevFormatRequestFromConfig(log logging.Logger, cfg *TierConfig) (BdevFormatRequest, error)

BdevFormatRequestFromConfig returns a bdev format request populated from a TierConfig.

type BdevFormatResponse

type BdevFormatResponse struct {
	DeviceResponses BdevDeviceFormatResponses
}

BdevFormatResponse contains the results of a Format operation.

type BdevForwarder

type BdevForwarder struct {
	BdevAdminForwarder
	NVMeFirmwareForwarder
}

func NewBdevForwarder

func NewBdevForwarder(log logging.Logger) *BdevForwarder

type BdevPrepareRequest

type BdevPrepareRequest struct {
	pbin.ForwardableRequest
	HugepageCount      int
	HugeNodes          string
	CleanHugepagesOnly bool
	PCIAllowList       string
	PCIBlockList       string
	TargetUser         string
	Reset_             bool
	DisableVFIO        bool
	EnableVMD          bool
}

BdevPrepareRequest defines the parameters for a Prepare operation.

type BdevPrepareResponse

type BdevPrepareResponse struct {
	NrHugepagesRemoved uint
	VMDPrepared        bool
}

BdevPrepareResponse contains the results of a successful Prepare operation.

type BdevProvider

BdevProvider defines an interface to be implemented by a Block Device provider.

type BdevRoles

type BdevRoles struct {
	OptionBits
}

BdevRoles is a bitset representing SSD role assignments (enabling Metadata-on-SSD).

func (BdevRoles) MarshalJSON

func (bdr BdevRoles) MarshalJSON() ([]byte, error)

MarshalJSON represents roles as user readable string.

func (BdevRoles) MarshalYAML

func (bdr BdevRoles) MarshalYAML() (interface{}, error)

func (*BdevRoles) String

func (bdr *BdevRoles) String() string

func (*BdevRoles) UnmarshalJSON

func (bdr *BdevRoles) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes user readable roles string into bitmask.

func (*BdevRoles) UnmarshalYAML

func (bdr *BdevRoles) UnmarshalYAML(unmarshal func(interface{}) error) error

type BdevScanRequest

type BdevScanRequest struct {
	pbin.ForwardableRequest
	DeviceList *BdevDeviceList
	VMDEnabled bool
}

BdevScanRequest defines the parameters for a Scan operation.

type BdevScanResponse

type BdevScanResponse struct {
	Controllers NvmeControllers
	VMDEnabled  bool
}

BdevScanResponse contains information gleaned during a successful Scan operation.

type BdevTierFormatResult

type BdevTierFormatResult struct {
	Tier        int
	DeviceRoles BdevRoles
	Error       error
	Result      *BdevFormatResponse
}

BdevTierFormatResult contains details of a format operation result.

type BdevTierProperties

type BdevTierProperties struct {
	Class          Class
	DeviceList     *BdevDeviceList
	DeviceFileSize uint64 // size in bytes for NVMe device emulation
	Tier           int
	DeviceRoles    BdevRoles // NVMe SSD role assignments
}

BdevTierProperties contains basic configuration properties of a bdev tier.

func BdevTierPropertiesFromConfig

func BdevTierPropertiesFromConfig(cfg *TierConfig) BdevTierProperties

BdevTierPropertiesFromConfig returns BdevTierProperties struct from given TierConfig.

type BdevTierScanResult

type BdevTierScanResult struct {
	Tier   int
	Result *BdevScanResponse
}

BdevTierScanResult contains details of a scan operation result.

type BdevWriteConfigRequest

type BdevWriteConfigRequest struct {
	pbin.ForwardableRequest
	ConfigOutputPath  string
	OwnerUID          int
	OwnerGID          int
	TierProps         []BdevTierProperties
	HotplugEnabled    bool
	HotplugBusidBegin uint8
	HotplugBusidEnd   uint8
	Hostname          string
	AccelProps        AccelProps
	SpdkRpcSrvProps   SpdkRpcServer
	AutoFaultyProps   BdevAutoFaulty
	VMDEnabled        bool
	ScannedBdevs      NvmeControllers // VMD needs address mapping for backing devices.
}

BdevWriteConfigRequest defines the parameters for a WriteConfig operation.

func BdevWriteConfigRequestFromConfig

func BdevWriteConfigRequestFromConfig(ctx context.Context, log logging.Logger, cfg *Config, vmdEnabled bool, getTopo topologyGetter) (*BdevWriteConfigRequest, error)

BdevWriteConfigRequestFromConfig returns a config write request derived from a storage config.

type BdevWriteConfigResponse

type BdevWriteConfigResponse struct{}

BdevWriteConfigResponse contains the result of a WriteConfig operation.

type Class

type Class string

Class indicates a specific type of storage.

const (
	ClassNone Class = ""
	ClassDcpm Class = "dcpm"
	ClassRam  Class = "ram"
	ClassNvme Class = "nvme"
	ClassKdev Class = "kdev"
	ClassFile Class = "file"
)

Class type definitions.

func (Class) String

func (c Class) String() string

func (*Class) UnmarshalYAML

func (c *Class) UnmarshalYAML(unmarshal func(interface{}) error) error

type Config

type Config struct {
	ControlMetadata  ControlMetadata `yaml:"-"` // inherited from server
	EngineIdx        uint            `yaml:"-"`
	Tiers            TierConfigs     `yaml:"storage" cmdLongFlag:"--storage_tiers,nonzero" cmdShortFlag:"-T,nonzero"`
	ConfigOutputPath string          `yaml:"-" cmdLongFlag:"--nvme" cmdShortFlag:"-n"`
	VosEnv           string          `yaml:"-" cmdEnv:"VOS_BDEV_CLASS"`
	EnableHotplug    bool            `yaml:"-"`
	NumaNodeIndex    uint            `yaml:"-"`
	AccelProps       AccelProps      `yaml:"acceleration,omitempty"`
	SpdkRpcSrvProps  SpdkRpcServer   `yaml:"spdk_rpc_server,omitempty"`
	AutoFaultyProps  BdevAutoFaulty  `yaml:"bdev_auto_faulty,omitempty"`
}

func (*Config) GetBdevs

func (c *Config) GetBdevs() *BdevDeviceList

func (*Config) GetNVMeBdevs

func (c *Config) GetNVMeBdevs() *BdevDeviceList

func (*Config) SetNUMAAffinity

func (c *Config) SetNUMAAffinity(node uint)

func (*Config) Validate

func (c *Config) Validate() error

type ControlMetadata

type ControlMetadata struct {
	Path       string `yaml:"path,omitempty"`
	DevicePath string `yaml:"device,omitempty"`
}

ControlMetadata describes configuration options for control plane metadata storage on the DAOS server.

func (ControlMetadata) Directory

func (cm ControlMetadata) Directory() string

Directory returns the full path to the directory where the control plane metadata is saved.

func (ControlMetadata) EngineDirectory

func (cm ControlMetadata) EngineDirectory(idx uint) string

EngineDirectory returns the full path to the directory where the per-engine metadata is saved.

func (ControlMetadata) HasPath

func (cm ControlMetadata) HasPath() bool

HasPath returns true if the ControlMetadata path is set.

type DeviceParams

type DeviceParams struct {
	Device string
}

DeviceParams defines the sub-parameters of a Format operation that will use a storage device.

type LedState

type LedState int32

LedState represents the LED state of device.

const (
	LedStateUnknown LedState = iota
	LedStateIdentify
	LedStateFaulty
	LedStateRebuild
	LedStateNormal
)

LedState values representing the VMD LED state (see src/proto/ctl/smd.proto).

func (LedState) MarshalJSON

func (vls LedState) MarshalJSON() ([]byte, error)

func (LedState) String

func (vls LedState) String() string

func (*LedState) UnmarshalJSON

func (vls *LedState) UnmarshalJSON(data []byte) error

type MetadataFormatRequest

type MetadataFormatRequest struct {
	pbin.ForwardableRequest
	RootPath   string
	Device     string
	DataPath   string
	OwnerUID   int
	OwnerGID   int
	EngineIdxs []uint
}

MetadataFormatReq is a request defining parameters for control plane metadata storage format.

type MetadataForwarder

type MetadataForwarder struct {
	pbin.Forwarder
}

MetadataForwarder forwards requests to the DAOS admin binary.

func NewMetadataForwarder

func NewMetadataForwarder(log logging.Logger) *MetadataForwarder

NewMetadataForwarder creates a new MetadataForwarder.

func (*MetadataForwarder) Format

Format forwards a request request to format a metadata device.

func (*MetadataForwarder) Mount

Mount forwards a metadata mount request.

func (*MetadataForwarder) NeedsFormat

func (f *MetadataForwarder) NeedsFormat(req MetadataFormatRequest) (bool, error)

NeedsFormat forwards a request request to check whether the metadata storage is formatted.

func (*MetadataForwarder) Unmount

Unmount forwards a metadata unmount request.

type MetadataMountRequest

type MetadataMountRequest struct {
	pbin.ForwardableRequest
	RootPath string
	Device   string
}

MetadataMountReq is a request defining parameters for control plane metadata storage mount or unmount.

type MetadataProvider

type MetadataProvider interface {
	Format(MetadataFormatRequest) error
	NeedsFormat(MetadataFormatRequest) (bool, error)
	Mount(MetadataMountRequest) (*MountResponse, error)
	Unmount(MetadataMountRequest) (*MountResponse, error)
}

MetadataProvider is an interface for interacting with control plane metadata storage.

type MockMetadataProvider

type MockMetadataProvider struct {
	MountRes       *MountResponse
	MountErr       error
	UnmountRes     *MountResponse
	UnmountErr     error
	FormatErr      error
	NeedsFormatRes bool
	NeedsFormatErr error
}

MockMetadataProvider defines a mock version of a MetadataProvider.

func (*MockMetadataProvider) Format

Format mocks a MetadataProvider format call.

func (*MockMetadataProvider) Mount

Mount mocks a MetadataProvider mount call.

func (*MockMetadataProvider) NeedsFormat

NeedsFormat mocks a MetadataProvider format check.

func (*MockMetadataProvider) Unmount

Unmount mocks a MetadataProvider unmount call.

type MockMountProvider

type MockMountProvider struct {
	// contains filtered or unexported fields
}

MockMountProvider is a mocked version of a MountProvider that can be used for testing.

func DefaultMockMountProvider

func DefaultMockMountProvider() *MockMountProvider

DefaultMockMountProvider creates a mock provider in which all requests succeed.

func NewMockMountProvider

func NewMockMountProvider(cfg *MockMountProviderConfig) *MockMountProvider

NewMockMountProvider creates a new MockProvider.

func (*MockMountProvider) ClearMountpoint

func (m *MockMountProvider) ClearMountpoint(_ string) error

ClearMountpoint is a mock implementation.

func (*MockMountProvider) GetMountOpts

func (m *MockMountProvider) GetMountOpts(target string) (string, bool)

GetMountOpts returns the mount options for the given target.

func (*MockMountProvider) IsMounted

func (m *MockMountProvider) IsMounted(target string) (bool, error)

IsMounted is a mock implementation.

func (*MockMountProvider) MakeMountPath

func (m *MockMountProvider) MakeMountPath(_ string, _, _ int) error

MakeMountPath is a mock implementation.

func (*MockMountProvider) Mount

Mount is a mock implementation.

func (*MockMountProvider) Unmount

func (m *MockMountProvider) Unmount(req MountRequest) (*MountResponse, error)

Unmount is a mock implementation.

type MockMountProviderConfig

type MockMountProviderConfig struct {
	MountErr           error
	UnmountErr         error
	IsMountedRes       bool
	IsMountedErr       error
	IsMountedCount     int
	ClearMountpointErr error
	MakeMountPathErr   error
}

MockMountProviderConfig is a configuration for a mock MountProvider.

type MockScmProvider

type MockScmProvider struct {
	MountRes          *MountResponse
	MountErr          error
	UnmountRes        *MountResponse
	UnmountErr        error
	FormatRes         *ScmFormatResponse
	FormatErr         error
	CheckFormatRes    *ScmFormatResponse
	CheckFormatErr    error
	ScanRes           *ScmScanResponse
	ScanErr           error
	PrepareRes        *ScmPrepareResponse
	PrepareErr        error
	FirmwareQueryRes  *ScmFirmwareQueryResponse
	FirmwareQueryErr  error
	FirmwareUpdateRes *ScmFirmwareUpdateResponse
	FirmwareUpdateErr error
}

MockScmProvider defines a mock version of an ScmProvider.

func (*MockScmProvider) CheckFormat

func (*MockScmProvider) Format

func (*MockScmProvider) Mount

func (*MockScmProvider) Prepare

func (*MockScmProvider) QueryFirmware

func (*MockScmProvider) Scan

func (*MockScmProvider) Unmount

func (*MockScmProvider) UpdateFirmware

type MountProvider

type MountProvider interface {
	Mount(MountRequest) (*MountResponse, error)
	Unmount(MountRequest) (*MountResponse, error)
	IsMounted(string) (bool, error)
	ClearMountpoint(string) error
	MakeMountPath(path string, tgtUID, tgtGID int) error
}

MountProvider defines an interface to be implemented by a mount/unmount provider.

type MountRequest

type MountRequest struct {
	Source     string
	Target     string
	Filesystem string
	Flags      uintptr
	Options    string
}

MountRequest represents a generic storage mount/unmount request.

type MountResponse

type MountResponse struct {
	Target  string
	Mounted bool
}

MountResponse indicates a successful mount or unmount operation on a generic device.

type NVMeDeviceFirmwareQueryResult

type NVMeDeviceFirmwareQueryResult struct {
	Device NvmeController
}

NVMeDeviceFirmwareQueryResult represents the result of a firmware query for a specific NVMe controller.

type NVMeDeviceFirmwareUpdateResult

type NVMeDeviceFirmwareUpdateResult struct {
	Device NvmeController
	Error  string
}

NVMeDeviceFirmwareUpdateResult represents the result of a firmware update for a specific NVMe controller.

type NVMeFirmwareForwarder

type NVMeFirmwareForwarder struct {
	pbin.Forwarder
}

NVMeFirmwareForwarder forwards firmware requests to a privileged binary.

func NewNVMeFirmwareForwarder

func NewNVMeFirmwareForwarder(log logging.Logger) *NVMeFirmwareForwarder

NewNVMeFirmwareForwarder returns a new bdev FirmwareForwarder.

func (*NVMeFirmwareForwarder) QueryFirmware

QueryFirmware forwards a request to query firmware on the NVMe device.

func (*NVMeFirmwareForwarder) UpdateFirmware

UpdateFirmware forwards a request to update firmware on the NVMe device.

type NVMeFirmwareQueryRequest

type NVMeFirmwareQueryRequest struct {
	pbin.ForwardableRequest
	DeviceAddrs []string // requested device PCI addresses, empty for all
	ModelID     string   // filter devices by model ID
	FirmwareRev string   // filter devices by current FW revision
}

NVMeFirmwareQueryRequest defines the parameters for a Nvme firmware query.

type NVMeFirmwareQueryResponse

type NVMeFirmwareQueryResponse struct {
	Results []NVMeDeviceFirmwareQueryResult
}

NVMeFirmwareQueryResponse contains the results of the firmware query.

type NVMeFirmwareUpdateRequest

type NVMeFirmwareUpdateRequest struct {
	pbin.ForwardableRequest
	DeviceAddrs  []string // requested device PCI addresses, empty for all
	FirmwarePath string   // location of the firmware binary
	ModelID      string   // filter devices by model ID
	FirmwareRev  string   // filter devices by current FW revision
}

NVMeFirmwareUpdateRequest defines the parameters for a firmware update.

type NVMeFirmwareUpdateResponse

type NVMeFirmwareUpdateResponse struct {
	Results []NVMeDeviceFirmwareUpdateResult
}

NVMeFirmwareUpdateResponse contains the results of the firmware update.

type NvmeAioDevice

type NvmeAioDevice struct {
	Path string `json:"path"`
	Size uint64 `json:"size"` // in unit of bytes
}

NvmeAioDevice returns struct representing an emulated NVMe AIO device (file or kdev).

func MockNvmeAioFile

func MockNvmeAioFile(varIdx ...int32) *NvmeAioDevice

MockNvmeAioFile returns struct representing an emulated NVMe AIO-file device.

func MockNvmeAioKdev

func MockNvmeAioKdev(varIdx ...int32) *NvmeAioDevice

MockNvmeAioKdev returns struct representing an emulated NVMe AIO-kdev device.

type NvmeController

type NvmeController struct {
	Info        string           `json:"info"`
	Model       string           `json:"model"`
	Serial      string           `hash:"ignore" json:"serial"`
	PciAddr     string           `json:"pci_addr"`
	FwRev       string           `json:"fw_rev"`
	VendorID    string           `json:"vendor_id"`
	PciType     string           `json:"pci_type"`
	SocketID    int32            `json:"socket_id"`
	HealthStats *NvmeHealth      `json:"health_stats"`
	Namespaces  []*NvmeNamespace `hash:"set" json:"namespaces"`
	SmdDevices  []*SmdDevice     `hash:"set" json:"smd_devices"`
	NvmeState   NvmeDevState     `json:"dev_state"`
	LedState    LedState         `json:"led_state"`
}

NvmeController represents a NVMe device controller which includes health and namespace information and mirrors C.struct_ns_t.

func MockNvmeController

func MockNvmeController(varIdx ...int32) *NvmeController

MockNvmeController returns struct with examples values.

func (*NvmeController) Capacity

func (nc *NvmeController) Capacity() (tb uint64)

Capacity returns the cumulative total bytes of all namespace sizes.

func (NvmeController) Free

func (nc NvmeController) Free() (tb uint64)

Free returns the cumulative available bytes of unused blobstore clusters.

func (NvmeController) Total

func (nc NvmeController) Total() (tb uint64)

Total returns the cumulative total bytes of all blobstore clusters.

func (*NvmeController) UpdateSmd

func (nc *NvmeController) UpdateSmd(newDev *SmdDevice)

UpdateSmd adds or updates SMD device entry for an NVMe Controller.

type NvmeControllers

type NvmeControllers []*NvmeController

NvmeControllers is a type alias for []*NvmeController.

func MockNvmeControllers

func MockNvmeControllers(length int) NvmeControllers

MockNvmeControllers returns slice of example NvmeController structs with examples values.

func (NvmeControllers) Addresses

func (ncs NvmeControllers) Addresses() (*hardware.PCIAddressSet, error)

Addresses returns a hardware.PCIAddressSet pointer to controller addresses.

func (NvmeControllers) Capacity

func (ncs NvmeControllers) Capacity() (tb uint64)

Capacity returns the cumulative total bytes of all controller capacities.

func (NvmeControllers) Free

func (ncs NvmeControllers) Free() (tb uint64)

Free returns the cumulative available bytes of all blobstore clusters.

func (NvmeControllers) PercentUsage

func (ncs NvmeControllers) PercentUsage() string

PercentUsage returns the percentage of used storage space.

func (NvmeControllers) String

func (ncs NvmeControllers) String() string

func (NvmeControllers) Summary

func (ncs NvmeControllers) Summary() string

Summary reports accumulated storage space and the number of controllers.

func (NvmeControllers) Total

func (ncs NvmeControllers) Total() (tb uint64)

Total returns the cumulative total bytes of all controller blobstores.

func (*NvmeControllers) Update

func (ncs *NvmeControllers) Update(ctrlrs ...NvmeController)

Update adds or updates slice of NVMe Controllers.

type NvmeDevState

type NvmeDevState int32

NvmeDevState represents the operation state of an NVMe device.

const (
	NvmeStateUnknown NvmeDevState = iota
	NvmeStateNormal
	NvmeStateNew
	NvmeStateFaulty
	NvmeStateUnplugged
)

NvmeDevState values representing the operational device state.

func (NvmeDevState) MarshalJSON

func (nds NvmeDevState) MarshalJSON() ([]byte, error)

func (NvmeDevState) String

func (nds NvmeDevState) String() string

func (*NvmeDevState) UnmarshalJSON

func (nds *NvmeDevState) UnmarshalJSON(data []byte) error

type NvmeHealth

type NvmeHealth struct {
	Timestamp               uint64 `json:"timestamp"`
	TempWarnTime            uint32 `json:"warn_temp_time"`
	TempCritTime            uint32 `json:"crit_temp_time"`
	CtrlBusyTime            uint64 `json:"ctrl_busy_time"`
	PowerCycles             uint64 `json:"power_cycles"`
	PowerOnHours            uint64 `json:"power_on_hours"`
	UnsafeShutdowns         uint64 `json:"unsafe_shutdowns"`
	MediaErrors             uint64 `json:"media_errs"`
	ErrorLogEntries         uint64 `json:"err_log_entries"`
	ReadErrors              uint32 `json:"bio_read_errs"`
	WriteErrors             uint32 `json:"bio_write_errs"`
	UnmapErrors             uint32 `json:"bio_unmap_errs"`
	ChecksumErrors          uint32 `json:"checksum_errs"`
	Temperature             uint32 `json:"temperature"`
	TempWarn                bool   `json:"temp_warn"`
	AvailSpareWarn          bool   `json:"avail_spare_warn"`
	ReliabilityWarn         bool   `json:"dev_reliability_warn"`
	ReadOnlyWarn            bool   `json:"read_only_warn"`
	VolatileWarn            bool   `json:"volatile_mem_warn"`
	ProgFailCntNorm         uint8  `json:"program_fail_cnt_norm"`
	ProgFailCntRaw          uint64 `json:"program_fail_cnt_raw"`
	EraseFailCntNorm        uint8  `json:"erase_fail_cnt_norm"`
	EraseFailCntRaw         uint64 `json:"erase_fail_cnt_raw"`
	WearLevelingCntNorm     uint8  `json:"wear_leveling_cnt_norm"`
	WearLevelingCntMin      uint16 `json:"wear_leveling_cnt_min"`
	WearLevelingCntMax      uint16 `json:"wear_leveling_cnt_max"`
	WearLevelingCntAvg      uint16 `json:"wear_leveling_cnt_avg"`
	EndtoendErrCntRaw       uint64 `json:"endtoend_err_cnt_raw"`
	CrcErrCntRaw            uint64 `json:"crc_err_cnt_raw"`
	MediaWearRaw            uint64 `json:"media_wear_raw"`
	HostReadsRaw            uint64 `json:"host_reads_raw"`
	WorkloadTimerRaw        uint64 `json:"workload_timer_raw"`
	ThermalThrottleStatus   uint8  `json:"thermal_throttle_status"`
	ThermalThrottleEventCnt uint64 `json:"thermal_throttle_event_cnt"`
	RetryBufferOverflowCnt  uint64 `json:"retry_buffer_overflow_cnt"`
	PllLockLossCnt          uint64 `json:"pll_lock_loss_cnt"`
	NandBytesWritten        uint64 `json:"nand_bytes_written"`
	HostBytesWritten        uint64 `json:"host_bytes_written"`
	ClusterSize             uint64 `json:"cluster_size"`
	MetaWalSize             uint64 `json:"meta_wal_size"`
	RdbWalSize              uint64 `json:"rdb_wal_size"`
}

NvmeHealth represents a set of health statistics for a NVMe device and mirrors C.struct_nvme_stats.

func MockNvmeHealth

func MockNvmeHealth(varIdx ...int32) *NvmeHealth

MockNvmeHealth returns struct with examples values.

func (*NvmeHealth) TempC

func (nch *NvmeHealth) TempC() float32

TempC returns controller temperature in degrees Celsius.

func (*NvmeHealth) TempF

func (nch *NvmeHealth) TempF() float32

TempF returns controller temperature in degrees Fahrenheit.

func (*NvmeHealth) TempK

func (nch *NvmeHealth) TempK() uint32

TempK returns controller temperature in degrees Kelvin.

type NvmeNamespace

type NvmeNamespace struct {
	ID   uint32 `json:"id"`
	Size uint64 `json:"size"`
}

NvmeNamespace represents an individual NVMe namespace on a device and mirrors C.struct_ns_t.

func MockNvmeNamespace

func MockNvmeNamespace(varIdx ...int32) *NvmeNamespace

MockNvmeNamespace returns struct with examples values.

type OptionBits

type OptionBits uint16

OptionBits is a type alias representing option flags as a bitset.

func (*OptionBits) IsEmpty

func (obs *OptionBits) IsEmpty() bool

IsEmpty returns true if no options have been set.

type Provider

type Provider struct {
	sync.RWMutex

	Sys SystemProvider
	// contains filtered or unexported fields
}

Provider provides storage specific capabilities.

func DefaultProvider

func DefaultProvider(log logging.Logger, idx int, engineStorage *Config) *Provider

DefaultProvider returns a provider populated with default parameters.

func MockProvider

func MockProvider(log logging.Logger, idx int, engineStorage *Config, sys SystemProvider, scm ScmProvider, bdev BdevProvider, meta MetadataProvider) *Provider

func NewProvider

func NewProvider(log logging.Logger, idx int, engineStorage *Config, sys SystemProvider, scm ScmProvider, bdev BdevProvider, meta MetadataProvider) *Provider

NewProvider returns an initialized storage provider.

func (*Provider) BdevRoleMetaConfigured

func (p *Provider) BdevRoleMetaConfigured() bool

func (*Provider) ControlMetadataEnginePath

func (p *Provider) ControlMetadataEnginePath() string

ControlMetadataEnginePath returns the path where control plane metadata for the engine is stored.

func (*Provider) ControlMetadataIsMounted

func (p *Provider) ControlMetadataIsMounted() (bool, error)

ControlMetadataIsMounted determines whether the control metadata storage is already mounted.

func (*Provider) ControlMetadataNeedsFormat

func (p *Provider) ControlMetadataNeedsFormat() (bool, error)

ControlMetadataNeedsFormat checks whether we need to format the control metadata storage before using it.

func (*Provider) ControlMetadataPath

func (p *Provider) ControlMetadataPath() string

ControlMetadataPath returns the path where control plane metadata is stored.

func (*Provider) ControlMetadataPathConfigured

func (p *Provider) ControlMetadataPathConfigured() bool

ControlMetadataPathConfigured checks whether metadata section is defined

func (*Provider) FormatBdevTiers

func (p *Provider) FormatBdevTiers(ctrlrs NvmeControllers) (results []BdevTierFormatResult)

FormatBdevTiers formats all the Bdev tiers in the engine storage configuration.

func (*Provider) FormatControlMetadata

func (p *Provider) FormatControlMetadata(engineIdxs []uint) error

FormatControlMetadata formats the storage used for control metadata.

func (*Provider) FormatScm

func (p *Provider) FormatScm(force bool) error

FormatScm formats SCM based on provider config and force flag.

func (*Provider) GetBdevConfigs

func (p *Provider) GetBdevConfigs() []*TierConfig

GetBdevConfigs returns the Bdev tier configs.

func (*Provider) GetControlMetadata

func (p *Provider) GetControlMetadata() *ControlMetadata

func (*Provider) GetScmConfig

func (p *Provider) GetScmConfig() (*TierConfig, error)

GetScmConfig returns the only SCM tier config.

func (*Provider) GetScmUsage

func (p *Provider) GetScmUsage() (*ScmMountPoint, error)

GetScmUsage returns space utilization info for a mount point.

func (*Provider) HasBlockDevices

func (p *Provider) HasBlockDevices() bool

HasBlockDevices returns true if provider engine storage config has configured block devices.

func (*Provider) IsVMDEnabled

func (p *Provider) IsVMDEnabled() bool

IsVMDEnabled queries whether VMD is enabled on storage provider.

func (*Provider) MountControlMetadata

func (p *Provider) MountControlMetadata() error

MountControlMetadata mounts the storage for control metadata, if it is on a separate device.

func (*Provider) MountScm

func (p *Provider) MountScm() error

MountScm mounts SCM based on provider config.

func (*Provider) PrepareBdevs

func (p *Provider) PrepareBdevs(req BdevPrepareRequest) (*BdevPrepareResponse, error)

PrepareBdevs attempts to configure NVMe devices to be usable by DAOS.

func (*Provider) PrepareScm

func (p *Provider) PrepareScm(req ScmPrepareRequest) (*ScmPrepareResponse, error)

PrepareScm calls into storage SCM provider to attempt to configure PMem devices to be usable by DAOS.

func (*Provider) QueryBdevFirmware

func (p *Provider) QueryBdevFirmware(req NVMeFirmwareQueryRequest) (*NVMeFirmwareQueryResponse, error)

QueryBdevFirmware queries NVMe SSD firmware.

func (*Provider) QueryScmFirmware

func (p *Provider) QueryScmFirmware(req ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error)

QueryScmFirmware queries PMem SSD firmware.

func (*Provider) ScanBdevs

func (p *Provider) ScanBdevs(req BdevScanRequest) (*BdevScanResponse, error)

ScanBdevs calls into bdev storage provider to scan SSDs, always bypassing cache. Function should not be called when engines have been started and SSDs have been claimed by SPDK.

func (*Provider) ScanScm

func (p *Provider) ScanScm(req ScmScanRequest) (*ScmScanResponse, error)

ScanScm calls into storage SCM provider to discover PMem modules, namespaces and state.

func (*Provider) ScmIsMounted

func (p *Provider) ScmIsMounted() (bool, error)

ScmIsMounted returns true if SCM is mounted.

func (*Provider) ScmNeedsFormat

func (p *Provider) ScmNeedsFormat() (bool, error)

ScmNeedsFormat returns true if SCM is found to require formatting.

func (*Provider) UnmountTmpfs

func (p *Provider) UnmountTmpfs() error

UnmountTmpfs unmounts SCM based on provider config.

func (*Provider) UpdateBdevFirmware

func (p *Provider) UpdateBdevFirmware(req NVMeFirmwareUpdateRequest) (*NVMeFirmwareUpdateResponse, error)

UpdateBdevFirmware queries NVMe SSD firmware.

func (*Provider) UpdateScmFirmware

func (p *Provider) UpdateScmFirmware(req ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error)

UpdateScmFirmware queries PMem SSD firmware.

func (*Provider) WithVMDEnabled

func (p *Provider) WithVMDEnabled(b bool) *Provider

WithVMDEnabled enables VMD on storage provider.

func (*Provider) WriteNvmeConfig

func (p *Provider) WriteNvmeConfig(ctx context.Context, log logging.Logger, ctrlrs NvmeControllers) error

WriteNvmeConfig creates an NVMe config file which describes what devices should be used by a DAOS engine process.

type RamdiskParams

type RamdiskParams struct {
	Size             uint
	NUMANode         uint
	DisableHugepages bool
}

RamdiskParams defines the sub-parameters of a Format or Mount operation that will use tmpfs-based ramdisk

type ScmAdminForwarder

type ScmAdminForwarder struct {
	pbin.Forwarder
}

ScmAdminForwarder forwards requests to the DAOS admin binary.

func NewScmAdminForwarder

func NewScmAdminForwarder(log logging.Logger) *ScmAdminForwarder

NewScmAdminForwarder creates a new ScmAdminForwarder.

func (*ScmAdminForwarder) CheckFormat

CheckFormat forwards a request to check the SCM formatting.

func (*ScmAdminForwarder) Format

Format forwards a request request to format SCM.

func (*ScmAdminForwarder) Mount

Mount forwards an SCM mount request.

func (*ScmAdminForwarder) Prepare

Prepare forwards a request to prep the SCM.

func (*ScmAdminForwarder) Scan

Scan forwards an SCM scan request.

func (*ScmAdminForwarder) Unmount

Unmount forwards an SCM unmount request.

type ScmConfig

type ScmConfig struct {
	MountPoint       string   `yaml:"scm_mount,omitempty" cmdLongFlag:"--storage" cmdShortFlag:"-s"`
	RamdiskSize      uint     `yaml:"scm_size,omitempty"`
	DisableHugepages bool     `yaml:"scm_hugepages_disabled,omitempty"`
	DeviceList       []string `yaml:"scm_list,omitempty"`
	NumaNodeIndex    uint     `yaml:"-"`
}

ScmConfig represents a SCM (Storage Class Memory) configuration entry.

func (*ScmConfig) Validate

func (sc *ScmConfig) Validate(class Class) error

Validate sanity checks engine scm config parameters.

type ScmFirmwareInfo

type ScmFirmwareInfo struct {
	ActiveVersion     string
	StagedVersion     string
	ImageMaxSizeBytes uint32
	UpdateStatus      ScmFirmwareUpdateStatus
}

ScmFirmwareInfo describes the firmware information of an PMem module.

type ScmFirmwareQueryRequest

type ScmFirmwareQueryRequest struct {
	pbin.ForwardableRequest
	DeviceUIDs  []string // requested device UIDs, empty for all
	ModelID     string   // filter by model ID
	FirmwareRev string   // filter by current FW revision
}

ScmFirmwareQueryRequest defines the parameters for a firmware query.

type ScmFirmwareQueryResponse

type ScmFirmwareQueryResponse struct {
	Results []ScmModuleFirmware
}

ScmFirmwareQueryResponse contains the results of a successful firmware query.

type ScmFirmwareUpdateRequest

type ScmFirmwareUpdateRequest struct {
	pbin.ForwardableRequest
	DeviceUIDs   []string // requested device UIDs, empty for all
	FirmwarePath string   // location of the firmware binary
	ModelID      string   // filter devices by model ID
	FirmwareRev  string   // filter devices by current FW revision
}

ScmFirmwareUpdateRequest defines the parameters for a firmware update.

type ScmFirmwareUpdateResponse

type ScmFirmwareUpdateResponse struct {
	Results []ScmFirmwareUpdateResult
}

ScmFirmwareUpdateResponse contains the results of the firmware update.

type ScmFirmwareUpdateResult

type ScmFirmwareUpdateResult struct {
	Module ScmModule
	Error  string
}

ScmFirmwareUpdateResult represents the result of a firmware update for a specific PMem module.

type ScmFirmwareUpdateStatus

type ScmFirmwareUpdateStatus uint32

ScmFirmwareUpdateStatus represents the status of a firmware update on the module.

const (
	// ScmUpdateStatusUnknown indicates that the firmware update status is unknown.
	ScmUpdateStatusUnknown ScmFirmwareUpdateStatus = iota
	// ScmUpdateStatusStaged indicates that a new firmware version has been staged.
	ScmUpdateStatusStaged
	// ScmUpdateStatusSuccess indicates that the firmware update was successfully applied.
	ScmUpdateStatusSuccess
	// ScmUpdateStatusFailed indicates that the firmware update failed.
	ScmUpdateStatusFailed
)

func (ScmFirmwareUpdateStatus) String

func (s ScmFirmwareUpdateStatus) String() string

String translates the update status to a string

type ScmFormatRequest

type ScmFormatRequest struct {
	pbin.ForwardableRequest
	Force      bool
	Mountpoint string
	OwnerUID   int
	OwnerGID   int
	Ramdisk    *RamdiskParams
	Dcpm       *DeviceParams
}

ScmFormatRequest defines the parameters for a Format operation or query.

type ScmFormatResponse

type ScmFormatResponse struct {
	Mountpoint string
	Formatted  bool
	Mounted    bool
	Mountable  bool
}

ScmFormatResponse contains the results of a successful Format operation or query.

type ScmForwarder

type ScmForwarder struct {
	ScmAdminForwarder
	ScmFwForwarder
}

func NewScmForwarder

func NewScmForwarder(log logging.Logger) *ScmForwarder

type ScmFwForwarder

type ScmFwForwarder struct {
	pbin.Forwarder
}

ScmFwForwarder forwards firmware requests to a privileged binary.

func NewScmFwForwarder

func NewScmFwForwarder(log logging.Logger) *ScmFwForwarder

NewScmFwForwarder returns a new ScmFwForwarder.

func (*ScmFwForwarder) QueryFirmware

Query forwards an SCM firmware query request.

func (*ScmFwForwarder) UpdateFirmware

Update forwards a request to update firmware on the SCM.

type ScmModule

type ScmModule struct {
	ChannelID        uint32
	ChannelPosition  uint32
	ControllerID     uint32
	SocketID         uint32
	PhysicalID       uint32
	Capacity         uint64
	UID              string
	PartNumber       string
	FirmwareRevision string
	HealthState      string
}

ScmModule represents a PMem DIMM.

This is a simplified representation of the raw struct used in the ipmctl package.

func MockScmModule

func MockScmModule(varIdx ...int32) *ScmModule

MockScmModule returns struct with examples values.

func (*ScmModule) String

func (sm *ScmModule) String() string

type ScmModuleFirmware

type ScmModuleFirmware struct {
	Module ScmModule
	Info   *ScmFirmwareInfo
	Error  string
}

ScmModuleFirmware represents the results of a firmware query for a specific PMem module.

type ScmModules

type ScmModules []*ScmModule

ScmModules is a type alias for []ScmModule that implements fmt.Stringer.

func MockScmModules

func MockScmModules(length int) ScmModules

MockScmModules returns slice of example ScmModule structs with examples values.

func (ScmModules) Capacity

func (sms ScmModules) Capacity() (tb uint64)

Capacity reports total storage capacity (bytes) across all modules.

func (ScmModules) String

func (sms ScmModules) String() string

func (ScmModules) Summary

func (sms ScmModules) Summary() string

Summary reports total storage space and the number of modules.

Capacity given in IEC standard units.

type ScmMountPoint

type ScmMountPoint struct {
	Class       Class         `json:"class"`
	DeviceList  []string      `json:"device_list"`
	Info        string        `json:"info"`
	Path        string        `json:"path"`
	Rank        ranklist.Rank `json:"rank"`
	TotalBytes  uint64        `json:"total_bytes"`
	AvailBytes  uint64        `json:"avail_bytes"`
	UsableBytes uint64        `json:"usable_bytes"`
}

ScmMountPoint represents location PMem filesystem is mounted.

func MockScmMountPoint

func MockScmMountPoint(varIdx ...int32) *ScmMountPoint

MockScmMountPoint returns struct with examples values. Avoid creating mock with zero sizes.

type ScmMountPoints

type ScmMountPoints []*ScmMountPoint

ScmMountPoints is a type alias for []ScmMountPoint that implements fmt.Stringer.

type ScmMountRequest

type ScmMountRequest struct {
	pbin.ForwardableRequest
	Class   Class
	Device  string
	Target  string
	Ramdisk *RamdiskParams
}

ScmMountRequest represents an SCM mount request.

type ScmNamespace

type ScmNamespace struct {
	UUID        string         `json:"uuid" hash:"ignore"`
	BlockDevice string         `json:"blockdev"`
	Name        string         `json:"dev"`
	NumaNode    uint32         `json:"numa_node"`
	Size        uint64         `json:"size"`
	Mount       *ScmMountPoint `json:"mount"`
}

ScmNamespace is a block device exposing a PMem AppDirect region.

func MockScmNamespace

func MockScmNamespace(varIdx ...int32) *ScmNamespace

MockScmNamespace returns struct with examples values. Avoid creating mock with zero sizes.

func (ScmNamespace) Capacity

func (sn ScmNamespace) Capacity() uint64

Capacity reports total storage capacity (bytes) of PMem namespace (pmem block device).

func (ScmNamespace) Free

func (sn ScmNamespace) Free() uint64

Free returns the available free bytes on mounted PMem namespace as reported by OS.

func (*ScmNamespace) String

func (sn *ScmNamespace) String() string

func (ScmNamespace) Total

func (sn ScmNamespace) Total() uint64

Total returns the total bytes on mounted PMem namespace as reported by OS.

func (ScmNamespace) Usable

func (sn ScmNamespace) Usable() uint64

Free returns the available free bytes on mounted PMem namespace as reported by OS.

type ScmNamespaces

type ScmNamespaces []*ScmNamespace

ScmNamespaces is a type alias for a slice of ScmNamespace references.

func (ScmNamespaces) Capacity

func (sns ScmNamespaces) Capacity() (tb uint64)

Capacity reports total storage capacity (bytes) across all namespaces.

func (ScmNamespaces) Free

func (sns ScmNamespaces) Free() (tb uint64)

Free returns the cumulative available bytes on all mounted PMem namespaces.

func (ScmNamespaces) PercentUsage

func (sns ScmNamespaces) PercentUsage() string

PercentUsage returns the percentage of used storage space.

func (ScmNamespaces) String

func (sns ScmNamespaces) String() string

func (ScmNamespaces) Summary

func (sns ScmNamespaces) Summary() string

Summary reports total storage space and the number of namespaces.

Capacity given in IEC standard units.

func (ScmNamespaces) Total

func (sns ScmNamespaces) Total() (tb uint64)

Total returns the cumulative total bytes on all mounted PMem namespaces.

func (ScmNamespaces) Usable

func (sns ScmNamespaces) Usable() (tb uint64)

Free returns the cumulative effective available bytes on all mounted PMem namespaces.

type ScmPrepareRequest

type ScmPrepareRequest struct {
	pbin.ForwardableRequest
	Reset                 bool  // Clear PMem namespaces and regions.
	NrNamespacesPerSocket uint  // Request this many PMem namespaces per socket.
	SocketID              *uint // Only process PMem attached to this socket.
}

ScmPrepareRequest defines the parameters for a Prepare operation.

type ScmPrepareResponse

type ScmPrepareResponse struct {
	Socket         *ScmSocketState
	RebootRequired bool
	Namespaces     ScmNamespaces
}

ScmPrepareResponse contains the results of a successful Prepare operation.

type ScmProvider

ScmProvider defines an interface to be implemented by a PMem provider.

type ScmScanRequest

type ScmScanRequest struct {
	pbin.ForwardableRequest
	SocketID *uint // Only process PMem attached to this socket.
}

ScmScanRequest defines the parameters for a Scan operation.

type ScmScanResponse

type ScmScanResponse struct {
	Modules    ScmModules
	Namespaces ScmNamespaces
}

ScmScanResponse contains information gleaned during a successful Scan operation.

type ScmSocketState

type ScmSocketState struct {
	SocketID *uint // If set, state applies to a specific socket.
	State    ScmState
}

ScmSocketState indicates the state of PMem for either a specific socket or all sockets.

type ScmState

type ScmState int

ScmState represents the probed state of PMem modules on the system.

const (
	// ScmStateUnknown represents the default (unknown) state.
	ScmStateUnknown ScmState = iota
	// ScmNoRegions indicates that PMem modules exist, but no regions have been created.
	ScmNoRegions
	// ScmFreeCap indicates that PMem AppDirect regions have free capacity.
	ScmFreeCap
	// ScmNoFreeCap indicates that PMem AppDirect regions have no free capacity.
	ScmNoFreeCap
	// ScmNotInterleaved indicates that a PMem AppDirect region is in non-interleaved mode.
	ScmNotInterleaved
	// ScmNoModules indicates that no PMem modules exist.
	ScmNoModules
	// ScmNotHealthy indicates a PMem AppDirect region is showing health state as "Error".
	ScmNotHealthy
	// ScmPartFreeCap indicates a PMem AppDirect region has only partial free capacity.
	ScmPartFreeCap
	// ScmUnknownMode indicates a pMem AppDirect region is in an unsupported memory mode.
	ScmUnknownMode

	// MinRamdiskMem is the minimum amount of memory needed for each engine's tmpfs RAM-disk.
	MinRamdiskMem = humanize.GiByte * 4
)

func (ScmState) String

func (ss ScmState) String() string

type SmdDevice

type SmdDevice struct {
	UUID             string         `json:"uuid"`
	TargetIDs        []int32        `hash:"set" json:"tgt_ids"`
	Rank             ranklist.Rank  `json:"rank"`
	TotalBytes       uint64         `json:"total_bytes"`
	AvailBytes       uint64         `json:"avail_bytes"`
	UsableBytes      uint64         `json:"usable_bytes"`
	ClusterSize      uint64         `json:"cluster_size"`
	MetaSize         uint64         `json:"meta_size"`
	MetaWalSize      uint64         `json:"meta_wal_size"`
	RdbSize          uint64         `json:"rdb_size"`
	RdbWalSize       uint64         `json:"rdb_wal_size"`
	Roles            BdevRoles      `json:"roles"`
	HasSysXS         bool           `json:"has_sys_xs"`
	Ctrlr            NvmeController `json:"ctrlr"`
	CtrlrNamespaceID uint32         `json:"ctrlr_namespace_id"`
}

SmdDevice contains DAOS storage device information, including health details if requested.

func MockSmdDevice

func MockSmdDevice(c *NvmeController, varIdx ...int32) *SmdDevice

MockSmdDevice returns struct with examples values.

func (*SmdDevice) MarshalJSON

func (sd *SmdDevice) MarshalJSON() ([]byte, error)

MarshalJSON handles the special case where native SmdDevice converts BdevRoles to bitmask in proto SmdDevice type. Native BdevRoles type en/decodes to/from human readable JSON strings.

func (*SmdDevice) String

func (sd *SmdDevice) String() string

func (*SmdDevice) UnmarshalJSON

func (sd *SmdDevice) UnmarshalJSON(data []byte) error

UnmarshalJSON handles the special case where proto SmdDevice converts BdevRoles bitmask to native BdevRoles type. Native BdevRoles type en/decodes to/from human readable JSON strings.

type SpdkRpcServer

type SpdkRpcServer struct {
	Enable   bool   `yaml:"enable,omitempty" json:"enable"`
	SockAddr string `yaml:"sock_addr,omitempty" json:"sock_addr"`
}

SpdkRpcServer struct describes settings for an optional SPDK JSON-RPC server instance that can run in the engine process.

type SystemProvider

type SystemProvider interface {
	system.IsMountedProvider
	system.MountProvider
	GetfsUsage(string) (uint64, uint64, error)
	Mkfs(system.MkfsReq) error
}

SystemProvider provides operating system capabilities.

type TierConfig

type TierConfig struct {
	Tier  int        `yaml:"-"`
	Class Class      `yaml:"class"`
	Scm   ScmConfig  `yaml:",inline"`
	Bdev  BdevConfig `yaml:",inline"`
}

func NewTierConfig

func NewTierConfig() *TierConfig

func (*TierConfig) IsBdev

func (tc *TierConfig) IsBdev() bool

func (*TierConfig) IsSCM

func (tc *TierConfig) IsSCM() bool

func (*TierConfig) SetNumaNodeIndex

func (tc *TierConfig) SetNumaNodeIndex(idx uint)

SetNumaNodeIndex sets the NUMA node index for the tier.

func (*TierConfig) Validate

func (tc *TierConfig) Validate() error

func (*TierConfig) WithBdevBusidRange

func (tc *TierConfig) WithBdevBusidRange(rangeStr string) *TierConfig

WithBdevBusidRange sets the bus-ID range to be used to filter hot plug events.

func (*TierConfig) WithBdevDeviceCount

func (tc *TierConfig) WithBdevDeviceCount(count int) *TierConfig

WithBdevDeviceCount sets the number of devices to be created when BdevClass is malloc.

func (*TierConfig) WithBdevDeviceList

func (tc *TierConfig) WithBdevDeviceList(devices ...string) *TierConfig

WithBdevDeviceList sets the list of block devices to be used.

func (*TierConfig) WithBdevDeviceRoles

func (tc *TierConfig) WithBdevDeviceRoles(bits int) *TierConfig

WithBdevDeviceRoles sets the role assignments for the bdev tier.

func (*TierConfig) WithBdevFileSize

func (tc *TierConfig) WithBdevFileSize(size int) *TierConfig

WithBdevFileSize sets the backing file size (used when BdevClass is malloc or file).

func (*TierConfig) WithNumaNodeIndex

func (tc *TierConfig) WithNumaNodeIndex(idx uint) *TierConfig

WithNumaNodeIndex sets the NUMA node index to be used for this tier.

func (*TierConfig) WithScmDeviceList

func (tc *TierConfig) WithScmDeviceList(devices ...string) *TierConfig

WithScmDeviceList sets the list of devices to be used for SCM storage.

func (*TierConfig) WithScmDisableHugepages

func (tc *TierConfig) WithScmDisableHugepages() *TierConfig

WithScmDisableHugepages disables hugepages for tmpfs.

func (*TierConfig) WithScmMountPoint

func (tc *TierConfig) WithScmMountPoint(scmPath string) *TierConfig

WithScmMountPoint sets the path to the device used for SCM storage.

func (*TierConfig) WithScmRamdiskSize

func (tc *TierConfig) WithScmRamdiskSize(size uint) *TierConfig

WithScmRamdiskSize sets the size (in GiB) of the ramdisk used to emulate SCM (no effect if ScmClass is not RAM).

func (*TierConfig) WithStorageClass

func (tc *TierConfig) WithStorageClass(cls string) *TierConfig

WithStorageClass defines the type of storage (scm or bdev) to be configured.

func (*TierConfig) WithTier

func (tc *TierConfig) WithTier(tier int) *TierConfig

type TierConfigs

type TierConfigs []*TierConfig

func (TierConfigs) AssignBdevTierRoles

func (tcs TierConfigs) AssignBdevTierRoles(extMetadataPath string) error

Set NVME class tier roles either based on explicit settings or heuristics.

Role assignments will be decided based on the following rule set:

  • For 1 bdev tier, all roles will be assigned to that tier.
  • For 2 bdev tiers, WAL role will be assigned to the first bdev tier and Meta and Data to the second bdev tier (Wal+Data is an invalid combination).
  • For 3 bdev tiers, WAL role will be assigned to the first bdev tier, Meta to the second bdev tier and Data to the third bdev tier.
  • For any more than 3 bdev tiers, an error will be returned.
  • If the scm tier is of class dcpm, no roles should be assigned and error should be returned.
  • If emulated NVMe is present in bdev tiers, implicit role assignment is skipped.

func (TierConfigs) BdevConfigs

func (tcs TierConfigs) BdevConfigs() (out TierConfigs)

func (TierConfigs) Bdevs

func (tcs TierConfigs) Bdevs() *BdevDeviceList

func (TierConfigs) HasBdevRoleMeta

func (tcs TierConfigs) HasBdevRoleMeta() bool

func (TierConfigs) HaveBdevs

func (tcs TierConfigs) HaveBdevs() bool

func (TierConfigs) HaveEmulatedNVMe

func (tcs TierConfigs) HaveEmulatedNVMe() bool

func (TierConfigs) HaveRealNVMe

func (tcs TierConfigs) HaveRealNVMe() bool

func (TierConfigs) NVMeBdevs

func (tcs TierConfigs) NVMeBdevs() *BdevDeviceList

func (TierConfigs) ScmConfigs

func (tcs TierConfigs) ScmConfigs() (out TierConfigs)

func (*TierConfigs) UnmarshalYAML

func (tcs *TierConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error

func (TierConfigs) Validate

func (tcs TierConfigs) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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