iscsi

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package iscsi combines LINSTOR operations and the CRM operations to create highly available iSCSI targets.

Index

Constants

View Source
const (
	IDFormat       = "iscsi-%s"
	FilenameFormat = "linstor-gateway-iscsi-%s.toml"
)
View Source
const (
	DefaultISCSIPort = 3260
	CurrentVersion   = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ISCSI

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

func New

func New(controllers []string) (*ISCSI, error)

func (*ISCSI) AddVolume

func (i *ISCSI) AddVolume(ctx context.Context, iqn Iqn, volCfg *common.VolumeConfig) (*ResourceConfig, error)

func (*ISCSI) Create

func (i *ISCSI) Create(ctx context.Context, rsc *ResourceConfig) (*ResourceConfig, error)

Create creates an iSCSI target according to the resource configuration described in rsc. It automatically prepends a "cluster private volume" to the list of volumes, so volume numbers must start at 1.

func (*ISCSI) Delete

func (i *ISCSI) Delete(ctx context.Context, iqn Iqn) error

func (*ISCSI) DeleteVolume

func (i *ISCSI) DeleteVolume(ctx context.Context, iqn Iqn, lun int) (*ResourceConfig, error)

func (*ISCSI) Get

func (i *ISCSI) Get(ctx context.Context, iqn Iqn) (*ResourceConfig, error)

func (*ISCSI) List

func (i *ISCSI) List(ctx context.Context) ([]*ResourceConfig, error)

func (*ISCSI) Start

func (i *ISCSI) Start(ctx context.Context, iqn Iqn) (*ResourceConfig, error)

func (*ISCSI) Stop

func (i *ISCSI) Stop(ctx context.Context, iqn Iqn) (*ResourceConfig, error)

type Iqn

type Iqn [2]string

func NewIqn

func NewIqn(s string) (Iqn, error)

func (Iqn) MarshalJSON

func (i Iqn) MarshalJSON() ([]byte, error)

func (Iqn) MarshalText

func (i Iqn) MarshalText() ([]byte, error)

func (*Iqn) Set

func (i *Iqn) Set(s string) error

func (Iqn) String

func (i Iqn) String() string

func (*Iqn) Type

func (i *Iqn) Type() string

func (*Iqn) UnmarshalJSON

func (i *Iqn) UnmarshalJSON(b []byte) error

func (*Iqn) UnmarshalText

func (i *Iqn) UnmarshalText(b []byte) error

func (*Iqn) WWN

func (i *Iqn) WWN() string

type ResourceConfig

type ResourceConfig struct {
	IQN               Iqn                   `json:"iqn"`
	AllowedInitiators []Iqn                 `json:"allowed_initiators,omitempty"`
	ResourceGroup     string                `json:"resource_group"`
	Volumes           []common.VolumeConfig `json:"volumes"`
	Username          string                `json:"username,omitempty"`
	Password          string                `json:"password,omitempty"`
	ServiceIPs        []common.IpCidr       `json:"service_ips"`
	Status            common.ResourceStatus `json:"status"`
	GrossSize         bool                  `json:"gross_size"`
	Implementation    string                `json:"implementation"`
}

func FromPromoter

func FromPromoter(cfg *reactor.PromoterConfig, definition *client.ResourceDefinition, volumeDefinitions []client.VolumeDefinition) (*ResourceConfig, error)

func (*ResourceConfig) FillDefaults

func (r *ResourceConfig) FillDefaults()

func (*ResourceConfig) ID

func (r *ResourceConfig) ID() string

func (*ResourceConfig) Matches

func (r *ResourceConfig) Matches(o *ResourceConfig) bool

func (*ResourceConfig) ToPromoter

func (r *ResourceConfig) ToPromoter(deployment []client.ResourceWithVolumes) (*reactor.PromoterConfig, error)

func (*ResourceConfig) Valid

func (r *ResourceConfig) Valid() error

func (*ResourceConfig) VolumeConfig

func (r *ResourceConfig) VolumeConfig(number int) *common.Volume

Jump to

Keyboard shortcuts

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