raid

package
v0.0.0-...-2b29b9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 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
)
View Source
const (
	RaidDriverToolMegacli64 = TRaidDriverToolType("megacli64")
	RaidDriverToolStorecli  = TRaidDriverToolType("storecli")
)

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

	Driver TRaidDriverToolType
}

func ReverseLogicalArray

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

type TRaidDriverToolType

type TRaidDriverToolType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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