Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoController = errors.New("megaraid Controller not found")
ErrNoController - Error reported by Query if no controller is found.
var ErrNoStorcli = errors.New("no 'storcli' command in PATH")
ErrNoStorcli - Error reported by Query if no storcli binary in PATH
var ErrUnsupported = errors.New("megaraid Controller unsupported")
ErrUnsupported - Error reported by Query if controller is not supported.
Functions ¶
func IsMegaRaidSysPath ¶
IsMegaRaidSysPath - is this sys path (udevadm info's DEVPATH) on a megaraid controller.
syspath will look something like /devices/pci0000:3a/0000:3a:02.0/0000:3c:00.0/host0/target0:2:2/0:2:2:0/block/sdc
func NameByDiskID ¶
NameByDiskID - return the linux name (sda) for the disk with given DiskID
Types ¶
type Controller ¶
type Controller struct { ID int Drives DriveSet DriveGroups DriveGroupSet VirtDrives VirtDriveSet }
Controller - a Megaraid controller
type Drive ¶
type Drive struct { ID int DriveGroup int EID int Slot int State string MediaType MediaType Model string Raw map[string]string }
Drive - a megaraid (physical) Drive.
type DriveGroup ¶
DriveGroup - a megaraid "Drive Group". These really have nothing that is their own other than their ID.
func (*DriveGroup) IsSSD ¶
func (dg *DriveGroup) IsSSD() bool
IsSSD - is this drive group composed of all SSD
type DriveGroupSet ¶
type DriveGroupSet map[int]*DriveGroup
DriveGroupSet - map of DriveGroups by their ID
func (DriveGroupSet) MarshalJSON ¶
func (dgs DriveGroupSet) MarshalJSON() ([]byte, error)
MarshalJSON - serialize to json. Custom Marshal to only reference Disks by ID not by full dump.
type MediaType ¶
type MediaType int
MediaType - a disk "Media"
func (MediaType) MarshalJSON ¶
MarshalJSON for string output rather than int
type MegaRaid ¶
type MegaRaid interface { // Query - Query the controller provided Query(int) (Controller, error) }
MegaRaid - basic interface
type VirtDrive ¶
type VirtDrive struct { // the Virtual Drive Number / ID ID int // the Drive Group ID DriveGroup int // Path in linux - may be empty if "Exposed to OS" != "Yes" Path string // "Name" in output - exposed in cimc UI RaidName string // Type RAID type (RAID0, RAID1...) Type string // /c0/v0 data as a string map Raw map[string]string // "VD0 Properties" as a map Properties map[string]string }
VirtDrive - represents a virtual drive.
type VirtDriveSet ¶
VirtDriveSet - a map of VirtDrives by their Number.