Docker-machine with vSphere ESX

By | 01/09/2017

Introduction

In various previous posts, we have been using docker-machine to create some servers on Virtualbox (see here), Digital Ocean (see here) and AWS (see here).

As I recently setup an entire vSphere environment on an Intel NUC, I wanted to use docker-machine to setup some servers also on my vSphere environment. This short posts describes how to achieve that.

Docker-machine has a vsphere driver as well and it actually turns out to be quite straightforward to launch docker hosts on vSphere.

The command to use is the following:

WAUTERW-M-T3ZT:~ wim$ docker-machine create --driver vmwarevsphere --vmwarevsphere-username=*******@vsphere.local --vmwarevsphere-password=********* --vmwarevsphere-vcenter= --vmwarevsphere-datastore= -vmwarevsphere-pool= 

The above command can look a bit obscure so let’s try it out. On your MAC, run the following command (obviously tweaked for your setup)

WAUTERW-M-T3ZT:~ wim$ docker-machine create --driver vmwarevsphere --vmwarevsphere-username=*******@vsphere.local --vmwarevsphere-password=********* --vmwarevsphere-vcenter=192.168.10.11 --vmwarevsphere-datastore=Datastore_Samsung_500GB -vmwarevsphere-pool=192.168.10.10 VM-Docker1

So in my setup the ‘192.168.10.10’ is the IP address of my ESX host, the ‘192.168.10.11’ is the IP address of the Vcenter Server Appliance.

The following screenshot shows everything went smoothly:

Leave a Reply

Your email address will not be published. Required fields are marked *