EMC VNX/VNX2 – Naviseccli & Powershell – Bulk config changes with ease

GUI’s are generally cool, but when you need to get many of the same/similar tasks done, you can’t beat the speed and ease of using scripts and CLI based tools.

I recently had a situation with a EMC VNX2 array where someone (or something) had caused all the LUNs in a RAID Group to become FastCACHE enabled. All 32 of them. Disabling this for one LUN is simple with Unisphere, but 32 would bore me to tears and take far too much effort.

The easy way to do this was to use Powershell and a string array to loop the disable process through Naviseccli.

To work out the affected RAID Group LUNs just use the getrg command with the –lunlist option. For me, this was RAID group 10 so the command was;

4-02-2015 6-31-52 PM

So the LUNs I’m working with are 50 through 81.

To check/verify the getlun command can be used with the –fastcache option. Singularly;

4-02-2015 6-34-46 PM

But let’s do it in ‘bulk’. I’m also adding the LUN ID as this is not included in the output.(saved and executed as fastchk.ps1)

Details; The first variable $lunlist stores the range of LUNs to be processed in an array we use in a standard ForEach loop to step each LUN through a naviseccli getlun operation.

The write-host preceding the naviseccli command simply inserts the currently processing LUN id as this is not returned from the direct execution.

Result, in progress. As you can see Fast Cache is in an Enabled state.   

4-02-2015 7-09-13 PM

To disable this for the same list of LUNs, we’ll use the chglun command with -fastcache 0 (use with -fastcache 1 to re-enable); and insert a ‘Completed’ after each LUN is processed. This again uses the same array/looping process as earlier.  (saved and executed as fastchg.ps1)

Results in progress, and completed;

4-02-2015 6-57-14 PM

To change a LUN singularly, you would use the chglun command like this

Verify by reusing the getlun command, as previous; Or of course check through Unisphere;

4-02-2015 7-13-33 PM

4-02-2015 7-14-33 PM

 

 

 

 

 

 

 

Hope this is useful 🙂

Related Post

5 thoughts on “EMC VNX/VNX2 – Naviseccli & Powershell – Bulk config changes with ease

  1. I found your blog website on google and verify a few of your early posts. Continue to keep up the very good operate. I just further up your RSS feed to my MSN Information Reader. Looking for ahead to reading extra from you in a while!…

    1. I’m so sorry you had to cringe through 4 instances of a typo. Rest assured I have corrected them now.
      I hope you find the courage to press on through these dire struggles.

    1. I’m so sorry you had to cringe through 4 instances of a typo. Rest assured I have corrected them now.
      I hope you find the courage to press on through these dire struggles.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: