I was recently made aware of a nice update from our developers that we now have a new version of the remote ESXCLI utility that is much simpler to install across any operating system and is fully backwards compatibility with ESXi hosts running 6.7.x, 7.x and 8.x.
Many of you are probably familiar with the local version of ESXCLI which is available when connecting to ESXi whether that is over SSH or directly in the ESXi Console. However, a remote version of ESXCLI has been available since the introduction of ESXCLI back in vSphere 4.0, but surprisingly, I still come across users who never knew that this was possible!
In the past, the remote version of ESXCLI was platform specific and it was distributed in a number of diffrent ways from being bundled as part of the vSphere CLI (6.7) to being a standalone download (7.0) and this inconsistency brought many challenges, not just from an internal development standpoint but also operationally for users who needed to deploy this utility across their administrative systems.
The first enhancement was to have a single Python package that is compatible with PyPI (Python Package Index) and can easily be installed using "pip" from any OS platform running Python. After downloading the ESXCLI 8.0 tarball from HERE, you can easily perform the unattended install using "pip install [file]" as shown in the screenshot below:
Not only does this single Python package improves the installation experience but it also reduces the number of libraries needed when it was OS dependent and ensures that it can easily be maintained, especially for any performance or security issues that may arise.
The second enhancement is that while this version of ESXCLI is designated as 8.x, it has been made fully compatible with ESXi hosts running 6.7.x and 7.x, which means that if you had previously installed other versions of ESXCLI as mentioned above, you can remove all previous versions and simply use this single ESXCLI version going forward.
For automation purposes, the use of remote ESXCLI is certainly my preference over SSH'ing to each ESXi host or if you are not a PowerCLI user, which ESXCLI is also exposed through Get-EsxCli cmdlet. The other nice thing to be aware of is that remote ESXCLI can connect to both a vCenter Server endpoint and to standalone ESXi host.
Here is an example connecting to a vCenter Server and accessing the power settings for one of the managed ESXi hosts:
esxcli --server vcsa.primp-industries.local --user *protected email* --vihost 192.168.30.5 hardware power policy get
esxcli --server 192.168.30.5 --user root hardware power policy get
To learn more about the remote version of ESXCLI including command line flags and examples, please check out the documentation HERE.