thecodeteam / mesos-module-dvdi

Mesos Docker Volume Driver Isolator module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using DVDI Module with Docker Containers

akamalov opened this issue · comments

Greetings,

Wondering if someone can supply an example of a JSON file where Docker container would mount DVDI provided volume ? Let's say I want to elasticsearch container to mount a volume called elkvol001 as the /data provided by DVDI module. Something along the lines of this:

{
    "id": "elasticsearch",
    "container": {
        "type": "DOCKER",
        "docker": {
            "image": "elasticsearch",
            "network": "BRIDGE"
        }
    },
    "volumes": [{
        "containerPath": "/data",
        "hostPath": "/var/lib/rexray/volumes/dbdata",
        "mode": "RW"
    }],
    "cpus": 0.2,
    "mem": 512.0,
    "env": {
        "DVDI_VOLUME_NAME": "elkvol001",
        "DVDI_VOLUME_DRIVER": "rexray",
        "DVDI_VOLUME_OPTS": "size=5,iops=150,volumetype=io1,newfstype=xfs,overwritefs=true"
    },
    "instances": 1
}

The DVDI isolator is not used (or needed) for external volume mounts from Docker containers.
The DVDI isolator is for use with tasks utilizing the Mesos containerizer instead of the Docker containerizer. For various reasons, many Mesos users elect to use the MEsos containerizer instead of using Docker.

If you want to use Docker with external volume mounts, this works, it just doesn't use the DVDI isolator.
This blog post covers external volume mounts from a Docker container on Mesos.
http://blog.emccode.com/2015/08/28/run-your-stateful-apps-with-mesos-and-docker/

Steve, Thanks so much!!!