raid

package
v0.3.10-0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

View Source
const (
	MODULE_MEGARAID = "megaraid_sas"
	MODULE_HPSA     = "hpsa"
	MODULE_MPT2SAS  = "mpt2sas"
	MODULE_MPT3SAS  = "mpt3sas"
	MODULE_AACRAID  = "aacraid"
	MODULE_SMARTPQI = "smartpqi"
)
View Source
const (
	MaxUint                   = ^uint(0)
	MaxInt                    = int(MaxUint >> 1)
	UnknownLogicalVolumeIndex = MaxInt
)

Variables

View Source
var (
	Debug bool
)
View Source
var RaidDrivers sRaidDrivers

Functions

func GetCommand

func GetCommand(bin string, args ...string) string

func GetModules

func GetModules(term IExecTerm) []string

func RegisterDriver

func RegisterDriver(name string, drv RaidDriverFactory)

func SGMap

func SGMap(term IExecTerm) ([]compute.SGMapItem, error)

Types

type IExecTerm

type IExecTerm interface {
	Run(cmds ...string) ([]string, error)
	RunWithInput(input io.Reader, cmds ...string) ([]string, error)
}

type IRaidAdapter

type IRaidAdapter interface {
	GetIndex() int
	PreBuildRaid(confs []*api.BaremetalDiskConfig) error
	GetLogicVolumes() ([]*RaidLogicalVolume, error)
	RemoveLogicVolumes() error
	GetDevices() []*baremetal.BaremetalStorage

	BuildRaid0(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error
	BuildRaid1(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error
	BuildRaid5(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error
	BuildRaid10(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error
	BuildNoneRaid(devs []*baremetal.BaremetalStorage) error
	PostBuildRaid() error
}

type IRaidDriver

type IRaidDriver interface {
	ParsePhyDevs() error
	GetName() string
	GetAdapters() []IRaidAdapter
	PreBuildRaid(confs []*api.BaremetalDiskConfig, adapterIdx int) error

	CleanRaid() error
}

type RaidBasePhyDev

type RaidBasePhyDev struct {
	Adapter int
	Size    int64
	Model   string
	Rotate  tristate.TriState
	Status  string
	Driver  string
}

func NewRaidBasePhyDev

func NewRaidBasePhyDev(driver string) *RaidBasePhyDev

func (*RaidBasePhyDev) IsComplete

func (dev *RaidBasePhyDev) IsComplete() bool

func (*RaidBasePhyDev) ToBaremetalStorage

func (dev *RaidBasePhyDev) ToBaremetalStorage(index int) *baremetal.BaremetalStorage

type RaidDriverFactory

type RaidDriverFactory func(term IExecTerm) IRaidDriver

type RaidLogicalVolume

type RaidLogicalVolume struct {
	Index    int
	Adapter  int
	BlockDev string
	IsSSD    tristate.TriState
}

func ReverseLogicalArray

func ReverseLogicalArray(input []*RaidLogicalVolume) []*RaidLogicalVolume

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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