In this blog I will explain how to configure and use the NetApp Docker Volume Plugin (nDVP) with SolidFire storage.
To get up and running follow these three main steps:
- Install the nDVP binary on your container host
- Create a config json file
- Create and manage volumes from Docker
and if it doesn’t work, check Troubleshooting :-)
[1] Install the nDVP binary on your container host
Install the nDVP software (a single binary) on your container host. We will create the config json file and start the daemon in the next step, so for now just get the files on the container host:
- Manual installation:
- Docker store installation (requires Docker v1.13 and greater. Note Docker switched to a YYMM version scheme, so v17.X is greater than v1.13):
docker plugin install --alias netapp --grant-all-permissions --disable netapp/ndvp-plugin:17.04
[2] Create a config json file
The nDVP uses a JSON formatted configuration file to learn connection information when it is started. There is a 1:1 relationship between a storage array and a configuration file. If you have multiple storage arrays you must configure a conf file, and start a nDVP daemon, for each one.
SolidFire supports the following config file options:
Option | Description | Example Value |
---|---|---|
version | Config file version number | 1 |
storageDriverName | ontap-nas , ontap-san , eseries-iscsi , or solidfire-san |
solidfire-san |
debug | Turn debugging output on or off | false |
Endpoint | MVIF API endpoint formatted as : https://login:password@mvip/json-rpc/element-version | https://user:[email protected]/json-rpc/7.0 |
SVIP | SVIP: iSCSI IP address and port | 10.0.0.7:3260 |
TenantName | SF Tenant to use (created if not found) | docker |
DefaultVolSz | Volume size in GiB | 1 |
InitiatorIFace | Specify interface when restricting iSCSI traffic to non-default interface | default |
Types | QoS specifications to simplify reuse of standard QoS settings | See example below |
LegacyNamePrefix | Prefix for upgraded NDVP installs to maintain mapping of volumes created with nDVP <1.3.2 | netappdvp- |
Here is a working example to use as a template:
{
"version": 1,
"storageDriverName": "solidfire-san",
"debug": false,
"Endpoint": "https://ndvpuser:[email protected]/json-rpc/7.0",
"SVIP": "10.0.0.7:3260",
"TenantName": "docker",
"DefaultVolSz": 1,
"InitiatorIFace": "default",
"Types": [
{
"Type": "staging",
"Qos": {
"minIOPS": 500,
"maxIOPS": 4000,
"burstIOPS": 8000
}
},
{
"Type": "prod",
"Qos": {
"minIOPS": 6000,
"maxIOPS": 8000,
"burstIOPS": 10000
}
}
]
}
- Copy the working example from above into your favorite text editor.
At a minimum, edit these fields:
Endpoint
: Replace with your username:password and MVIF IP addressSVIP
: Replace with SVIP IP address and iSCSI Port (normally 3260)TenantName
: Replace with the Account name to use for this nDVP instance
Write out the contents to
/etc/netappdvp/config.json
on your container host:mkdir /etc/netappdvp cat << EOF > /etc/netappdvp/config.json **PASTE YOUR JSON CONFIG CONTENTS HERE** EOF
Start the nDVP:
If installed manually:
/opt/netappdvp/netappdvp --config=/etc/netappdvp/config.json &
If installed from the Docker store:
docker plugin enable netapp
[3] Create and manage volumes from Docker
Volumes are managed using the docker volume
command family. The examples all assume you started the nDVP using the default volume-driver name (netapp
). Options can be passed to volume plugins using one or more -o KEY=VALUE
arguments.
Supported options for SolidFire iSCSI are:
Option | Description | Default | Example |
---|---|---|---|
size |
Size in GiB. | DefaultVolSz from nDVP json config file |
115 |
type |
QoS Types entry from nDVP json config file | SolidFire array default | gold |
qos |
MIN,MAX,BURST QoS IOP values | SolidFire array default | 100,500,1500 |
from |
Create a clone from this volume | none | vol1 |
from-snapshot |
Snapshot name to use for clone | none | snap1 |
SolidFire iSCSI volume create examples:
# Create a volume using default settings for size and QoS
docker volume create --driver netapp --name volDefault
# Create a 65GB volume using default QoS settings
docker volume create --driver netapp --name vol65 -o size=65
# Create a 75GB volume using QoS settings from the Gold Type
docker volume create --driver netapp --name volGold -o size=75 -o type=gold
# Create a 85GB volume using QoS of Min:100, Max:200, Burst:1000
docker volume create --driver netapp --name volQos -o size=85 -o qos=100,200,1000
# Create a clone volume from an existing volume volGold (QoS settings are inherited)
docker volume create --driver netapp --name volGoldClone -o from=volGold
# Create a clone volume from an existing volume volGold, snapshot upgrade55 (QoS settings are inherited)
docker volume create --driver netapp --name volGoldClone -o from=volGold -o from-snapshot=upgrade55
Volume list examples:
# List all volumes
docker volume ls
# List volumes for driver netapp
docker volume ls -f driver=netapp
# Inspect (full listing of) a specific volume. Note that snapshot names are shown
# which is helpful when creating a clone using the from-snapshot option
docker volume inspect volGold
[
{
"Name": "volGold",
"Driver": "solidfire-san",
"Mountpoint": "",
"Status": {
"Snapshots": [
{
"Created": "2017-02-03T20:14:32Z",
"Name": "maddenSnap"
}
]
},
"Labels": {},
"Scope": "global"
}
]
Volume remove example:
# Remove volume named volGoldClone; will remove the Docker volume and the volume
# from the SolidFire array
docker volume rm volGoldClone
Attaching a volume to a container providing persistent storage:
# Run a Debian bash shell and attach gold-vol to /gold
docker run -it --rm -v volGold:/gold debian bash
# Write something to the volume and exit
echo "SolidFire: zero touch storage" >> /gold/zero.txt
exit
# Run a CentOS bash shell and attach gold-vol to /gold
docker run -it --rm -v volGold:/gold centos bash
# Read from the persistent disk and exit
cat /gold/zero.txt
exit
Putting it all together
Seeing the input/output helps sometimes so check out this Asciicast [which allows copy/paste!] for a demo of the above!
Troubleshooting
The nDVP daemon must be running for it to manage NetApp storage. Check that it is running with:
ps -ef | grep netappdvp
Check the nDVP logfile for status or error messages:
If installed manually:
tail /var/log/netappdvp/*
If installed using
docker plugin
:# find the container docker-runc list # view the logs in the container docker-runc exec -t <container id> cat /var/log/netappdvp/netapp.log
As always, comments are welcome!