Great things are continuing to happen with storage and Docker.  In recent months, Docker has introduced external volume functionality through Volume Drivers.  We at {code} have been tracking this work and aligning the advanced storage functionality of REX-Ray to the upcoming enhancements.

This post is going to focus on some of the really cool things that should be possible in the next version of Docker (1.9) and REX-Ray (0.2).  Both of these capabilities are available today with single line installs via experimental/unstable branches as follows.

curl -sSL https://experimental.docker.com/ | sh
curl -sSL https://dl.bintray.com/emccode/rexray/install-unstable | sh -

With the release of Docker 1.8 the storage team at Docker officially enabled the ability to extend Volume functionality to Volume Plugins.  That capability expected that Volumes would be pre-created to match the needed characteristics.  A major change that is likely to make it in 1.9 is the new CLI and API calls have been created to enable specific volume functionality.  We can thank Brian Goff for the heavy lifting in this PR!  Your feedback is welcome!

Now what does this mean?  For all existing drivers there is now a sub-command for volumes.  This enables direct creation and removal tasks of volumes.

[[email protected] centos]# docker volume ls
DRIVER              VOLUME NAME
rexray              testing

That’s great, but the real special sauce is yet to come.  With the new sub-command we can now specify volume options.  This means that a volume can be created with specific settings that a volume plugin can interpret.  For REX-Ray, we expose the advanced functionality of our storage drivers.

This includes operations like creating a volume from another volume, creating volumes from snapshot, creating volumes in another availability zone, or even specifying detailed information like disk type, or IOPS.

The following command specifies a volume type, an IOPS setting, and a volume size.

docker volume create --driver=rexray --name=testing10 --opt=volumetype=io1 --opt=iops=100 --opt=size=10

What if we want to create a volume from an existing volume for testing or other reasons?  Or create a volume from an existing snapshot? Or change the underlying type of storage from SSD to magnetic? Simple, notice we just specify the name of the previous volume as an option.

docker volume create --driver=rexray --name=testing10-copy1 --opt=volumetype=standard --opt=volumename=testing10

Further than this, what if we want to copy a volume between availability zones?
We do this here by leveraging the options to specify a new destination.

docker volume create --driver=rexray --name=testing-copy1 --opt=volumename=testing --opt=availabilityzone=us-west-1b

What do you think?  We feel like this is a very useful addition to the Docker storage plugin community.  REX-Ray is ready, check it out!