storage_drivers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigVersion = 1

ConfigVersion is the expected version specified in the config file

View Source
const DefaultAccessGroupName = "netappdvp"
View Source
const DefaultHostType = "linux_dm_mp"
View Source
const DriverVersion = "1.4.0"

DriverVersion is the actual release version number

View Source
const EseriesIscsiStorageDriverName = "eseries-iscsi"

EseriesIscsiStorageDriverName is the name for this storage driver that is specified in the config file, etc.

View Source
const OntapNASStorageDriverName = "ontap-nas"

OntapNASStorageDriverName is the constant name for this Ontap NAS storage driver

View Source
const OntapSANStorageDriverName = "ontap-san"

OntapSANStorageDriverName is the constant name for this Ontap NAS storage driver

View Source
const SolidfireSANStorageDriverName = "solidfire-san"

SolidfireSANStorageDriverName is the constant name for this Solidfire SAN storage driver

Variables

View Source
var Drivers = make(map[string]StorageDriver)

Drivers is a map of driver names -> object

View Source
var ExtendedDriverVersion = "native"

ExtendedDriverVersion can be overridden by embeddors such as Trident to uniquify the version string

Functions

func CreateOntapClone added in v1.3.1

func CreateOntapClone(name, source, snapshot, newSnapshotPrefix string, api *ontap.Driver) error

Create a volume clone

func EmsInitialized

func EmsInitialized(driverName string, api *ontap.Driver)

EmsInitialized logs an ASUP message that this docker volume plugin has been initialized view them via filer::> event log show

func GetVolume added in v1.3.3

func GetVolume(name string, api *ontap.Driver) error

Test for the existence of a volume

func GetVolumeList added in v1.3.3

func GetVolumeList(prefix string, api *ontap.Driver) ([]string, error)

Return the list of volumes associated with the tenant

func InitializeOntapDriver

func InitializeOntapDriver(config OntapStorageDriverConfig) (*ontap.Driver, error)

InitializeOntapDriver will attempt to derive the SVM to use if not provided

func MakeSolidFireName added in v1.3.1

func MakeSolidFireName(name string) string

Make SolidFire name

Types

type CommonSnapshot added in v1.3.1

type CommonSnapshot struct {
	Name    string // The snapshot name or other identifier you would use to reference it
	Created string // The UTC time that the snapshot was created, in RFC3339 format
}

CommonSnapshot contains the normalized volume snapshot format we report to Docker

func GetSnapshotList added in v1.3.1

func GetSnapshotList(name string, api *ontap.Driver) ([]CommonSnapshot, error)

Return the list of snapshots associated with the named volume

type CommonStorageDriverConfig

type CommonStorageDriverConfig struct {
	Version           int             `json:"version"`
	StorageDriverName string          `json:"storageDriverName"`
	Debug             bool            `json:"debug"`
	DebugTraceFlags   map[string]bool `json:"debugTraceFlags"` // Example: {"api":false, "method":true}
	DisableDelete     bool            `json:"disableDelete"`
	StoragePrefixRaw  json.RawMessage `json:"storagePrefix,string"`
	SnapshotPrefixRaw json.RawMessage `json:"snapshotPrefix,string"`
}

CommonStorageDriverConfig holds settings in common across all StorageDrivers

func ValidateCommonSettings

func ValidateCommonSettings(configJSON string) (*CommonStorageDriverConfig, error)

ValidateCommonSettings attempts to "partially" decode the JSON into just the settings in CommonStorageDriverConfig

type ESeriesStorageDriver

type ESeriesStorageDriver struct {
	Initialized bool
	Config      ESeriesStorageDriverConfig
	API         *eseries.ESeriesAPIDriver
}

ESeriesStorageDriver is for storage provisioning via the Web Services Proxy RESTful interface that communicates with E-Series controllers via the SYMbol API.

func (*ESeriesStorageDriver) Attach

func (d *ESeriesStorageDriver) Attach(name, mountpoint string, opts map[string]string) error

Attach is called by Docker when attaching a container volume to a container. This method is expected to map the volume to the local host, discover it on the SCSI bus, format it with a filesystem, and mount it at the specified mount point. This method has an opts parameter, but no options are presently handled by this method.

func (*ESeriesStorageDriver) Create

func (d *ESeriesStorageDriver) Create(name string, opts map[string]string) error

Create is called by Docker to create a container volume. Besides the volume name, a few optional parameters such as size and disk media type may be provided in the opts map. If more than one pool on the storage controller can satisfy the request, the one with the most free space is selected.

func (*ESeriesStorageDriver) CreateClone added in v1.3.1

func (d *ESeriesStorageDriver) CreateClone(name, source, snapshot, newSnapshotPrefix string) error

CreateClone creates a new volume from the named volume, either by direct clone or from the named snapshot. The E-series volume plugin does not support cloning or snapshots, so this method always returns an error.

func (*ESeriesStorageDriver) DefaultSnapshotPrefix added in v1.3.1

func (d *ESeriesStorageDriver) DefaultSnapshotPrefix() string

DefaultSnapshotPrefix returns the driver specific prefix for created snapshots, which may be overridden in the config file.

func (*ESeriesStorageDriver) DefaultStoragePrefix

func (d *ESeriesStorageDriver) DefaultStoragePrefix() string

DefaultStoragePrefix returns the driver specific prefix for created storage, which may be overridden in the config file.

func (*ESeriesStorageDriver) Destroy

func (d *ESeriesStorageDriver) Destroy(name string) error

Create is called by Docker to delete a container volume.

func (*ESeriesStorageDriver) Detach

func (d *ESeriesStorageDriver) Detach(name, mountpoint string) error

Attach is called by Docker when detaching a container volume from a container. This method merely unmounts the volume; it does not rescan the bus, unmap the volume, or undo any of the other actions taken by the Attach method.

func (*ESeriesStorageDriver) Get added in v1.3.3

func (d *ESeriesStorageDriver) Get(name string) error

Test for the existence of a volume

func (*ESeriesStorageDriver) Initialize

func (d *ESeriesStorageDriver) Initialize(configJSON string) error

Initialize from the provided config

func (*ESeriesStorageDriver) List added in v1.3.3

func (d *ESeriesStorageDriver) List(prefix string) ([]string, error)

Return the list of volumes associated with this tenant

func (*ESeriesStorageDriver) MapVolumeToLocalHost added in v1.4.0

func (d *ESeriesStorageDriver) MapVolumeToLocalHost(volume eseries.VolumeEx) (eseries.LUNMapping, error)

MapVolumeToLocalHost gets the iSCSI identity of the local host, ensures a corresponding Host definition exists on the array (defining a Host & HostGroup if not), maps the specified volume to the host/group (if it isn't already), and returns the mapping info.

func (*ESeriesStorageDriver) Name

func (d *ESeriesStorageDriver) Name() string

func (*ESeriesStorageDriver) Protocol added in v1.3.1

func (d *ESeriesStorageDriver) Protocol() string

func (*ESeriesStorageDriver) SnapshotList added in v1.3.1

func (d *ESeriesStorageDriver) SnapshotList(name string) ([]CommonSnapshot, error)

SnapshotList returns the list of snapshots associated with the named volume. The E-series volume plugin does not support snapshots, so this method always returns an empty array.

func (*ESeriesStorageDriver) Validate

func (d *ESeriesStorageDriver) Validate() error

Validate the driver configuration

type ESeriesStorageDriverConfig

type ESeriesStorageDriverConfig struct {
	CommonStorageDriverConfig

	// Web Proxy Services Info
	WebProxyHostname  string `json:"webProxyHostname"`
	WebProxyPort      string `json:"webProxyPort"`      // optional
	WebProxyUseHTTP   bool   `json:"webProxyUseHTTP"`   // optional
	WebProxyVerifyTLS bool   `json:"webProxyVerifyTLS"` // optional
	Username          string `json:"username"`
	Password          string `json:"password"`

	// Array Info
	ControllerA   string `json:"controllerA"`
	ControllerB   string `json:"controllerB"`
	PasswordArray string `json:"passwordArray"` //optional

	// Options
	PoolNameSearchPattern string `json:"poolNameSearchPattern"` //optional

	// Host Networking
	HostData_IP string `json:"hostData_IP,omitempty"` // for backward compatibility only
	HostDataIP  string `json:"hostDataIP"`            // for iSCSI can be either port if multipathing is setup
	AccessGroup string `json:"accessGroupName"`       // name for host group, default is 'netappdvp'
	HostType    string `json:"hostType"`              // host type, default is 'linux_dm_mp'
}

ESeriesStorageDriverConfig holds settings for ESeriesStorageDriver

type OntapNASStorageDriver

type OntapNASStorageDriver struct {
	Initialized bool
	Config      OntapStorageDriverConfig
	API         *ontap.Driver
}

OntapNASStorageDriver is for NFS storage provisioning

func (*OntapNASStorageDriver) Attach

func (d *OntapNASStorageDriver) Attach(name, mountpoint string, opts map[string]string) error

Attach the volume

func (*OntapNASStorageDriver) Create

func (d *OntapNASStorageDriver) Create(name string, opts map[string]string) error

Create a volume with the specified options

func (*OntapNASStorageDriver) CreateClone added in v1.3.1

func (d *OntapNASStorageDriver) CreateClone(name, source, snapshot, newSnapshotPrefix string) error

Create a volume clone

func (*OntapNASStorageDriver) DefaultSnapshotPrefix added in v1.3.1

func (d *OntapNASStorageDriver) DefaultSnapshotPrefix() string

DefaultSnapshotPrefix is the driver specific prefix for created snapshots, can be overridden in the config file

func (*OntapNASStorageDriver) DefaultStoragePrefix

func (d *OntapNASStorageDriver) DefaultStoragePrefix() string

DefaultStoragePrefix is the driver specific prefix for created storage, can be overridden in the config file

func (*OntapNASStorageDriver) Destroy

func (d *OntapNASStorageDriver) Destroy(name string) error

Destroy the volume

func (*OntapNASStorageDriver) Detach

func (d *OntapNASStorageDriver) Detach(name, mountpoint string) error

Detach the volume

func (*OntapNASStorageDriver) Get added in v1.3.3

func (d *OntapNASStorageDriver) Get(name string) error

Test for the existence of a volume

func (*OntapNASStorageDriver) Initialize

func (d *OntapNASStorageDriver) Initialize(configJSON string) error

Initialize from the provided config

func (*OntapNASStorageDriver) List added in v1.3.3

func (d *OntapNASStorageDriver) List(prefix string) ([]string, error)

Return the list of volumes associated with this tenant

func (*OntapNASStorageDriver) Name

func (d *OntapNASStorageDriver) Name() string

Name is for returning the name of this driver

func (*OntapNASStorageDriver) SnapshotList added in v1.3.1

func (d *OntapNASStorageDriver) SnapshotList(name string) ([]CommonSnapshot, error)

Return the list of snapshots associated with the named volume

func (*OntapNASStorageDriver) Validate

func (d *OntapNASStorageDriver) Validate() error

Validate the driver configuration and execution environment

type OntapSANStorageDriver

type OntapSANStorageDriver struct {
	Initialized bool
	Config      OntapStorageDriverConfig
	API         *ontap.Driver
}

OntapSANStorageDriver is for iSCSI storage provisioning

func (*OntapSANStorageDriver) Attach

func (d *OntapSANStorageDriver) Attach(name, mountpoint string, opts map[string]string) error

Attach the lun

func (*OntapSANStorageDriver) Create

func (d *OntapSANStorageDriver) Create(name string, opts map[string]string) error

Create a volume+LUN with the specified options

func (*OntapSANStorageDriver) CreateClone added in v1.3.1

func (d *OntapSANStorageDriver) CreateClone(name, source, snapshot, newSnapshotPrefix string) error

Create a volume clone

func (*OntapSANStorageDriver) DefaultSnapshotPrefix added in v1.3.1

func (d *OntapSANStorageDriver) DefaultSnapshotPrefix() string

DefaultSnapshotPrefix is the driver specific prefix for created snapshots, can be overridden in the config file

func (*OntapSANStorageDriver) DefaultStoragePrefix

func (d *OntapSANStorageDriver) DefaultStoragePrefix() string

DefaultStoragePrefix is the driver specific prefix for created storage, can be overridden in the config file

func (*OntapSANStorageDriver) Destroy

func (d *OntapSANStorageDriver) Destroy(name string) error

Destroy the requested (volume,lun) storage tuple

func (*OntapSANStorageDriver) Detach

func (d *OntapSANStorageDriver) Detach(name, mountpoint string) error

Detach the volume

func (*OntapSANStorageDriver) Get added in v1.3.3

func (d *OntapSANStorageDriver) Get(name string) error

Test for the existence of a volume

func (*OntapSANStorageDriver) Initialize

func (d *OntapSANStorageDriver) Initialize(configJSON string) error

Initialize from the provided config

func (*OntapSANStorageDriver) List added in v1.3.3

func (d *OntapSANStorageDriver) List(prefix string) ([]string, error)

Return the list of volumes associated with this tenant

func (OntapSANStorageDriver) Name

func (d OntapSANStorageDriver) Name() string

Name is for returning the name of this driver

func (*OntapSANStorageDriver) SnapshotList added in v1.3.1

func (d *OntapSANStorageDriver) SnapshotList(name string) ([]CommonSnapshot, error)

Return the list of snapshots associated with the named volume

func (*OntapSANStorageDriver) Validate

func (d *OntapSANStorageDriver) Validate() error

Validate the driver configuration and execution environment

type OntapStorageDriverConfig

type OntapStorageDriverConfig struct {
	CommonStorageDriverConfig        // embedded types replicate all fields
	ManagementLIF             string `json:"managementLIF"`
	DataLIF                   string `json:"dataLIF"`
	IgroupName                string `json:"igroupName"`
	SVM                       string `json:"svm"`
	Username                  string `json:"username"`
	Password                  string `json:"password"`
	Aggregate                 string `json:"aggregate"`
}

OntapStorageDriverConfig holds settings for OntapStorageDrivers

type SolidfireSANStorageDriver

type SolidfireSANStorageDriver struct {
	Initialized      bool
	Config           SolidfireStorageDriverConfig
	Client           *sfapi.Client
	TenantID         int64
	DefaultVolSz     int64
	VagID            int64
	LegacyNamePrefix string
	InitiatorIFace   string
}

SolidfireSANStorageDriver is for iSCSI storage provisioning

func (*SolidfireSANStorageDriver) Attach

func (d *SolidfireSANStorageDriver) Attach(name, mountpoint string, opts map[string]string) error

Attach the lun

func (*SolidfireSANStorageDriver) Create

func (d *SolidfireSANStorageDriver) Create(name string, opts map[string]string) error

Create a SolidFire volume

func (*SolidfireSANStorageDriver) CreateClone added in v1.3.1

func (d *SolidfireSANStorageDriver) CreateClone(name, source, snapshot, newSnapshotPrefix string) error

Create a volume clone

func (*SolidfireSANStorageDriver) DefaultSnapshotPrefix added in v1.3.1

func (d *SolidfireSANStorageDriver) DefaultSnapshotPrefix() string

DefaultSnapshotPrefix is the driver specific prefix for created snapshots, can be overridden in the config file

func (*SolidfireSANStorageDriver) DefaultStoragePrefix

func (d *SolidfireSANStorageDriver) DefaultStoragePrefix() string

DefaultStoragePrefix is the driver specific prefix for created storage, can be overridden in the config file

func (*SolidfireSANStorageDriver) Destroy

func (d *SolidfireSANStorageDriver) Destroy(name string) error

Destroy the requested docker volume

func (*SolidfireSANStorageDriver) Detach

func (d *SolidfireSANStorageDriver) Detach(name, mountpoint string) error

Detach the volume

func (*SolidfireSANStorageDriver) Get added in v1.3.3

func (d *SolidfireSANStorageDriver) Get(name string) error

Test for the existence of a volume

func (*SolidfireSANStorageDriver) Initialize

func (d *SolidfireSANStorageDriver) Initialize(configJSON string) error

Initialize from the provided config

func (*SolidfireSANStorageDriver) List added in v1.3.3

func (d *SolidfireSANStorageDriver) List(prefix string) (vols []string, err error)

Return the list of volumes according to backend device

func (SolidfireSANStorageDriver) Name

Name is for returning the name of this driver

func (*SolidfireSANStorageDriver) SnapshotList added in v1.3.1

func (d *SolidfireSANStorageDriver) SnapshotList(name string) ([]CommonSnapshot, error)

Return the list of snapshots associated with the named volume

func (*SolidfireSANStorageDriver) Validate

func (d *SolidfireSANStorageDriver) Validate() error

Validate the driver configuration and execution environment

type SolidfireStorageDriverConfig

type SolidfireStorageDriverConfig struct {
	CommonStorageDriverConfig // embedded types replicate all fields
	TenantName                string
	EndPoint                  string
	DefaultVolSz              int64 //Default volume size in GiB
	SVIP                      string
	InitiatorIFace            string //iface to use of iSCSI initiator
	Types                     *[]sfapi.VolType
	LegacyNamePrefix          string //name prefix used in earlier ndvp versions
}

SolidfireStorageDriverConfig holds settings for SolidfireStorageDrivers

type StorageDriver

type StorageDriver interface {
	Name() string
	Initialize(string) error
	Validate() error
	Create(name string, opts map[string]string) error
	CreateClone(name, source, snapshot, newSnapshotPrefix string) error
	Destroy(name string) error
	Attach(name, mountpoint string, opts map[string]string) error
	Detach(name, mountpoint string) error
	DefaultStoragePrefix() string
	DefaultSnapshotPrefix() string
	SnapshotList(name string) ([]CommonSnapshot, error)
	List(prefix string) ([]string, error)
	Get(name string) error
}

StorageDriver provides a common interface for storage related operations

Jump to

Keyboard shortcuts

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