Vplex Shortcut commands for Vplex CLI

           

   Article Number:     534210                                   Article Version: 2     Article Type:    How To 
   

 


Product:

 

VPLEX Series,VPLEX Local,VPLEX Metro,VPLEX VS2,VPLEX VS6,VPLEX GeoSynchrony

 

Instructions:

 

 

Some Vplex commands to show useful information on the Vplex CLI can be cumbersome, long and hard to remember. Vplex Engineering have provided a set of alias commands to set up easy to issue and easy remember shortcut commands for show and set Vplex cli commands.   
   
    Vplex employs a Linux based CLI therefore to simply list commands for example listing the storage arrays connected toy Vplex you would have to issue the following on the Vplex CLI:   
        
    Example 1.   
    ll /clusters/cluster-1/storage-elements/storage-arrays/     
   
    Vplex Engineering have provided a set of alias commands to shorten such CLI commands. Continuing with the example above showing storage arrays connected to VPlex we can set up the alias “showarrays” as follows from the Vplex CLI:   
        
    Example 2.   
    VPlexcli:/>  alias -n showarrays    -t 'll //clusters/cluster-1/storage-elements/storage-arrays/* -f'     
        
    Once issued the ll command in example 1. Can be done by just issuing “showarrays” providing a much more direct and rememberable means to run this very common show command.   
        
    Note: Example 1. and 2. are Vplex local specific, for Vplex Metro the alias commands will vary to include cluster-2, please see from the files attached the 'VPLEX alias reference' Excel 'for Vplex Metro section, c1showarrays and c2showarrays alias commands.   
   
    Such alias commands can be set up manually on a per command bases depending on your needs but for your convenience Vplex Engineering have provided an extensive list of common show and set commands applicable for Vplex Local and Metro. Please see the attached files.   
        
    Loading these onto your Vplex.   
        
    These can be loaded in 2 ways, both of which are totally none disruptive to Vplex operations:   

         
  1.         Like in example 2. Above Simply issue the full alias commands at the Vplex CLI. The alias’s will be set up and ready to use but will NOT persist across management server reboots.     
  2.      
  3.         Recommended. Add the alias commands to the VPlexcli-init file. With the commands added  they will be available on the Vplex cli and will persist across management server reboots. In the case of Vplex Metro systems the VPlexcli-init file will need to be updated on the management server at both Vplex cluster-1 and 2.     
  4.    
        
    Steps to update the VPlexcli-init file   
        
    You will need:   
         
  •         Access to the Vplex CLI on cluster-1 on Local systems and cluster-1 and cluster-2 of metro systems.     
  •      
  •         Download, save and unzip the applicable (local or metro) alias command file from this KBA to your system.     
  •      
  •         WinSCP (or similar) to transfer files from your system to the Vplex management server (or servers).     
  •    
    Here we are simply adding the provided alias commands provided in the applicable text files (local / Metro) to the VPlexcli-init file which is located on the management server in the directory /var/log/VPlex/cli.   
        
    Example 3.   
        
    service@ManagementServer:~> cd /var/log/VPlex/cli   
    service@ManagementServer:/var/log/VPlex/cli> ll   
    total 295784   
    -rw-r--r-- 1 service users        1405 May  2 13:06 audit.log_20190425101730   
    -rw-r--r-- 1 service users        1876 May  2 13:11 audit.log_20190502130650   
    -rw-r--r-- 1 service users        1682 May 22 11:10 audit.log_20190502131650   
    -rw-r--r-- 1 service users         219 May 22 11:11 audit.log_20190522111038   
    -rw-r--r-- 1 service users       34023 May 26 07:11 audit.log_20190522111641   
    -rw-r--r-- 1 root    root          721 May  2 13:09 authentication-service-configuration.log   
    .   
    .   
    -rw-r----- 1 service groupSvc   382626 May 26 07:00 vplex_backup_ms_to_director.log   
    -rw-r----- 1 service users       25632 May 15 10:30 vplex_backup_ms_to_director.log-20190515.bz2   

      -rw-r--r-- 1 service users        1978 Feb  8  2018 VPlexcli-init   <------ this file   

-rw-r--r-- 1 service users        9357 May 23 10:39 VPlexcommands.txt   
    -rw-r--r-- 1 service users       15879 May 23 10:39 VPlexconfig.log   
   
    Note the files are in alphabetical order so the VPlexcli-init is found under ‘V’. This is its self a text file so there are multiple ways to add the alias commands, we suggest the following steps.   
        
         
  1.         Log into Vplex cluster-1 management server cli (not the Vplex cli) and cd to the following director and find the VPlexcli-init file. See example 3. Above.     
  2.      
  3.         Preserve the original file by copying it and naming the copied file VPlexcli-init.org. The file can be left here in the CLI directory but can also me moved to the /tmp/ directory so as to keep the already crowed /cli directory tidy, but this is optional.     
  4.    
        
    Example 4.   
   
    service@Cork-VPlex-C1:/var/log/VPlex/cli> cp VPlexcli-init VPlexcli-init.org       
        service@Cork-VPlex-C1:/var/log/VPlex/cli> mv VPlexcli-init.org /tmp/
   
        
         
  1.         Using WinSCP copy the VPlexcli-init file to your desktop and using a text editor like notepad++ add the alias commands from the applicable alias files to the VPlexcli-init file.     
  2.    
   
    Example 5.   
        
    #-------------------------------------------------------------------------------   
    #- (C) 2007-2010 EMC Corporation. All rights reserved.   
    #-   
    #- This CLI initialization script is executed if it's located in any of the   
    #- following locations:   
    #- (CLI terminates the search on first success.)   
    #- if the --init-file option is specified on the command line then use that file   
    #- else search for the file "VPlexcli-init" in the following order:   
    #-   a.  CLI directory (specified with the --cli-directory option)   
    #-   b.  current dir (of the shell that started CLI)   
    #-   c.  user.dir (usually equivalent to the current dir)   
    #-   d.  user.home    
    #-   e.  classpath   
    #- This script is processed as if it had been sourced using the 'source' command   
    #-------------------------------------------------------------------------------   
        
    #-------------------------------------------------------------------------------   
    #- start the webserver   
    #-------------------------------------------------------------------------------   
    webserver start   
        
    #-------------------------------------------------------------------------------   
    #- connect to any directors listed in the 'connections' file in this CLI directory   
    #-------------------------------------------------------------------------------   
    connect --no-prompt -c   
        
    #-------------------------------------------------------------------------------   
    #- connect to the directors in your system   
    #- WARNING: do not use both the 'connections' file method and this method    
    #  at the same time.  Connecting to the same director twice can have    
    #  unwanted side-effects.   
    #-------------------------------------------------------------------------------   
    #connect 128.221.252.35 --secondary-host 128.221.253.35 --name director-1-1-A   
    #connect 128.221.252.36 --secondary-host 128.221.253.36 --name director-1-1-B   
    #connect 128.221.252.67 --secondary-host 128.221.253.67 --name director-2-1-A   
    #connect 128.221.252.68 --secondary-host 128.221.253.68 --name director-2-1-B   
                                                                                                                                                                            ß Pasted Alias commands from here    
    alias -n showarrays    -t 'll //clusters/cluster-1/storage-elements/storage-arrays/* -f'                   
    alias -n showdevmigall    -t 'll //data-migrations/device-migrations'                                      
    alias -n showdevs       -t 'll //clusters/cluster-1/devices/'                                                                               
    alias -n showeng -t 'll //engines/*'           
    alias -n showinits      -t 'll //clusters/cluster-1/exports/initiator-ports/'                                                             
    alias -n showportsall -t 'll //engines/*/directors/*/hardware/ports'                                        
    alias -n showstorvols  -t 'll //clusters/cluster-1/storage-elements/storage-volumes/'               
    alias -n showsysvols -t 'll //clusters/cluster-1/system-volumes/'            
    alias -n showvirtvols  -t 'll //clusters/cluster-1/virtual-volumes/'                
    alias -n showviews      -t 'll //clusters/cluster-1/exports/storage-views/* -f'   
    .   
    .             
        
    Save the file as VPlexcli-init.alias to avoid confusion   
         
  1.         Transfer this file (VPlexcli-init.alias) to the Vplex management server /var/log/VPlex/cli directory again using WinSCP.     
  2.      
  3.         Using WinSCP or the rename Linux command rename:                
               
    1.             VPlexcli-init  to VPlexcli-init.old         
    2.          
    3.             VPlexcli-init.alias  to  VPlexcli-init         
    4.        
                  
  4.      
  5.         To double check all is correct so far look inside VPlexcli-init file to confirm that the alias commands are in there. This can be done using the Linux commands less or cat     
  6.    
    Example 6.   
   
    service@Cork-VPlex-C1:/var/log/VPlex/cli> less VPlexcli-init   
    Output should match the output displayed in example 5. Note: when using less you may need to page down to see the full file.   
         
  1.         To activate the new updated VPlexcli-init file restart the management server by typing 'sudo /etc/init.d/VPlexManagementConsole restart'     
  2.    
    Example 7.   
   
    service@Cork-VPlex-C1:~> sudo /etc/init.d/VPlexManagementConsole restart   
    Restarting EMC VPlex Management Console...                                                                                                            done   
    service@Cork-VPlex-C1:~> sudo /etc/init.d/VPlexManagementConsole status   
    VPlexManagementConsole                                                                                                                                running   
        
         
  1.         Final step to verify the new commands are available. Log into the VplexCLI and issue ‘showarrays’ the response should display all storage arrays connected to Vplex.     
  2.    
        
    Example 8.   
   
    VPlexcli:/> showarrays   
        
    /clusters/cluster-1/storage-elements/storage-arrays/EMC-SYMMETRIX-29490xxxx:   
        
    Attributes:   
    Name                  Value   
    --------------------  ----------------------------------------   
    auto-switch           -   
    connectivity-status   ok   
    controllers           [29490xxxx]   
    logical-unit-count    24   
    ports                 [0x50000974c005xxxx, 0x50000974c005xxxx]   
    product-revision      5876   
    storage-array-family  symmetrix   
        
        
    Contexts:   
    Name           Description   
    -------------  ------------------------------   
    logical-units  Luns exported from this array.   
        
    VPlexcli:/>   
        
   
   
                                                                                                                                

 

 

Notes:

 

 

Important considerations:   
   
    If you are applying these steps to a Vplex Metro you need to repeat the above on the remote Vplex cluster.   
   
    Also if you have changed the Vplex cluster names you will have to modify the alias commands file replacing “cluster-1 and cluster-2” with your custom cluster names.   
   
   
    Further information:   
   
    For further details regarding the Vplex cli, alias command and the commands covered in these command sets please refer to the Vplex CLI and admin guides available at https://support.emc.com/products/29384_VPLEX-Series/Documentation/ browsing to the applicable VPLEX CLI guide and Administration guide for you particular GeoSyncgrony version.