I found a suggestion by Russel Peters in the bottom of this thread (below) that I extracted from a Blog. Hope this helps.   Wednesday, December 22, 2010 in Storage by slowe | 4 comments The VPLEX command line interface (CLI) is a bit different than a lot of other CLIs with which I’ve worked. In some respects, it’s similar to the scope-based CLI that Cisco uses with Unified Computing System (UCS). In this post, I’d like to explore the VPLEX CLI a bit and provide a brief introduction to the VPLEX CLI. Keep in mind that this is just an introduction—for a complete reference to the VPLEX CLI, I’ll refer you to the VPLEX product area on EMC PowerLink where a complete VPLEX CLI User’s Guide is available in PDF. In my opinion, there are two things to know about the VPLEX CLI that will help you understand how to use it: With these concepts in mind, the real key to using the VPLEX CLI is simply learning where all the various objects reside. For example, in an earlier post on VPLEX storage objects, I discussed the building blocks of storage in a VPLEX environment: storage volumes, extents, devices, and virtual volumes. These reside in different places in the VPLEX contextual tree: Storage volumes: /clusters/ /storage-elements/storage-volumes Extents: /clusters/ /storage-elements/extents Devices: /clusters/ /devices Distributed devices: /distributed-storage/distributed-devicesVirtual volumes: /clusters/ /virtual-volumes  Within each of these contexts, you can use the ls and ll commands to view the contents of that context. The help command will show you what other commands are available in each context. Here’s my first example. When you first log into the VPLEX CLI, you’ll get dropped into a “root context”. Running ls here will produce output something like this: VPlexcli:/> lsclusters    data-migrations  distributed-storage  engines  management-servermonitoring  notifications    system-defaults Let’s take a look at a few more examples. For example, the following two sets of commands will produce the same output: cd /clustersll and ll /clusters Remember that specifying the context in the command is the same as changing into that context and then running the command. That is why these two commands produce the same output. To view the list of directors in a cluster: ll /engines/*/directors This is an example of using the asterisk to represent a wildcard that matches all entries in that context. Let’s look at another example of two different commands that produce the same output. To view the status of the ports on a particular director in a cluster, you could use either of these two commands: ll /engines/ /directors/ /hardware/ports  or cd /engines/ /directors/ /hardware/ports ll  By the way, if you haven’t figured it out yet, you can easily get the names of the engines (or the directors) by simply running the ll command against the engines context or the directors context within a specific engine. But what if you wanted to see the status of the ports across multiple directors? Now you won’t want to use the cd command. You’ll want to use globbing with wildcards instead, like this: ll /engines/**/ports While the single asterisk matches anything within a context, the double asterisk matches across multiple contexts. So, in this case, it ends up matching multiple engines and directors within those engines. And if you wanted to see only some of the front-end ports on all directors: ls /engines/**/hardware/ports/*1-FC0[0-3] In some cases, you might need to set an attribute on an object within a context. For example, you might need to enable a port by setting the enabled attribute on that port to True. Here’s how you would do that: set /engines/ /directors/ /hardware/ports/A0-FC00::enabled true  If you think about it, you could easily combine some globbing to enable multiple ports at the same time: set /engines/**/hardware/ports/A0-FC0[0-3]::enabled true You can then verify the operation by using the -t parameter to the ls command, which instructs it to include attributes: ls -t /engines/**/hardware/ports/A0-FC0[0-3]::enabled There are many, many more examples I could share with you, but this should get you started for now. I hope to have a post up soon with a CLI guide to setting up storage volumes, extents, devices, and virtual volumes. As usual, feel free to speak up in the comments if you have any questions or clarifications. Thank you! Tags: CLI, EMC, Storage, VPLEX   Comments feed for this article Trackback link: [URL]  [IMAGE]  kdossjojo on Thursday, June 30, 2011 at 9:45 am Lovely – Just what I was looking for. Carry on with your good work. This I am sure will definitely help a lot of people like me – around the world. Thanks.  [IMAGE]  sdit on Tuesday, August 2, 2011 at 3:57 pm  Is there any way to script the VPLEXCLI? Looking at the CLI PDF it appears that you have to SSH to the management server, then issue the vplexcli command which then prompts for another username/password set. This looks to make scripting of claims and provisioning difficult.  [IMAGE]  slowe on Tuesday, August 2, 2011 at 6:00 pm  To my knowledge, there is no way to script the CLI. In version 5 of the VPLEX software (called GeoSynchrony), there is an HTTP REST API, in case you’re interested.  [IMAGE]  Russell Peters on Friday, March 2, 2012 at 8:55 am  I was also looking for a way to script in the vplexcli and found that Expect is installed on the management console. So this Expect script should help (just replace the string “password_for_service” with the correct password for the service account (or any account you would want to use):——-service[NAME]-Vplex-MGMT:~> cat vplexcl#!/usr/bin/expect set cmd [lindex $argv 0] spawn telnet localhost 49500expect “Enter User Name:”send — “service\r”expect “Password:”send — “password_for_service\r”expect “VPlexcli:/>”send “$cmd\r” expect “VPlexcli:/>”send — “exit\r”expect “TCP-Vplex-MGMT” service[NAME]-Vplex-MGMT:~>service[NAME]-Vplex-MGMT:~> cdservice[NAME]-Vplex-MGMT:~> cat ./vplexcl#!/usr/bin/expect set cmd [lindex $argv 0] spawn telnet localhost 49500expect “Enter User Name:”send — “service\r”expect “Password:”send — “Mi[NAME]\r”expect “VPlexcli:/>”send “$cmd\r” expect “VPlexcli:/>”send — “exit\r”expect “TCP-Vplex-MGMT”——Then you can write scripts that use the expect script like this example./home/service/vplexcl “ls /clusters” Then use awk, perl, or your favorite command line utility to scrape out the information you need. Or if you want to run the script from another host, you can set-up ssh keys to the service account (or any named account) and run them that way. The only caveat is that the password is stored in the expect script. However this is only exposed on the vplex management console, which is already password (or ssh-key) protected anyway. 
Hi,  Is there a way to script Vplexcli ? Since the commands are executed inside a "restricted shell", do I need to open/close a session for each command executed ?  Thanks, Gaetano
How script Vplexcli