Documentation
¶
Index ¶
Constants ¶
const ( // TypeUnknown represents an unknown storage connector. TypeUnknown string = "unknown" // TypeNVME represents an NVMe/TCP storage connector. TypeNVME string = "nvme" // TypeSDC represents Dell SDC storage connector. TypeSDC string = "sdc" // TypeISCSI represents an iSCSI storage connector. TypeISCSI string = "iscsi" )
const ( // NVMeDefaultDiscoveryPort is the default port number for NVMe/TCP discovery // controller. NVMeDefaultDiscoveryPort = "8009" // NVMeDefaultTransportPort is the default port number for NVMe/TCP I/O // controller. NVMeDefaultTransportPort = "4420" )
const (
// ISCSIDefaultPort is the default port number for iSCSI targets.
ISCSIDefaultPort = "3260"
)
const (
// SDCDevicePath represents the SDC device once the respective kernel module is loaded.
SDCDevicePath = "/dev/scini"
)
const SubtypeNVMESubsys = "nvme subsystem"
SubtypeNVMESubsys defines an NVMe subsystem type (from https://github.com/linux-nvme/libnvme/blob/97886cb68d238ccbbed804a275851f63e490b22f/src/nvme/fabrics.c#L99).
Variables ¶
var ErrNotSupported = errors.New("Not supported")
ErrNotSupported is the "Not supported" error.
Functions ¶
func GetSupportedVersions ¶
GetSupportedVersions returns the versions for the given connector types ignoring those that produce an error when version is being retrieved (e.g. due to a missing required tools).
Types ¶
type Connector ¶
type Connector interface {
Type() string
Version() (string, error)
QualifiedName() (string, error)
LoadModules() error
Connect(ctx context.Context, targetQN string, targetAddrs ...string) (revert.Hook, error)
Disconnect(targetQN string) error
Discover(ctx context.Context, targetAddresses ...string) ([]any, error)
GetDiskDevicePath(diskPathFilter block.DevicePathFilterFunc) (string, error)
WaitDiskDevicePath(ctx context.Context, diskPathFilter block.DevicePathFilterFunc) (string, error)
WaitDiskDeviceResize(ctx context.Context, diskPath string, newSizeBytes int64) error
RemoveDiskDevice(ctx context.Context, devicePath string) error
// contains filtered or unexported methods
}
Connector represents a storage connector that handles connections through appropriate storage subsystem.
func NewConnector ¶
NewConnector instantiates a new connector of the given type. The caller needs to ensure connector type is validated before calling this function, as common (empty) connector is returned for unknown type.
type ISCSIDiscoveryLogRecord ¶
ISCSIDiscoveryLogRecord represents an ISCSI discovery entry.
type NVMeDiscoveryLogRecord ¶
type NVMeDiscoveryLogRecord struct {
TransportType string `json:"trtype"`
AddressFamily string `json:"adrfam"`
TransportAddress string `json:"traddr"`
TransportServiceIdentifier string `json:"trsvcid"`
SubType string `json:"subtype"`
SubNQN string `json:"subnqn"`
}
NVMeDiscoveryLogRecord represents an NVMe discovery entry.