WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Automating downloads from MyVMware

Automating downloads from MyVMware

10.15.2018 by William Lam // 5 Comments

I recently came across a really cool project called vmw-cli which was built by Andrew Obersnel, an Engineer who works over in our Network and Security Business Unit (NSBU) at VMware. This CLI tool enables you to login to MyVMware and based on your entitlements, download any VMware binary or application just like you would using a web browser but now you can completely automate it from the command-line! The CLI is written as a Node.js application and you can consume as a CLI which requires Node.js to be installed or you can just run it as a Docker Container.

UPDATE (01/24/22): There is now a new VMware Customer Connect CLI (vcc) that is OSS as part of the VMware Labs Github repo. For more details on how to use this new CLI, please check out the README in the repo.

In the example below, I will take you through on how to use vmw-cli using the Node.js CLI method. If you prefer to use the Docker Container, you can simply refer to the Github project page for more details.

Step 1 - To get started, you will need to first install Node.js. Next, you can install vmw-cli using the following npm command:

npm install vmw-cli --global

By default, the CLI will be installed under .npm-global/bin/ directory and you will probably want to update your PATH variable to include this additional path if you do not already. For Linux or MacOS systems, you can simply run the following (which temporally updates your PATH variable):

export PATH=$PATH:~/.npm-global/bin/

Step 2 - Next, we need to set up two additional environmental variables which contains the username and password you use to login to MyVMware. For Linux or MacOS systems, you can run the following command:

export VMWUSER='<userid>'
export VMWPASS='<password>'

Step 3 - To confirm that everything is working, we can run the "list" command which will simply list the top level products from MyVMware.

vmw-cli list


The output is exactly what you would see if you were simply browsing https://vmware.com/download page.


To be able to download using vmw-cli, you will need to first generate an index for a given product. For products like vSphere which contains a large number of releases, the indexing can take some time. In my environment, it took exactly 10 minutes to index the "VMware vSphere" product which you can do by running the following command:

vmw-cli index vmware-vsphere

Note: For those interested, the JSON index file is located in ./.npm-global/lib/node_modules/vmw-cli/lib/fileIndex.json

Once the indexing has completed, you can then download a specific file given the filename and you can even use vmw-cli to perform a search. In my opinion, the easiest way to find the file name is to actually use MyVMware site from web browser. For example, highlighted below is the filename for the latest version of the ESXi 6.7 ISO.


Once you have the filename, simply run the "get" command as shown below to start the download.

vmw-cli get VMware-VMvisor-Installer-6.7.0-8169922.x86_64.iso


This is definitely a handy tool to have around and it is something I have a seen customers ask about before. Thanks Andrew for developing this solution and If you have any feedback or feature enhancements, feel free to leave a comment on his Github project page.

More from my site

  • Using PowerCLI to invoke Guest Operations API to a Nested ESXi VM
  • Quick Tip - Allow unsupported CPUs when upgrading to ESXi 7.0
  • Quick Tip - vSphere 6.0 Update 3 resolves "Compute" only Cross-vCenter vMotion operation
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline?
  • vCenter Server 6.0 Tidbits Part 3: Finding all deployed Platform Services Controller

Categories // Automation Tags // MyVMware

Comments

  1. Brad Calvert (@BlueArcher) says

    10/15/2018 at 3:07 pm

    Now if only there were an API for the license portal!

    Reply
    • William Lam says

      10/15/2018 at 3:34 pm

      Couldn't agree more! Anything in particular you were looking for in terms of functionality for license portal or how you might use the API for a given use case?

      Reply
      • Brad Calvert (@BlueArcher) says

        10/16/2018 at 6:12 pm

        We are a very large shop with a double digit number of divisions and HPP purchasing. I would really love to put some automation around combining, dividing, and moving keys between folders, and retrieving keys by product/folder/annotation value, to start. Longer term I would like to build an internal portal to receive basic vCenter and host license requests, have someone approve it, have it create the key (dividing off of a large unallocated key, for example), apply specific annotations to the key (cluster name, vCenter, location, requestor name, etc), and then move the key to an existing folder for that division to give the appropriate employees access.

        At first I thought maybe putting automation around HPP purchases, but maybe that isn't a good idea, HAH.

        At our scale , it is quite difficult to keep the license portal clean looking and auditable with the number of people that need access. Oh, and we have a shocking number of VMware accounts 🙁

        Reply
  2. Nick says

    10/16/2018 at 6:49 am

    I think this is a great start but have a suggestion for an improvement. I would like to be able to automatically pull the latest patch of a product (e.g. ESXi 6.5). Maybe even have it keep a cache of the last version I downloaded so the next time I run it, searching for the same product, it will automatically download if there is a newer patch available or state "No new patches" if not. I have an aggressive patching cycle on some of my networks and it would make my life much easier to automate the checking of new patches for all the VMware products I use.

    Reply
  3. David Chung (@dchung615) says

    11/19/2019 at 4:36 pm

    Would like to see license management API. Split/Combine/Upgrade and get licenses. 😉

    Reply

Leave a Reply to David Chung (@dchung615) Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...