Generic Openstack Docker volume plugin. This is based off of https://github.com/j-griffith/cinder-docker-driver with a lot of the same code but focused on only providing simple cinder mapping to nova-compute hypervisors without the iscsi bits. Currently only tested with docker 1.12.6 on CentOS7.
curl -sSl https://raw.githubusercontent.com/mvollman/openstack-docker-driver/master/install.sh | sudo bash
git clone https://github.com/mvollman/openstack-docker-driver
cd openstack-docker-driver
export GOPATH=$PWD
go get ./...
go build
Source an openstack RC file like you would to run Openstack CLI commands and run
source openrc
./openstack-docker-driver
Edit /etc/sysconfig/openstack-docker-driver or /etc/default/openstack-docker-driver and setup your Openstack authentication
Set the required options:
OS_REGION_NAME=
OS_USERNAME=
OS_PASSWORD=
OS_AUTH_URL=
OS_PROJECT_NAME=
OS_TENANT_NAME=
OS_TENANT_ID=
Optional option SWARM_MODE=true
tells the driver to detach a volume that is in-use when a mount request comes in. This is assuming that the node with the attached volume has failed and we want to detach to start the docker on a new node.
Then start the driver:
sudo service openstack-docker-driver start
And restart docker:
sudo service docker restart
Example 10GB ceph cinder volume:
docker volume create -d openstack --name myvolume -o type=ceph -o size=10
Example mount your volume to the a container:
docker run -v myvolume:/Data --volume-driver=openstack -i -t ubuntu /bin/bash
The driver works on the happy path. What's left?
- Test all the edge cases
- More logging and debug messages
- Remove code duplication
- Upstart service script
- Per volume file system types