fusionstorage

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasicURI                           = "/dsware/service/"
	UnitGiShiftBit                     = 10
	DefaultAZ                          = "default"
	NamePrefix                         = "opensds"
	LunId                              = "lunId"
	FusionstorageIscsi                 = "fusionstorage_iscsi"
	InitiatorNotExistErrorCodeVersion6 = "32155103"
	InitiatorNotExistErrorCodeVersion8 = "155103"
	VolumeAlreadyInHostErrorCode       = "157001"
	CmdBin                             = "fsc_cli"
	DefaultConfPath                    = "/etc/opensds/driver/fusionstorage.yaml"
	ClientVersion6_3                   = "6.3"
	ClientVersion8_0                   = "8.0"
	MaxRetry                           = 3
)

Variables

View Source
var CliErrorMap = map[string]string{
	"50000001": "DSware error",
	"50150001": "Receive a duplicate request",
	"50150002": "Command type is not supported",
	"50150003": "Command format is error",
	"50150004": "Lost contact with major VBS",
	"50150005": "Volume does not exist",
	"50150006": "Snapshot does not exist",
	"50150007": "Volume already exists or name exists or name duplicates with a snapshot name",
	"50150008": "The snapshot has already existed",
	"50150009": "VBS space is not enough",
	"50150010": "The node type is error",
	"50150011": "Volume and snapshot number is beyond max",
	"50150012": "VBS is not ready",
	"50150013": "The ref num of node is not 0",
	"50150014": "The volume is not in the pre-deletion state.",
	"50150015": "The storage resource pool is faulty",
	"50150016": "VBS handle queue busy",
	"50150017": "VBS handle request timeout",
	"50150020": "VBS metablock is locked",
	"50150021": "VBS pool dose not exist",
	"50150022": "VBS is not ok",
	"50150023": "VBS pool is not ok",
	"50150024": "VBS dose not exist",
	"50150064": "VBS load SCSI-3 lock pr meta failed",
	"50150100": "The disaster recovery relationship exists",
	"50150101": "The DR relationship does not exist",
	"50150102": "Volume has existed mirror",
	"50150103": "The volume does not have a mirror",
	"50150104": "Incorrect volume status",
	"50150105": "The mirror volume already exists",
}

Functions

func EncodeName

func EncodeName(id string) string

func NewCliError

func NewCliError(code string) error

func StartServer added in v0.5.3

func StartServer() error

Types

type AuthOptions

type AuthOptions struct {
	Username        string   `yaml:"username"`
	Password        string   `yaml:"password"`
	Url             string   `yaml:"url"`
	FmIp            string   `yaml:"fmIp,omitempty"`
	FsaIp           []string `yaml:"fsaIp,flow"`
	PwdEncrypter    string   `yaml:"PwdEncrypter,omitempty"`
	EnableEncrypted bool     `yaml:"EnableEncrypted,omitempty"`
	Version         string   `json:"version"`
}

type CliError

type CliError struct {
	Msg  string
	Code string
}

func NewCliErrorBase

func NewCliErrorBase(msg, code string) *CliError

func (*CliError) Error

func (c *CliError) Error() string

type Config

type Config struct {
	AuthOptions `yaml:"authOptions"`
	Pool        map[string]PoolProperties `yaml:"pool,flow"`
}

type Detail added in v0.5.3

type Detail struct {
	Description string `json:"description,omitempty"`
	ErrorCode   int    `json:"errorCode,omitempty"`
}

type DeviceVersion added in v0.5.3

type DeviceVersion struct {
	Version string `json:"version"`
}

type Driver

type Driver struct {
	Client *FsClient
	Conf   *Config
}

func (*Driver) AddPortToHost added in v0.5.3

func (d *Driver) AddPortToHost(initiator, hostName string) error

func (*Driver) CheckHostIsExist added in v0.5.3

func (d *Driver) CheckHostIsExist(hostName string) error

func (*Driver) CheckVolAttachToHost added in v0.5.3

func (d *Driver) CheckVolAttachToHost(hostName, lunId string) error

func (*Driver) CreateHostIfNotExist added in v0.5.3

func (d *Driver) CreateHostIfNotExist(hostInfo *pb.HostInfo) error

func (*Driver) CreatePortIfNotExist added in v0.5.3

func (d *Driver) CreatePortIfNotExist(initiator string) error

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(opt *pb.CreateVolumeSnapshotOpts) (*VolumeSnapshotSpec, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(opt *pb.CreateVolumeOpts) (*VolumeSpec, error)

func (*Driver) CreateVolumeGroup

func (d *Driver) CreateVolumeGroup(opt *pb.CreateVolumeGroupOpts) (*VolumeGroupSpec, error)

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(opt *pb.DeleteVolumeSnapshotOpts) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(opt *pb.DeleteVolumeOpts) error

func (*Driver) DeleteVolumeGroup

func (d *Driver) DeleteVolumeGroup(opt *pb.DeleteVolumeGroupOpts) error

func (*Driver) ExtendVolume

func (d *Driver) ExtendVolume(opt *pb.ExtendVolumeOpts) (*VolumeSpec, error)

func (*Driver) GeTgtPortalAndIQNVersion6_3 added in v0.5.3

func (d *Driver) GeTgtPortalAndIQNVersion6_3(initiator string) ([]string, []string, error)

func (*Driver) GeTgtPortalAndIQNVersion8_0 added in v0.5.3

func (d *Driver) GeTgtPortalAndIQNVersion8_0() ([]string, []string, error)

func (*Driver) GetTargetPortal added in v0.5.3

func (d *Driver) GetTargetPortal(initiator string) ([]string, []string, error)

func (*Driver) GetTgtLunID added in v0.5.3

func (d *Driver) GetTgtLunID(hostName, sourceLunID string) (int, error)

func (*Driver) InitializeConnection

func (d *Driver) InitializeConnection(opt *pb.CreateVolumeAttachmentOpts) (*ConnectionInfo, error)

func (*Driver) InitializeSnapshotConnection

func (d *Driver) InitializeSnapshotConnection(opt *pb.CreateSnapshotAttachmentOpts) (*ConnectionInfo, error)

func (*Driver) ListPools

func (d *Driver) ListPools() ([]*StoragePoolSpec, error)

func (*Driver) PullSnapshot

func (d *Driver) PullSnapshot(snapIdentifier string) (*VolumeSnapshotSpec, error)

func (*Driver) PullVolume

func (d *Driver) PullVolume(volIdentifier string) (*VolumeSpec, error)

func (*Driver) Setup

func (d *Driver) Setup() error

func (*Driver) TerminateConnection

func (d *Driver) TerminateConnection(opt *pb.DeleteVolumeAttachmentOpts) error

func (*Driver) TerminateSnapshotConnection

func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) error

func (*Driver) Unset

func (d *Driver) Unset() error

func (*Driver) UpdateVolumeGroup

func (d *Driver) UpdateVolumeGroup(opt *pb.UpdateVolumeGroupOpts) (*VolumeGroupSpec, error)

type FsClient added in v0.5.3

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

func (*FsClient) RunCmd added in v0.5.3

func (c *FsClient) RunCmd(args ...string) ([]string, error)

type Host added in v0.5.3

type Host struct {
	HostName string `json:"hostName"`
}

type HostList added in v0.5.3

type HostList struct {
	HostList []Host `json:"hostList"`
}

type HostLunList added in v0.5.3

type HostLunList struct {
	LunList []LunList `json:"hostLunList"`
}

type IscsiPortal added in v0.5.3

type IscsiPortal struct {
	NodeResultList []NodeResult `json:"nodeResultList"`
}

type LunList added in v0.5.3

type LunList struct {
	Id   int    `json:"lunId"`
	Name string `json:"lunName"`
}

type NodeResult added in v0.5.3

type NodeResult struct {
	PortalList []Portal `json:"iscsiPortalList"`
}

type Pool added in v0.5.3

type Pool struct {
	PoolId        int   `json:"poolId"`
	TotalCapacity int64 `json:"totalCapacity"`
	AllocCapacity int64 `json:"allocatedCapacity"`
	UsedCapacity  int64 `json:"usedCapacity"`
}

type PoolResp

type PoolResp struct {
	Pools []Pool `json:"storagePools"`
}

type PortHostMap added in v0.5.3

type PortHostMap struct {
	PortHostMap map[string][]string `json:"portHostMap"`
}

type Portal added in v0.5.3

type Portal struct {
	IscsiPortal string `json:"iscsiPortal"`
	Status      string `json:"iscsiStatus"`
}

type RequesData added in v0.5.3

type RequesData struct {
	Timeout int         `json:"timeout"`
	Data    interface{} `json:"data`
}

type ResponseResult added in v0.5.3

type ResponseResult struct {
	RespCode int      `json:"result"`
	Details  []Detail `json:"detail"`
}

type Version added in v0.5.3

type Version struct {
	CurrentVersion string `json:"currentVersion"`
}

Jump to

Keyboard shortcuts

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