Home > Virtualization > Run esxcli Command in A Browser: Hidden But Probably Better Hack

Run esxcli Command in A Browser: Hidden But Probably Better Hack

December 12th, 2013 Leave a comment Go to comments

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.

There is actually another way to run the esxcli command in a browser that is less hacky even though the user interface is not as good as the esxcli.cgi, and there is no central page that links them together. In other words, you cannot navigate the pages and have to type in individual URLs. Luckily, there is a pretty straightforward pattern in the URLs, so it’s not a big deal.

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure


This approach was first discovered by William Lam in one of his posts in 2010 with ESXi 4.1. With the 5.1, the exact URLs may not be working due to the changes of the ESXi product, mainly the esxcli command itself. Because it’s hidden, VMware can change it without notifying anyone. The URL pattern, however, remain the same.

In ESXi 4.1 as William found out, the following URL points to the vms/vm namespace or managed object:


The new name space for the same(?) object in ESXi 5.1/5.5 is:

Once you get the page as below, you can use it the same way as with other managed objects in MOB. Here, for example, you can simply click on a method link and got a popup page on which you can click “Invoke Method” for the return information.

The invoke page can also be accessed directly with the URL with method parameter as follows:

Now, let’s cover a bit more on the URL pattern. Everything is pretty much the same as other URLs in MOB. The key here is the string after “moid=,” which is essentially the value of ManagedObjectReference. The string has two parts: one is the “ha-cli-handler-“ which is fixed for the esxcli related managed objects. The second part is the so called namespace. It has to be the leaf namespace (just think the namespaces as a tree) that does not have no “Available Namespaces:” when trying out the command on ESXi. The storage-filesystem, for example, is a leaf namespace but storage is not. When not sure, just type in the esxcli command. With a leaf namespace in esxcli command, you can replace the space with “-“, and compile a full URL. The URL for the storage filesystem URL is as follows:

While it’s not quite important on the type of the managed object, the type name for the above storage filesystem is “VimEsxCLIstoragefilesystem”. I am sure you can easily generalize a pattern out of it for the type names.

Categories: Virtualization Tags: ,
  1. No comments yet.
  1. No trackbacks yet.