This is a really cool development. There is now a docker volume driver for vSphere which we just made public last night, and is now available for tech preview. This will allow customers to address persistent storage requirements for Docker containers in vSphere environments. Basically, it allows you to create a VMDK, and use this VMDK as a persistent storage volume for containers. In the following posts, I will outline the steps involved in getting started with Docker Volume Driver for vSphere. In essence, there are 4 steps:

Install the docker volume plugin on ESXi host. I was running ESXi 6.0U2. Deploy Photon OS VM (although you can also use Ubuntu) Install the docker VMDK plugin on VM Create docker volume and run container to consume it

All the pieces to get you started are available on github here.

1. Install Docker Volume plugin on ESXi host

You will need to include the –no-sig-check option to the vib install to bypasses acceptance level verification, including signing.

[root@esxi-hp-08:~] esxcli software vib install \ -d "/vmfs/volumes/569c904a-8880cc78-a5c7-a0369f56ddc0/\ vmdkops/vmware-esx-vmdkops-0.1.0.tp.zip" --no-sig-check -f Installation Result Message: Operation finished successfully. Reboot Required: false VIBs Installed: VMWare_bootbank_esx-vmdkops-service_1.0.0-0.0.1 VIBs Removed: VIBs Skipped: [root@esxi-hp-08:~]

No reboot is required once installed. Check the status of the service as follows:

[root@esxi-hp-08:~] /etc/init.d/vmdk-opsd status vmdkops-opsd is running pid=12343527 [root@esxi-hp-08:~]

Logs are available in /var/log/vmware/vmdk_ops.log:

05/27/16 14:18:42 12343527 [INFO ] Log configuration generated \ - '/etc/vmware/vmdkops/log_config.json'. 05/27/16 14:18:42 12343527 [INFO ] === Starting vmdkops service === . . . 05/30/16 09:06:20 12343527 [INFO ] Created /vmfs/volumes/562f4eef-04977492\ -d303-a0369f56ddc0/dockvols 05/30/16 09:15:57 12343527 [INFO ] *** createVMDK: /vmfs/volumes/562f4eef\ -04977492-d303-a0369f56ddc0/dockvols/MyVolume.vmdk opts = {u'size': u'10gb'}

2. Deploy Photon OS

I simply rolled out the latest OVA 1.0 version of Photon OS (which is also our release candidate – RC). You can get the details on github here. As mentioned, there are also instructions to install on Ubuntu if you wish to use that flavor instead of Photon OS.

3. Install docker VMDK plugin on Photon OS

For Photon OS, there is an RPM that we must install. There is one requirement however. The version of docker must be greater than 1.9. The last version of Photon OS RC has version 1.11 installed.

root@photon-machine [ ~ ]# docker version Client: Version: 1.11.0 API version: 1.23 Go version: go1.5.4 Git commit: 4dc5990 Built: Wed Apr 13 19:36:04 2016 OS/Arch: linux/amd64 Server: Version: 1.11.0 API version: 1.23 Go version: go1.5.4 Git commit: 4dc5990 Built: Wed Apr 13 19:36:04 2016 OS/Arch: linux/amd64 root@photon-machine [ ~ ]#

Install the RPM (I’ve used “-U” out of habit, but “-i” can also be used):

root@photon-machine [ ~ ]# ls docker-volume-vsphere-0.1.0.tp-1.x86_64.rpm root@photon-machine [ ~ ]# rpm -Uvh docker-volume-vsphere-0.1.0.tp-1.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:docker-volume-vsphere-0:0.1.0.tp-################################# [100%] File: '/proc/1/exe' -> '/usr/lib/systemd/systemd' Created symlink from /etc/systemd/system/multi-user.target.wants/\ docker-volume-vsphere.service to /usr/lib/systemd/system/docker-volume-vsphere.service.

Check the status of the plugin:

root@photon-machine [ ~ ]# systemctl status docker-volume-vsphere * docker-volume-vsphere.service - "Docker Volume Driver for vSphere" Loaded: loaded (/usr/lib/systemd/system/docker-volume-vsphere.service;\ enabled; vendor preset: enabled) Active: active (running) since Mon 2016-05-30 09:04:21 UTC; 28s ago Main PID: 256 (docker-volume-v) CGroup: /system.slice/docker-volume-vsphere.service `-256 /usr/local/bin/docker-volume-vsphere May 30 09:04:21 photon-machine systemd[1]: Started "Docker Volume Driver\ for.... Hint: Some lines were ellipsized, use -l to show in full. root@photon-machine [ ~ ]#