VMware

Managing vSphere Alarms with PowerCLI | Main | Support for Virtual Machine SCSI Controllers in PowerCLI 4.1.1

December 02, 2010

ESXCLI now available through PowerCLI

I’ll illustrate esxcli in PowerCLI with an example of how path selection policy can be set for specific storage array type plugin. As you may know, until now this action could be performed by the esxcli command line tool and the call would look something like:

    esxcli nmp satp setdefaultpsp -psp VMW_PSP_RR -satp VMW_SATP_SYMM

From this release the esxcli functionality is available directly through the PowerCLI. The only thing you have to do is to retrieve an EsxCli instance and then invoke any of its methods. So it will look like:

    $esxCli = Get-EsxCli –Server $myEsxConnection

    $esxCli.nmp.satp.setdefaultpsp(“VMW_PSP_RR”, “VMW_SATP_SYMM”)

Note that you have to be connected directly to your ESX, in order to retrieve EsxCli instance (It won’t work with VMHost instances, retrieved from a VC).

In the esxcli tool you have applications, which are grouped in namespaces. Those applications have commands. The same organization is preserved in PowerCLI – The EsxCli object contains the namespaces as properties. The namespace objects contain the applications as properties and finally the commands are methods of those application objects. It’s quite easy to get help for those methods. What you have to do is to call help method for some application object, specifying the name of the desired command method:

    $esxCli.nmp.satp.help("setdefaultpsp") 

You can also retrieve help for the entire application:

    $esxCli.nmp.satp.help()

Note that this feature is experimental. This means that in future releases backward compatibility is not guarantied.

If you’d like to take a deeper look in the PowerCLI’s esxcli interface, you can read this article: ESXCLI in PowerCLI - overview

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341c328153ef013489ae0c76970c

Listed below are links to weblogs that reference ESXCLI now available through PowerCLI:

Comments

Post a comment

If you have a TypeKey or TypePad account, please Sign In.

About this Blog

This blog provides insight and highlights for VMware PowerCLI, the best tool for automating management and configuration of VMware vSphere.

Subscribe via RSS  

Recommended Reading

Pimp your PowerCLI

Twitter


Facebook

    VMware Blogs