Retrieving the ESXCLI object in PowerCLI
To begin leveraging ESXCLI from PowerCLI, you need to obtain an ESXCLI object and begin looking through the structure of the object. In particular, the methods attached to an ESXCLI object are powerful for performing configuration tasks on a host.
ESXCLI is limited in scope to an individual ESXi host. This means that it is not aware of vCenter and performing an operation on many hosts is going to require you to loop through a set of defined hosts to execute the same operation.
ESXCLI works differently than PowerCLI. Where PowerCLI is object-based and all of the data and methods for changing data are stored within objects, ESXCLI works on the concept of namespaces. There are 14 namespaces that comprise ESXCLI. If you run esxcli
on the direct console of an ESXi host, the output is the list of namespaces with a description of each. The output is pictured in the following screenshot:
On a clean installation of ESXi 5.5, there are 13 namespaces output. The...