Docker Volume Plugin Integration
Overview
The Docker Volume Plugin for OSNEXUS QuantaStor makes it easy to create and mange persistent Docker containers using Docker APIs and command line tools for containerized applications and stateful QuantaStor storage volumes.
Quantastor Docker Volume Plugin offers the following benefits:
- Provides persistent shared storage across containers.
- Easy to deploy and manage. Docker APIs can be used to manage volume life cycle.
Platform and Software Dependencies
Operating Systems Supported
Ubuntu (Xenial 16.04 LTS, Bionic 18.04 LTS)
Environments Supported
Docker (18.09.2 and above)
Other software dependencies
Latest iSCSI initiator software (open-iscsi). Required for iSCSI connectivity to Quantastor Volumes.
Plugin Installation
Create a directory "/plugin" Create a config file /plugin/qsdvp/conf/qs-config.json The config file looks like this:
{ "qsHostIp": "10.0.xx.xx", "qsHostUsername": "admin", "qsHostPass": "xxxx", "fsType": "ext4", "logFileLocation": "/plugin/qsdvp/log/qsdocker.log" }
qsHostIp : IP address of the Quantastor Server qsHostUsername : Username for the Quantastor Server qsHostPass : Password for the Quantastor Server fsType : File system type logFileLocation : Location for the volume plugin log file. Default is "/plugin/qsdvp/log/qsdocker.log"
Install the plugin using the following command
docker plugin install store/osnexus/volumeplugin:1.0 config=/plugin/qsdvp/conf/qs-config.json --grant-all-permissions
List the installed plugin :
docker plugin ls ID NAME DESCRIPTION ENABLED 2380742852ac store/osnexus/volumeplugin:1.0 QuantaStor Docker volume plugin true
Creating volumes and other operations
Volume List
docker volume ls
This command will list all the volumes present on the QuantaStor Device.
docker volume ls DRIVER VOLUME NAME store/osnexus/volumeplugin:1.0 jobod-vol.000 store/osnexus/volumeplugin:1.0 jobod-vol.001 store/osnexus/volumeplugin:1.0 jobod-vol.002 store/osnexus/volumeplugin:1.0 jobod-vol.003
Volume List by ID
docker volume inspect qs-vol-name
This command will display the data of the specified volume only.
Volume Create
The supported units are MB, GB, TB and PB only.
docker volume create -d=store/osnexus/volumeplugin:1.0 --name=qs-vol-from-plugin -o create=true -o size=10m -o provisionableID=qs-13ed78ad-c37a-1ac9-f9b2-39055f71ace9
docker volume ls DRIVER VOLUME NAME store/osnexus/volumeplugin:1.0 jobod-vol.000 store/osnexus/volumeplugin:1.0 jobod-vol.001 store/osnexus/volumeplugin:1.0 jobod-vol.002 store/osnexus/volumeplugin:1.0 jobod-vol.003 store/osnexus/volumeplugin:1.0 qs-vol-from-plugin
Create volume with size in MB:
docker volume create -d=store/osnexus/volumeplugin:1.0 --name=qs-vol-from-plugin -o create=true -o size=10m -o provisionableID=29xxxxxx-fxx1-fxxx-xx13-3174xxxxb0xx
Create volume with size in GB:
docker volume create -d=store/osnexus/volumeplugin:1.0 --name=qs-vol-from-plugin -o create=true -o size=10g -o provisionableID=29xxxxxx-fxx1-fxxx-xx13-3174xxxxb0xx
Create volume with size in TB:
docker volume create -d=store/osnexus/volumeplugin:1.0 --name=qs-vol-from-plugin -o create=true -o size=10t -o provisionableID=29xxxxxx-fxx1-fxxx-xx13-3174xxxxb0xx
Create volume with size in PB:
docker volume create -d=store/osnexus/volumeplugin:1.0 --name=qs-vol-from-plugin -o create=true -o size=10p -o provisionableID=29xxxxxx-fxx1-fxxx-xx13-3174xxxxb0xx
The value for the parameter “-d” should be the plugin name "store/osnexus/volumeplugin:1.0". An alias for the above name can also be created during installation.
docker plugin install store/osnexus/volumeplugin:1.0 config=/plugin/qsdvp/conf/qs-config.json --grant-all-permissions --alias qsdvp
Volume Clone
docker volume create -d=qsdvp --name=qs-vol-clone -o clone=true -o storageVolume=qsdvp-qs-vol-from-plugin -o provisionableID=805xxxxx-6800-cb72-xxcd-877xxxxxe4fx
Volume Snapshot
docker volume create -d=qsdvp --name=qs-vol-snapshot -o snapshot=true -o storageVolume=qsdvp-qs-vol-from-plugin -o provisionableID=805xxxxx-6800-cb72-xxcd-877xxxxxe4fx
NOTE: All the CREATE commands will check for free space available in the pool, if there is not enough space the commands will return an error.
Volume Remove
docker volume rm qsdvp-qs-vol
NOTE: This command will delete the volume and also delete the snapshots(if any) of this volume.
Volume Mount
docker run -it -d --name mounter -v qs-vol-from-plugin:/data ubuntu /bin/bash
NOTE: Volume Mount is called when your volume is used for a container, it is called once per container start.
Volume Unmount
docker stop devtest
NOTE: Volume Unmount is called once per container stop.
Disabling the plugin
Plugin can be disabled using the following command:
docker plugin disable store/osnexus/volumeplugin:1.0
Uninstall the plugin
To uninstall the plugin use the following command:
docker plugin rm osnexus/volumeplugin
Trouble shooting the plugin
Log location
Log for the plugin can be found at "/plugin/qsdvp/log/qsdocker.log".
Incorrect config file
If your plugin fails to install with the error "Error response from daemon: dial unix /run/docker/plugins/05e9ee....61/qsdvp.sock: connect: no such file or directory", then your plugin configuration is incorrect, please check your `qs-config.json` file, make sure all the parameters in this file are correct.
iscsi-adm errors
If you receive following error: "ls cannot access '/dev/disk/by-path/': No such file or directory", it might be the case that the iscsid service might be stopped. Restart the iscsid service on docker host. Make sure open-iscsi is installed.
apt-get install open-iscsi systemd-tmpfiles --create systemctl start iscsid systemctl enable iscsid systemctl status iscsid