Documentation ¶
Index ¶
- Constants
- type DevicesHaveDifferentParentsErr
- type HCTL
- type Scsi
- func (s *Scsi) CheckDeviceIsValid(ctx context.Context, device string) bool
- func (s *Scsi) DeleteSCSIDeviceByHCTL(ctx context.Context, h HCTL) error
- func (s *Scsi) DeleteSCSIDeviceByName(ctx context.Context, name string) error
- func (s *Scsi) DeleteSCSIDeviceByPath(ctx context.Context, devPath string) error
- func (s *Scsi) GetDMChildren(ctx context.Context, dm string) ([]string, error)
- func (s *Scsi) GetDMDeviceByChildren(ctx context.Context, devices []string) (string, error)
- func (s *Scsi) GetDeviceNameByHCTL(ctx context.Context, h HCTL) (string, error)
- func (s *Scsi) GetDeviceWWN(ctx context.Context, devices []string) (string, error)
- func (s *Scsi) GetDevicesByWWN(ctx context.Context, wwn string) ([]string, error)
- func (s *Scsi) GetNVMEDMDeviceByChildren(ctx context.Context, devices []string) (string, error)
- func (s *Scsi) GetNVMEDeviceWWN(ctx context.Context, devices []string) (string, error)
- func (s *Scsi) GetNVMEMultipathDMName(device string, pattern string) ([]string, error)
- func (s *Scsi) GetNVMESymlink(checkPath string) (string, error)
- func (s *Scsi) IsDeviceExist(ctx context.Context, device string) bool
- func (s *Scsi) RescanSCSIDeviceByHCTL(ctx context.Context, h HCTL) error
- func (s *Scsi) RescanSCSIHostByHCTL(ctx context.Context, addr HCTL) error
- func (s *Scsi) WaitUdevSymlink(ctx context.Context, deviceName string, wwn string) error
- func (s *Scsi) WaitUdevSymlinkNVMe(ctx context.Context, deviceName string, wwn string) error
Constants ¶
const ( NVMEMultipathSleepTime = 500 NVMESymlinkSleepTime = 200 )
constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicesHaveDifferentParentsErr ¶
type DevicesHaveDifferentParentsErr struct{}
DevicesHaveDifferentParentsErr defines a custom error
func (*DevicesHaveDifferentParentsErr) Error ¶
func (dperr *DevicesHaveDifferentParentsErr) Error() string
type Scsi ¶
type Scsi struct {
// contains filtered or unexported fields
}
Scsi defines scsi info
func (*Scsi) CheckDeviceIsValid ¶
CheckDeviceIsValid checks if device specified is valid by performing io operation on the device
func (*Scsi) DeleteSCSIDeviceByHCTL ¶
DeleteSCSIDeviceByHCTL deletes scsi device specified by HCTL
func (*Scsi) DeleteSCSIDeviceByName ¶
DeleteSCSIDeviceByName deletes scsi device specified by name
func (*Scsi) DeleteSCSIDeviceByPath ¶
DeleteSCSIDeviceByPath deletes device by specified "device folder" path Examples:
/sys/block/sde/device/ /sys/class/scsi_device/37:0:0:1/device/ /sys/class/iscsi_session/session3/device/target37:0:0/37:0:0:1/
func (*Scsi) GetDMChildren ¶
GetDMChildren fetches multipath block devices
func (*Scsi) GetDMDeviceByChildren ¶
GetDMDeviceByChildren fetches multipath device name
func (*Scsi) GetDeviceNameByHCTL ¶
GetDeviceNameByHCTL finds scsi device name by HCTL
func (*Scsi) GetDeviceWWN ¶
GetDeviceWWN fetches device WWN
func (*Scsi) GetDevicesByWWN ¶
GetDevicesByWWN fetches devices by wwn
func (*Scsi) GetNVMEDMDeviceByChildren ¶
GetNVMEDMDeviceByChildren fetches multipath device name
func (*Scsi) GetNVMEDeviceWWN ¶
GetNVMEDeviceWWN gets wwn of nvme device
func (*Scsi) GetNVMEMultipathDMName ¶
GetNVMEMultipathDMName finds the multipath DM mame for NVMe
func (*Scsi) GetNVMESymlink ¶
GetNVMESymlink return the NVMe symlink for the given path
func (*Scsi) IsDeviceExist ¶
IsDeviceExist checks if scsi device exists
func (*Scsi) RescanSCSIDeviceByHCTL ¶
RescanSCSIDeviceByHCTL performs scsi device rescan
func (*Scsi) RescanSCSIHostByHCTL ¶
RescanSCSIHostByHCTL performs scsi host rescan
func (*Scsi) WaitUdevSymlink ¶
WaitUdevSymlink checks if udev symlink for device specified by device name with WWN is found