storage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 32

Documentation

Overview

(C) Copyright 2019-2020 Intel Corporation.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019-2020 Intel Corporation.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019 Intel Corporation.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockUUID added in v0.9.0

func MockUUID(varIdx ...int32) string

Types

type BdevClass

type BdevClass string

BdevClass specifies block device type for block device storage

const (
	BdevClassNone   BdevClass = ""
	BdevClassNvme   BdevClass = "nvme"
	BdevClassMalloc BdevClass = "malloc"
	BdevClassKdev   BdevClass = "kdev"
	BdevClassFile   BdevClass = "file"
)

func (BdevClass) String

func (b BdevClass) String() string

func (*BdevClass) UnmarshalYAML

func (b *BdevClass) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler on BdevClass type

type BdevConfig

type BdevConfig struct {
	ConfigPath  string    `yaml:"-" cmdLongFlag:"--nvme" cmdShortFlag:"-n"`
	Class       BdevClass `yaml:"bdev_class,omitempty"`
	DeviceList  []string  `yaml:"bdev_list,omitempty"`
	DeviceCount int       `yaml:"bdev_number,omitempty"`
	FileSize    int       `yaml:"bdev_size,omitempty"`
	ShmID       int       `yaml:"-" cmdLongFlag:"--shm_id,nonzero" cmdShortFlag:"-i,nonzero"`
	MemSize     int       `yaml:"-" cmdLongFlag:"--mem_size,nonzero" cmdShortFlag:"-r,nonzero"`
	VosEnv      string    `yaml:"-" cmdEnv:"VOS_BDEV_CLASS"`
	Hostname    string    `yaml:"-"` // used when generating templates
}

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

func (*BdevConfig) GetNvmeDevs

func (bc *BdevConfig) GetNvmeDevs() []string

func (*BdevConfig) Validate

func (bc *BdevConfig) Validate() error

type NvmeController added in v0.8.0

type NvmeController struct {
	Model       string
	Serial      string
	PciAddr     string
	FwRev       string
	SocketID    int32
	HealthStats *NvmeDeviceHealth
	Namespaces  []*NvmeNamespace
}

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

func MockNvmeController added in v0.8.0

func MockNvmeController(varIdx ...int32) *NvmeController

type NvmeControllers added in v0.8.0

type NvmeControllers []*NvmeController

NvmeControllers is a type alias for []*NvmeController which implements fmt.Stringer.

type NvmeDeviceHealth added in v0.8.0

type NvmeDeviceHealth struct {
	Temp            uint32
	TempWarnTime    uint32
	TempCritTime    uint32
	CtrlBusyTime    uint64
	PowerCycles     uint64
	PowerOnHours    uint64
	UnsafeShutdowns uint64
	MediaErrors     uint64
	ErrorLogEntries uint64
	TempWarn        bool
	AvailSpareWarn  bool
	ReliabilityWarn bool
	ReadOnlyWarn    bool
	VolatileWarn    bool
}

NvmeDeviceHealth represents a set of health statistics for a NVMe device.

func MockNvmeDeviceHealth added in v0.8.0

func MockNvmeDeviceHealth(varIdx ...int32) *NvmeDeviceHealth

type NvmeNamespace added in v0.8.0

type NvmeNamespace struct {
	ID   uint32
	Size uint64
}

NvmeNamespace represents an individual NVMe namespace on a device.

func MockNvmeNamespace added in v0.8.0

func MockNvmeNamespace(varIdx ...int32) *NvmeNamespace

type ScmClass

type ScmClass string

ScmClass specifies device type for Storage Class Memory

const (
	ScmClassNone ScmClass = ""
	ScmClassDCPM ScmClass = "dcpm"
	ScmClassRAM  ScmClass = "ram"
)

func (ScmClass) String

func (s ScmClass) String() string

func (*ScmClass) UnmarshalYAML

func (s *ScmClass) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler on ScmClass type

type ScmConfig

type ScmConfig struct {
	MountPoint  string   `yaml:"scm_mount,omitempty" cmdLongFlag:"--storage" cmdShortFlag:"-s"`
	Class       ScmClass `yaml:"scm_class,omitempty"`
	RamdiskSize int      `yaml:"scm_size,omitempty"`
	DeviceList  []string `yaml:"scm_list,omitempty"`
}

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

func (*ScmConfig) Validate

func (sc *ScmConfig) Validate() error

type ScmModule

type ScmModule struct {
	ChannelID       uint32
	ChannelPosition uint32
	ControllerID    uint32
	SocketID        uint32
	PhysicalID      uint32
	Capacity        uint64
}

ScmModule represents a SCM DIMM.

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

func MockScmModule added in v0.9.0

func MockScmModule(varIdx ...int32) *ScmModule

func (*ScmModule) String

func (sm *ScmModule) String() string

type ScmModules

type ScmModules []*ScmModule

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

func (ScmModules) Capacity added in v0.9.1

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

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

func (ScmModules) String

func (sms ScmModules) String() string

func (ScmModules) Summary

func (sms ScmModules) Summary() string

Summary reports total storage space and the number of modules.

Capacity given in IEC standard units.

type ScmNamespace

type ScmNamespace struct {
	UUID        string `json:"uuid"`
	BlockDevice string `json:"blockdev"`
	Name        string `json:"dev"`
	NumaNode    uint32 `json:"numa_node"`
	Size        uint64 `json:"size"`
}

ScmNamespace represents a mapping of AppDirect regions to block device files.

func MockScmNamespace added in v0.9.0

func MockScmNamespace(varIdx ...int32) *ScmNamespace

func (*ScmNamespace) String

func (sn *ScmNamespace) String() string

type ScmNamespaces

type ScmNamespaces []*ScmNamespace

ScmNamespaces is a type alias for []ScmNamespace that implements fmt.Stringer.

func (ScmNamespaces) Capacity added in v0.9.1

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

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

func (ScmNamespaces) String

func (sns ScmNamespaces) String() string

func (ScmNamespaces) Summary

func (sns ScmNamespaces) Summary() string

Summary reports total storage space and the number of namespaces.

Capacity given in IEC standard units.

type ScmState

type ScmState int

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

const (
	// ScmStateUnknown represents the default (unknown) state.
	ScmStateUnknown ScmState = iota
	// ScmStateNoRegions indicates that SCM modules exist, but
	// no regions have been created.
	ScmStateNoRegions
	// ScmStateFreeCapacity indicates that SCM modules exist with
	// configured regions that have available capacity.
	ScmStateFreeCapacity
	// ScmStateNoCapacity indicates that SCM modules exist with
	// configured regions but not available capacity.
	ScmStateNoCapacity
)

func (ScmState) String

func (i ScmState) String() string

Directories

Path Synopsis
(C) Copyright 2019-2020 Intel Corporation.
(C) Copyright 2019-2020 Intel Corporation.
(C) Copyright 2019-2020 Intel Corporation.
(C) Copyright 2019-2020 Intel Corporation.

Jump to

Keyboard shortcuts

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