The esxcli is a command tool that is available on VMware ESXi for managing ESXi. Unlike the vim-cmd command, it focuses on underlying infrastructure and touches lower level of controls of the ESXi hypervisor itself. Although it’s just one command, it packs a lot of functionalities with different namespaces/sub-namespaces, and sub-commands. Because they are organized in nice tree hierarchy, it’s actually quite easy to use most times.
VMware has evaluation license for ESXi servers. After 60 days, it expires and you have to apply a paid or free license to continue. Technically, there is a trick to reset the evaluation key by deleting two files (/etc/vmware/vmware.lic and /etc/vmware/license.cfg) and rebooting the server. It’s of course not complying with VMwrae license terms. Under some circumstances like training lab, it may be OK. Make sure to consult VMware on this if you are not working for VMware. But wait – if you are working for VMware, do you need evaluation license? In his reply to my tweet, Duncan mentioned he never saw license expiration.
My article “Run esxcli Command in a Web Browser: Another ESXi Hack” got quite some interests from the community. Although it works, I am not quite satisfied with the fact that the real esxcfg-info.cgi is disabled to run the esxcli.cgi.
In my recent consulting projects, I really got into a lot of scripting either command lines or Python with ESXi management. As I mentioned the hidden HTML formatter in esxcli command, you may have speculated what could the usage. The answer is simple: Web. But it’s not quite clear how it can be used. That’s where my curiosity started.
Besides the vim-cmd command I covered earlier, there is another powerful set of commands in ESXi – esxcli. As you can find from the help of the command, it covers 10 namespaces and drills down several layers down. The typical operations with the namespaces are get, set, and list. If you are familiar with REST API, you can think of the bottom level namespaces are resources.