Documentation ¶
Index ¶
- Constants
- Variables
- func CalcMemForRamdiskSize(log logging.Logger, ramdiskSize, memHuge, memSys uint64, ...) (uint64, error)
- func CalcMinHugepages(hugepageSizeKb int, numTargets int) (int, error)
- func CalcRamdiskSize(log logging.Logger, memTotal, memHuge, memSys uint64, tgtCount, engCount int) (uint64, error)
- func ControlMetadataEngineDir(mdPath string, engineIdx uint) string
- func FaultBdevAccelEngineUnknown(input string, options ...string) *fault.Fault
- func FaultBdevConfigBadNrRoles(role string, gotNr, wantNr int) *fault.Fault
- func FaultBdevConfigOptFlagUnknown(input string, options ...string) *fault.Fault
- func FaultBdevNotFound(vmdEnabled bool, bdevs ...string) *fault.Fault
- func FaultConfigRamdiskUnderMinMem(confSize, memRamdiskMin uint64) *fault.Fault
- func FaultDeviceWithFsNoMountpoint(dev, tgt string) *fault.Fault
- func FaultPathAccessDenied(path string) *fault.Fault
- func FaultRamdiskBadSize(existingSize, calcSize uint64) *fault.Fault
- func FaultRamdiskLowMem(memType string, confRamdiskSize, memNeed, memHave uint64) *fault.Fault
- func FaultScmInvalidPMem(msg string) *fault.Fault
- func FaultScmNotHealthy(sockID uint) *fault.Fault
- func FaultScmNotInterleaved(sockID uint) *fault.Fault
- func FaultScmPartialCapacity(sockID uint) *fault.Fault
- func FaultScmUnknownMemoryMode(sockID uint) *fault.Fault
- func MockGetTopology(context.Context) (*hardware.Topology, error)
- type AccelOptionBits
- type AccelProps
- type BdevAdminForwarder
- func (f *BdevAdminForwarder) Format(req BdevFormatRequest) (*BdevFormatResponse, error)
- func (f *BdevAdminForwarder) Prepare(req BdevPrepareRequest) (*BdevPrepareResponse, error)
- func (f *BdevAdminForwarder) Scan(req BdevScanRequest) (*BdevScanResponse, error)
- func (f *BdevAdminForwarder) SendReq(method string, fwdReq interface{}, fwdRes interface{}) error
- func (f *BdevAdminForwarder) WriteConfig(req BdevWriteConfigRequest) (*BdevWriteConfigResponse, error)
- type BdevAutoFaulty
- type BdevBusRange
- type BdevConfig
- type BdevDeviceFormatRequest
- type BdevDeviceFormatResponse
- type BdevDeviceFormatResponses
- type BdevDeviceList
- func (bdl *BdevDeviceList) Devices() []string
- func (bdl *BdevDeviceList) Equals(other *BdevDeviceList) bool
- func (bdl *BdevDeviceList) Len() int
- func (bdl *BdevDeviceList) MarshalJSON() ([]byte, error)
- func (bdl *BdevDeviceList) MarshalYAML() (interface{}, error)
- func (bdl *BdevDeviceList) PCIAddressSetPtr() *hardware.PCIAddressSet
- func (bdl *BdevDeviceList) String() string
- func (bdl *BdevDeviceList) UnmarshalJSON(data []byte) error
- func (bdl *BdevDeviceList) UnmarshalYAML(unmarshal func(interface{}) error) error
- type BdevFormatRequest
- type BdevFormatResponse
- type BdevForwarder
- type BdevPrepareRequest
- type BdevPrepareResponse
- type BdevProvider
- type BdevRoles
- type BdevScanRequest
- type BdevScanResponse
- type BdevTierFormatResult
- type BdevTierProperties
- type BdevTierScanResult
- type BdevWriteConfigRequest
- type BdevWriteConfigResponse
- type Class
- type Config
- type ControlMetadata
- type DeviceParams
- type LedState
- type MetadataFormatRequest
- type MetadataForwarder
- func (f *MetadataForwarder) Format(req MetadataFormatRequest) error
- func (f *MetadataForwarder) Mount(req MetadataMountRequest) (*MountResponse, error)
- func (f *MetadataForwarder) NeedsFormat(req MetadataFormatRequest) (bool, error)
- func (f *MetadataForwarder) Unmount(req MetadataMountRequest) (*MountResponse, error)
- type MetadataMountRequest
- type MetadataProvider
- type MockMetadataProvider
- func (m *MockMetadataProvider) Format(_ MetadataFormatRequest) error
- func (m *MockMetadataProvider) Mount(_ MetadataMountRequest) (*MountResponse, error)
- func (m *MockMetadataProvider) NeedsFormat(MetadataFormatRequest) (bool, error)
- func (m *MockMetadataProvider) Unmount(MetadataMountRequest) (*MountResponse, error)
- type MockMountProvider
- func (m *MockMountProvider) ClearMountpoint(_ string) error
- func (m *MockMountProvider) GetMountOpts(target string) (string, bool)
- func (m *MockMountProvider) IsMounted(target string) (bool, error)
- func (m *MockMountProvider) MakeMountPath(_ string, _, _ int) error
- func (m *MockMountProvider) Mount(req MountRequest) (*MountResponse, error)
- func (m *MockMountProvider) Unmount(req MountRequest) (*MountResponse, error)
- type MockMountProviderConfig
- type MockScmProvider
- func (m *MockScmProvider) CheckFormat(ScmFormatRequest) (*ScmFormatResponse, error)
- func (m *MockScmProvider) Format(ScmFormatRequest) (*ScmFormatResponse, error)
- func (m *MockScmProvider) Mount(ScmMountRequest) (*MountResponse, error)
- func (m *MockScmProvider) Prepare(ScmPrepareRequest) (*ScmPrepareResponse, error)
- func (m *MockScmProvider) QueryFirmware(ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error)
- func (m *MockScmProvider) Scan(ScmScanRequest) (*ScmScanResponse, error)
- func (m *MockScmProvider) Unmount(ScmMountRequest) (*MountResponse, error)
- func (m *MockScmProvider) UpdateFirmware(ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error)
- type MountProvider
- type MountRequest
- type MountResponse
- type NVMeDeviceFirmwareQueryResult
- type NVMeDeviceFirmwareUpdateResult
- type NVMeFirmwareForwarder
- type NVMeFirmwareQueryRequest
- type NVMeFirmwareQueryResponse
- type NVMeFirmwareUpdateRequest
- type NVMeFirmwareUpdateResponse
- type NvmeAioDevice
- type NvmeController
- type NvmeControllers
- func (ncs NvmeControllers) Addresses() (*hardware.PCIAddressSet, error)
- func (ncs NvmeControllers) Capacity() (tb uint64)
- func (ncs NvmeControllers) Free() (tb uint64)
- func (ncs NvmeControllers) PercentUsage() string
- func (ncs NvmeControllers) String() string
- func (ncs NvmeControllers) Summary() string
- func (ncs NvmeControllers) Total() (tb uint64)
- func (ncs *NvmeControllers) Update(ctrlrs ...NvmeController)
- type NvmeDevState
- type NvmeHealth
- type NvmeNamespace
- type OptionBits
- type Provider
- func (p *Provider) BdevRoleMetaConfigured() bool
- func (p *Provider) ControlMetadataEnginePath() string
- func (p *Provider) ControlMetadataIsMounted() (bool, error)
- func (p *Provider) ControlMetadataNeedsFormat() (bool, error)
- func (p *Provider) ControlMetadataPath() string
- func (p *Provider) ControlMetadataPathConfigured() bool
- func (p *Provider) FormatBdevTiers(ctrlrs NvmeControllers) (results []BdevTierFormatResult)
- func (p *Provider) FormatControlMetadata(engineIdxs []uint) error
- func (p *Provider) FormatScm(force bool) error
- func (p *Provider) GetBdevConfigs() []*TierConfig
- func (p *Provider) GetControlMetadata() *ControlMetadata
- func (p *Provider) GetScmConfig() (*TierConfig, error)
- func (p *Provider) GetScmUsage() (*ScmMountPoint, error)
- func (p *Provider) HasBlockDevices() bool
- func (p *Provider) IsVMDEnabled() bool
- func (p *Provider) MountControlMetadata() error
- func (p *Provider) MountScm() error
- func (p *Provider) PrepareBdevs(req BdevPrepareRequest) (*BdevPrepareResponse, error)
- func (p *Provider) PrepareScm(req ScmPrepareRequest) (*ScmPrepareResponse, error)
- func (p *Provider) QueryBdevFirmware(req NVMeFirmwareQueryRequest) (*NVMeFirmwareQueryResponse, error)
- func (p *Provider) QueryScmFirmware(req ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error)
- func (p *Provider) ScanBdevs(req BdevScanRequest) (*BdevScanResponse, error)
- func (p *Provider) ScanScm(req ScmScanRequest) (*ScmScanResponse, error)
- func (p *Provider) ScmIsMounted() (bool, error)
- func (p *Provider) ScmNeedsFormat() (bool, error)
- func (p *Provider) UnmountTmpfs() error
- func (p *Provider) UpdateBdevFirmware(req NVMeFirmwareUpdateRequest) (*NVMeFirmwareUpdateResponse, error)
- func (p *Provider) UpdateScmFirmware(req ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error)
- func (p *Provider) WithVMDEnabled(b bool) *Provider
- func (p *Provider) WriteNvmeConfig(ctx context.Context, log logging.Logger, ctrlrs NvmeControllers) error
- type RamdiskParams
- type ScmAdminForwarder
- func (f *ScmAdminForwarder) CheckFormat(req ScmFormatRequest) (*ScmFormatResponse, error)
- func (f *ScmAdminForwarder) Format(req ScmFormatRequest) (*ScmFormatResponse, error)
- func (f *ScmAdminForwarder) Mount(req ScmMountRequest) (*MountResponse, error)
- func (f *ScmAdminForwarder) Prepare(req ScmPrepareRequest) (*ScmPrepareResponse, error)
- func (f *ScmAdminForwarder) Scan(req ScmScanRequest) (*ScmScanResponse, error)
- func (f *ScmAdminForwarder) Unmount(req ScmMountRequest) (*MountResponse, error)
- type ScmConfig
- type ScmFirmwareInfo
- type ScmFirmwareQueryRequest
- type ScmFirmwareQueryResponse
- type ScmFirmwareUpdateRequest
- type ScmFirmwareUpdateResponse
- type ScmFirmwareUpdateResult
- type ScmFirmwareUpdateStatus
- type ScmFormatRequest
- type ScmFormatResponse
- type ScmForwarder
- type ScmFwForwarder
- type ScmModule
- type ScmModuleFirmware
- type ScmModules
- type ScmMountPoint
- type ScmMountPoints
- type ScmMountRequest
- type ScmNamespace
- type ScmNamespaces
- func (sns ScmNamespaces) Capacity() (tb uint64)
- func (sns ScmNamespaces) Free() (tb uint64)
- func (sns ScmNamespaces) PercentUsage() string
- func (sns ScmNamespaces) String() string
- func (sns ScmNamespaces) Summary() string
- func (sns ScmNamespaces) Total() (tb uint64)
- func (sns ScmNamespaces) Usable() (tb uint64)
- type ScmPrepareRequest
- type ScmPrepareResponse
- type ScmProvider
- type ScmScanRequest
- type ScmScanResponse
- type ScmSocketState
- type ScmState
- type SmdDevice
- type SpdkRpcServer
- type SystemProvider
- type TierConfig
- func (tc *TierConfig) IsBdev() bool
- func (tc *TierConfig) IsSCM() bool
- func (tc *TierConfig) SetNumaNodeIndex(idx uint)
- func (tc *TierConfig) Validate() error
- func (tc *TierConfig) WithBdevBusidRange(rangeStr string) *TierConfig
- func (tc *TierConfig) WithBdevDeviceCount(count int) *TierConfig
- func (tc *TierConfig) WithBdevDeviceList(devices ...string) *TierConfig
- func (tc *TierConfig) WithBdevDeviceRoles(bits int) *TierConfig
- func (tc *TierConfig) WithBdevFileSize(size int) *TierConfig
- func (tc *TierConfig) WithNumaNodeIndex(idx uint) *TierConfig
- func (tc *TierConfig) WithScmDeviceList(devices ...string) *TierConfig
- func (tc *TierConfig) WithScmDisableHugepages() *TierConfig
- func (tc *TierConfig) WithScmMountPoint(scmPath string) *TierConfig
- func (tc *TierConfig) WithScmRamdiskSize(size uint) *TierConfig
- func (tc *TierConfig) WithStorageClass(cls string) *TierConfig
- func (tc *TierConfig) WithTier(tier int) *TierConfig
- type TierConfigs
- func (tcs TierConfigs) AssignBdevTierRoles(extMetadataPath string) error
- func (tcs TierConfigs) BdevConfigs() (out TierConfigs)
- func (tcs TierConfigs) Bdevs() *BdevDeviceList
- func (tcs TierConfigs) HasBdevRoleMeta() bool
- func (tcs TierConfigs) HaveBdevs() bool
- func (tcs TierConfigs) HaveEmulatedNVMe() bool
- func (tcs TierConfigs) HaveRealNVMe() bool
- func (tcs TierConfigs) NVMeBdevs() *BdevDeviceList
- func (tcs TierConfigs) ScmConfigs() (out TierConfigs)
- func (tcs *TierConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (tcs TierConfigs) Validate() error
Constants ¶
const ( BdevPciAddrSep = " " NilBdevAddress = "<nil>" )
BdevPciAddrSep defines the separator used between PCI addresses in string lists.
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.
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.
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).
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" )
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" )
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.
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" )
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 ¶
var ( ErrInvalidDcpmCount = errors.New("expected exactly 1 DCPM device") ErrNoScmTiers = errors.New("expected exactly 1 SCM tier in storage configuration") )
var ( // 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") // 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") )
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") )
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 ¶
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 ¶
ControlMetadataEngineDir generates a properly formatted path to engine specific control plane metadata.
func FaultBdevAccelEngineUnknown ¶
FaultBdevAccelEngineUnknown creates a Fault when an unrecognized acceleration engine setting is detected.
func FaultBdevConfigBadNrRoles ¶
FaultBdevConfigBadNrRoles creates a Fault when an unexpected number of roles have been assigned to bdev tiers.
func FaultBdevConfigOptFlagUnknown ¶
FaultBdevConfigOptFlagUnknown creates a Fault when an unrecognized option flag (string) is detected in the engine storage section of the config file.
func FaultBdevNotFound ¶
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 ¶
FaultConfigRamdiskUnderMinMem indicates that the tmpfs size requested in config is less than minimum allowed.
func FaultDeviceWithFsNoMountpoint ¶
FaultDeviceWithFsNoMountpoint creates a Fault for the case where a mount device is missing respective target location.
func FaultPathAccessDenied ¶
FaultPathAccessDenied represents an error where a mount point or device path for a storage target is inaccessible because of a permissions issue.
func FaultRamdiskBadSize ¶
FaultRamdiskBadSize indicates that the already-mounted ramdisk is out of spec with the calculated ramdisk size for the engine.
func FaultRamdiskLowMem ¶
FaultRamdiskLowMem indicates that total RAM is insufficient to support given configuration.
func FaultScmInvalidPMem ¶
FaultScmInvalidPMem creates a fault for the case where PMem validation has failed.
func FaultScmNotHealthy ¶
FaultScmNotHealthy creates a fault for the case where the PMem region is in an unhealthy state.
func FaultScmNotInterleaved ¶
FaultScmNotInterleaved creates a fault for the case where the PMem region is in non-interleaved mode, this is unsupported.
func FaultScmPartialCapacity ¶
FaultScmPartialCapacity creates a fault for the case where the PMem region has only partial free capacity, this is unsupported.
func FaultScmUnknownMemoryMode ¶
FaultScmUnknownMemoryMode creates a Fault for the case where the PMem region has an unsupported persistent memory type (not AppDirect).
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 ¶
func NewBdevAdminForwarder ¶
func NewBdevAdminForwarder(log logging.Logger) *BdevAdminForwarder
func (*BdevAdminForwarder) Format ¶
func (f *BdevAdminForwarder) Format(req BdevFormatRequest) (*BdevFormatResponse, error)
func (*BdevAdminForwarder) Prepare ¶
func (f *BdevAdminForwarder) Prepare(req BdevPrepareRequest) (*BdevPrepareResponse, error)
func (*BdevAdminForwarder) Scan ¶
func (f *BdevAdminForwarder) Scan(req BdevScanRequest) (*BdevScanResponse, error)
func (*BdevAdminForwarder) SendReq ¶
func (f *BdevAdminForwarder) SendReq(method string, fwdReq interface{}, fwdRes interface{}) error
func (*BdevAdminForwarder) WriteConfig ¶
func (f *BdevAdminForwarder) WriteConfig(req BdevWriteConfigRequest) (*BdevWriteConfigResponse, error)
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 ¶
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 ¶
BdevDeviceFormatRequest designs the parameters for a device-specific format.
type BdevDeviceFormatResponse ¶
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 ¶
BdevPrepareResponse contains the results of a successful Prepare operation.
type BdevProvider ¶
type BdevProvider interface { Prepare(BdevPrepareRequest) (*BdevPrepareResponse, error) Scan(BdevScanRequest) (*BdevScanResponse, error) Format(BdevFormatRequest) (*BdevFormatResponse, error) WriteConfig(BdevWriteConfigRequest) (*BdevWriteConfigResponse, error) QueryFirmware(NVMeFirmwareQueryRequest) (*NVMeFirmwareQueryResponse, error) UpdateFirmware(NVMeFirmwareUpdateRequest) (*NVMeFirmwareUpdateResponse, error) }
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 ¶
MarshalJSON represents roles as user readable string.
func (BdevRoles) MarshalYAML ¶
func (*BdevRoles) UnmarshalJSON ¶
UnmarshalJSON decodes user readable roles string into bitmask.
func (*BdevRoles) UnmarshalYAML ¶
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) UnmarshalYAML ¶
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 ¶
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 (*LedState) UnmarshalJSON ¶
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 ¶
MetadataForwarder forwards requests to the DAOS admin binary.
func NewMetadataForwarder ¶
func NewMetadataForwarder(log logging.Logger) *MetadataForwarder
NewMetadataForwarder creates a new MetadataForwarder.
func (*MetadataForwarder) Format ¶
func (f *MetadataForwarder) Format(req MetadataFormatRequest) error
Format forwards a request request to format a metadata device.
func (*MetadataForwarder) Mount ¶
func (f *MetadataForwarder) Mount(req MetadataMountRequest) (*MountResponse, error)
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 ¶
func (f *MetadataForwarder) Unmount(req MetadataMountRequest) (*MountResponse, error)
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 ¶
func (m *MockMetadataProvider) Format(_ MetadataFormatRequest) error
Format mocks a MetadataProvider format call.
func (*MockMetadataProvider) Mount ¶
func (m *MockMetadataProvider) Mount(_ MetadataMountRequest) (*MountResponse, error)
Mount mocks a MetadataProvider mount call.
func (*MockMetadataProvider) NeedsFormat ¶
func (m *MockMetadataProvider) NeedsFormat(MetadataFormatRequest) (bool, error)
NeedsFormat mocks a MetadataProvider format check.
func (*MockMetadataProvider) Unmount ¶
func (m *MockMetadataProvider) Unmount(MetadataMountRequest) (*MountResponse, error)
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 ¶
func (m *MockMountProvider) Mount(req MountRequest) (*MountResponse, error)
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 (m *MockScmProvider) CheckFormat(ScmFormatRequest) (*ScmFormatResponse, error)
func (*MockScmProvider) Format ¶
func (m *MockScmProvider) Format(ScmFormatRequest) (*ScmFormatResponse, error)
func (*MockScmProvider) Mount ¶
func (m *MockScmProvider) Mount(ScmMountRequest) (*MountResponse, error)
func (*MockScmProvider) Prepare ¶
func (m *MockScmProvider) Prepare(ScmPrepareRequest) (*ScmPrepareResponse, error)
func (*MockScmProvider) QueryFirmware ¶
func (m *MockScmProvider) QueryFirmware(ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error)
func (*MockScmProvider) Scan ¶
func (m *MockScmProvider) Scan(ScmScanRequest) (*ScmScanResponse, error)
func (*MockScmProvider) Unmount ¶
func (m *MockScmProvider) Unmount(ScmMountRequest) (*MountResponse, error)
func (*MockScmProvider) UpdateFirmware ¶
func (m *MockScmProvider) UpdateFirmware(ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error)
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 ¶
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 ¶
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 ¶
func (f *NVMeFirmwareForwarder) QueryFirmware(req NVMeFirmwareQueryRequest) (*NVMeFirmwareQueryResponse, error)
QueryFirmware forwards a request to query firmware on the NVMe device.
func (*NVMeFirmwareForwarder) UpdateFirmware ¶
func (f *NVMeFirmwareForwarder) UpdateFirmware(req NVMeFirmwareUpdateRequest) (*NVMeFirmwareUpdateResponse, error)
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 ¶
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 ¶
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 (*Provider) ControlMetadataEnginePath ¶
ControlMetadataEnginePath returns the path where control plane metadata for the engine is stored.
func (*Provider) ControlMetadataIsMounted ¶
ControlMetadataIsMounted determines whether the control metadata storage is already mounted.
func (*Provider) ControlMetadataNeedsFormat ¶
ControlMetadataNeedsFormat checks whether we need to format the control metadata storage before using it.
func (*Provider) ControlMetadataPath ¶
ControlMetadataPath returns the path where control plane metadata is stored.
func (*Provider) ControlMetadataPathConfigured ¶
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 ¶
FormatControlMetadata formats the storage used for control metadata.
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 ¶
HasBlockDevices returns true if provider engine storage config has configured block devices.
func (*Provider) IsVMDEnabled ¶
IsVMDEnabled queries whether VMD is enabled on storage provider.
func (*Provider) MountControlMetadata ¶
MountControlMetadata mounts the storage for control metadata, if it is on a separate device.
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 ¶
ScmIsMounted returns true if SCM is mounted.
func (*Provider) ScmNeedsFormat ¶
ScmNeedsFormat returns true if SCM is found to require formatting.
func (*Provider) UnmountTmpfs ¶
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 ¶
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 ¶
RamdiskParams defines the sub-parameters of a Format or Mount operation that will use tmpfs-based ramdisk
type ScmAdminForwarder ¶
ScmAdminForwarder forwards requests to the DAOS admin binary.
func NewScmAdminForwarder ¶
func NewScmAdminForwarder(log logging.Logger) *ScmAdminForwarder
NewScmAdminForwarder creates a new ScmAdminForwarder.
func (*ScmAdminForwarder) CheckFormat ¶
func (f *ScmAdminForwarder) CheckFormat(req ScmFormatRequest) (*ScmFormatResponse, error)
CheckFormat forwards a request to check the SCM formatting.
func (*ScmAdminForwarder) Format ¶
func (f *ScmAdminForwarder) Format(req ScmFormatRequest) (*ScmFormatResponse, error)
Format forwards a request request to format SCM.
func (*ScmAdminForwarder) Mount ¶
func (f *ScmAdminForwarder) Mount(req ScmMountRequest) (*MountResponse, error)
Mount forwards an SCM mount request.
func (*ScmAdminForwarder) Prepare ¶
func (f *ScmAdminForwarder) Prepare(req ScmPrepareRequest) (*ScmPrepareResponse, error)
Prepare forwards a request to prep the SCM.
func (*ScmAdminForwarder) Scan ¶
func (f *ScmAdminForwarder) Scan(req ScmScanRequest) (*ScmScanResponse, error)
Scan forwards an SCM scan request.
func (*ScmAdminForwarder) Unmount ¶
func (f *ScmAdminForwarder) Unmount(req ScmMountRequest) (*MountResponse, error)
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.
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 ¶
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 ¶
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 ¶
ScmFwForwarder forwards firmware requests to a privileged binary.
func NewScmFwForwarder ¶
func NewScmFwForwarder(log logging.Logger) *ScmFwForwarder
NewScmFwForwarder returns a new ScmFwForwarder.
func (*ScmFwForwarder) QueryFirmware ¶
func (f *ScmFwForwarder) QueryFirmware(req ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error)
Query forwards an SCM firmware query request.
func (*ScmFwForwarder) UpdateFirmware ¶
func (f *ScmFwForwarder) UpdateFirmware(req ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error)
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 ¶
MockScmModule returns struct with examples values.
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 ¶
type ScmProvider interface { Mount(ScmMountRequest) (*MountResponse, error) Unmount(ScmMountRequest) (*MountResponse, error) Format(ScmFormatRequest) (*ScmFormatResponse, error) CheckFormat(ScmFormatRequest) (*ScmFormatResponse, error) Scan(ScmScanRequest) (*ScmScanResponse, error) Prepare(ScmPrepareRequest) (*ScmPrepareResponse, error) QueryFirmware(ScmFirmwareQueryRequest) (*ScmFirmwareQueryResponse, error) UpdateFirmware(ScmFirmwareUpdateRequest) (*ScmFirmwareUpdateResponse, error) }
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 )
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 ¶
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) UnmarshalJSON ¶
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 GetfsUsage(string) (uint64, uint64, error) ReadFile(string) ([]byte, 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