vSphere Docker Volume Service
Python Go JavaScript C Shell Makefile Other
Latest commit 25d6b78 Feb 24, 2017 @pshahzeb pshahzeb committed with shuklanirdesh82 Failing volume create in case of wrong/incompatible VSAN policy (#947)
* Failing volume create in case of wrong/incompatible VSAN policy

1. In case of wrong/incompatible policy, error is returned which is
   displayed on the client. Changing signature of set_policy to return
   the error thrown by VSAN
2. cleanVMDK to delete the vmdk file in cases when metafile hasn't been
   created but the vmdk is; and the vmdk file needs to be deleted
   Invoked as a part of removeVMDK procedure and
   cases requiring deletion of vmdk file only (when meta file
   hasn't been generated)
   eg: Unsuccesful attempt to apply vsan policy and when failed
   to create metadata for vmdk_path

Added test scenario of impossible policy so that createVMDK fails
Add this in VmdkCreateRemoveTestCase

Resolves: #874

* Adding logs and a negative test case for bad policy content

* Adding CleanVMDK logs

* Correcting logs for cleanVMDK errors


Build Status Join the chat at https://gitter.im/vmware/docker-volume-vsphere

vSphere Docker Volume Service

vSphere Docker Volume Service enables customers to address persistent storage requirements for Docker containers in vSphere environments. This service is integrated with Docker Volume Plugin framework. Docker users can now consume vSphere Storage (vSAN, VMFS, NFS) to stateful containers using Docker.

To read more about code development and testing please read CONTRIBUTING.md as well as the FAQ on the project site.

Detailed documentation

Detailed documentation can be found in our GitHub Documenation Page.


Click here to download (Github releases)

The download consists of 2 parts:

  1. ESX: The ESX code is packaged as a vib or an offline depot
  2. VM Running Docker: The docker service is packaged as a deb or rpm file.
    • Photon/RedHat => Download RPM
    • Ubuntu => Download Deb.

Pick the latest release and use the same version of ESX and VM release.


The demos are located on the project site and wiki

Project Website

Project page is located @ https://vmware.github.io/docker-volume-vsphere/. Documentation, FAQ and other content can be found @ https://vmware.github.io/docker-volume-vsphere/documentation

Installation Instructions


Install vSphere Installation Bundle (VIB). Please refer to vSphere documentation.

Install using localcli on an ESX node

esxcli software vib install --no-sig-check  -v /tmp/<vib_name>.vib

Make sure you provide the absolute path to the .vib file or the install will fail.

On Docker Host (VM)

The Docker volume plugin requires the docker engine to be installed as a prerequisite. This requires Ubuntu users to configure the docker repository and pull the docker-engine package from there. Ubuntu users can find instructions here.

Docker recommends that the docker engine should start after the plugins.

sudo dpkg -i <name>.deb # Ubuntu or deb based distros
sudo rpm -ivh <name>.rpm # Photon or rpm based distros

Using Docker CLI

Refer to tenancy documentation for setting up tenants.

# To select datastore use --name=MyVolume@<Datastore Name>
$ docker volume create --driver=vmdk --name=MyVolume -o size=10gb
$ docker volume ls
$ docker volume inspect MyVolume
# To select datastore use MyVolume@<Datastore Name>
$ docker run --rm -it -v MyVolume:/mnt/myvol busybox
$ cd /mnt/myvol # to access volume inside container, exit to quit
$ docker volume rm MyVolume

Using ESXi Admin CLI

$ /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls

Restarting Docker and vSphere Docker Volume Service

The volume service needs to be started up before starting docker.

service docker stop
service docker-volume-vsphere restart
service docker start

Using systemctl

systemctl stop docker
systemctl restart docker-volume-vsphere
systemctl start docker


The relevant logging for debugging consists of the following:

  • Docker Logs
  • Plugin logs - VM (docker-side)
  • Plugin logs - ESX (server-side)

Docker logs: see https://docs.docker.com/engine/admin/logging/overview/

/var/log/upstart/docker.log # Upstart
journalctl -fu docker.service # Journalctl/Systemd

VM (Docker-side) Plugin logs

  • Log location: /var/log/docker-volume-vsphere.log
  • Config file location: /etc/docker-volume-vsphere.conf.
    • This JSON-formatted file controls logs retention, size for rotation and log location. Example:
 {"MaxLogAgeDays": 28,
 "MaxLogSizeMb": 100,
 "LogPath": "/var/log/docker-volume-vsphere.log"}
  • Turning on debug logging: stop the service and manually run with `--log_level=debug flag

ESX Plugin logs

  • Log location: /var/log/vmware/vmdk_ops.log
  • Config file location: /etc/vmware/vmdkops/log_config.json See Python logging config format for content details.
  • Turning on debug logging: replace all 'INFO' with 'DEBUG' in config file, restart the service

Tested on

VMware ESXi:

  • 6.0
  • 6.0 u1
  • 6.0 u2
  • 6.5

Docker: 1.9 and higher

Guest Operating System:

Known Issues

  1. VM level snapshots do not include docker data volumes. #60
  2. Exiting bug in Docker around cleanup if mounting of volume fails when -w command is passed. Docker Issue #22564
  3. VIB, RPM and Deb files are not signed.#273
  4. Pre-GA releases of Photon can crash on attaching a Docker volume. This issue is resolved in Photon Issue 455 (Photon GA). Workaround: power off the Photon VM, change SCSI Adapter type from LSI Logic to PVSCSI, and power on the VM.

Contact us