ontap

package
v18.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: Apache-2.0 Imports: 22 Imported by: 27

Documentation

Index

Constants

View Source
const (
	LSMirrorIdleTimeoutSecs      = 30
	MinimumVolumeSizeBytes       = 20971520 // 20 MiB
	HousekeepingStartupDelaySecs = 10
)
View Source
const DefaultEncryption = "false"
View Source
const DefaultExportPolicy = "default"
View Source
const DefaultFileSystemType = "ext4"
View Source
const DefaultLimitAggregateUsage = ""
View Source
const DefaultLimitVolumeSize = ""
View Source
const DefaultNfsMountOptions = "-o nfsvers=3"
View Source
const DefaultSecurityStyle = "unix"
View Source
const DefaultSnapshotDir = "false"
View Source
const DefaultSnapshotPolicy = "none"
View Source
const DefaultSnapshotReserve = ""
View Source
const DefaultSpaceReserve = "none"
View Source
const DefaultSplitOnClone = "false"
View Source
const DefaultUnixPermissions = "---rwxrwxrwx"
View Source
const LUNAttributeFSType = "com.netapp.ndvp.fstype"
View Source
const MSecPerHour = 1000 * 60 * 60 // millis * seconds * minutes

Variables

This section is empty.

Functions

func CreateOntapClone

func CreateOntapClone(
	name, source, snapshot string, split bool, config *drivers.OntapStorageDriverConfig, client *api.Client,
) error

Create a volume clone

func EMSHeartbeat

func EMSHeartbeat(driver StorageDriver)

EMSHeartbeat logs an ASUP message on a timer view them via filer::> event log show -severity NOTICE

func GetSnapshotList

func GetSnapshotList(name string, config *drivers.OntapStorageDriverConfig, client *api.Client) ([]storage.Snapshot, error)

Return the list of snapshots associated with the named volume

func GetSnapshotReserve

func GetSnapshotReserve(snapshotPolicy, snapshotReserve string) (int, error)

func GetVolume

func GetVolume(name string, client *api.Client, config *drivers.OntapStorageDriverConfig) error

GetVolume checks for the existence of a volume. It returns nil if the volume exists and an error if it does not (or the API call fails).

func GetVolumeSize

func GetVolumeSize(sizeBytes uint64, config drivers.OntapStorageDriverConfig) (uint64, error)

func InitializeOntapAPI

func InitializeOntapAPI(config *drivers.OntapStorageDriverConfig) (*api.Client, error)

InitializeOntapAPI returns an ontap.Client ZAPI client. If the SVM isn't specified in the config file, this method attempts to derive the one to use.

func InitializeOntapConfig

func InitializeOntapConfig(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) (*drivers.OntapStorageDriverConfig, error)

InitializeOntapConfig parses the ONTAP config, mixing in the specified common config.

func InitializeOntapDriver

func InitializeOntapDriver(config *drivers.OntapStorageDriverConfig) (*api.Client, error)

InitializeOntapDriver sets up the API client and performs all other initialization tasks that are common to all the ONTAP drivers.

func PopulateConfigurationDefaults

func PopulateConfigurationDefaults(config *drivers.OntapStorageDriverConfig) error

PopulateConfigurationDefaults fills in default values for configuration settings if not supplied in the config file

func UpdateLoadSharingMirrors

func UpdateLoadSharingMirrors(client *api.Client)

UpdateLoadSharingMirrors checks for the present of LS mirrors on the SVM root volume, and if present, starts an update and waits for them to become idle.

func ValidateDataLIF

func ValidateDataLIF(dataLIF string, dataLIFs []string) ([]string, error)

func ValidateEncryptionAttribute

func ValidateEncryptionAttribute(encryption string, client *api.Client) (*bool, error)

ValidateEncryptionAttribute returns true/false if encryption is being requested of a backend that supports NetApp Volume Encryption, and nil otherwise so that the ZAPIs may be sent without any reference to encryption.

func ValidateNASDriver

func ValidateNASDriver(api *api.Client, config *drivers.OntapStorageDriverConfig) error

ValidateNASDriver contains the validation logic shared between ontap-nas and ontap-nas-economy.

Types

type HousekeepingTask

type HousekeepingTask struct {
	Name         string
	Ticker       *time.Ticker
	InitialDelay time.Duration
	Done         chan struct{}
	Tasks        []func()
	Driver       *NASQtreeStorageDriver
}

func NewPruneTask

func NewPruneTask(d *NASQtreeStorageDriver, tasks []func()) *HousekeepingTask

func NewResizeTask

func NewResizeTask(d *NASQtreeStorageDriver, tasks []func()) *HousekeepingTask

func (*HousekeepingTask) Start

func (t *HousekeepingTask) Start()

func (*HousekeepingTask) Stop

func (t *HousekeepingTask) Stop()

type NASFlexGroupStorageDriver

type NASFlexGroupStorageDriver struct {
	Config    drivers.OntapStorageDriverConfig
	API       *api.Client
	Telemetry *Telemetry
	// contains filtered or unexported fields
}

NASFlexGroupStorageDriver is for NFS FlexGroup storage provisioning

func (*NASFlexGroupStorageDriver) Create

func (d *NASFlexGroupStorageDriver) Create(name string, sizeBytes uint64, opts map[string]string) error

Create a volume with the specified options

func (*NASFlexGroupStorageDriver) CreateClone

func (d *NASFlexGroupStorageDriver) CreateClone(name, source, snapshot string, opts map[string]string) error

Create a volume clone

func (*NASFlexGroupStorageDriver) CreateFollowup

func (d *NASFlexGroupStorageDriver) CreateFollowup(
	volConfig *storage.VolumeConfig,
) error

func (*NASFlexGroupStorageDriver) CreatePrepare

func (d *NASFlexGroupStorageDriver) CreatePrepare(volConfig *storage.VolumeConfig) bool

func (*NASFlexGroupStorageDriver) Destroy

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

Destroy the volume

func (*NASFlexGroupStorageDriver) Get

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

Tests the existence of a FlexGroup. Returns nil if the FlexGroup exists and an error otherwise.

func (*NASFlexGroupStorageDriver) GetAPI

func (d *NASFlexGroupStorageDriver) GetAPI() *api.Client

func (*NASFlexGroupStorageDriver) GetConfig

func (*NASFlexGroupStorageDriver) GetExternalConfig

func (d *NASFlexGroupStorageDriver) GetExternalConfig() interface{}

func (*NASFlexGroupStorageDriver) GetInternalVolumeName

func (d *NASFlexGroupStorageDriver) GetInternalVolumeName(name string) string

func (*NASFlexGroupStorageDriver) GetProtocol

func (*NASFlexGroupStorageDriver) GetStorageBackendSpecs

func (d *NASFlexGroupStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error

Retrieve storage backend capabilities

func (*NASFlexGroupStorageDriver) GetTelemetry

func (d *NASFlexGroupStorageDriver) GetTelemetry() *Telemetry

func (*NASFlexGroupStorageDriver) GetUpdateType

func (d *NASFlexGroupStorageDriver) GetUpdateType(driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*NASFlexGroupStorageDriver) GetVolumeExternal

func (d *NASFlexGroupStorageDriver) GetVolumeExternal(name string) (*storage.VolumeExternal, error)

GetVolumeExternal queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume.

func (*NASFlexGroupStorageDriver) GetVolumeExternalWrappers

func (d *NASFlexGroupStorageDriver) GetVolumeExternalWrappers(
	channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*NASFlexGroupStorageDriver) GetVolumeOpts

func (d *NASFlexGroupStorageDriver) GetVolumeOpts(
	volConfig *storage.VolumeConfig,
	pool *storage.Pool,
	requests map[string]sa.Request,
) (map[string]string, error)

func (*NASFlexGroupStorageDriver) Initialize

func (d *NASFlexGroupStorageDriver) Initialize(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) error

Initialize from the provided config

func (*NASFlexGroupStorageDriver) Initialized

func (d *NASFlexGroupStorageDriver) Initialized() bool

func (*NASFlexGroupStorageDriver) Name

Name is for returning the name of this driver

func (*NASFlexGroupStorageDriver) Publish

func (d *NASFlexGroupStorageDriver) Publish(name string, publishInfo *utils.VolumePublishInfo) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*NASFlexGroupStorageDriver) Resize

func (d *NASFlexGroupStorageDriver) Resize(name string, sizeBytes uint64) error

Resize expands the FlexGroup size.

func (*NASFlexGroupStorageDriver) SnapshotList

func (d *NASFlexGroupStorageDriver) SnapshotList(name string) ([]storage.Snapshot, error)

Return the list of snapshots associated with the named volume

func (*NASFlexGroupStorageDriver) StoreConfig

func (*NASFlexGroupStorageDriver) Terminate

func (d *NASFlexGroupStorageDriver) Terminate()

type NASQtreeStorageDriver

type NASQtreeStorageDriver struct {
	Config    drivers.OntapStorageDriverConfig
	API       *api.Client
	Telemetry *Telemetry
	// contains filtered or unexported fields
}

NASQtreeStorageDriver is for NFS storage provisioning of qtrees

func (*NASQtreeStorageDriver) Create

func (d *NASQtreeStorageDriver) Create(name string, sizeBytes uint64, opts map[string]string) error

Create a qtree-backed volume with the specified options

func (*NASQtreeStorageDriver) CreateClone

func (d *NASQtreeStorageDriver) CreateClone(name, source, snapshot string, opts map[string]string) error

Create a volume clone

func (*NASQtreeStorageDriver) CreateFollowup

func (d *NASQtreeStorageDriver) CreateFollowup(volConfig *storage.VolumeConfig) error

func (*NASQtreeStorageDriver) CreatePrepare

func (d *NASQtreeStorageDriver) CreatePrepare(volConfig *storage.VolumeConfig) bool

func (*NASQtreeStorageDriver) Destroy

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

Destroy the volume

func (*NASQtreeStorageDriver) FlexvolNamePrefix

func (d *NASQtreeStorageDriver) FlexvolNamePrefix() string

func (*NASQtreeStorageDriver) Get

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

Test for the existence of a volume

func (*NASQtreeStorageDriver) GetAPI

func (d *NASQtreeStorageDriver) GetAPI() *api.Client

func (*NASQtreeStorageDriver) GetConfig

func (*NASQtreeStorageDriver) GetExternalConfig

func (d *NASQtreeStorageDriver) GetExternalConfig() interface{}

func (*NASQtreeStorageDriver) GetInternalVolumeName

func (d *NASQtreeStorageDriver) GetInternalVolumeName(name string) string

func (*NASQtreeStorageDriver) GetProtocol

func (d *NASQtreeStorageDriver) GetProtocol() tridentconfig.Protocol

func (*NASQtreeStorageDriver) GetStorageBackendSpecs

func (d *NASQtreeStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error

Retrieve storage backend capabilities

func (*NASQtreeStorageDriver) GetTelemetry

func (d *NASQtreeStorageDriver) GetTelemetry() *Telemetry

func (*NASQtreeStorageDriver) GetUpdateType

func (d *NASQtreeStorageDriver) GetUpdateType(driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*NASQtreeStorageDriver) GetVolumeExternal

func (d *NASQtreeStorageDriver) GetVolumeExternal(name string) (*storage.VolumeExternal, error)

GetVolumeExternal queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume.

func (*NASQtreeStorageDriver) GetVolumeExternalWrappers

func (d *NASQtreeStorageDriver) GetVolumeExternalWrappers(
	channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*NASQtreeStorageDriver) GetVolumeOpts

func (d *NASQtreeStorageDriver) GetVolumeOpts(
	volConfig *storage.VolumeConfig,
	pool *storage.Pool,
	requests map[string]sa.Request,
) (map[string]string, error)

func (*NASQtreeStorageDriver) Initialize

func (d *NASQtreeStorageDriver) Initialize(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) error

Initialize from the provided config

func (*NASQtreeStorageDriver) Initialized

func (d *NASQtreeStorageDriver) Initialized() bool

func (*NASQtreeStorageDriver) Name

func (d *NASQtreeStorageDriver) Name() string

Name is for returning the name of this driver

func (*NASQtreeStorageDriver) Publish

func (d *NASQtreeStorageDriver) Publish(name string, publishInfo *utils.VolumePublishInfo) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*NASQtreeStorageDriver) Resize

func (d *NASQtreeStorageDriver) Resize(name string, sizeBytes uint64) error

Resize expands the Flexvol containing the Qtree and updates the Qtree quota.

func (*NASQtreeStorageDriver) SnapshotList

func (d *NASQtreeStorageDriver) SnapshotList(name string) ([]storage.Snapshot, error)

Return the list of snapshots associated with the named volume

func (*NASQtreeStorageDriver) StoreConfig

func (*NASQtreeStorageDriver) Terminate

func (d *NASQtreeStorageDriver) Terminate()

type NASStorageDriver

type NASStorageDriver struct {
	Config    drivers.OntapStorageDriverConfig
	API       *api.Client
	Telemetry *Telemetry
	// contains filtered or unexported fields
}

NASStorageDriver is for NFS storage provisioning

func (*NASStorageDriver) Create

func (d *NASStorageDriver) Create(name string, sizeBytes uint64, opts map[string]string) error

Create a volume with the specified options

func (*NASStorageDriver) CreateClone

func (d *NASStorageDriver) CreateClone(name, source, snapshot string, opts map[string]string) error

Create a volume clone

func (*NASStorageDriver) CreateFollowup

func (d *NASStorageDriver) CreateFollowup(
	volConfig *storage.VolumeConfig,
) error

func (*NASStorageDriver) CreatePrepare

func (d *NASStorageDriver) CreatePrepare(volConfig *storage.VolumeConfig) bool

func (*NASStorageDriver) Destroy

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

Destroy the volume

func (*NASStorageDriver) Get

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

Test for the existence of a volume

func (*NASStorageDriver) GetAPI

func (d *NASStorageDriver) GetAPI() *api.Client

func (*NASStorageDriver) GetConfig

func (*NASStorageDriver) GetExternalConfig

func (d *NASStorageDriver) GetExternalConfig() interface{}

func (*NASStorageDriver) GetInternalVolumeName

func (d *NASStorageDriver) GetInternalVolumeName(name string) string

func (*NASStorageDriver) GetProtocol

func (d *NASStorageDriver) GetProtocol() tridentconfig.Protocol

func (*NASStorageDriver) GetStorageBackendSpecs

func (d *NASStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error

Retrieve storage backend capabilities

func (*NASStorageDriver) GetTelemetry

func (d *NASStorageDriver) GetTelemetry() *Telemetry

func (*NASStorageDriver) GetUpdateType

func (d *NASStorageDriver) GetUpdateType(driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*NASStorageDriver) GetVolumeExternal

func (d *NASStorageDriver) GetVolumeExternal(name string) (*storage.VolumeExternal, error)

GetVolumeExternal queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume.

func (*NASStorageDriver) GetVolumeExternalWrappers

func (d *NASStorageDriver) GetVolumeExternalWrappers(
	channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*NASStorageDriver) GetVolumeOpts

func (d *NASStorageDriver) GetVolumeOpts(
	volConfig *storage.VolumeConfig,
	pool *storage.Pool,
	requests map[string]sa.Request,
) (map[string]string, error)

func (*NASStorageDriver) Initialize

func (d *NASStorageDriver) Initialize(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) error

Initialize from the provided config

func (*NASStorageDriver) Initialized

func (d *NASStorageDriver) Initialized() bool

func (*NASStorageDriver) Name

func (d *NASStorageDriver) Name() string

Name is for returning the name of this driver

func (*NASStorageDriver) Publish

func (d *NASStorageDriver) Publish(name string, publishInfo *utils.VolumePublishInfo) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*NASStorageDriver) Resize

func (d *NASStorageDriver) Resize(name string, sizeBytes uint64) error

Resize expands the volume size.

func (*NASStorageDriver) SnapshotList

func (d *NASStorageDriver) SnapshotList(name string) ([]storage.Snapshot, error)

Return the list of snapshots associated with the named volume

func (*NASStorageDriver) StoreConfig

func (*NASStorageDriver) Terminate

func (d *NASStorageDriver) Terminate()

type SANStorageDriver

type SANStorageDriver struct {
	Config drivers.OntapStorageDriverConfig

	API       *api.Client
	Telemetry *Telemetry
	// contains filtered or unexported fields
}

SANStorageDriver is for iSCSI storage provisioning

func (*SANStorageDriver) Create

func (d *SANStorageDriver) Create(name string, sizeBytes uint64, opts map[string]string) error

Create a volume+LUN with the specified options

func (*SANStorageDriver) CreateClone

func (d *SANStorageDriver) CreateClone(name, source, snapshot string, opts map[string]string) error

Create a volume clone

func (*SANStorageDriver) CreateFollowup

func (d *SANStorageDriver) CreateFollowup(volConfig *storage.VolumeConfig) error

func (*SANStorageDriver) CreatePrepare

func (d *SANStorageDriver) CreatePrepare(volConfig *storage.VolumeConfig) bool

func (*SANStorageDriver) Destroy

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

Destroy the requested (volume,lun) storage tuple

func (*SANStorageDriver) Get

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

Test for the existence of a volume

func (*SANStorageDriver) GetAPI

func (d *SANStorageDriver) GetAPI() *api.Client

func (*SANStorageDriver) GetConfig

func (*SANStorageDriver) GetExternalConfig

func (d *SANStorageDriver) GetExternalConfig() interface{}

func (*SANStorageDriver) GetInternalVolumeName

func (d *SANStorageDriver) GetInternalVolumeName(name string) string

func (*SANStorageDriver) GetProtocol

func (d *SANStorageDriver) GetProtocol() tridentconfig.Protocol

func (*SANStorageDriver) GetStorageBackendSpecs

func (d *SANStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error

Retrieve storage backend capabilities

func (*SANStorageDriver) GetTelemetry

func (d *SANStorageDriver) GetTelemetry() *Telemetry

func (*SANStorageDriver) GetUpdateType

func (d *SANStorageDriver) GetUpdateType(driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*SANStorageDriver) GetVolumeExternal

func (d *SANStorageDriver) GetVolumeExternal(name string) (*storage.VolumeExternal, error)

GetVolumeExternal queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume.

func (*SANStorageDriver) GetVolumeExternalWrappers

func (d *SANStorageDriver) GetVolumeExternalWrappers(
	channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*SANStorageDriver) GetVolumeOpts

func (d *SANStorageDriver) GetVolumeOpts(
	volConfig *storage.VolumeConfig,
	pool *storage.Pool,
	requests map[string]sa.Request,
) (map[string]string, error)

func (*SANStorageDriver) Initialize

func (d *SANStorageDriver) Initialize(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) error

Initialize from the provided config

func (*SANStorageDriver) Initialized

func (d *SANStorageDriver) Initialized() bool

func (SANStorageDriver) Name

func (d SANStorageDriver) Name() string

Name is for returning the name of this driver

func (*SANStorageDriver) Publish

func (d *SANStorageDriver) Publish(name string, publishInfo *utils.VolumePublishInfo) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*SANStorageDriver) Resize

func (d *SANStorageDriver) Resize(name string, sizeBytes uint64) error

Resize expands the volume size.

func (*SANStorageDriver) SnapshotList

func (d *SANStorageDriver) SnapshotList(name string) ([]storage.Snapshot, error)

Return the list of snapshots associated with the named volume

func (*SANStorageDriver) StoreConfig

func (*SANStorageDriver) Terminate

func (d *SANStorageDriver) Terminate()

type StorageDriver

type StorageDriver interface {
	GetConfig() *drivers.OntapStorageDriverConfig
	GetAPI() *api.Client
	GetTelemetry() *Telemetry
	Name() string
}

type Telemetry

type Telemetry struct {
	tridentconfig.Telemetry
	Plugin        string        `json:"plugin"`
	SVM           string        `json:"svm"`
	StoragePrefix string        `json:"storagePrefix"`
	Driver        StorageDriver `json:"-"`
	// contains filtered or unexported fields
}

func NewOntapTelemetry

func NewOntapTelemetry(d StorageDriver) *Telemetry

func (*Telemetry) Start

func (t *Telemetry) Start()

Start starts the flow of ASUP messages for the driver These messages can be viewed via filer::> event log show -severity NOTICE.

func (*Telemetry) Stop

func (t *Telemetry) Stop()

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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