Last week during lunch I learned about a cool little project that my colleague Alan Renouf was working on in his spare time at night. He was interested in learning more about Docker and thought the best way to learn about something new was by using it, which is normally how I learn as well. He came up with a nifty idea to create a Docker Image that would house a bunch of useful VMware tools which included several VMware open source projects as well.
UPDATE (11/23/16) - The Docker Container has now been updated with all the latest vSphere 6.5 SDK/CLI/Tools. We also plan to make this new version of the Docker Image available on Docker Hub, so stay tuned for those details shortly.
Some customers in the past have built similar offerings by using a free VMware Appliance called vMA (vSphere Management Assistance). vMA is nothing more than a stripped down version of SLES that has the vSphere CLI (vCLI) pre-installed. In my opinion, vMA is pretty limited and you can not install additional packages without voiding official support. Even if you decide to ignore support and install custom packages, I have often seen this break existing dependencies. When I talk to customers about their use of vMA, most used it because it was just there, but the majority prefer to use their own harden distribution of Linux and install their own admin utilities and packages which may also include non-VMware tools.
I personally have no problem building my own VM appliance that contains the various VMware packages, utilities and scripts that I use on a daily basis. However, not everyone is comfortable with this idea. Wow could this be further simplified and automated? Well, enter vmware-utils a Docker Image that allows you to automatically build a new image that contains some of the most popular and widely used VMware Utilities.
I wanted to enhance the awesome work that Alan had done with couple more VMware open source tools that I thought might be useful to VMware Administrators, which I actually wrote about here in my List of VMware CLIs, SDKS and DevOps Tools article. I have already submitted a pull request for my changes here. If there are other tools or packages you think that are useful and wish to contribute back, feel free to clone the repository and submit a pull request!
The latest vmware-utils now contains the following:
- vSphere CLI 6.5
- PowerCLI Core 1.0
- vSphere Management SDK 6.5
- vSphere SDK for Perl 6.5
- vSphere SDK for Ruby (rbvmomi)
- vSphere SDK for Python (pyvmomi)
- vSphere Automation SDK for Ruby 6.5
- vSphere Automation SDK for Python 6.5
- vSphere Automation SDK for Perl 6.5
- vSphere Automation SDK for Java 6.5
- VSAN Management SDK for Ruby 6.5
- VSAN Management SDK for Python 6.5
- VSAN Management SDK for Java 6.5
- VSAN Management SDK for Perl 6.5
- Virtual Disk Development Kit (VDDK) 6.5
- OVFTool 4.2
- PowerCLI Community Repository
- PowerCLI Core Docker Container Samples
- William Lam's vGhetto Script Repository
- Pyvmomi Community Samples
- Docker Client v1.12.3
- Docker Compose v1.8.1
For those of you who are new to Docker, a great way to quickly get started is by using an awesome tool called boot2docker which allows you to run Docker Containers on either a Windows or Mac OS X system. This also helps remove any barriers if you do not want to setup a Linux machine to get Docker of if you are like me, running on Mac OS X and rather not have to spin up a VM just to use Docker. Below are the steps on getting boot2docker working and building your own vmware-utils Docker Image.
Step 1 - Download the Docker Client for your specific OS (Windows, Linux or Mac OS X)
Step 2 - Take a look at the vmware-utils README, I spent some time updating it to make it more consumable for new users of Docker and follow the "How" section which will have you download the 4 VMware utilities as well as the vmware-utils DockerFile which we will need to build the Docker Container.
Step 3 - Create a directory and place all files into that directory. In this example, I have called the directory "vmware-utils".
Step 3 - We are now ready to build our vmware-utils Docker Image. Change into the "vmware-utils" directory that contains the files you downloaded earlier we will need to specify a "tag" for our image as part of the build command. In this example, I have called my image "lamw/vmware-utils" and to start the build process run the following command:
docker build -t lamw/vmware-utils .
Step 4 - The build itself may take some time depending on the speed of your internet connection. You will know when it has successfully completed when it states "Successfully built X" where X will be some unique ID as seen in the screenshot below.
Step 5 - Once the Docker Image has finished building, you can then run and connect to the Container by running the following command:
docker run --rm -it lamw/vmware-utils
At this point, you are now logged into the vmware-utils Docker Container that you have just built! It contains all the VMware Utilities that I have listed earlier and for more details on what has been installed and the location of the utilities, take a look at the vmware-utils Github documentation. If there are other tools you would like to see, feel free to contribute back by cloning the repository and submitting a pull request. I am definitely looking forward to seeing how this project evolves and providing a more dynamic way of creating a vMA-like experience without the current limitations. Keep up the awesome work Alan!
b-o-k says
Great stuff!
Note: last command should be "docker run --rm -it lamw/vmware-utils" instead.
William Lam says
Good catch! Just fixed, thanks
chris says
What is all that extra stuff in your terminal? tmux + modifications?
William Lam says
It's oh-my-zsh, check it out. It's pretty cool and has lots of plugins for things like Git/etc.
Brian Marsh says
Hey William, I'm getting an odd error while trying to get this running the initial docker build. Any ideas?
Step 16 : RUN go get github.com/vmware/govmomi/govc
---> Running in 00478e442e4f
# github.com/vmware/govmomi/vim25/soap
src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:68: unknown net.Dialer field 'KeepAlive' in struct literal
src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:74: c.t.TLSHandshakeTimeout undefined (type *http.Transport has no field or method TLSHandshakeTimeout)
2015/04/08 21:46:39 The command [/bin/sh -c go get github.com/vmware/govmomi/govc] returned a non-zero code: 2
Mike says
I opened a PR for this
https://github.com/alanrenouf/vmware-utils/pull/5
Yong says
Just wondering why not having vSphere SDK for Perl included, is it deprecated?
Thanks!
Andrew Hancock (@einsteinagogo) says
Step 23 : RUN gem install --no-rdoc --no-ri vcloud-tools
---> Running in 89a31d05672f
I wonder if this is broke as well now ?
as I get this...
---> Running in 89a31d05672f
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: vcloud-tools requires vcloud-core (>= 0); vc
loud-walker requires vcloud-core (~> 1.0.0); vcloud-net_launcher requires vcloud
-core (~> 1.1.0); vcloud-launcher requires vcloud-core (~> 1.1.0); vcloud-edge_g
ateway requires vcloud-core (~> 1.0.0)
The command '/bin/sh -c gem install --no-rdoc --no-ri vcloud-tools' returned a n
on-zero code: 1
thecanadianbacon says
For some reason docker cannot seem to find lamw/vmware-utils for download. Yet, I can find ashleymichaelwilliams/vmware-utils .... ?
Kevin Martin says
Would it be possible to install the perl 6.0 sdk on here? I have a large number of perl scripts running that I would like to use this with
Felipe Nieves says
Hi, I've noticed it has been a while since someone updated this post or the github project, I've just wanted to let you know that the container worked really good for me (so far) I had to make some changes to the dockerfile on the project and some annotations on your instructions to match the new versions on the packages but in the end it worked, I have tried dcli and powershell from the container using over ubuntu 17.04 and it work wonders.
Thank you very much for the effort and if you're interested on my annotations just let me know.
Good bye!