/ #cli #pivotal 

Download VMware and Pivotal Products via CLI

I had to deploy NSX-T and PKS to a new infrastructure lately. The usage of a jump host was inevitable as my home bandwidth is not great to upload many GB to a remote site. The lazy option would have been to create a Windows VM running on the same infrastructure and deploy from there. As I was not in a lazy mood, I decided to go for an Ubuntu jumpbox: I can deploy OVA using OVF Tool or via govc (#rungovc) and I was already familiar of the Pivnet CLI to download Pivotal products …all I was missing was a capability to download VMware products using CLI and I was happy to discover that the vmw-cli client can exactly do that for me. :)

If you want to make your life easier to deploy OVA, check one of my previous article: OVA/OVF Deployment Using govc CLI.

Download VMware Products

The vmw-cli is a CLI client that can be used to login and interact with the my.vmware.com portal. As of today, it can only be used to query and download VMware product binaries based on your entitlements. What I found very attractive is that you can consume vmw-cli natively via NPM or by using a Docker image (I had to use both methods this week).

Although I won’t cover the usage of this command-line in details (it’s very well explained in the Github page), I’ll provide an example to download NSX-T Manager 2.3.0 below.

To begin, I’m listing the available solutions on the portal using vmw-cli list: this step is required before proceeding with other commands.

List all available product binaries from my.vmware.com using command-line

The next step is to index the files available for a specific solution, in my case vmware-nsx-t-data-center:

vmw-cli index vmware-nsx-t-data-center

Please note that this step can take some time, depending on the selected solution.

Index product binaries from my.vmware.com using command-line

Once the index is built, I retrieve the file names that I need to download:

vmw-cli find fileName:unified,fileType:ova,version:2.3

Find product binaries from my.vmware.com using command-line

The last step is to download the NSX-T Manager OVA

vmw-cli get nsx-unified-appliance-

Download VMware product binaries using vmw-cli

The requested file will be downloaded to the current working directory.

Please note that this is not an official VMware tool; it was built by Andrew Obersnel, one of our great VMware Engineer. Feel free to leave a comment on his Github project page if you have any feedback or feature enhancement request.

Download Pivotal Products

Pivotal Network (a.k.a. Pivnet) is the portal where you can download Pivotal products, get the documentation and so on. Pivnet CLI is a command-line that can be used to interact with the Pivotal Network portal. Using it requires your Pivotal Network API token, which you can retrieve in your Pivotal Network account (Edit Profile > UAA API Token).

Authentication to the portal is the first step:

pivnet login --api-token='<your-token>'

Except if you know exactly what you are looking for, you will have to dig into the product list first: pivnet products. In the scenario below, I was looking for Harbor.

Interact with Pivotal Network from the command-line using pivnet-cli

Once you retrieved the product slug (harbor-container-registry in my example), you can list the associated files for a specific version:

pivnet product-files -p harbor-container-registry -r 1.6.0

The output will present you various information such as the name, version, file type, checksum and object key.

Finally, you only have to download the file:

pivnet download-product-files -p harbor-container-registry -r 1.6.0 -g harbor-container-registry-1.6.0-build.35.pivotal

Download Pivotal product binaries using pivnet-cli

Both command-line clients are very convenient to have in your toolbox and very easy to consume, I’ll highly recommend them for everyone!



Staff Architect & Member of the CTO Ambassador Program at VMware, focusing on NSX and Cloud-Native Applications. He is a double VCDX (DCV and NV, #120), VCDX panelist, frequent VMUG/VMworld speaker and contributor to the community via this blog or social media (follow him on Twitter @woueb).