Difference between revisions of "Docker Volume Plugin Integration"

From OSNEXUS Online Documentation Site
Jump to: navigation, search
m (Volume List)
m (Creating volumes and other operations)
Line 66: Line 66:
 
  docker volume ls
 
  docker volume ls
 
DRIVER                                VOLUME NAME
 
DRIVER                                VOLUME NAME
sheetaldockerid/qs-volume-plugin:3.0  jobod-vol.000
+
osnexus/volumeplugin                  jobod-vol.000
sheetaldockerid/qs-volume-plugin:3.0  jobod-vol.001
+
osnexus/volumeplugin                  jobod-vol.001
sheetaldockerid/qs-volume-plugin:3.0  jobod-vol.002
+
osnexus/volumeplugin                  jobod-vol.002
sheetaldockerid/qs-volume-plugin:3.0  jobod-vol.003
+
osnexus/volumeplugin                  jobod-vol.003
  
 
</pre>
 
</pre>
Line 124: Line 124:
  
 
NOTE: Volume Unmount is called once per container stop.
 
NOTE: Volume Unmount is called once per container stop.
 
  
 
===Disabling the plugin===
 
===Disabling the plugin===

Revision as of 09:50, 3 June 2019

Overview

Coming soon (June 2019), please contact support@osenexus.com for early access to the QuantaStor Docker Volume Plugin.

Quantastor Docker Volume Plugin by OSNEXUS provides integration for Docker containers and Quantastor Volumes. Quantastor Docker Volume Plugin provides stateful volumes for containerized applications. The volumes are served on storage provided by Quantastor.

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.

Installation the plugin

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 osnexus/volumeplugin config=/plugin/qsdvp/conf/qs-config.json --grant-all-permissions

List the installed plugin :

docker plugin ls
ID                  NAME                                   DESCRIPTION                       ENABLED
2380742852ac        osnexus/volumeplugin                   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
osnexus/volumeplugin                   jobod-vol.000
osnexus/volumeplugin                   jobod-vol.001
osnexus/volumeplugin                   jobod-vol.002
osnexus/volumeplugin                   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.

Create volume with size in MB:

docker volume create -d=osnexus/volumeplugin --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=osnexus/volumeplugin --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=osnexus/volumeplugin --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=osnexus/volumeplugin --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 "osnexus/volumeplugin". An alias for the above name can also be created during installation.

docker plugin install osnexus/volumeplugin 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 osnexus/volumeplugin

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