# Docker Volumes

# Do I have to use cio CLI commands to create volumes for docker containers or services?

You can use either the docker CLI or Storidge's cio CLI to create volumes for docker containers and services.

Storidge provides a docker volume plugin that allows volumes to be requested natively from the docker CLI. See Volumes with Docker CLI (opens new window) for examples.

Volumes can also be created using the cio CLI. See cio volume (opens new window) for examples.

Storidge uses the concept of profiles (opens new window) to greatly simplify volume management. Profiles are managed using the cio CLI.

# How do I create a Storidge cio volume using the docker volume create command?

Use --driver cio in the docker volume create command. This passes the request for creating the volume to the Storidge CIO volume plugin, e.g.:

docker volume create --driver cio --name foo --opt capacity=15

For more examples, see Volumes with Docker CLI (opens new window).

# How do I create Storidge volumes from a docker compose or docker stack file?

See Volumes for Docker Compose (opens new window) for examples of how to set definitions for Storidge volumes within a docker compose or docker stack file.

In general, pass a named volume in the volumes section of a service definition, e.g. mysql-data:

    image: mysql:5.7
        # Pass volume named mysql-data to mysql container
      - "mysql-data:/var/lib/mysql"

Then add a definition to create the named volume, e.g. mysql-data referenced above. This creates volume mysql-data with default parameters.

    driver: cio

To create a volume using a profile (opens new window), use driver options to pass the profile name, e.g. profile MYSQL below:

    driver: cio
      profile: "MYSQL"

# Can I create a unique volume for each task of a docker swarm service using the replicas flag?

You can use a templatized notation to create and mount a unique volume into each task of a service. The example below deploys a service with 5 tasks with the .Task.Slot template assigning volume N to task N.

docker service create \
--mount source={{.Service.Name}}-{{.Task.Slot}},target=/var/lib/mysql,volume-driver=cio,volume-opt=profile=MYSQL \
--replicas 5 \
--detach=false \
--name mysql \

Refer to Volumes for Services (opens new window) for more info on using volumes with docker service create.

# Does Storidge have a docker volume plugin?

Yes, Storidge provides a docker volume plugin (opens new window) which is automatically installed as part of a Storidge CIO software installation.

This volume plugin enables request for storage to be passed to the Storidge CIO software whether from a docker run, docker service create, docker volume create command or Docker Compose file.

For more details, refer to Install Volume Plugin (opens new window).

# How do I upgrade Storidge's docker volume plugin?

To upgrade the volume plugin, use the docker plugin command to disable the plugin, upgrade, then re-enable the plugin.

Refer to Upgrade CIO Volume Plugin (opens new window) for details on using the docker plugin command.

# Does Storidge have a CSI driver or volume plugin?

Yes, a Storidge CSI driver (opens new window) is available.

This driver passes requests for persistent volume claims or persistent volumes to the Storidge CIO software. The driver supports declarative input and enables storage for pods to be dynamically provisioned on demand based on storage classes or profiles.

# Can I migrate data on a docker volume to a Storidge volume?

Use the cioctl migrate docker command to copy files from a docker named volume to a Storidge volume on a local node.

To migrate data on a docker volume to a remote Storidge cluster, use the --ip flag to specify the IP address of the Storidge cluster where the volume should be moved.

See the cioctl migrate (opens new window) documentation for usage info and examples.

Last Updated: 11/27/2019, 10:59:06 PM