config

package
v0.0.0-...-f2e4893 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: BSD-2-Clause-Patent Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigOut = ".daos_server.active.yml"

	// ScanMinHugepageCount is the minimum number of hugepages to allocate in order to satisfy
	// SPDK memory requirements when performing a NVMe device scan.
	ScanMinHugepageCount = 128
)

Variables

View Source
var (
	FaultUnknown = serverConfigFault(
		code.ServerConfigUnknown,
		"unknown control server error",
		"",
	)
	FaultBadConfig = serverConfigFault(
		code.ServerBadConfig,
		"insufficient information in configuration",
		"supply path to valid configuration file, use examples for reference",
	)
	FaultConfigNoPath = serverConfigFault(
		code.ServerNoConfigPath,
		"configuration file path not set",
		"supply the path to a server configuration file when restarting the control server with commandline option '-o'",
	)
	FaultConfigBadControlPort = serverConfigFault(
		code.ServerConfigBadControlPort,
		"invalid control port in configuration",
		"specify a positive non-zero network port in configuration ('port' parameter) and restart the control server",
	)
	FaultConfigBadTelemetryPort = serverConfigFault(
		code.ServerConfigBadTelemetryPort,
		"invalid telemetry port in configuration",
		"specify a positive non-zero network port in configuration ('telemetry_port' parameter) and restart the control server",
	)
	FaultConfigBadMgmtSvcReplicas = serverConfigFault(
		code.ServerConfigBadMgmtSvcReplicas,
		"invalid list of MS replicas in configuration",
		"'mgmt_svc_replicas' must contain resolvable addresses; fix the configuration and restart the control server",
	)
	FaultConfigEvenMgmtSvcReplicas = serverConfigFault(
		code.ServerConfigEvenMgmtSvcReplicas,
		"non-odd number of MS replicas in configuration",
		"'mgmt_svc_replicas' must contain an odd number (e.g. 1, 3, 5, etc.) of addresses; fix the configuration and restart the control server",
	)
	FaultConfigNoProvider = serverConfigFault(
		code.ServerConfigBadProvider,
		"provider not specified in server configuration",
		"specify a valid network provider in configuration ('provider' parameter) and restart the control server",
	)
	FaultConfigNoEngines = serverConfigFault(
		code.ServerConfigNoEngines,
		"no DAOS IO Engines specified in configuration",
		"specify at least one IO Engine configuration ('engines' list parameter) and restart the control server",
	)
	FaultConfigFaultCallbackNotFound = serverConfigFault(
		code.ServerConfigFaultCallbackNotFound,
		"fault domain callback script not found",
		"specify a valid fault domain callback script ('fault_cb' parameter) and restart the control server",
	)
	FaultConfigFaultCallbackBadPerms = serverConfigFault(
		code.ServerConfigFaultCallbackBadPerms,
		"fault domain callback cannot be executed",
		"ensure that permissions for the DAOS server user are properly set on the fault domain callback script ('fault_cb' parameter) and restart the control server",
	)
	FaultConfigBothFaultPathAndCb = serverConfigFault(
		code.ServerConfigBothFaultPathAndCb,
		"both fault domain and fault path are defined in the configuration",
		"remove either the fault domain ('fault_path' parameter) or callback script ('fault_cb' parameter) and restart the control server",
	)
	FaultConfigFaultCallbackEmpty = serverConfigFault(
		code.ServerConfigFaultCallbackEmpty,
		"fault domain callback executed but did not generate output",
		"specify a valid fault domain callback script ('fault_cb' parameter) and restart the control server",
	)
	FaultConfigTooManyLayersInFaultDomain = serverConfigFault(
		code.ServerConfigFaultDomainTooManyLayers,
		"the fault domain path may have a maximum of 2 levels below the root",
		"update either the fault domain ('fault_path' parameter) or callback script ('fault_cb' parameter) and restart the control server",
	)
	FaultConfigHugepagesDisabledWithNvmeBdevs = serverConfigFault(
		code.ServerConfigHugepagesDisabledWithNvmeBdevs,
		"hugepages cannot be disabled if nvme-bdevs have been specified in config",
		"either set false (or remove) disable_hugepages parameter or remove nvme storage assignment in config and restart the control server",
	)
	FaultConfigHugepagesDisabledWithNrSet = serverConfigFault(
		code.ServerConfigHugepagesDisabledWithNrSet,
		"hugepages cannot be disabled if non-zero number has been specified in config",
		"either set false (or remove) disable_hugepages parameter or remove nr_hugepages assignment in config and restart the control server",
	)
	FaultConfigControlMetadataNoPath = serverConfigFault(
		code.ServerConfigControlMetadataNoPath,
		"using a control_metadata device requires a path to use as the mount point",
		"add a valid 'path' to the 'control_metadata' section of the config",
	)
	FaultConfigEngineBdevRolesMismatch = serverConfigFault(
		code.ServerConfigEngineBdevRolesMismatch,
		"md-on-ssd bdev roles have been set in some but not all engine configs",
		"set bdev roles on all engines or remove all bdev role assignments in config",
	)
	FaultConfigSysRsvdZero = serverConfigFault(
		code.ServerConfigSysRsvdZero,
		"`system_ram_reserved` is set to zero in server config",
		"set `system_ram_reserved` to a positive integer value in config",
	)
	FaultConfigEnableHotplugDeprecated = serverConfigFault(
		code.ServerConfigEnableHotplugDeprecated,
		"'enable_hotplug' setting is deprecated and no longer supported",
		"set 'disable_hotplug: true' in server config file to disable hotplug",
	)
	FaultConfigBdevExcludeClash = serverConfigFault(
		code.ServerConfigBdevExcludeClash,
		"'bdev_exclude' list includes address used in engine config bdev_list",
		"make sure addresses excluded are not included in engine storage configs then restart daos_server",
	)
)
View Source
var (
	// ErrNoAffinityDetected is a sentinel error used to indicate that no affinity was detected.
	ErrNoAffinityDetected = errors.New("no NUMA affinity detected")
)

Functions

func FaultConfigBadControlInterface

func FaultConfigBadControlInterface(iface string, err error) *fault.Fault

FaultConfigBadControlInterface creates a fault for an invalid control plane network interface.

func FaultConfigBdevCountMismatch

func FaultConfigBdevCountMismatch(curIdx, curCount, seenIdx, seenCount int) *fault.Fault

func FaultConfigControlInterfaceMismatch

func FaultConfigControlInterfaceMismatch(ifaceAddr, replicaAddr string) *fault.Fault

FaultConfigControlInterfaceMismatch creates a fault when the control interface address doesn't match the configured MS replica address.

func FaultConfigDuplicateFabric

func FaultConfigDuplicateFabric(curIdx, seenIdx int) *fault.Fault

func FaultConfigDuplicateLogFile

func FaultConfigDuplicateLogFile(curIdx, seenIdx int) *fault.Fault

func FaultConfigDuplicateScmDeviceList

func FaultConfigDuplicateScmDeviceList(curIdx, seenIdx int) *fault.Fault

func FaultConfigDuplicateScmMount

func FaultConfigDuplicateScmMount(curIdx, seenIdx int) *fault.Fault

func FaultConfigEngineNUMAImbalance

func FaultConfigEngineNUMAImbalance(nodeMap map[int]int) *fault.Fault

FaultConfigEngineNUMAImbalance creates a fault indicating that engines are not distributed evenly across NUMA nodes.

func FaultConfigFaultCallbackFailed

func FaultConfigFaultCallbackFailed(err error) *fault.Fault

FaultConfigFaultCallbackFailed creates a Fault for the scenario where the fault domain callback failed with some error.

func FaultConfigFaultCallbackInsecure

func FaultConfigFaultCallbackInsecure(requiredDir string) *fault.Fault

FaultConfigFaultCallbackInsecure creates a fault for the scenario where the fault domain callback path doesn't meet security requirements.

func FaultConfigFaultDomainInvalid

func FaultConfigFaultDomainInvalid(err error) *fault.Fault

func FaultConfigHelperStreamCountMismatch

func FaultConfigHelperStreamCountMismatch(curIdx, curCount, seenIdx, seenCount int) *fault.Fault

func FaultConfigInvalidNetDevClass

func FaultConfigInvalidNetDevClass(curIdx int, primaryDevClass, thisDevClass hardware.NetDevClass, iface string) *fault.Fault

func FaultConfigNrHugepagesOutOfRange

func FaultConfigNrHugepagesOutOfRange(req, max int) *fault.Fault

FaultConfigNrHugepagesOutOfRange creates a fault for the scenario where the number of configured huge pages is smaller than zero or larger than the maximum value allowed.

func FaultConfigOverlappingBdevDeviceList

func FaultConfigOverlappingBdevDeviceList(curIdx, seenIdx int) *fault.Fault

func FaultConfigRamdiskOverMaxMem

func FaultConfigRamdiskOverMaxMem(confSize, ramSize, memRamdiskMin uint64) *fault.Fault

FaultConfigRamdiskOverMaxMem indicates that the tmpfs size requested in config is larger than maximum allowed.

func FaultConfigScmDiffClass

func FaultConfigScmDiffClass(curIdx, seenIdx int) *fault.Fault

func FaultConfigScmDiffHugeEnabled

func FaultConfigScmDiffHugeEnabled(curIdx, seenIdx int) *fault.Fault

func FaultConfigTargetCountMismatch

func FaultConfigTargetCountMismatch(curIdx, curCount, seenIdx, seenCount int) *fault.Fault

func GetMSReplicaPort

func GetMSReplicaPort(log logging.Logger, addr string) (int, error)

GetMSReplicaPort returns port number suffixed to replicas address after its validation or 0 if no port number specified. Error returned if validation fails.

Types

type EngineAffinityFn

type EngineAffinityFn func(logging.Logger, *engine.Config) (uint, error)

EngineAffinityFn defines a function which returns the NUMA node affinity of a given engine.

type Server

type Server struct {
	// control-specific
	ControlPort        int                       `yaml:"port"`
	ControlInterface   string                    `yaml:"control_iface,omitempty"`
	TransportConfig    *security.TransportConfig `yaml:"transport_config"`
	Engines            []*engine.Config          `yaml:"engines"`
	BdevExclude        []string                  `yaml:"bdev_exclude,omitempty"`
	DisableVFIO        bool                      `yaml:"disable_vfio"`
	DisableVMD         *bool                     `yaml:"disable_vmd"`
	DisableHotplug     *bool                     `yaml:"disable_hotplug"`
	NrHugepages        int                       `yaml:"nr_hugepages"`        // total for all engines
	SystemRamReserved  int                       `yaml:"system_ram_reserved"` // total for all engines
	DisableHugepages   bool                      `yaml:"disable_hugepages"`
	AllowNumaImbalance bool                      `yaml:"allow_numa_imbalance"`
	AllowTHP           bool                      `yaml:"allow_thp"`
	ControlLogMask     common.ControlLogLevel    `yaml:"control_log_mask"`
	ControlLogFile     string                    `yaml:"control_log_file,omitempty"`
	ControlLogJSON     bool                      `yaml:"control_log_json,omitempty"`
	HelperLogFile      string                    `yaml:"helper_log_file,omitempty"`
	FWHelperLogFile    string                    `yaml:"firmware_helper_log_file,omitempty"`
	FaultPath          string                    `yaml:"fault_path,omitempty"`
	TelemetryPort      int                       `yaml:"telemetry_port,omitempty"`
	CoreDumpFilter     uint8                     `yaml:"core_dump_filter,omitempty"`
	ClientEnvVars      []string                  `yaml:"client_env_vars,omitempty"`
	SupportConfig      SupportConfig             `yaml:"support_config,omitempty"`

	// duplicated in engine.Config
	SystemName string              `yaml:"name"`
	SocketDir  string              `yaml:"socket_dir"`
	Fabric     engine.FabricConfig `yaml:",inline"`
	Modules    string              `yaml:"-"`

	MgmtSvcReplicas []string `yaml:"mgmt_svc_replicas"`

	Metadata storage.ControlMetadata `yaml:"control_metadata,omitempty"`

	// unused (?)
	FaultCb      string `yaml:"fault_cb"`
	Hyperthreads bool   `yaml:"hyperthreads"`

	Path string `yaml:"-"` // path to config file

	// Behavior flags
	AutoFormat bool `yaml:"-"`
	// contains filtered or unexported fields
}

Server describes configuration options for DAOS control plane. See utils/config/daos_server.yml for parameter descriptions.

func DefaultServer

func DefaultServer() *Server

DefaultServer creates a new instance of configuration struct populated with defaults.

func (*Server) GetBdevConfigs

func (cfg *Server) GetBdevConfigs() (bdevCfgs storage.TierConfigs)

GetBdevConfigs retrieves all engine bdev storage tier configs from a server configuration.

func (*Server) GetNumaNodes

func (cfg *Server) GetNumaNodes() ([]int, error)

GetNumaNodes returns in use NUMA nodes based on engine configurations. Detects the number of engine configs assigned to each NUMA node and return error if engines are distributed unevenly across NUMA nodes. Otherwise return sorted list of NUMA nodes in use. Configurations where all engines are on a single NUMA node will be allowed.

func (*Server) HasPMem

func (cfg *Server) HasPMem() bool

HasPMem returns true if any engine storage config contains a DCPM-class SCM-tier.

func (*Server) Load

func (cfg *Server) Load(log logging.Logger) error

Load reads the serialized configuration from disk and validates file syntax.

func (*Server) SaveActiveConfig

func (cfg *Server) SaveActiveConfig(log logging.Logger)

SaveActiveConfig saves read-only active config, tries config dir then /tmp/.

func (*Server) SaveToFile

func (cfg *Server) SaveToFile(filename string) error

SaveToFile serializes the configuration and saves it to the specified filename.

func (*Server) SetEngineAffinities

func (cfg *Server) SetEngineAffinities(log logging.Logger, affSources ...EngineAffinityFn) error

SetEngineAffinities sets the NUMA node affinity for all engines in the configuration.

func (*Server) SetNrHugepages

func (cfg *Server) SetNrHugepages(log logging.Logger, hugepageSizeKiB int) error

SetNrHugepages calculates minimum based on total target count if using nvme. Handle scenarios for disabling hugepages and no configured bdevs by setting config request value (NrHugepages) appropriately. Hugepage allocation requests will be validated in prepBdevStorage().

func (*Server) SetPath

func (cfg *Server) SetPath(inPath string) error

SetPath sets the default path to the configuration file.

func (*Server) SetRamdiskSize

func (cfg *Server) SetRamdiskSize(log logging.Logger, smi *common.SysMemInfo) error

SetRamdiskSize calculates maximum RAM-disk size using total memory as reported by /proc/meminfo. Then either validate configured engine storage values or assign if not already set.

func (*Server) Validate

func (cfg *Server) Validate(log logging.Logger) (err error)

Validate asserts that config meets minimum requirements.

func (*Server) WithAllowNumaImbalance

func (cfg *Server) WithAllowNumaImbalance(allowed bool) *Server

WithAllowNumaImbalance allows engine count mismatch between NUMA-nodes.

func (*Server) WithAllowTHP

func (cfg *Server) WithAllowTHP(allowed bool) *Server

WithAllowTHP allows DAOS server to run with transparent hugepage support enabled.

func (*Server) WithBdevExclude

func (cfg *Server) WithBdevExclude(bList ...string) *Server

WithBdevExclude sets the block device exclude list.

func (*Server) WithClientEnvVars

func (cfg *Server) WithClientEnvVars(envVars []string) *Server

WithClientEnvVars sets the environment variables to be sent to the client.

func (*Server) WithControlInterface

func (cfg *Server) WithControlInterface(iface string) *Server

WithControlInterface sets the network interface for the control plane listener.

func (*Server) WithControlLogFile

func (cfg *Server) WithControlLogFile(filePath string) *Server

WithControlLogFile sets the path to the daos_server logfile.

func (*Server) WithControlLogJSON

func (cfg *Server) WithControlLogJSON(enabled bool) *Server

WithControlLogJSON enables or disables JSON output.

func (*Server) WithControlLogMask

func (cfg *Server) WithControlLogMask(lvl common.ControlLogLevel) *Server

WithControlLogMask sets the daos_server log level.

func (*Server) WithControlMetadata

func (cfg *Server) WithControlMetadata(md storage.ControlMetadata) *Server

WithControlMetadata sets the control plane metadata.

func (*Server) WithControlPort

func (cfg *Server) WithControlPort(port int) *Server

WithControlPort sets the gRPC listener port.

func (*Server) WithCoreDumpFilter

func (cfg *Server) WithCoreDumpFilter(filter uint8) *Server

WithCoreDumpFilter sets the core dump filter written to /proc/self/coredump_filter.

func (*Server) WithCrtTimeout

func (cfg *Server) WithCrtTimeout(timeout uint32) *Server

WithCrtTimeout sets the top-level CrtTimeout.

func (*Server) WithDisableHotplug

func (cfg *Server) WithDisableHotplug(disabled bool) *Server

WithDisableHotplug can be used to disable hotplug.

func (*Server) WithDisableHugepages

func (cfg *Server) WithDisableHugepages(disabled bool) *Server

WithDisableHugepages disables the use of huge pages.

func (*Server) WithDisableVFIO

func (cfg *Server) WithDisableVFIO(disabled bool) *Server

WithDisableVFIO indicates that the vfio-pci driver should not be used by SPDK even if an IOMMU is detected. Note that this option requires that DAOS be run as root.

func (*Server) WithDisableVMD

func (cfg *Server) WithDisableVMD(disabled bool) *Server

WithDisableVMD can be used to set the state of VMD functionality, if disabled then VMD devices will not be used if they exist.

func (*Server) WithEngines

func (cfg *Server) WithEngines(engineList ...*engine.Config) *Server

WithEngines sets the list of engine configurations.

func (*Server) WithFabricAuthKey

func (cfg *Server) WithFabricAuthKey(key string) *Server

WithFabricAuthKey sets the top-level fabric authorization key.

func (*Server) WithFabricProvider

func (cfg *Server) WithFabricProvider(provider string) *Server

WithFabricProvider sets the top-level fabric provider.

func (*Server) WithFaultCb

func (cfg *Server) WithFaultCb(cb string) *Server

WithFaultCb sets the path to the fault callback script.

func (*Server) WithFaultPath

func (cfg *Server) WithFaultPath(fp string) *Server

WithFaultPath sets the fault path (identification string e.g. rack/shelf/node).

func (*Server) WithFirmwareHelperLogFile

func (cfg *Server) WithFirmwareHelperLogFile(filePath string) *Server

WithFirmwareHelperLogFile sets the path to the daos_firmware_helper logfile.

func (*Server) WithHelperLogFile

func (cfg *Server) WithHelperLogFile(filePath string) *Server

WithHelperLogFile sets the path to the daos_server_helper logfile.

func (*Server) WithHyperthreads

func (cfg *Server) WithHyperthreads(enabled bool) *Server

WithHyperthreads enables or disables hyperthread support.

func (*Server) WithMgmtSvcReplicas

func (cfg *Server) WithMgmtSvcReplicas(reps ...string) *Server

WithMgmtSvcReplicas sets the MS replicas list.

func (*Server) WithModules

func (cfg *Server) WithModules(mList string) *Server

WithModules sets a list of server modules to load.

func (*Server) WithNrHugepages

func (cfg *Server) WithNrHugepages(nr int) *Server

WithNrHugepages sets the number of huge pages to be used (total for all engines).

func (*Server) WithNumSecondaryEndpoints

func (cfg *Server) WithNumSecondaryEndpoints(nr []int) *Server

WithNumSecondaryEndpoints sets the number of network endpoints for each engine's secondary provider.

func (*Server) WithSocketDir

func (cfg *Server) WithSocketDir(sockDir string) *Server

WithSocketDir sets the default socket directory.

func (*Server) WithSystemName

func (cfg *Server) WithSystemName(name string) *Server

WithSystemName sets the system name.

func (*Server) WithSystemRamReserved

func (cfg *Server) WithSystemRamReserved(nr int) *Server

WithSystemRamReserved sets the amount of system memory to reserve for system (non-DAOS) use. In units of GiB.

func (*Server) WithTelemetryPort

func (cfg *Server) WithTelemetryPort(port int) *Server

WithTelemetryPort sets the port for the telemetry exporter.

func (*Server) WithTransportConfig

func (cfg *Server) WithTransportConfig(cfgTransport *security.TransportConfig) *Server

WithTransportConfig sets the gRPC transport configuration.

type SupportConfig

type SupportConfig struct {
	FileTransferExec string `yaml:"file_transfer_exec,omitempty"`
}

SupportConfig is defined here to avoid a import cycle

Jump to

Keyboard shortcuts

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