Documentation
¶
Overview ¶
Copyright 2017 The Goock Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func SetExecutor(e exec.Interface)
- func SetLogger(l *logrus.Logger)
- type ConnectionProperty
- type HostInfo
- type ISCSIConnector
- func (iscsi *ISCSIConnector) ConnectVolume(connectionProperty ConnectionProperty) (VolumeInfo, error)
- func (iscsi *ISCSIConnector) DisconnectVolume(connectProperty ConnectionProperty) error
- func (iscsi *ISCSIConnector) DiscoverPortal(targetPortal ...string) []model.ISCSISession
- func (iscsi *ISCSIConnector) ExtendVolume(connectionProperty ConnectionProperty) error
- func (iscsi *ISCSIConnector) GetHostInfo(args []string) (HostInfo, error)
- func (iscsi *ISCSIConnector) LoginPortal(targetPortal string, targetIqn string) error
- func (iscsi *ISCSIConnector) SetNode2Auto(targetPortal string, targetIqn string) error
- type ISCSIInterface
- type Interface
- type OPERATION_ENUM
- type StringEnum
- type VolumeInfo
Constants ¶
const (
ISCSIPathPattern = "/dev/disk/by-path/ip-%s-iscsi-%s-lun-%d"
)
Variables ¶
This section is empty.
Functions ¶
func SetExecutor ¶
Types ¶
type ConnectionProperty ¶
type ConnectionProperty struct {
TargetIqns []string
TargetPortals []string
TargetLuns []int
StorageProtocol string
AccessMode StringEnum
}
func (ConnectionProperty) IsEmpty ¶
func (prop ConnectionProperty) IsEmpty() error
Validate whether the ConnectionProperty is empty
type ISCSIConnector ¶
type ISCSIConnector struct {
// contains filtered or unexported fields
}
func (*ISCSIConnector) ConnectVolume ¶
func (iscsi *ISCSIConnector) ConnectVolume(connectionProperty ConnectionProperty) (VolumeInfo, error)
Attach the volume from the remote to the local
- Need to login/discover iscsi sessions from the ConnectionProperty
- Get all possible paths for the targets
- If multipath is enabled, return multipath_id as well, returned properties ScsiWwn: <scsi wwn> MultipathId: <multipath id> Path: single path device description
func (*ISCSIConnector) DisconnectVolume ¶
func (iscsi *ISCSIConnector) DisconnectVolume(connectProperty ConnectionProperty) error
func (*ISCSIConnector) DiscoverPortal ¶
func (iscsi *ISCSIConnector) DiscoverPortal(targetPortal ...string) []model.ISCSISession
Discover all target portals
func (*ISCSIConnector) ExtendVolume ¶
func (iscsi *ISCSIConnector) ExtendVolume(connectionProperty ConnectionProperty) error
Update the local kernel's size information
func (*ISCSIConnector) GetHostInfo ¶
func (iscsi *ISCSIConnector) GetHostInfo(args []string) (HostInfo, error)
func (*ISCSIConnector) LoginPortal ¶
func (iscsi *ISCSIConnector) LoginPortal(targetPortal string, targetIqn string) error
Login all target portals if needed TODO(peter) consider using goroutine to login concurrently?
func (*ISCSIConnector) SetNode2Auto ¶
func (iscsi *ISCSIConnector) SetNode2Auto(targetPortal string, targetIqn string) error
Set the node to 'node.startup = automatic', it will login the portal automatically after reboot
type ISCSIInterface ¶
type ISCSIInterface interface {
GetHostInfo(args []string) (HostInfo, error)
ConnectVolume(connectionProperty ConnectionProperty) (VolumeInfo, error)
DisconnectVolume(connectionProperty ConnectionProperty) error
ExtendVolume(connectionProperty ConnectionProperty) error
LoginPortal(targetPortal string, targetIqn string) error
SetNode2Auto(targetPortal string, targetIqn string) error
DiscoverPortal(targetPortal ...string) []model.ISCSISession
}
func NewISCSIConnector ¶
func NewISCSIConnector() ISCSIInterface
type Interface ¶
type Interface interface {
GetHostInfo(args []string) (HostInfo, error)
ConnectVolume(connectionProperty ConnectionProperty) (VolumeInfo, error)
DisconnectVolume(connectionProperty ConnectionProperty) error
ExtendVolume(connectionProperty ConnectionProperty) error
}
type OPERATION_ENUM ¶
type OPERATION_ENUM StringEnum
const ( OPERATION_NEW OPERATION_ENUM = "new" OPERATION_DELETE OPERATION_ENUM = "new" OPERATION_UPDATE OPERATION_ENUM = "update" OPERATION_SHOW OPERATION_ENUM = "show" OPERATION_NON_PERSISTENT OPERATION_ENUM = "nonpersistent" )
type StringEnum ¶
type StringEnum string
const ( READWRITE StringEnum = "rw" READONLY StringEnum = "ro" )
const ( ISCSI_PROTOCOL StringEnum = "iscsi" FC_PROTOCOL StringEnum = "fc" )