gobrick

package module
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 9

README ¶

🔒 Important Notice

Starting with the release of Container Storage Modules v1.16.0, this repository will no longer be maintained as an open source project. Future development will continue under a closed source model. This change reflects our commitment to delivering even greater value to our customers by enabling faster innovation and more deeply integrated features with the Dell storage portfolio.
For existing customers using Dell’s Container Storage Modules, you will continue to receive:

  • Ongoing Support & Community Engagement
    You will continue to receive high-quality support through Dell Support and our community channels. Your experience of engaging with the Dell community remains unchanged.
  • Streamlined Deployment & Updates
    Deployment and update processes will remain consistent, ensuring a smooth and familiar experience.
  • Access to Documentation & Resources
    All documentation and related materials will remain publicly accessible, providing transparency and technical guidance.
  • Continued Access to Current Open Source Version
    The current open-source version will remain available under its existing license for those who rely on it.

Moving to a closed source model allows Dell’s development team to accelerate feature delivery and enhance integration across our Enterprise Kubernetes Storage solutions ultimately providing a more seamless and robust experience.
We deeply appreciate the contributions of the open source community and remain committed to supporting our customers through this transition.
For questions or access requests, please contact the maintainers via Dell Support.

GOBRICK

Library for iSCSI/FC/NVMe volume connection

Example
connector := gobrick.NewISCSIConnector(gobrick.ISCSIConnectorParams{})
dev, err := connector.ConnectVolume(context.Background(),
		gobrick.ISCSIVolumeInfo{
			Lun:1,
			Targets: []gobrick.ISCSITargetInfo{
				{Portal: "1.1.1.1",
				 Target: "iqn.2015-10.com.dell:dellemc-array-fnm00185000782-b-5dc4fceb"}}})

err = connector.DisconnectVolumeByDeviceName(context.Background(), "dm-1")

Documentation ¶

Overview ¶

Package gobrick is a generated GoMock package.

Index ¶

Constants ¶

View Source
const (
	// NVMeWaitDeviceTimeoutDefault - NVMe default device time out
	NVMeWaitDeviceTimeoutDefault = time.Second * 30

	// NVMeWaitDeviceRegisterTimeoutDefault - NVMe default device register timeout
	NVMeWaitDeviceRegisterTimeoutDefault = time.Second * 10

	// NVMeMaxParallelOperationsDefault - max parallen NVMe operations
	NVMeMaxParallelOperationsDefault = 5

	// NVMePortDefault - NVMe TCP port
	NVMePortDefault = ":4420"

	// PowerMaxOUIPrefix - PowerMax format 6 OUI prefix
	PowerMaxOUIPrefix = "6000097"

	// PowerStoreOUIPrefix - PowerStore format 6 OUI prefix
	PowerStoreOUIPrefix = "68ccf09"
)

Variables ¶

This section is empty.

Functions ¶

func SetLogger ¶

func SetLogger(customLogger Logger)

SetLogger set custom logger for gobrick

func SetTracer ¶

func SetTracer(customTracer Tracer)

SetTracer set custom tracer for gobrick

Types ¶

type Device ¶

type Device struct {
	WWN         string
	Name        string
	MultipathID string
	PowerpathID string
}

Device defines device info

type DevicePathResult ¶ added in v1.3.0

type DevicePathResult struct {
	// contains filtered or unexported fields
}

DevicePathResult - placeholder for nvme devicepaths

type FCConnector ¶

type FCConnector struct {
	// contains filtered or unexported fields
}

FCConnector connector for FC transport

func NewFCConnector ¶

func NewFCConnector(params FCConnectorParams) *FCConnector

NewFCConnector create new FCConnector

func (*FCConnector) ConnectRDMVolume ¶ added in v1.6.0

func (fc *FCConnector) ConnectRDMVolume(ctx context.Context, info RDMVolumeInfo) (Device, error)

ConnectRDMVolume attach RDM to a VM

func (*FCConnector) ConnectVolume ¶

func (fc *FCConnector) ConnectVolume(ctx context.Context, info FCVolumeInfo) (Device, error)

ConnectVolume attach volume to a node

func (*FCConnector) DisconnectVolume ¶

func (fc *FCConnector) DisconnectVolume(ctx context.Context, info FCVolumeInfo) error

DisconnectVolume disconnects volume from a node by full volume request

func (*FCConnector) DisconnectVolumeByDeviceName ¶

func (fc *FCConnector) DisconnectVolumeByDeviceName(ctx context.Context, name string) error

DisconnectVolumeByDeviceName disconnects volume from a node by device name

func (*FCConnector) DisconnectVolumeByWWN ¶ added in v1.15.0

func (fc *FCConnector) DisconnectVolumeByWWN(ctx context.Context, wwn string) error

DisconnectVolumeByWWN disconnects volume from a node by WWN

func (*FCConnector) GetInitiatorPorts ¶

func (fc *FCConnector) GetInitiatorPorts(ctx context.Context) ([]string, error)

GetInitiatorPorts return information about nodes local FC ports

type FCConnectorParams ¶

type FCConnectorParams struct {
	// run commands inside chroot
	Chroot string

	// how long wait for DM appear
	WaitDeviceRegisterTimeout time.Duration
	// timeout for multipath flush command
	MultipathFlushTimeout time.Duration
	// timeout for each multipath flush retry
	MultipathFlushRetryTimeout time.Duration
	// how many retries for multipath flush
	MultipathFlushRetries int

	// how many parallel operations allowed
	MaxParallelOperations int
}

FCConnectorParams options for FCConnector

type FCHBA ¶

type FCHBA struct {
	PortName   string
	NodeName   string
	HostDevice string
}

FCHBA holds information about host local FC ports

type FCHBAInfo ¶ added in v1.4.0

type FCHBAInfo struct {
	PortName string
	NodeName string
}

FCHBAInfo holds information about host NVMe/FC ports

type FCTargetInfo ¶

type FCTargetInfo struct {
	WWPN string
}

FCTargetInfo holds information about remote FC ports

type FCVolumeInfo ¶

type FCVolumeInfo struct {
	Targets []FCTargetInfo
	Lun     int
}

FCVolumeInfo connection request for volume

type ISCSIConnector ¶

type ISCSIConnector struct {
	// contains filtered or unexported fields
}

ISCSIConnector defines iscsi connector info

func NewISCSIConnector ¶

func NewISCSIConnector(params ISCSIConnectorParams) *ISCSIConnector

NewISCSIConnector creates an ISCSI client and returns it

func (*ISCSIConnector) ConnectVolume ¶

func (c *ISCSIConnector) ConnectVolume(ctx context.Context, info ISCSIVolumeInfo) (Device, error)

ConnectVolume connects to the iscsi volume and returns device info

func (*ISCSIConnector) DisconnectVolume ¶

func (c *ISCSIConnector) DisconnectVolume(ctx context.Context, info ISCSIVolumeInfo) error

DisconnectVolume disconnects from iscsi volume

func (*ISCSIConnector) DisconnectVolumeByDeviceName ¶

func (c *ISCSIConnector) DisconnectVolumeByDeviceName(ctx context.Context, name string) error

DisconnectVolumeByDeviceName disconnects from volume specified by WWN name

func (*ISCSIConnector) GetInitiatorName ¶

func (c *ISCSIConnector) GetInitiatorName(ctx context.Context) ([]string, error)

GetInitiatorName gets iscsi initiators and returns it

type ISCSIConnectorParams ¶

type ISCSIConnectorParams struct {
	// iscsiLib command will run from this chroot
	Chroot string

	// chap
	ChapUser     string
	ChapPassword string
	ChapEnabled  bool

	// timeouts
	// how long to wait for iSCSI session to become active after login
	WaitDeviceTimeout                      time.Duration
	WaitDeviceRegisterTimeout              time.Duration
	FailedSessionMinimumLoginRetryInterval time.Duration
	MultipathFlushTimeout                  time.Duration
	MultipathFlushRetryTimeout             time.Duration

	MultipathFlushRetries int
	MaxParallelOperations int
}

ISCSIConnectorParams defines ISCSI connector parameters

type ISCSITargetInfo ¶

type ISCSITargetInfo struct {
	Portal string
	Target string
	// NetworkID is the ID of the network that this target is reachable on.
	// This data is returned from the array API and filled in by the driver to manage discovery.
	NetworkID string
}

ISCSITargetInfo defines iscsi target info

type ISCSIVolumeInfo ¶

type ISCSIVolumeInfo struct {
	Targets []ISCSITargetInfo
	Lun     int
}

ISCSIVolumeInfo defines iscsi volume info

type Logger ¶

type Logger = logger.Logger

Logger defines logger interface used

type NVMeConnector ¶ added in v1.4.0

type NVMeConnector struct {
	// contains filtered or unexported fields
}

NVMeConnector - type defenition for NVMe connector

func NewNVMeConnector ¶ added in v1.4.0

func NewNVMeConnector(params NVMeConnectorParams) *NVMeConnector

NewNVMeConnector - get new NVMeConnector

func (*NVMeConnector) ConnectVolume ¶ added in v1.4.0

func (c *NVMeConnector) ConnectVolume(ctx context.Context, info NVMeVolumeInfo, useFC bool) (Device, error)

ConnectVolume - connect to nvme volume

func (*NVMeConnector) DisconnectVolume ¶ added in v1.4.0

func (c *NVMeConnector) DisconnectVolume(ctx context.Context, info NVMeVolumeInfo) error

DisconnectVolume - disconnect a given nvme volume

func (*NVMeConnector) DisconnectVolumeByDeviceName ¶ added in v1.4.0

func (c *NVMeConnector) DisconnectVolumeByDeviceName(ctx context.Context, name string) error

DisconnectVolumeByDeviceName - disconnect from a given device

func (*NVMeConnector) GetInitiatorName ¶ added in v1.4.0

func (c *NVMeConnector) GetInitiatorName(ctx context.Context) ([]string, error)

GetInitiatorName - returns nqn

type NVMeConnectorParams ¶ added in v1.4.0

type NVMeConnectorParams struct {
	// nvmeLib command will run from this chroot
	Chroot string

	// timeouts
	// how long to wait for nvme session to become active after login
	WaitDeviceTimeout                      time.Duration
	WaitDeviceRegisterTimeout              time.Duration
	FailedSessionMinimumLoginRetryInterval time.Duration
	MultipathFlushTimeout                  time.Duration
	MultipathFlushRetryTimeout             time.Duration

	MultipathFlushRetries int
	MaxParallelOperations int
}

NVMeConnectorParams - type definition for NVMe connector params

type NVMeTargetInfo ¶ added in v1.4.0

type NVMeTargetInfo struct {
	Portal    string
	Target    string
	NetworkID string
}

NVMeTargetInfo - Placeholder for NVMe targets

type NVMeVolumeInfo ¶ added in v1.4.0

type NVMeVolumeInfo struct {
	Targets []NVMeTargetInfo
	WWN     string
}

NVMeVolumeInfo - placeholder for NVMe volume

type RDMVolumeInfo ¶ added in v1.6.0

type RDMVolumeInfo struct {
	Targets []FCTargetInfo
	Lun     int
	WWN     string
}

RDMVolumeInfo has request info for RDM device

type Tracer ¶

type Tracer = tracer.Tracer

Tracer defines tracing interface used

Directories ¶

Path Synopsis
internal
logger
Package logger is a generated GoMock package.
Package logger is a generated GoMock package.
mockhelper
Package mockhelper is a generated GoMock package.
Package mockhelper is a generated GoMock package.
multipath
Package multipath is a generated GoMock package.
Package multipath is a generated GoMock package.
powerpath
Package powerpath is a generated GoMock package.
Package powerpath is a generated GoMock package.
scsi
Package scsi is a generated GoMock package.
Package scsi is a generated GoMock package.
tracer
Package tracer is a generated GoMock package.
Package tracer is a generated GoMock package.
wrappers
Package wrappers is a generated GoMock package.
Package wrappers is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

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