control

package
v0.0.0-...-b364e49 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-2-Clause-Patent Imports: 60 Imported by: 0

README

DAOS Control API

The control package exposes an RPC-based API for control plane client applications to communicate with DAOS Server processes. The underlying transport mechanism is gRPC and the externally exposed API request and response structures are converted into protobuf messages internally (protobuf definitions are not directly exposed to the consumer of the API).

Public API functions that return a structured response adhere to the following signature pattern:

func ObjectAction(context.Context, UnaryInvoker, *ObjectActionReq) (*ObjectActionResp, error)

Public API functions that are pass/fail adhere to the following signature pattern:

func ObjectAction(context.Context, UnaryInvoker, *ObjectActionReq) error

The provided Context is primarily used for cancellation and deadlines. UnaryInvoker is an interface normally implemented by the Client, but can be mocked out for testing.

For usage examples, please refer to the dmg utility's source code, as it is the primary consumer of this API.

The Control API is organized into two primary areas of focus: Control, and Management. The Control APIs are intended to be used to interact with the Control Plane servers, e.g. to query or format storage as part of bringing a DAOS system online. The Management APIs are intended to be used with a running system, e.g. to create or manage Pools.

Control Methods


Management Methods


Container Methods
Pool Methods
System Methods

Invoking RPCs


In the following simple usage example, we'll see the invocation of a storage scan across a set of hosts. The output will either be pretty-printed or JSON-formatted, depending on what the user specifies.

package main

import (
        "context"
        "encoding/json"
        "flag"
        "fmt"
        "os"
        "strings"

        "github.com/daos-stack/daos/src/control/cmd/dmg/pretty"
        "github.com/daos-stack/daos/src/control/lib/control"
        "github.com/daos-stack/daos/src/control/lib/hostlist"
)

var (
        scanNvmeHealth   bool
        scanNvmeMetadata bool
        jsonOutput       bool
        hostList         string
        cfgPath          string
)

func init() {
        flag.BoolVar(&scanNvmeHealth, "d", false, "include NVMe device health")
        flag.BoolVar(&scanNvmeMetadata, "m", false, "include NVMe device metadata")
        flag.BoolVar(&jsonOutput, "j", false, "emit JSON-formatted output")
        flag.StringVar(&hostList, "l", "", "optional hostlist")
        flag.StringVar(&cfgPath, "c", "", "optional path to control config")
}

func main() {
        flag.Parse()

        ctlClient := control.NewClient()

        cfg, err := control.LoadConfig(cfgPath)
        if err != nil {
                panic(err)
        }
        ctlClient.SetConfig(cfg)

        request := &control.StorageScanReq{
                NvmeHealth: scanNvmeHealth,
                NvmeMeta:   scanNvmeMetadata,
        }

        // If no hostlist is supplied, the daos_control.yml file will be
        // checked to supply a default.
        if hostList != "" {
                hs, err := hostlist.CreateSet(hostList)
                if err != nil {
                        panic(err)
                }
                request.SetHostList(hs.Slice())
        }

        response, err := control.StorageScan(context.Background(), ctlClient, request)
        if err != nil {
                panic(err)
        }

        if jsonOutput {
                data, err := json.Marshal(response)
                if err != nil {
                        panic(err)
                }
                fmt.Println(string(data))
                os.Exit(0)
        }

        var bld strings.Builder
        if err := pretty.PrintHostStorageMap(response.HostStorage, &bld); err != nil {
                panic(err)
        }
        fmt.Println(bld.String())
}

Documentation

Overview

Package control provides an API surface for the DAOS Control Plane.

Index

Constants

View Source
const (
	SystemCheckFlagDryRun         = SystemCheckFlags(chkpb.CheckFlag_CF_DRYRUN)
	SystemCheckFlagReset          = SystemCheckFlags(chkpb.CheckFlag_CF_RESET)
	SystemCheckFlagFailout        = SystemCheckFlags(chkpb.CheckFlag_CF_FAILOUT)
	SystemCheckFlagAuto           = SystemCheckFlags(chkpb.CheckFlag_CF_AUTO)
	SystemCheckFlagFindOrphans    = SystemCheckFlags(chkpb.CheckFlag_CF_ORPHAN_POOL)
	SystemCheckFlagDisableFailout = SystemCheckFlags(chkpb.CheckFlag_CF_NO_FAILOUT)
	SystemCheckFlagDisableAuto    = SystemCheckFlags(chkpb.CheckFlag_CF_NO_AUTO)
)
View Source
const (
	SystemCheckScanPhasePrepare          = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_PREPARE)
	SystemCheckScanPhasePoolList         = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_POOL_LIST)
	SystemCheckScanPhasePoolMembership   = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_POOL_MBS)
	SystemCheckScanPhasePoolCleanup      = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_POOL_CLEANUP)
	SystemCheckScanPhaseContainerList    = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_CONT_LIST)
	SystemCheckScanPhaseContainerCleanup = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_CONT_CLEANUP)
	SystemCheckScanPhaseDtxResync        = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_DTX_RESYNC)
	SystemCheckScanPhaseObjectScrub      = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_OBJ_SCRUB)
	SystemCheckScanPhaseObjectRebuild    = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_REBUILD)
	SystemCheckScanPhaseAggregation      = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_AGGREGATION)
	SystemCheckScanPhaseDone             = SystemCheckScanPhase(chkpb.CheckScanPhase_CSP_DONE)
)
View Source
const (
	// PoolCreateTimeout defines the amount of time a pool create
	// request can take before being timed out.
	PoolCreateTimeout = 10 * time.Minute // be generous for large pools
	// DefaultPoolTimeout is the default timeout for a pool request.
	DefaultPoolTimeout = 5 * time.Minute
)
View Source
const (
	// SystemJoinTimeout defines the overall amount of time a system join attempt
	// can take. It should be an extremely generous value, in order to
	// accommodate (re)joins during leadership upheaval and other scenarios
	// that are expected to eventually resolve.
	SystemJoinTimeout = 1 * time.Hour // effectively "forever", just keep retrying
	// SystemJoinRetryTimeout defines the amount of time a retry attempt can take. It
	// should be set low in order to ensure that individual join attempts retry quickly.
	SystemJoinRetryTimeout = 10 * time.Second
)

Variables

View Source
var (
	FaultUnknown = clientFault(
		code.ClientUnknown,
		"unknown client error",
		"",
	)
	FaultConfigBadControlPort = clientFault(
		code.ClientConfigBadControlPort,
		"invalid control port in configuration",
		"specify a nonzero control port in configuration ('port' parameter) and retry the client application",
	)
	FaultConfigEmptyHostList = clientFault(
		code.ClientConfigEmptyHostList,
		"empty hostlist parameter in configuration",
		"specify a non-empty list of DAOS server addresses in configuration ('hostlist' parameter) and retry the client application",
	)
	FaultFormatRunningSystem = clientFault(
		code.ClientFormatRunningSystem,
		"storage format invoked on a running system",
		"stop and erase the system, then retry the format operation",
	)
	FaultConfigVMDImbalance = clientFault(
		code.ClientConfigVMDImbalance,
		"different number of backing devices behind each engine's VMD addresses",
		"assign an equal number of NVMe SSDs to each VMD when configuring in BIOS",
	)
)
View Source
var (
	// ErrNoConfigFile indicates that no configuration file was able
	// to be located.
	ErrNoConfigFile = errors.New("no configuration file found")
)

Functions

func ContSetOwner

func ContSetOwner(ctx context.Context, rpcClient UnaryInvoker, req *ContSetOwnerReq) error

ContSetOwner changes the owner user and/or group of a DAOS container.

func DefaultEngineCfg

func DefaultEngineCfg(idx int) *engine.Config

DefaultEngineCfg is a standard baseline for the config generate to start from.

func FaultConnectionBadHost

func FaultConnectionBadHost(srvAddr string) *fault.Fault

func FaultConnectionClosed

func FaultConnectionClosed(srvAddr string) *fault.Fault

func FaultConnectionNoRoute

func FaultConnectionNoRoute(srvAddr string) *fault.Fault

func FaultConnectionRefused

func FaultConnectionRefused(srvAddr string) *fault.Fault

func FaultConnectionTimedOut

func FaultConnectionTimedOut(srvAddr string) *fault.Fault

func FaultRpcTimeout

func FaultRpcTimeout(req deadliner) *fault.Fault

func FormatACL

func FormatACL(acl *AccessControlList, verbose bool) string

FormatACL converts the AccessControlList to a human-readable string.

func FormatACLDefault

func FormatACLDefault(acl *AccessControlList) string

FormatACLDefault formats the AccessControlList in non-verbose mode.

func HTTPReqTimedOut

func HTTPReqTimedOut(url string) error

HTTPReqTimedOut creates an error indicating that an HTTP request timed out.

func IsConfGenerateError

func IsConfGenerateError(err error) bool

IsConfGenerateError returns true if the provided error is a *ConfGenerateError.

func IsConnErr

func IsConnErr(err error) bool

IsConnErr indicates whether the error is a connection error.

func IsMSConnectionFailure

func IsMSConnectionFailure(err error) bool

IsMSConnectionFailure checks whether the error is an MS connection failure.

func IsRetryableConnErr

func IsRetryableConnErr(err error) bool

IsRetryableConnErr indicates whether the error is a connection error that can be retried.

func MockBdevTier

func MockBdevTier(numaID int, pciAddrIDs ...int) *storage.TierConfig

MockBdevTier creates a bdev TierConfig using supplied NUMA and PCI addresses.

func MockBdevTierWithRole

func MockBdevTierWithRole(numaID, role int, pciAddrIDs ...int) *storage.TierConfig

MockBdevTierWithRole creates a bdev TierConfig with specific roles using supplied NUMA, roles and PCI addresses.

func MockEngineCfg

func MockEngineCfg(numaID int, pciAddrIDs ...int) *engine.Config

MockEngineCfg creates an engine config using supplied NUMA and PCI addresses.

func MockEngineCfgTmpfs

func MockEngineCfgTmpfs(numaID, ramdiskSize int, bdevTiers ...*storage.TierConfig) *engine.Config

MockEngineCfgTmpfs generates ramdisk engine config with pciAddrIDs defining bdev tier device lists.

func MockFailureMap

func MockFailureMap(idxList ...int) map[int]struct{}

MockFailureMap returns failure map from the given range of integers.

func MockHostSet

func MockHostSet(t *testing.T, hosts string) *hostlist.HostSet

MockHostSet builds a HostSet from a list of strings.

func MockMemInfo

func MockMemInfo() *common.MemInfo

MockMemInfo returns a mock MemInfo result.

func MockPoolCreateResp

func MockPoolCreateResp(t *testing.T, config *MockPoolRespConfig) *mgmtpb.PoolCreateResp

MockPoolCreateResp creates a PoolCreateResp using supplied MockPoolRespConfig.

func MockServerCfg

func MockServerCfg(provider string, ecs []*engine.Config) *config.Server

MockServerCfg generates a server config from provided provider string and slice of engine configs.

func MockServerScanResp

func MockServerScanResp(t *testing.T, variant string) *ctlpb.StorageScanResp

MockServerScanResp returns protobuf storage scan response with contents defined by the variant input string parameter.

func MockStorageScanResp

func MockStorageScanResp(t *testing.T,
	mockScmConfigArray []MockScmConfig,
	mockNvmeConfigArray []MockNvmeConfig) *ctlpb.StorageScanResp

MockStorageScanResp builds a storage scan response from config array structs for SCM and NVMe.

func PoolDestroy

func PoolDestroy(ctx context.Context, rpcClient UnaryInvoker, req *PoolDestroyReq) error

PoolDestroy performs a pool destroy operation on a DAOS Management Server instance.

func PoolDrain

func PoolDrain(ctx context.Context, rpcClient UnaryInvoker, req *PoolDrainReq) error

PoolDrain will set a pool target for a specific rank to the drain status. This should automatically start the rebuildiing process. Returns an error (including any DER code from DAOS).

func PoolEvict

func PoolEvict(ctx context.Context, rpcClient UnaryInvoker, req *PoolEvictReq) error

PoolEvict performs a pool connection evict operation on a DAOS Management Server instance.

func PoolExclude

func PoolExclude(ctx context.Context, rpcClient UnaryInvoker, req *PoolExcludeReq) error

PoolExclude will set a pool target for a specific rank to down. This should automatically start the rebuildiing process. Returns an error (including any DER code from DAOS).

func PoolExtend

func PoolExtend(ctx context.Context, rpcClient UnaryInvoker, req *PoolExtendReq) error

PoolExtend will extend the DAOS pool by the specified ranks. This should automatically start the rebalance process. Returns an error (including any DER code from DAOS).

func PoolGetProp

func PoolGetProp(ctx context.Context, rpcClient UnaryInvoker, req *PoolGetPropReq) ([]*daos.PoolProperty, error)

PoolGetProp sends a pool get-prop request to the pool service leader.

func PoolReintegrate

func PoolReintegrate(ctx context.Context, rpcClient UnaryInvoker, req *PoolReintegrateReq) error

PoolReintegrate will set a pool target for a specific rank back to up. This should automatically start the reintegration process. Returns an error (including any DER code from DAOS).

func PoolSetProp

func PoolSetProp(ctx context.Context, rpcClient UnaryInvoker, req *PoolSetPropReq) error

PoolSetProp sends a pool set-prop request to the pool service leader.

func PoolUpgrade

func PoolUpgrade(ctx context.Context, rpcClient UnaryInvoker, req *PoolUpgradeReq) error

PoolUpgrade performs a pool upgrade operation on a DAOS Management Server instance.

func StartPProf

func StartPProf(log logging.Logger)

func SystemCheckDisable

func SystemCheckDisable(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckDisableReq) error

SystemCheckDisable disables the system checker.

func SystemCheckEnable

func SystemCheckEnable(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckEnableReq) error

SystemCheckEnable enables the system checker.

func SystemCheckRepair

func SystemCheckRepair(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckRepairReq) error

SystemCheckRepair sends a request to the system checker to indicate what the desired repair action is for a reported inconsistency.

func SystemCheckSetPolicy

func SystemCheckSetPolicy(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckSetPolicyReq) error

SystemCheckSetPolicy sets the system checker properties.

func SystemCheckStart

func SystemCheckStart(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckStartReq) error

SystemCheckStart starts the system checker.

func SystemCheckStop

func SystemCheckStop(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckStopReq) error

SystemCheckStop stops the system checker.

func SystemConfigPath

func SystemConfigPath() string

SystemConfigPath returns the computed path to the system control configuration file, if it exists.

func SystemSetAttr

func SystemSetAttr(ctx context.Context, rpcClient UnaryInvoker, req *SystemSetAttrReq) error

SystemSetAttr sets system attributes.

func SystemSetProp

func SystemSetProp(ctx context.Context, rpcClient UnaryInvoker, req *SystemSetPropReq) error

SystemSetProp sets system properties.

func UserConfigPath

func UserConfigPath() string

UserConfigPath returns the computed path to a per-user control configuration file, if it exists.

Types

type AccessControlList

type AccessControlList struct {
	Entries    []string `json:"entries"`     // Access Control Entries in short string format
	Owner      string   `json:"owner_user"`  // User that owns the resource
	OwnerGroup string   `json:"owner_group"` // Group that owns the resource
}

AccessControlList is a structure for the access control list.

func ParseACL

func ParseACL(reader io.Reader) (*AccessControlList, error)

ParseACL reads the content from io.Reader and puts the results into a AccessControlList structure. Assumes that ACE strings are provided one per line.

func ReadACLFile

func ReadACLFile(aclFile string) (*AccessControlList, error)

ReadACLFile reads in a file representing an ACL, and translates it into an AccessControlList structure

func (*AccessControlList) Empty

func (acl *AccessControlList) Empty() bool

Empty checks whether there are any entries in the AccessControlList

func (*AccessControlList) HasOwner

func (acl *AccessControlList) HasOwner() bool

HasOwner checks whether the AccessControlList has an owner user.

func (*AccessControlList) HasOwnerGroup

func (acl *AccessControlList) HasOwnerGroup() bool

HasOwnerGroup checks whether the AccessControlList has an owner group.

func (*AccessControlList) String

func (acl *AccessControlList) String() string

String displays the AccessControlList in a basic string format.

type CleanupResult

type CleanupResult struct {
	Status int32  `json:"status"`  // Status returned from this specific evict call
	Msg    string `json:"msg"`     // Error message if Status is not Success
	PoolID string `json:"pool_id"` // Unique identifier
	Count  uint32 `json:"count"`   // Number of pool handles evicted
}

type Client

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

Client implements the Invoker interface and should be provided to API methods to invoke RPCs.

func DefaultClient

func DefaultClient() *Client

DefaultClient returns an initialized Client with its parameters set to default values.

func NewClient

func NewClient(opts ...ClientOption) *Client

NewClient returns an initialized Client with its parameters set by the provided ClientOption list.

func (*Client) Debug

func (c *Client) Debug(msg string)

func (*Client) Debugf

func (c *Client) Debugf(fmtStr string, args ...interface{})

func (*Client) GetComponent

func (c *Client) GetComponent() build.Component

GetComponent returns the client's component.

func (*Client) GetSystem

func (c *Client) GetSystem() string

GetConfig retrieves the system name from the client configuration and implements the sysGetter interface.

func (*Client) InvokeUnaryRPC

func (c *Client) InvokeUnaryRPC(ctx context.Context, req UnaryRequest) (*UnaryResponse, error)

InvokeUnaryRPC performs a synchronous (blocking) invocation of the request's RPC across all hosts in the request. The response contains a slice of HostResponse items which represent the success or failure of the RPC invocation for each host in the request.

func (*Client) InvokeUnaryRPCAsync

func (c *Client) InvokeUnaryRPCAsync(parent context.Context, req UnaryRequest) (HostResponseChan, error)

InvokeUnaryRPCAsync performs an asynchronous invocation of the given RPC across all hosts in the request's host list. The returned HostResponseChan provides access to a stream of HostResponse items as they are received, and is closed when no more responses are expected.

func (*Client) SetConfig

func (c *Client) SetConfig(cfg *Config)

SetConfig sets the client configuration for an existing Client.

type ClientNetworkHint

type ClientNetworkHint struct {
	// These CaRT settings are shared with the
	// libdaos client to aid in CaRT initialization.
	Provider    string   `json:"provider"`
	Interface   string   `json:"interface"`
	Domain      string   `json:"domain"`
	CrtTimeout  uint32   `json:"crt_timeout"`
	NetDevClass uint32   `json:"net_dev_class"`
	SrvSrxSet   int32    `json:"srv_srx_set"`
	EnvVars     []string `json:"env_vars"`
	ProviderIdx uint32   `json:"provider_idx"`
}

type ClientOption

type ClientOption func(c *Client)

ClientOption defines the signature for functional Client options.

func WithClientComponent

func WithClientComponent(comp build.Component) ClientOption

WithClientComponent sets the client's component.

func WithClientLogger

func WithClientLogger(log debugLogger) ClientOption

WithClientLogger sets the client's debugLogger.

func WithConfig

func WithConfig(cfg *Config) ClientOption

WithConfig sets the client's configuration.

type CollectLogReq

type CollectLogReq struct {
	TargetFolder string
	AdminNode    string
	ExtraLogsDir string
	JsonOutput   bool
	LogFunction  int32
	LogCmd       string
	LogStartDate string
	LogEndDate   string
	LogStartTime string
	LogEndTime   string
	StopOnError  bool
	// contains filtered or unexported fields
}

CollectLogReq contains the parameters for a collect-log request.

type CollectLogResp

type CollectLogResp struct {
	HostErrorsResp
}

CollectLogResp contains the results of a collect-log

func CollectLog

func CollectLog(ctx context.Context, rpcClient UnaryInvoker, req *CollectLogReq) (*CollectLogResp, error)

CollectLog concurrently performs log collection across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host log collection operations.

type ConfGenerateError

type ConfGenerateError struct {
	HostErrorsResp
}

ConfGenerateError implements the error interface and contains a set of host-specific errors encountered while attempting to generate a configuration.

func (*ConfGenerateError) Error

func (cge *ConfGenerateError) Error() string

func (*ConfGenerateError) GetHostErrors

func (cge *ConfGenerateError) GetHostErrors() HostErrorsMap

GetHostErrors returns the wrapped HostErrorsMap.

type ConfGenerateRemoteReq

type ConfGenerateRemoteReq struct {
	ConfGenerateReq
	HostList []string
	Client   UnaryInvoker
}

ConfGenerateRemoteReq adds connectivity related fields to base request.

type ConfGenerateRemoteResp

type ConfGenerateRemoteResp struct {
	ConfGenerateResp
}

ConfGenerateRemoteResp wraps the ConfGenerateResp.

func ConfGenerateRemote

func ConfGenerateRemote(ctx context.Context, req ConfGenerateRemoteReq) (*ConfGenerateRemoteResp, error)

ConfGenerateRemote calls ConfGenerate after validating a homogeneous hardware setup across remote hosts. Returns API response or error.

type ConfGenerateReq

type ConfGenerateReq struct {
	// Number of engines to include in generated config.
	NrEngines int `json:"NrEngines"`
	// Force use of a specific network device class for fabric comms.
	NetClass hardware.NetDevClass `json:"-"`
	// Force use of a specific fabric provider.
	NetProvider string `json:"NetProvider"`
	// Generate a config without NVMe.
	SCMOnly bool `json:"SCMOnly"`
	// Hosts to run the management service.
	AccessPoints []string `json:"-"`
	// Ports to use for fabric comms (one needed per engine).
	FabricPorts []int `json:"-"`
	// Generate config with a tmpfs RAM-disk SCM.
	UseTmpfsSCM bool `json:"UseTmpfsSCM"`
	// Location to persist control-plane metadata, will generate MD-on-SSD config.
	ExtMetadataPath string         `json:"ExtMetadataPath"`
	Log             logging.Logger `json:"-"`
}

ConGenerateReq contains the inputs for the request.

func (*ConfGenerateReq) UnmarshalJSON

func (cgr *ConfGenerateReq) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks JSON message into ConfGenerateReq struct.

type ConfGenerateResp

type ConfGenerateResp struct {
	config.Server
}

ConfGenerateResp contains the generated server config.

func ConfGenerate

func ConfGenerate(req ConfGenerateReq, newEngineCfg newEngineCfgFn, hf *HostFabric, hs *HostStorage) (*ConfGenerateResp, error)

ConfGenerate derives an optimal server config file from details of network, storage and CPU hardware by evaluating affinity matches for NUMA node combinations.

type Config

type Config struct {
	SystemName      string                    `yaml:"name"`
	ControlPort     int                       `yaml:"port"`
	HostList        []string                  `yaml:"hostlist"`
	TransportConfig *security.TransportConfig `yaml:"transport_config"`
	Path            string                    `yaml:"-"`
}

Config defines the parameters used to connect to a control API server.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config populated with default values. Only suitable for single-node configurations.

func LoadConfig

func LoadConfig(cfgPath string) (*Config, error)

LoadConfig attempts to load a configuration by one of the following: 1. If the supplied path is a non-empty string, use it. Otherwise, 2. Try to load the config from the current user's home directory. 3. Finally, try to load the config from the system location.

type ContSetOwnerReq

type ContSetOwnerReq struct {
	ContUUID string // Container UUID
	PoolUUID string // UUID of the pool for the container
	User     string // User to own the container, or empty if none
	Group    string // Group to own the container, or empty if none
	// contains filtered or unexported fields
}

ContSetOwnerReq contains the parameters for the set owner request

type DeviceType

type DeviceType uint32

DeviceType is an enum representing the storage device type.

const (
	// DeviceTypeUnknown represents an unspecified device type.
	DeviceTypeUnknown DeviceType = iota
	// DeviceTypeSCM represents SCM modules.
	DeviceTypeSCM
	// DeviceTypeNVMe represents NVMe SSDs.
	DeviceTypeNVMe
)

type EventForwarder

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

EventForwarder implements the events.Handler interface, increments sequence number for each event forwarded and distributes requests to MS access points.

func NewEventForwarder

func NewEventForwarder(rpcClient UnaryInvoker, accessPts []string) *EventForwarder

NewEventForwarder returns an initialized EventForwarder.

func (*EventForwarder) OnEvent

func (ef *EventForwarder) OnEvent(ctx context.Context, evt *events.RASEvent)

OnEvent implements the events.Handler interface.

type EventLogger

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

EventLogger implements the events.Handler interface and logs RAS event to INFO using supplied logging.Logger. In addition syslog is written to at the priority level derived from the event severity.

func NewEventLogger

func NewEventLogger(log logging.Logger) *EventLogger

NewEventLogger returns an initialized EventLogger capable of writing to the supplied logger in addition to syslog.

func (*EventLogger) OnEvent

func (el *EventLogger) OnEvent(_ context.Context, evt *events.RASEvent)

OnEvent implements the events.Handler interface.

type EventNotifyReq

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

EventNotifyReq contains the inputs for an event notify request.

type EventNotifyResp

type EventNotifyResp struct{}

EventNotifyResp contains the inputs for an event notify response.

type FirmwareQueryReq

type FirmwareQueryReq struct {
	SCM         bool     // Query SCM devices
	NVMe        bool     // Query NVMe devices
	Devices     []string // Specific devices to query
	ModelID     string   // Filter by model ID
	FirmwareRev string   // Filter by current FW revision
	// contains filtered or unexported fields
}

FirmwareQueryReq is a request for firmware information for storage devices.

type FirmwareQueryResp

type FirmwareQueryResp struct {
	HostErrorsResp
	HostSCMFirmware  HostSCMQueryMap
	HostNVMeFirmware HostNVMeQueryMap
}

FirmwareQueryResp returns storage device firmware information.

func FirmwareQuery

func FirmwareQuery(ctx context.Context, rpcClient UnaryInvoker, req *FirmwareQueryReq) (*FirmwareQueryResp, error)

FirmwareQuery concurrently requests device firmware information from all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host firmware query operations.

type FirmwareUpdateReq

type FirmwareUpdateReq struct {
	FirmwarePath string
	Type         DeviceType
	Devices      []string // Specific devices to update
	ModelID      string   // Update only devices of specific model
	FirmwareRev  string   // Update only devices with a specific current firmware
	// contains filtered or unexported fields
}

FirmwareUpdateReq is a request to update firmware for a specific type of storage device.

type FirmwareUpdateResp

type FirmwareUpdateResp struct {
	HostErrorsResp
	HostSCMResult  HostSCMUpdateMap
	HostNVMeResult HostNVMeUpdateMap
}

FirmwareUpdateResp returns the results of firmware update operations.

func FirmwareUpdate

func FirmwareUpdate(ctx context.Context, rpcClient UnaryInvoker, req *FirmwareUpdateReq) (*FirmwareUpdateResp, error)

FirmwareUpdate concurrently updates device firmware for a given device type for all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host firmware update operations.

type GetAttachInfoReq

type GetAttachInfoReq struct {
	System   string
	AllRanks bool
	// contains filtered or unexported fields
}

GetAttachInfoReq defines the request parameters for GetAttachInfo.

func (*GetAttachInfoReq) SetMaxTries

func (r *GetAttachInfoReq) SetMaxTries(mt uint)

SetMaxTries sets the maximum number of request attempts.

type GetAttachInfoResp

type GetAttachInfoResp struct {
	System                  string                `json:"sys"`
	ServiceRanks            []*PrimaryServiceRank `json:"rank_uris"`
	AlternateServiceRanks   []*PrimaryServiceRank `json:"secondary_rank_uris"`
	MSRanks                 []uint32              `json:"ms_ranks"`
	ClientNetHint           ClientNetworkHint     `json:"client_net_hint"`
	AlternateClientNetHints []ClientNetworkHint   `json:"secondary_client_net_hints"`
}

func GetAttachInfo

func GetAttachInfo(ctx context.Context, rpcClient UnaryInvoker, req *GetAttachInfoReq) (*GetAttachInfoResp, error)

GetAttachInfo makes a request to the current MS leader in order to learn the PSRs (rank/uri mapping) for the DAOS cluster. This information is used by DAOS clients in order to make connections to DAOS servers over the storage fabric.

func (*GetAttachInfoResp) String

func (gair *GetAttachInfoResp) String() string

type HistogramMetric

type HistogramMetric struct {
	Labels      LabelMap        `json:"labels"`
	SampleCount uint64          `json:"sample_count"`
	SampleSum   float64         `json:"sample_sum"`
	Buckets     []*MetricBucket `json:"buckets"`
}

HistogramMetric represents a group of observations sorted into buckets.

func (*HistogramMetric) IsMetric

func (*HistogramMetric) IsMetric()

IsMetric identifies HistogramMetric as a Metric.

type HostErrorSet

type HostErrorSet struct {
	HostSet   *hostlist.HostSet
	HostError error
}

HostErrorSet preserves the original hostError used to create the map key.

type HostErrorsMap

type HostErrorsMap map[string]*HostErrorSet

HostErrorsMap provides a mapping from error strings to a set of hosts to which the error applies.

func (HostErrorsMap) Add

func (hem HostErrorsMap) Add(hostAddr string, hostErr error) (err error)

Add creates or updates the err/addr keyval pair.

func (HostErrorsMap) ErrorCount

func (hem HostErrorsMap) ErrorCount() (nrErrs int)

ErrorCount returns a count of errors in map.

func (HostErrorsMap) Keys

func (hem HostErrorsMap) Keys() []string

Keys returns a stable sorted slice of the errors map keys.

func (HostErrorsMap) MarshalJSON

func (hem HostErrorsMap) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom marshaller to include the hostset as a ranged string.

type HostErrorsResp

type HostErrorsResp struct {
	HostErrors HostErrorsMap `json:"host_errors"`
}

HostErrorsResp is a response type containing a HostErrorsMap.

func MockHostErrorsResp

func MockHostErrorsResp(t *testing.T, hostErrors ...*MockHostError) HostErrorsResp

MockHostErrorsResp returns HostErrorsResp when provided with MockHostErrors from different hostsets.

func (*HostErrorsResp) Errors

func (her *HostErrorsResp) Errors() error

Errors returns an error containing brief description of errors in map.

func (*HostErrorsResp) GetHostErrors

func (her *HostErrorsResp) GetHostErrors() HostErrorsMap

GetHostErrors retrieves a HostErrorsMap from a response type.

type HostFabric

type HostFabric struct {
	Interfaces   []*HostFabricInterface `hash:"set"`
	Providers    []string               `hash:"set"`
	NumaCount    uint32
	CoresPerNuma uint32
}

HostFabric describes a host fabric configuration.

func (*HostFabric) AddInterface

func (hf *HostFabric) AddInterface(hfi *HostFabricInterface)

AddInterface is a helper function that populates a HostFabric.

func (*HostFabric) HashKey

func (hf *HostFabric) HashKey() (uint64, error)

HashKey returns a uint64 value suitable for use as a key into a map of HostFabric configurations.

type HostFabricInterface

type HostFabricInterface struct {
	Provider    string
	Device      string
	NumaNode    uint32
	Priority    uint32
	NetDevClass hardware.NetDevClass
}

HostFabricInterface describes a host fabric interface.

func (*HostFabricInterface) String

func (hfi *HostFabricInterface) String() string

type HostFabricMap

type HostFabricMap map[uint64]*HostFabricSet

HostFabricMap provides a map of HostFabric keys to HostFabricSet values.

func MockHostFabricMap

func MockHostFabricMap(t *testing.T, scans ...*MockFabricScan) HostFabricMap

MockHostFabricMap generates a HostFabricMap from MockFabricScan structs.

func (HostFabricMap) Add

func (hfm HostFabricMap) Add(hostAddr string, hf *HostFabric) (err error)

Add inserts the given host address to a matching HostFabricSet or creates a new one.

func (HostFabricMap) Keys

func (hfm HostFabricMap) Keys() []uint64

Keys returns a set of storage map keys sorted by hosts.

type HostFabricSet

type HostFabricSet struct {
	HostFabric *HostFabric
	HostSet    *hostlist.HostSet
}

HostFabricSet contains a HostFabric configuration and the set of hosts matching this configuration.

func NewHostFabricSet

func NewHostFabricSet(hostAddr string, hf *HostFabric) (*HostFabricSet, error)

NewHostFabricSet returns an initialized HostFabricSet for the given host address and HostFabric configuration.

type HostNVMeQueryMap

type HostNVMeQueryMap map[string][]*NVMeQueryResult

HostNVMeQueryMap maps a host name to a slice of NVMe firmware query results.

func (HostNVMeQueryMap) Keys

func (m HostNVMeQueryMap) Keys() []string

Keys returns the sorted list of keys from the HostNVMeQueryMap.

type HostNVMeUpdateMap

type HostNVMeUpdateMap map[string][]*NVMeUpdateResult

HostNVMeUpdateMap maps a host name to a slice of NVMe update results.

func (HostNVMeUpdateMap) Keys

func (m HostNVMeUpdateMap) Keys() []string

Keys returns the sorted list of keys from the NVMe result map.

type HostResponse

type HostResponse struct {
	Addr    string
	Error   error
	Message proto.Message
}

HostResponse contains a single host's response to an unary RPC, or an error if the host was unable to respond successfully.

func MockHostResponses

func MockHostResponses(t *testing.T, count int, fmtStr string, respMsg proto.Message) []*HostResponse

MockHostResponses returns mock host responses.

type HostResponseChan

type HostResponseChan chan *HostResponse

HostResponseChan defines a channel of *HostResponse items returned from asynchronous unary RPC invokers.

type HostResponseReportFn

type HostResponseReportFn func(*HostResponse)

HostResponseReport defines the function signature for a callback invoked when a host response is received.

type HostSCMQueryMap

type HostSCMQueryMap map[string][]*SCMQueryResult

HostSCMQueryMap maps a host name to a slice of SCM firmware query results.

func (HostSCMQueryMap) Keys

func (m HostSCMQueryMap) Keys() []string

Keys returns the sorted list of keys from the HostSCMQueryMap.

type HostSCMUpdateMap

type HostSCMUpdateMap map[string][]*SCMUpdateResult

HostSCMUpdateMap maps a host name to a slice of SCM update results.

func (HostSCMUpdateMap) Keys

func (m HostSCMUpdateMap) Keys() []string

Keys returns the sorted list of keys from the SCM result map.

type HostStorage

type HostStorage struct {
	// NvmeDevices contains the set of NVMe controllers (SSDs)
	// in this configuration.
	NvmeDevices storage.NvmeControllers `json:"nvme_devices"`

	// ScmModules contains the set of SCM modules (persistent
	// memory DIMMs) in this configuration.
	ScmModules storage.ScmModules `json:"scm_modules"`

	// ScmNamespaces contains the set of prepared SCM namespaces
	// (block devices) in this configuration.
	ScmNamespaces storage.ScmNamespaces `json:"scm_namespaces"`

	// ScmMountPoints contains the set of SCM mountpoints in
	// this configuration.
	ScmMountPoints storage.ScmMountPoints `json:"scm_mount_points"`

	// SmdInfo contains information obtained by querying the
	// host's metadata table, if available.
	SmdInfo *SmdInfo `json:"smd_info"`

	// RebootRequired indicates that a host reboot is necessary in order
	// to achieve some goal (SCM prep, etc.)
	RebootRequired bool `json:"reboot_required"`

	// MemInfo contains information about the host's hugepages.
	MemInfo *common.MemInfo `json:"mem_info"`
}

HostStorage describes a host storage configuration which may apply to one or more hosts.

func (*HostStorage) HashKey

func (hs *HostStorage) HashKey() (uint64, error)

HashKey returns a uint64 value suitable for use as a key into a map of HostStorage configurations.

type HostStorageMap

type HostStorageMap map[uint64]*HostStorageSet

HostStorageMap provides a map of HostStorage keys to HostStorageSet values.

func MockHostStorageMap

func MockHostStorageMap(t *testing.T, scans ...*MockStorageScan) HostStorageMap

MockHostStorageMap returns HostStorageMap when provided with mock storage scan results from different hostsets.

func (HostStorageMap) Add

func (hsm HostStorageMap) Add(hostAddr string, hs *HostStorage) (err error)

Add inserts the given host address to a matching HostStorageSet or creates a new one.

func (HostStorageMap) HostCount

func (hsm HostStorageMap) HostCount() (nrHosts int)

HostCount returns a count of hosts in map.

func (HostStorageMap) Keys

func (hsm HostStorageMap) Keys() []uint64

Keys returns a set of storage map keys sorted by hosts.

func (HostStorageMap) String

func (hsm HostStorageMap) String() string

type HostStorageSet

type HostStorageSet struct {
	HostStorage *HostStorage      `json:"storage"`
	HostSet     *hostlist.HostSet `json:"hosts"`
}

HostStorageSet contains a HostStorage configuration and the set of hosts matching this configuration.

func NewHostStorageSet

func NewHostStorageSet(hostAddr string, hs *HostStorage) (*HostStorageSet, error)

NewHostStorageSet returns an initialized HostStorageSet for the given host address and HostStorage configuration.

func (*HostStorageSet) Len

func (hss *HostStorageSet) Len() int

Len returns the number of hosts in set with this host storage.

func (*HostStorageSet) String

func (hss *HostStorageSet) String() string

type Invoker

type Invoker interface {
	UnaryInvoker
	//TODO: StreamInvoker
	SetConfig(*Config)
}

Invoker defines an interface to be implemented by clients capable of invoking unary or stream RPCs.

type LabelMap

type LabelMap map[string]string

LabelMap is the set of key-value label pairs.

func (LabelMap) Keys

func (m LabelMap) Keys() []string

Keys gets the sorted list of label keys.

type LeaderQueryReq

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

LeaderQueryReq contains the inputs for the leader query request.

func (*LeaderQueryReq) SetHosts

func (req *LeaderQueryReq) SetHosts(hosts *hostlist.HostSet)

func (*LeaderQueryReq) SetRanks

func (req *LeaderQueryReq) SetRanks(ranks *ranklist.RankSet)

type LeaderQueryResp

type LeaderQueryResp struct {
	Leader       string   `json:"current_leader"`
	Replicas     []string `json:"replicas"`
	DownReplicas []string `json:"down_replicas"`
}

LeaderQueryResp contains the status of the request and, if successful, the MS leader and set of replicas in the system.

func LeaderQuery

func LeaderQuery(ctx context.Context, rpcClient UnaryInvoker, req *LeaderQueryReq) (*LeaderQueryResp, error)

LeaderQuery requests the current Management Service leader and the set of MS replicas.

type ListPoolsReq

type ListPoolsReq struct {
	NoQuery bool
	// contains filtered or unexported fields
}

ListPoolsReq contains the inputs for the list pools command.

type ListPoolsResp

type ListPoolsResp struct {
	Status int32   `json:"status"`
	Pools  []*Pool `json:"pools"`
}

ListPoolsResp contains the status of the request and, if successful, the list of pools in the system.

func ListPools

func ListPools(ctx context.Context, rpcClient UnaryInvoker, req *ListPoolsReq) (*ListPoolsResp, error)

ListPools fetches the list of all pools and their service replicas from the system.

func (*ListPoolsResp) Errors

func (lpr *ListPoolsResp) Errors() error

Errors returns summary of response errors including pool query failures.

func (*ListPoolsResp) Validate

func (lpr *ListPoolsResp) Validate() (string, error)

Validate returns error if response contents are unexpected, string of warnings if pool queries have failed or nil values if contents are expected.

type Metric

type Metric interface {
	IsMetric()
}

Metric is an interface implemented by all metric types.

type MetricBucket

type MetricBucket struct {
	CumulativeCount uint64  `json:"cumulative_count"`
	UpperBound      float64 `json:"upper_bound"`
}

MetricBucket represents a bucket for observations to be sorted into.

type MetricSet

type MetricSet struct {
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Type        MetricType `json:"type"`
	Metrics     []Metric   `json:"metrics"`
}

MetricSet is a group of related metrics.

func (*MetricSet) MarshalJSON

func (ms *MetricSet) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MetricSet to JSON.

func (*MetricSet) UnmarshalJSON

func (ms *MetricSet) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the MetricSet from JSON.

type MetricType

type MetricType uint32

MetricType defines the different types of metrics.

const (
	MetricTypeUnknown MetricType = iota
	MetricTypeGeneric
	MetricTypeCounter
	MetricTypeGauge
	MetricTypeSummary
	MetricTypeHistogram
)

func (MetricType) String

func (t MetricType) String() string

type MetricsListReq

type MetricsListReq struct {
	Host string // Host to query for telemetry data
	Port uint32 // Port to use for collecting telemetry data
	// contains filtered or unexported fields
}

MetricsListReq is used to request the list of metrics.

type MetricsListResp

type MetricsListResp struct {
	AvailableMetricSets []*MetricSet `json:"available_metric_sets"`
}

MetricsListResp contains the list of available metrics.

func MetricsList

func MetricsList(ctx context.Context, req *MetricsListReq) (*MetricsListResp, error)

MetricsList fetches the list of available metric types from the DAOS nodes.

type MetricsQueryReq

type MetricsQueryReq struct {
	Host        string   // host to query for telemetry data
	Port        uint32   // port to use for collecting telemetry data
	MetricNames []string // if empty, collects all metrics
	// contains filtered or unexported fields
}

MetricsQueryReq is used to query telemetry values.

type MetricsQueryResp

type MetricsQueryResp struct {
	MetricSets []*MetricSet `json:"metric_sets"`
}

MetricsQueryResp contains the list of telemetry values per host.

func MetricsQuery

func MetricsQuery(ctx context.Context, req *MetricsQueryReq) (*MetricsQueryResp, error)

MetricsQuery fetches the requested metrics values from the DAOS nodes.

type MockFabricScan

type MockFabricScan struct {
	Hosts  string
	Fabric *HostFabric
}

MockFabricScan is used to generate HostFabricMap from mock scan results.

type MockFormatConf

type MockFormatConf struct {
	Hosts        int
	ScmPerHost   int
	NvmePerHost  int
	ScmFailures  map[int]struct{}
	NvmeFailures map[int]struct{}
	NvmeRoleBits int
}

MockFormatConf configures the contents of a StorageFormatResp.

type MockHostError

type MockHostError struct {
	Hosts string
	Error string
}

MockHostError represents an error received from multiple hosts.

type MockHostStorageConfig

type MockHostStorageConfig struct {
	HostName   string
	ScmConfig  []MockScmConfig
	NvmeConfig []MockNvmeConfig
}

type MockInvoker

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

MockInvoker implements the Invoker interface in order to enable unit testing of API functions.

func DefaultMockInvoker

func DefaultMockInvoker(log debugLogger) *MockInvoker

DefaultMockInvoker returns a MockInvoker that uses the default configuration.

func NewMockInvoker

func NewMockInvoker(log debugLogger, cfg *MockInvokerConfig) *MockInvoker

NewMockInvoker returns a configured MockInvoker. If a nil config is supplied, the default config is used.

func (*MockInvoker) Debug

func (mi *MockInvoker) Debug(msg string)

func (*MockInvoker) Debugf

func (mi *MockInvoker) Debugf(fmtStr string, args ...interface{})

func (*MockInvoker) GetComponent

func (mi *MockInvoker) GetComponent() build.Component

func (*MockInvoker) GetInvokeCount

func (mi *MockInvoker) GetInvokeCount() int

func (*MockInvoker) GetSystem

func (mi *MockInvoker) GetSystem() string

func (*MockInvoker) InvokeUnaryRPC

func (mi *MockInvoker) InvokeUnaryRPC(ctx context.Context, uReq UnaryRequest) (*UnaryResponse, error)

func (*MockInvoker) InvokeUnaryRPCAsync

func (mi *MockInvoker) InvokeUnaryRPCAsync(ctx context.Context, uReq UnaryRequest) (HostResponseChan, error)

func (*MockInvoker) SetConfig

func (mi *MockInvoker) SetConfig(_ *Config)

type MockInvokerConfig

type MockInvokerConfig struct {
	Sys                 string
	Component           build.Component
	UnaryError          error
	UnaryResponse       *UnaryResponse
	UnaryResponseSet    []*UnaryResponse
	UnaryResponseDelays [][]time.Duration
	HostResponses       HostResponseChan
	ReqTimeout          time.Duration
	RetryTimeout        time.Duration
}

MockInvokerConfig defines the configured responses for a MockInvoker.

func DefaultMockInvokerConfig

func DefaultMockInvokerConfig() *MockInvokerConfig

DefaultMockInvokerConfig returns the default MockInvoker configuration.

type MockMessage

type MockMessage struct{}

MockMessage implements the proto.Message interface, and can be used for test mocks.

func (*MockMessage) ProtoMessage

func (mm *MockMessage) ProtoMessage()

func (*MockMessage) ProtoReflect

func (mm *MockMessage) ProtoReflect() protoreflect.Message

func (*MockMessage) Reset

func (mm *MockMessage) Reset()

func (*MockMessage) String

func (mm *MockMessage) String() string

type MockNvmeConfig

type MockNvmeConfig struct {
	MockStorageConfig
	Rank ranklist.Rank
}

type MockPoolRespConfig

type MockPoolRespConfig struct {
	HostName  string
	Ranks     string
	ScmBytes  uint64
	NvmeBytes uint64
}

MockPoolRespConfig is used to create a pool response with MockPoolCreateResp.

type MockScmConfig

type MockScmConfig struct {
	MockStorageConfig
	Rank ranklist.Rank
}

type MockStorageConfig

type MockStorageConfig struct {
	TotalBytes  uint64 // RAW size of the device
	AvailBytes  uint64 // Available raw storage
	UsableBytes uint64 // Effective storage available for data
	NvmeState   *storage.NvmeDevState
	NvmeRole    *storage.BdevRoles
}

type MockStorageScan

type MockStorageScan struct {
	Hosts    string
	HostScan *ctlpb.StorageScanResp
}

MockStorageScan represents results from scan on multiple hosts.

type NVMeQueryResult

type NVMeQueryResult struct {
	Device storage.NvmeController
}

NVMeQueryResult represents the results of a firmware query for a single NVMe device.

type NVMeUpdateResult

type NVMeUpdateResult struct {
	DevicePCIAddr string
	Error         error
}

NVMeUpdateResult represents the results of a firmware update for a single NVMe device.

type NetworkScanReq

type NetworkScanReq struct {
	Provider string
	// contains filtered or unexported fields
}

NetworkScanReq contains the parameters for a network scan request.

type NetworkScanResp

type NetworkScanResp struct {
	HostErrorsResp
	HostFabrics HostFabricMap
}

NetworkScanResp contains the results of a network scan.

func NetworkScan

func NetworkScan(ctx context.Context, rpcClient UnaryInvoker, req *NetworkScanReq) (*NetworkScanResp, error)

NetworkScan concurrently performs network scans across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host scan operations.

type NvmeAddDeviceReq

type NvmeAddDeviceReq struct {
	PCIAddr          string `json:"pci_addr"`
	EngineIndex      uint32 `json:"engine_index"`
	StorageTierIndex int32  `json:"storage_tier_index"`
	// contains filtered or unexported fields
}

NvmeAddDeviceReq contains the parameters for a storage nvme-add-device request.

If StorageTierIndex is set to -1, this indicates that the server should add the device to the first configured bdev tier.

func (*NvmeAddDeviceReq) WithStorageTierIndex

func (req *NvmeAddDeviceReq) WithStorageTierIndex(i int32) *NvmeAddDeviceReq

WithStorageTierIndex updates request storage tier index value and returns reference.

type NvmeAddDeviceResp

type NvmeAddDeviceResp struct {
	HostErrorsResp
}

NvmeAddDeviceResp contains the response from a storage nvme-add-device request.

func StorageNvmeAddDevice

func StorageNvmeAddDevice(ctx context.Context, rpcClient UnaryInvoker, req *NvmeAddDeviceReq) (*NvmeAddDeviceResp, error)

StorageNvmeAddDevice adds NVMe SSD transport address to an engine configuration.

type NvmeRebindReq

type NvmeRebindReq struct {
	PCIAddr string `json:"pci_addr"`
	// contains filtered or unexported fields
}

NvmeRebindReq contains the parameters for a storage nvme-rebind request.

type NvmeRebindResp

type NvmeRebindResp struct {
	HostErrorsResp
}

NvmeRebindResp contains the response from a storage nvme-rebind request.

func StorageNvmeRebind

func StorageNvmeRebind(ctx context.Context, rpcClient UnaryInvoker, req *NvmeRebindReq) (*NvmeRebindResp, error)

StorageNvmeRebind rebinds NVMe SSD from kernel driver and binds to user-space driver on single server.

type Pool

type Pool struct {
	// UUID uniquely identifies a pool within the system.
	UUID string `json:"uuid"`
	// Label is an optional human-friendly identifier for a pool.
	Label string `json:"label,omitempty"`
	// ServiceLeader is the current pool service leader.
	ServiceLeader uint32 `json:"svc_ldr"`
	// ServiceReplicas is the list of ranks on which this pool's
	// service replicas are running.
	ServiceReplicas []ranklist.Rank `json:"svc_reps"`
	// State is the current state of the pool.
	State string `json:"state"`

	// TargetsTotal is the total number of targets in pool.
	TargetsTotal uint32 `json:"targets_total"`
	// TargetsDisabled is the number of inactive targets in pool.
	TargetsDisabled uint32 `json:"targets_disabled"`

	// UpgradeLayoutVer is latest pool layout version to be upgraded.
	UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"`
	// PoolLayoutVer is current pool layout version.
	PoolLayoutVer uint32 `json:"pool_layout_ver"`

	// QueryErrorMsg reports an RPC error returned from a query.
	QueryErrorMsg string `json:"query_error_msg"`
	// QueryStatusMsg reports any DAOS error returned from a query
	// operation converted into human readable message.
	QueryStatusMsg string `json:"query_status_msg"`

	// Usage contains pool usage statistics for each storage tier.
	Usage []*PoolTierUsage `json:"usage"`

	// PoolRebuildStatus contains detailed information about the pool rebuild process.
	RebuildState string `json:"rebuild_state"`
}

Pool contains a representation of a DAOS Storage Pool including usage statistics.

func (*Pool) GetName

func (p *Pool) GetName() string

GetPool retrieves effective name for pool from either label or UUID.

func (*Pool) HasErrors

func (p *Pool) HasErrors() bool

HasErrors indicates whether a pool query operation failed on this pool.

type PoolCreateReq

type PoolCreateReq struct {
	User       string
	UserGroup  string
	ACL        *AccessControlList `json:"-"`
	NumSvcReps uint32
	Properties []*daos.PoolProperty `json:"-"`
	// auto-config params
	TotalBytes uint64
	TierRatio  []float64
	NumRanks   uint32
	// manual params
	Ranks     []ranklist.Rank
	TierBytes []uint64
	MetaBytes uint64 `json:"meta_blob_size"`
	// contains filtered or unexported fields
}

PoolCreateReq contains the parameters for a pool create request.

func (*PoolCreateReq) MarshalJSON

func (pcr *PoolCreateReq) MarshalJSON() ([]byte, error)

type PoolCreateResp

type PoolCreateResp struct {
	UUID      string   `json:"uuid"`
	Leader    uint32   `json:"svc_ldr"`
	SvcReps   []uint32 `json:"svc_reps"`
	TgtRanks  []uint32 `json:"tgt_ranks"`
	TierBytes []uint64 `json:"tier_bytes"`
}

PoolCreateResp contains the response from a pool create request.

func PoolCreate

func PoolCreate(ctx context.Context, rpcClient UnaryInvoker, req *PoolCreateReq) (*PoolCreateResp, error)

PoolCreate performs a pool create operation on a DAOS Management Server instance. Default values for missing request parameters (e.g. owner/group) are generated when appropriate.

type PoolDeleteACLReq

type PoolDeleteACLReq struct {
	ID        string // UUID or label of the pool
	Principal string // Principal whose entry will be removed
	// contains filtered or unexported fields
}

PoolDeleteACLReq contains the input parameters for PoolDeleteACL.

type PoolDeleteACLResp

type PoolDeleteACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolDeleteACLResp returns the updated ACL for the pool.

func PoolDeleteACL

func PoolDeleteACL(ctx context.Context, rpcClient UnaryInvoker, req *PoolDeleteACLReq) (*PoolDeleteACLResp, error)

PoolDeleteACL sends a request to delete an entry in a pool's Access Control List. If it succeeds, it returns the updated ACL. If it fails, it returns an error.

type PoolDestroyReq

type PoolDestroyReq struct {
	ID        string
	Recursive bool // Remove pool and any child containers.
	Force     bool
	// contains filtered or unexported fields
}

PoolDestroyReq contains the parameters for a pool destroy request.

type PoolDrainReq

type PoolDrainReq struct {
	ID        string
	Rank      ranklist.Rank
	Targetidx []uint32
	// contains filtered or unexported fields
}

PoolDrainReq struct contains request

type PoolEvictReq

type PoolEvictReq struct {
	ID      string
	Handles []string
	// contains filtered or unexported fields
}

PoolEvictReq contains the parameters for a pool evict request.

type PoolExcludeReq

type PoolExcludeReq struct {
	ID        string
	Rank      ranklist.Rank
	Targetidx []uint32
	// contains filtered or unexported fields
}

PoolExcludeReq struct contains request

type PoolExtendReq

type PoolExtendReq struct {
	ID    string
	Ranks []ranklist.Rank
	// contains filtered or unexported fields
}

PoolExtendReq struct contains request

type PoolGetACLReq

type PoolGetACLReq struct {
	ID string // pool ID
	// contains filtered or unexported fields
}

PoolGetACLReq contains the input parameters for PoolGetACL

type PoolGetACLResp

type PoolGetACLResp struct {
	ACL *AccessControlList
}

PoolGetACLResp contains the output results for PoolGetACL

func PoolGetACL

func PoolGetACL(ctx context.Context, rpcClient UnaryInvoker, req *PoolGetACLReq) (*PoolGetACLResp, error)

PoolGetACL gets the Access Control List for the pool.

type PoolGetPropReq

type PoolGetPropReq struct {

	// ID identifies the pool for which this property should be set.
	ID string
	// Name is always a string representation of the pool property.
	// It will be resolved into the C representation prior to being
	// forwarded over dRPC. If not set, all properties will be returned.
	Name string
	// Properties is the list of properties to be retrieved. If empty,
	// all properties will be retrieved.
	Properties []*daos.PoolProperty
	// contains filtered or unexported fields
}

PoolGetPropReq contains pool get-prop parameters.

type PoolInfo

type PoolInfo struct {
	TotalTargets     uint32               `json:"total_targets"`
	ActiveTargets    uint32               `json:"active_targets"`
	TotalEngines     uint32               `json:"total_engines"`
	DisabledTargets  uint32               `json:"disabled_targets"`
	Version          uint32               `json:"version"`
	Leader           uint32               `json:"leader"`
	Rebuild          *PoolRebuildStatus   `json:"rebuild"`
	TierStats        []*StorageUsageStats `json:"tier_stats"`
	EnabledRanks     *ranklist.RankSet    `json:"-"`
	DisabledRanks    *ranklist.RankSet    `json:"-"`
	PoolLayoutVer    uint32               `json:"pool_layout_ver"`
	UpgradeLayoutVer uint32               `json:"upgrade_layout_ver"`
}

PoolInfo contains information about the pool.

type PoolOverwriteACLReq

type PoolOverwriteACLReq struct {
	ID  string             // pool UUID or label
	ACL *AccessControlList // new ACL for the pool
	// contains filtered or unexported fields
}

PoolOverwriteACLReq contains the input parameters for PoolOverwriteACL

type PoolOverwriteACLResp

type PoolOverwriteACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolOverwriteACLResp returns the updated ACL for the pool

func PoolOverwriteACL

func PoolOverwriteACL(ctx context.Context, rpcClient UnaryInvoker, req *PoolOverwriteACLReq) (*PoolOverwriteACLResp, error)

PoolOverwriteACL sends a request to replace the pool's old Access Control List with a new one. If it succeeds, it returns the updated ACL. If not, it returns an error.

type PoolQueryReq

type PoolQueryReq struct {
	ID                   string
	IncludeEnabledRanks  bool
	IncludeDisabledRanks bool
	// contains filtered or unexported fields
}

PoolQueryReq contains the parameters for a pool query request.

type PoolQueryResp

type PoolQueryResp struct {
	Status int32                   `json:"status"`
	State  system.PoolServiceState `json:"state"`
	UUID   string                  `json:"uuid"`
	PoolInfo
}

PoolQueryResp contains the pool query response.

func PoolQuery

func PoolQuery(ctx context.Context, rpcClient UnaryInvoker, req *PoolQueryReq) (*PoolQueryResp, error)

PoolQuery performs a pool query operation for the specified pool ID on a DAOS Management Server instance.

func (*PoolQueryResp) MarshalJSON

func (pqr *PoolQueryResp) MarshalJSON() ([]byte, error)

func (*PoolQueryResp) UnmarshalJSON

func (pqr *PoolQueryResp) UnmarshalJSON(data []byte) error

func (*PoolQueryResp) UpdateState

func (pqr *PoolQueryResp) UpdateState() error

UpdateState update the pool state.

type PoolQueryTargetInfo

type PoolQueryTargetInfo struct {
	Type  PoolQueryTargetType  `json:"target_type"`
	State PoolQueryTargetState `json:"target_state"`
	Space []*StorageTargetUsage
}

PoolQueryTargetInfo contains information about a single target

type PoolQueryTargetReq

type PoolQueryTargetReq struct {
	ID      string
	Rank    ranklist.Rank
	Targets []uint32
	// contains filtered or unexported fields
}

PoolQueryTargetReq contains parameters for a pool query target request

type PoolQueryTargetResp

type PoolQueryTargetResp struct {
	Status int32 `json:"status"`
	Infos  []*PoolQueryTargetInfo
}

PoolQueryTargetResp contains a pool query target response

func PoolQueryTargets

func PoolQueryTargets(ctx context.Context, rpcClient UnaryInvoker, req *PoolQueryTargetReq) (*PoolQueryTargetResp, error)

PoolQueryTargets performs a pool query targets operation on a DAOS Management Server instance, for the specified pool ID, pool engine rank, and target indices.

type PoolQueryTargetState

type PoolQueryTargetState int32
const (
	PoolTargetStateUnknown PoolQueryTargetState = iota
	// PoolTargetStateDownOut indicates the target is not available
	PoolTargetStateDownOut
	// PoolTargetStateDown indicates the target is not available, may need rebuild
	PoolTargetStateDown
	// PoolTargetStateUp indicates the target is up
	PoolTargetStateUp
	// PoolTargetStateUpIn indicates the target is up and running
	PoolTargetStateUpIn
	// PoolTargetStateNew indicates the target is in an intermediate state (pool map change)
	PoolTargetStateNew
	// PoolTargetStateDrain indicates the target is being drained
	PoolTargetStateDrain
)

func (PoolQueryTargetState) MarshalJSON

func (pqts PoolQueryTargetState) MarshalJSON() ([]byte, error)

func (PoolQueryTargetState) String

func (pts PoolQueryTargetState) String() string

type PoolQueryTargetType

type PoolQueryTargetType int32

func (PoolQueryTargetType) MarshalJSON

func (pqtt PoolQueryTargetType) MarshalJSON() ([]byte, error)

func (PoolQueryTargetType) String

func (ptt PoolQueryTargetType) String() string

type PoolRebuildState

type PoolRebuildState int32

PoolRebuildState indicates the current state of the pool rebuild process.

const (
	// PoolRebuildStateIdle indicates that the rebuild process is idle.
	PoolRebuildStateIdle PoolRebuildState = iota
	// PoolRebuildStateDone indicates that the rebuild process has completed.
	PoolRebuildStateDone
	// PoolRebuildStateBusy indicates that the rebuild process is in progress.
	PoolRebuildStateBusy
)

func (PoolRebuildState) MarshalJSON

func (prs PoolRebuildState) MarshalJSON() ([]byte, error)

func (PoolRebuildState) String

func (prs PoolRebuildState) String() string

func (*PoolRebuildState) UnmarshalJSON

func (prs *PoolRebuildState) UnmarshalJSON(data []byte) error

type PoolRebuildStatus

type PoolRebuildStatus struct {
	Status  int32            `json:"status"`
	State   PoolRebuildState `json:"state"`
	Objects uint64           `json:"objects"`
	Records uint64           `json:"records"`
}

PoolRebuildStatus contains detailed information about the pool rebuild process.

type PoolReintegrateReq

type PoolReintegrateReq struct {
	ID        string
	Rank      ranklist.Rank
	Targetidx []uint32
	// contains filtered or unexported fields
}

PoolReintegrateReq struct contains request

type PoolSetPropReq

type PoolSetPropReq struct {

	// ID identifies the pool for which this property should be set.
	ID         string
	Properties []*daos.PoolProperty
	// contains filtered or unexported fields
}

PoolSetPropReq contains pool set-prop parameters.

type PoolTierUsage

type PoolTierUsage struct {
	// TierName identifies a pool's storage tier.
	TierName string `json:"tier_name"`
	// Size is the total number of bytes in the pool tier.
	Size uint64 `json:"size"`
	// Free is the number of free bytes in the pool tier.
	Free uint64 `json:"free"`
	// Imbalance is the percentage imbalance of pool tier usage
	// across all the targets.
	Imbalance uint32 `json:"imbalance"`
}

PoolTierUsage describes usage of a single pool storage tier.

type PoolUpdateACLReq

type PoolUpdateACLReq struct {
	ID  string             // pool UUID or label
	ACL *AccessControlList // ACL entries to add to the pool
	// contains filtered or unexported fields
}

PoolUpdateACLReq contains the input parameters for PoolUpdateACL

type PoolUpdateACLResp

type PoolUpdateACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolUpdateACLResp returns the updated ACL for the pool

func PoolUpdateACL

func PoolUpdateACL(ctx context.Context, rpcClient UnaryInvoker, req *PoolUpdateACLReq) (*PoolUpdateACLResp, error)

PoolUpdateACL sends a request to add new entries and update existing entries in a pool's Access Control List. If it succeeds, it returns the updated ACL. If not, it returns an error.

type PoolUpgradeReq

type PoolUpgradeReq struct {
	ID string
	// contains filtered or unexported fields
}

PoolUpgradeReq contains the parameters for a pool upgrade request.

type PrimaryServiceRank

type PrimaryServiceRank struct {
	Rank        uint32 `json:"rank"`
	Uri         string `json:"uri"`
	ProviderIdx uint32 `json:"provider_idx"`
	NumCtxs     uint32 `json:"num_ctxs"`
}

PrimaryServiceRank provides a rank->uri mapping for a DAOS Primary Service Rank (PSR).

type QuantileMap

type QuantileMap map[float64]float64

QuantileMap is the set of quantile measurements.

func (QuantileMap) Keys

func (m QuantileMap) Keys() []float64

Keys gets the sorted list of quantile keys.

func (QuantileMap) MarshalJSON

func (m QuantileMap) MarshalJSON() ([]byte, error)

MarshalJSON marshals the QuantileMap into JSON.

func (QuantileMap) UnmarshalJSON

func (m QuantileMap) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the QuantileMap from JSON.

type RanksReq

type RanksReq struct {
	Ranks     string `json:"ranks"`
	Force     bool   `json:"force"`
	CheckMode bool   `json:"check_mode"`
	// contains filtered or unexported fields
}

RanksReq contains the parameters for a system ranks request.

func (*RanksReq) SetReportCb

func (r *RanksReq) SetReportCb(cb HostResponseReportFn)

type RanksResp

type RanksResp struct {
	HostErrorsResp // record unresponsive hosts
	RankResults    system.MemberResults
}

RanksResp contains the response from a system ranks request.

func PrepShutdownRanks

func PrepShutdownRanks(ctx context.Context, rpcClient UnaryInvoker, req *RanksReq) (*RanksResp, error)

PrepShutdownRanks concurrently performs prep shutdown ranks across all hosts supplied in the request's hostlist.

This is called from method of the same name in server/ctl_system.go with a populated host list in the request parameter and blocks until all results (successful or otherwise) are received after invoking fan-out. Returns a single response structure containing results generated with request responses from each selected rank.

func ResetFormatRanks

func ResetFormatRanks(ctx context.Context, rpcClient UnaryInvoker, req *RanksReq) (*RanksResp, error)

ResetFormatRanks concurrently resets format state on ranks across all hosts supplied in the request's hostlist.

This is called from SystemResetFormat in server/ctl_system.go with a populated host list in the request parameter and blocks until all results (successful or otherwise) are received after invoking fan-out. Returns a single response structure containing results generated with request responses from each selected rank.

func StartRanks

func StartRanks(ctx context.Context, rpcClient UnaryInvoker, req *RanksReq) (*RanksResp, error)

StartRanks concurrently performs start ranks across all hosts supplied in the request's hostlist.

This is called from SystemStart in server/ctl_system.go with a populated host list in the request parameter and blocks until all results (successful or otherwise) are received after invoking fan-out. Returns a single response structure containing results generated with request responses from each selected rank.

func StopRanks

func StopRanks(ctx context.Context, rpcClient UnaryInvoker, req *RanksReq) (*RanksResp, error)

StopRanks concurrently performs stop ranks across all hosts supplied in the request's hostlist.

This is called from method of the same name in server/ctl_system.go with a populated host list in the request parameter and blocks until all results (successful or otherwise) are received after invoking fan-out. Returns a single response structure containing results generated with request responses from each selected rank.

type SCMQueryResult

type SCMQueryResult struct {
	Module storage.ScmModule
	Info   *storage.ScmFirmwareInfo
	Error  error
}

SCMFirmwareResult represents the results of a firmware query for a single SCM device.

type SCMUpdateResult

type SCMUpdateResult struct {
	Module storage.ScmModule
	Error  error
}

SCMUpdateResult represents the results of a firmware update for a single SCM device.

type SetEngineLogMasksReq

type SetEngineLogMasksReq struct {
	Masks      *string `json:"masks"`
	Streams    *string `json:"streams"`
	Subsystems *string `json:"subsystems"`
	// contains filtered or unexported fields
}

SetEngineLogMasksReq contains the inputs for the set engine log level request.

type SetEngineLogMasksResp

type SetEngineLogMasksResp struct {
	HostErrorsResp
	HostStorage HostStorageMap
}

SetEngineLogMasksResp contains the results of a set engine log level request.

func SetEngineLogMasks

func SetEngineLogMasks(ctx context.Context, rpcClient UnaryInvoker, req *SetEngineLogMasksReq) (*SetEngineLogMasksResp, error)

SetEngineLogMasks will send RPC to hostlist to request changes to log level of all DAOS engines on each host in list.

type SimpleMetric

type SimpleMetric struct {
	Labels LabelMap `json:"labels"`
	Value  float64  `json:"value"`
}

SimpleMetric is a specific metric with a value.

func (*SimpleMetric) IsMetric

func (*SimpleMetric) IsMetric()

IsMetric identifies SimpleMetric as a Metric.

type SmdInfo

type SmdInfo struct {
	Devices []*storage.SmdDevice `hash:"set" json:"devices"`
	Pools   SmdPoolMap           `json:"pools"`
}

SmdInfo encapsulates SMD-specific information.

func (*SmdInfo) String

func (si *SmdInfo) String() string

type SmdManageOpcode

type SmdManageOpcode uint8

SmdManageOpcode defines an SmdManage operation.

const (
	SetFaultyOp SmdManageOpcode
	DevReplaceOp
	LedCheckOp
	LedBlinkOp
	LedResetOp
)

SmdManageOpcode definitions

func (SmdManageOpcode) String

func (smo SmdManageOpcode) String() string

type SmdManageReq

type SmdManageReq struct {
	IDs             string // comma separated list of IDs
	Rank            ranklist.Rank
	ReplaceUUID     string // For device replacement, UUID of new device
	ReplaceNoReint  bool   // For device replacement, indicate no reintegration
	IdentifyTimeout uint32 // For LED identify, blink duration in minutes
	Operation       SmdManageOpcode
	// contains filtered or unexported fields
}

SmdManageReq contains the request parameters for a SMD query operation.

type SmdPool

type SmdPool struct {
	UUID      string        `json:"uuid"`
	TargetIDs []int32       `hash:"set" json:"tgt_ids"`
	Blobs     []uint64      `hash:"set" json:"blobs"`
	Rank      ranklist.Rank `hash:"set" json:"rank"`
}

SmdPool contains the per-server components of a DAOS pool.

type SmdPoolMap

type SmdPoolMap map[string][]*SmdPool

SmdPoolMap provides a map from pool UUIDs to per-rank pool info.

type SmdQueryReq

type SmdQueryReq struct {
	OmitDevices      bool          `json:"omit_devices"`
	OmitPools        bool          `json:"omit_pools"`
	IncludeBioHealth bool          `json:"include_bio_health"`
	UUID             string        `json:"uuid"`
	Rank             ranklist.Rank `json:"rank"`
	FaultyDevsOnly   bool          `json:"-"` // only show faulty devices
	// contains filtered or unexported fields
}

SmdQueryReq contains the request parameters for a SMD query operation.

type SmdResp

type SmdResp struct {
	HostErrorsResp
	HostStorage HostStorageMap `json:"host_storage_map"`
}

SmdResp represents the results of performing SMD query or manage operations across a set of hosts.

func SmdManage

func SmdManage(ctx context.Context, rpcClient UnaryInvoker, req *SmdManageReq) (*SmdResp, error)

SmdManage concurrently performs per-server metadata operations across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all SMD operations.

func SmdQuery

func SmdQuery(ctx context.Context, rpcClient UnaryInvoker, req *SmdQueryReq) (*SmdResp, error)

SmdQuery concurrently performs per-server metadata operations across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all SMD operations.

func (*SmdResp) ResultCount

func (sr *SmdResp) ResultCount() int

type StorageFormatReq

type StorageFormatReq struct {
	Reformat bool
	// contains filtered or unexported fields
}

StorageFormatReq contains the parameters for a storage format request.

type StorageFormatResp

type StorageFormatResp struct {
	HostErrorsResp
	HostStorage HostStorageMap
}

StorageFormatResp contains the response from a storage format request.

func MockFormatResp

func MockFormatResp(t *testing.T, mfc MockFormatConf) *StorageFormatResp

MockFormatResp returns a populated StorageFormatResp based on input config.

func StorageFormat

func StorageFormat(ctx context.Context, rpcClient UnaryInvoker, req *StorageFormatReq) (*StorageFormatResp, error)

StorageFormat concurrently performs storage preparation steps across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host storage prepare operations.

type StorageMediaType

type StorageMediaType int32
const (
	// StorageMediaTypeScm indicates that the media is storage class (persistent) memory
	StorageMediaTypeScm StorageMediaType = iota
	// StorageMediaTypeNvme indicates that the media is NVMe SSD
	StorageMediaTypeNvme
)

func (StorageMediaType) MarshalJSON

func (smt StorageMediaType) MarshalJSON() ([]byte, error)

func (StorageMediaType) String

func (smt StorageMediaType) String() string

type StorageScanReq

type StorageScanReq struct {
	Usage      bool
	NvmeHealth bool
	NvmeBasic  bool
	// contains filtered or unexported fields
}

StorageScanReq contains the parameters for a storage scan request.

type StorageScanResp

type StorageScanResp struct {
	HostErrorsResp
	HostStorage HostStorageMap
}

StorageScanResp contains the response from a storage scan request.

func StorageScan

func StorageScan(ctx context.Context, rpcClient UnaryInvoker, req *StorageScanReq) (*StorageScanResp, error)

StorageScan concurrently performs storage scans across all hosts supplied in the request's hostlist, or all configured hosts if not explicitly specified. The function blocks until all results (successful or otherwise) are received, and returns a single response structure containing results for all host scan operations.

NumaHealth option requests SSD health statistics. NumaMeta option requests DAOS server meta data stored on SSDs. NumaBasic option strips SSD details down to only the most basic.

type StorageTargetUsage

type StorageTargetUsage struct {
	Total     uint64           `json:"total"`
	Free      uint64           `json:"free"`
	MediaType StorageMediaType `json:"media_type"`
}

StorageTargetUsage represents DAOS target storage usage

type StorageUsageStats

type StorageUsageStats struct {
	Total     uint64           `json:"total"`
	Free      uint64           `json:"free"`
	Min       uint64           `json:"min"`
	Max       uint64           `json:"max"`
	Mean      uint64           `json:"mean"`
	MediaType StorageMediaType `json:"media_type"`
}

StorageUsageStats represents DAOS storage usage statistics.

type SummaryMetric

type SummaryMetric struct {
	Labels      LabelMap    `json:"labels"`
	SampleCount uint64      `json:"sample_count"`
	SampleSum   float64     `json:"sample_sum"`
	Quantiles   QuantileMap `json:"quantiles"`
}

SummaryMetric represents a group of observations.

func (*SummaryMetric) IsMetric

func (*SummaryMetric) IsMetric()

IsMetric identifies SummaryMetric as a Metric.

func (*SummaryMetric) UnmarshalJSON

func (m *SummaryMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a SummaryMetric from JSON.

type SystemCheckDisableReq

type SystemCheckDisableReq struct {
	mgmtpb.CheckDisableReq
	// contains filtered or unexported fields
}

type SystemCheckEnableReq

type SystemCheckEnableReq struct {
	mgmtpb.CheckEnableReq
	// contains filtered or unexported fields
}

type SystemCheckFindingClass

type SystemCheckFindingClass chkpb.CheckInconsistClass

func CheckerPolicyClasses

func CheckerPolicyClasses() []SystemCheckFindingClass

func (*SystemCheckFindingClass) FromString

func (c *SystemCheckFindingClass) FromString(in string) error

func (SystemCheckFindingClass) String

func (c SystemCheckFindingClass) String() string

type SystemCheckFlags

type SystemCheckFlags uint32

func (SystemCheckFlags) MarshalJSON

func (f SystemCheckFlags) MarshalJSON() ([]byte, error)

func (SystemCheckFlags) String

func (f SystemCheckFlags) String() string

type SystemCheckGetPolicyReq

type SystemCheckGetPolicyReq struct {
	mgmtpb.CheckGetPolicyReq
	// contains filtered or unexported fields
}

func (*SystemCheckGetPolicyReq) SetClasses

func (r *SystemCheckGetPolicyReq) SetClasses(classes []SystemCheckFindingClass)

type SystemCheckGetPolicyResp

type SystemCheckGetPolicyResp struct {
	CheckerFlags SystemCheckFlags     `json:"checker_flags"`
	Policies     []*SystemCheckPolicy `json:"policies"`
}

func SystemCheckGetPolicy

func SystemCheckGetPolicy(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckGetPolicyReq) (*SystemCheckGetPolicyResp, error)

SystemCheckGetPolicy queries the system checker properties.

type SystemCheckPolicy

type SystemCheckPolicy struct {
	FindingClass SystemCheckFindingClass
	RepairAction SystemCheckRepairAction
}

func NewSystemCheckPolicy

func NewSystemCheckPolicy(cls, act string) (*SystemCheckPolicy, error)

func (*SystemCheckPolicy) MarshalJSON

func (p *SystemCheckPolicy) MarshalJSON() ([]byte, error)

func (*SystemCheckPolicy) String

func (p *SystemCheckPolicy) String() string

func (*SystemCheckPolicy) UnmarshalJSON

func (p *SystemCheckPolicy) UnmarshalJSON(in []byte) error

type SystemCheckPoolInfo

type SystemCheckPoolInfo struct {
	RawRankInfo rawRankMap    `json:"-"`
	UUID        string        `json:"uuid"`
	Label       string        `json:"label"`
	Status      string        `json:"status"`
	Phase       string        `json:"phase"`
	StartTime   time.Time     `json:"-"`
	Remaining   time.Duration `json:"-"`
	Elapsed     time.Duration `json:"-"`
}

func (*SystemCheckPoolInfo) MarshalJSON

func (p *SystemCheckPoolInfo) MarshalJSON() ([]byte, error)

func (*SystemCheckPoolInfo) String

func (p *SystemCheckPoolInfo) String() string

func (*SystemCheckPoolInfo) Unchecked

func (p *SystemCheckPoolInfo) Unchecked() bool

type SystemCheckQueryReq

type SystemCheckQueryReq struct {
	mgmtpb.CheckQueryReq
	// contains filtered or unexported fields
}

type SystemCheckQueryResp

type SystemCheckQueryResp struct {
	Status    SystemCheckStatus    `json:"status"`
	ScanPhase SystemCheckScanPhase `json:"scan_phase"`
	StartTime time.Time            `json:"start_time"`

	Pools   map[string]*SystemCheckPoolInfo `json:"pools"`
	Reports []*SystemCheckReport            `json:"reports"`
}

func SystemCheckQuery

func SystemCheckQuery(ctx context.Context, rpcClient UnaryInvoker, req *SystemCheckQueryReq) (*SystemCheckQueryResp, error)

SystemCheckQuery queries the system checker status.

func (*SystemCheckQueryResp) MarshalJSON

func (r *SystemCheckQueryResp) MarshalJSON() ([]byte, error)

type SystemCheckRepairAction

type SystemCheckRepairAction chkpb.CheckInconsistAction

func CheckerPolicyActions

func CheckerPolicyActions() []SystemCheckRepairAction

func (*SystemCheckRepairAction) FromString

func (a *SystemCheckRepairAction) FromString(in string) error

func (SystemCheckRepairAction) String

func (a SystemCheckRepairAction) String() string

type SystemCheckRepairChoice

type SystemCheckRepairChoice struct {
	Action SystemCheckRepairAction
	Info   string
}

SystemCheckRepairChoice describes a possible means to repair a checker error.

type SystemCheckRepairReq

type SystemCheckRepairReq struct {
	mgmtpb.CheckActReq
	// contains filtered or unexported fields
}

func (*SystemCheckRepairReq) SetAction

func (r *SystemCheckRepairReq) SetAction(action int32) error

type SystemCheckReport

type SystemCheckReport struct {
	chkpb.CheckReport
}

SystemCheckReport contains the results of a system check.

func (*SystemCheckReport) IsInteractive

func (r *SystemCheckReport) IsInteractive() bool

IsInteractive indicates whether this report requires user interaction to make a repair choice.

func (*SystemCheckReport) IsRemovedPool

func (r *SystemCheckReport) IsRemovedPool() bool

IsRemovedPool indicates whether the error detected in this report indicates a missing pool.

func (*SystemCheckReport) RepairChoices

func (r *SystemCheckReport) RepairChoices() []*SystemCheckRepairChoice

RepairChoices lists all possible repair options for this particular report.

func (*SystemCheckReport) Resolution

func (r *SystemCheckReport) Resolution() string

Resolution returns a string describing the action taken to resolve this report.

type SystemCheckScanPhase

type SystemCheckScanPhase chkpb.CheckScanPhase

func (SystemCheckScanPhase) Description

func (p SystemCheckScanPhase) Description() string

func (SystemCheckScanPhase) MarshalJSON

func (p SystemCheckScanPhase) MarshalJSON() ([]byte, error)

func (SystemCheckScanPhase) String

func (p SystemCheckScanPhase) String() string

type SystemCheckSetPolicyReq

type SystemCheckSetPolicyReq struct {
	ResetToDefaults bool
	AllInteractive  bool
	Policies        []*SystemCheckPolicy
	mgmtpb.CheckSetPolicyReq
	// contains filtered or unexported fields
}

type SystemCheckStartReq

type SystemCheckStartReq struct {
	Policies []*SystemCheckPolicy
	mgmtpb.CheckStartReq
	// contains filtered or unexported fields
}

type SystemCheckStatus

type SystemCheckStatus chkpb.CheckInstStatus

func (SystemCheckStatus) MarshalJSON

func (p SystemCheckStatus) MarshalJSON() ([]byte, error)

func (SystemCheckStatus) String

func (s SystemCheckStatus) String() string

type SystemCheckStopReq

type SystemCheckStopReq struct {
	mgmtpb.CheckStopReq
	// contains filtered or unexported fields
}

type SystemCleanupReq

type SystemCleanupReq struct {
	Machine string `json:"machine"`
	// contains filtered or unexported fields
}

SystemCleanupReq contains the inputs for the system cleanup request.

func (*SystemCleanupReq) SetHosts

func (req *SystemCleanupReq) SetHosts(hosts *hostlist.HostSet)

func (*SystemCleanupReq) SetRanks

func (req *SystemCleanupReq) SetRanks(ranks *ranklist.RankSet)

type SystemCleanupResp

type SystemCleanupResp struct {
	Results []*CleanupResult `json:"results"`
}

SystemCleanupResp contains the request response.

func SystemCleanup

func SystemCleanup(ctx context.Context, rpcClient UnaryInvoker, req *SystemCleanupReq) (*SystemCleanupResp, error)

SystemCleanup requests resources associated with a machine name be cleanedup.

func (*SystemCleanupResp) Errors

func (scr *SystemCleanupResp) Errors() error

Errors returns a single error combining all error messages associated with a system cleanup response.

type SystemEraseReq

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

SystemEraseReq contains the inputs for a system erase request.

func (*SystemEraseReq) SetMaxTries

func (r *SystemEraseReq) SetMaxTries(mt uint)

SetMaxTries sets the maximum number of request attempts.

type SystemEraseResp

type SystemEraseResp struct {
	HostErrorsResp
	Results system.MemberResults
}

SystemEraseResp contains the results of a system erase request.

func SystemErase

func SystemErase(ctx context.Context, rpcClient UnaryInvoker, req *SystemEraseReq) (*SystemEraseResp, error)

SystemErase initiates a wipe of system metadata prior to reformatting storage.

func (*SystemEraseResp) Errors

func (resp *SystemEraseResp) Errors() error

Errors returns error if any of the results indicate a failure.

type SystemExcludeReq

type SystemExcludeReq struct {
	Clear bool
	// contains filtered or unexported fields
}

SystemExcludeReq contains the inputs for the system exclude request.

func (*SystemExcludeReq) SetHosts

func (req *SystemExcludeReq) SetHosts(hosts *hostlist.HostSet)

func (*SystemExcludeReq) SetRanks

func (req *SystemExcludeReq) SetRanks(ranks *ranklist.RankSet)

type SystemExcludeResp

type SystemExcludeResp struct {
	Results system.MemberResults
	// contains filtered or unexported fields
}

SystemExcludeResp contains the request response.

func SystemExclude

func SystemExclude(ctx context.Context, rpcClient UnaryInvoker, req *SystemExcludeReq) (*SystemExcludeResp, error)

SystemExclude will mark the specified ranks as administratively excluded from the system.

func (*SystemExcludeResp) Errors

func (resp *SystemExcludeResp) Errors() error

Errors returns a single error combining all error messages associated with a system exclude response.

type SystemGetAttrReq

type SystemGetAttrReq struct {
	Keys []string
	// contains filtered or unexported fields
}

SystemGetAttrReq contains the inputs for the system get-attr request.

type SystemGetAttrResp

type SystemGetAttrResp struct {
	Attributes map[string]string `json:"attributes"`
}

SystemGetAttrResp contains the request response.

func SystemGetAttr

func SystemGetAttr(ctx context.Context, rpcClient UnaryInvoker, req *SystemGetAttrReq) (*SystemGetAttrResp, error)

SystemGetAttr gets system attributes.

type SystemGetPropReq

type SystemGetPropReq struct {
	Keys []daos.SystemPropertyKey
	// contains filtered or unexported fields
}

SystemGetPropReq contains the inputs for the system get-attr request.

type SystemGetPropResp

type SystemGetPropResp struct {
	Properties []*daos.SystemProperty `json:"properties"`
}

SystemGetPropResp contains the request response.

func SystemGetProp

func SystemGetProp(ctx context.Context, rpcClient UnaryInvoker, req *SystemGetPropReq) (*SystemGetPropResp, error)

SystemGetProp gets system attributes.

type SystemJoinReq

type SystemJoinReq struct {
	ControlAddr          *net.TCPAddr
	UUID                 string
	Rank                 ranklist.Rank
	URI                  string
	SecondaryURIs        []string            `json:"secondary_uris"`
	NumContexts          uint32              `json:"nctxs"`
	NumSecondaryContexts []uint32            `json:"secondary_nctxs"`
	FaultDomain          *system.FaultDomain `json:"srv_fault_domain"`
	InstanceIdx          uint32              `json:"idx"`
	Incarnation          uint64              `json:"incarnation"`
	CheckMode            bool                `json:"check_mode"`
	// contains filtered or unexported fields
}

SystemJoinReq contains the inputs for the system join request.

func (*SystemJoinReq) MarshalJSON

func (req *SystemJoinReq) MarshalJSON() ([]byte, error)

MarshalJSON packs SystemJoinResp struct into a JSON message.

func (*SystemJoinReq) SetMaxTries

func (r *SystemJoinReq) SetMaxTries(mt uint)

SetMaxTries sets the maximum number of request attempts.

type SystemJoinResp

type SystemJoinResp struct {
	Rank       ranklist.Rank
	State      system.MemberState
	LocalJoin  bool
	MapVersion uint32 `json:"map_version"`
}

SystemJoinResp contains the request response.

func SystemJoin

func SystemJoin(ctx context.Context, rpcClient UnaryInvoker, req *SystemJoinReq) (*SystemJoinResp, error)

SystemJoin will attempt to join a new member to the DAOS system.

func (*SystemJoinResp) UnmarshalJSON

func (resp *SystemJoinResp) UnmarshalJSON(data []byte) error

type SystemQueryReq

type SystemQueryReq struct {
	FailOnUnavailable bool               // Fail without retrying if the MS is unavailable
	NotOK             bool               // Only show engines not in a joined state
	WantedStates      system.MemberState // Bitmask of desired states
	// contains filtered or unexported fields
}

SystemQueryReq contains the inputs for the system query request.

func (*SystemQueryReq) SetHosts

func (req *SystemQueryReq) SetHosts(hosts *hostlist.HostSet)

func (*SystemQueryReq) SetMaxTries

func (r *SystemQueryReq) SetMaxTries(mt uint)

SetMaxTries sets the maximum number of request attempts.

func (*SystemQueryReq) SetRanks

func (req *SystemQueryReq) SetRanks(ranks *ranklist.RankSet)

type SystemQueryResp

type SystemQueryResp struct {
	Members   system.Members `json:"members"`
	Providers []string       `json:"providers"`
	// contains filtered or unexported fields
}

SystemQueryResp contains the request response.

func SystemQuery

func SystemQuery(ctx context.Context, rpcClient UnaryInvoker, req *SystemQueryReq) (*SystemQueryResp, error)

SystemQuery requests DAOS system status.

Handles MS requests sent from management client app e.g. 'dmg' and calls into mgmt_system.go method of the same name. The triggered method uses the control API to fanout to (selection or all) gRPC servers listening as part of the DAOS system and retrieve results from the selected ranks hosted there.

func (*SystemQueryResp) Errors

func (resp *SystemQueryResp) Errors() error

Errors returns a single error combining all error messages associated with a system query response.

func (*SystemQueryResp) UnmarshalJSON

func (resp *SystemQueryResp) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks JSON message into SystemQueryResp struct.

type SystemSetAttrReq

type SystemSetAttrReq struct {
	Attributes map[string]string
	// contains filtered or unexported fields
}

SystemSetAttrReq contains the inputs for the system set-attr request.

type SystemSetPropReq

type SystemSetPropReq struct {
	Properties map[daos.SystemPropertyKey]daos.SystemPropertyValue
	// contains filtered or unexported fields
}

SystemSetPropReq contains the inputs for the system set-prop request.

type SystemStartReq

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

SystemStartReq contains the inputs for the system start request.

func (*SystemStartReq) SetHosts

func (req *SystemStartReq) SetHosts(hosts *hostlist.HostSet)

func (*SystemStartReq) SetRanks

func (req *SystemStartReq) SetRanks(ranks *ranklist.RankSet)

type SystemStartResp

type SystemStartResp struct {
	Results system.MemberResults // resulting from harness starts
	// contains filtered or unexported fields
}

SystemStartResp contains the request response.

func SystemStart

func SystemStart(ctx context.Context, rpcClient UnaryInvoker, req *SystemStartReq) (*SystemStartResp, error)

SystemStart will perform a start after a controlled shutdown of DAOS system.

Handles MS requests sent from management client app e.g. 'dmg' and calls into mgmt_system.go method of the same name. The triggered method uses the control API to fanout to (selection or all) gRPC servers listening as part of the DAOS system and retrieve results from the selected ranks hosted there.

func (*SystemStartResp) Errors

func (resp *SystemStartResp) Errors() error

Errors returns a single error combining all error messages associated with a system start response.

func (*SystemStartResp) UnmarshalJSON

func (resp *SystemStartResp) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks JSON message into SystemStartResp struct.

type SystemStopReq

type SystemStopReq struct {
	Force bool
	// contains filtered or unexported fields
}

SystemStopReq contains the inputs for the system stop command.

func (*SystemStopReq) SetHosts

func (req *SystemStopReq) SetHosts(hosts *hostlist.HostSet)

func (*SystemStopReq) SetRanks

func (req *SystemStopReq) SetRanks(ranks *ranklist.RankSet)

type SystemStopResp

type SystemStopResp struct {
	Results system.MemberResults
	// contains filtered or unexported fields
}

SystemStopResp contains the request response.

func SystemStop

func SystemStop(ctx context.Context, rpcClient UnaryInvoker, req *SystemStopReq) (*SystemStopResp, error)

SystemStop will perform a two-phase controlled shutdown of DAOS system and a list of remaining system members on failure.

Handles MS requests sent from management client app e.g. 'dmg' and calls into mgmt_system.go method of the same name. The triggered method uses the control API to fanout to (selection or all) gRPC servers listening as part of the DAOS system and retrieve results from the selected ranks hosted there.

func (*SystemStopResp) Errors

func (resp *SystemStopResp) Errors() error

Errors returns a single error combining all error messages associated with a system stop response.

func (*SystemStopResp) UnmarshalJSON

func (resp *SystemStopResp) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks JSON message into SystemStopResp struct.

type UnaryInvoker

type UnaryInvoker interface {
	GetComponent() build.Component
	InvokeUnaryRPC(ctx context.Context, req UnaryRequest) (*UnaryResponse, error)
	InvokeUnaryRPCAsync(ctx context.Context, req UnaryRequest) (HostResponseChan, error)
	// contains filtered or unexported methods
}

UnaryInvoker defines an interface to be implemented by clients capable of invoking a unary RPC (1 response for 1 request).

type UnaryRequest

type UnaryRequest interface {
	// contains filtered or unexported methods
}

UnaryRequest defines an interface to be implemented by unary request types (1 response to 1 request).

type UnaryResponse

type UnaryResponse struct {
	Responses []*HostResponse
	// contains filtered or unexported fields
}

UnaryResponse contains a slice of *HostResponse items returned from synchronous unary RPC invokers.

func MockMSResponse

func MockMSResponse(hostAddr string, hostErr error, hostMsg proto.Message) *UnaryResponse

MockMSResponse creates a synthetic Management Service response from the supplied HostResponse values.

Jump to

Keyboard shortcuts

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