EMC – naviseccli – Using chglun to modify LUN cache settings

Friday morning I had cause to “fiddle” with the LUN cache settings on 312 component LUNs across 2 arrays and needed to turn on read and write cache on each component LUN. Via Unisphere I would have to find the MetaLUN, right-click, select Show Components, expand the Component 0, right-click on the component, select Properties, select the Cache tab, tick the radio boxes for SP Read Cache and SP Write Cache, click OK, then re-expand the Component 0, rinse and repeat. On a few components this is tolerable, but for 312 not so much.

So I thought that maybe I could do something with naviseccli. You can change the cache properties of a LUN, amongst other things, using the chglun command.

chglun -l <LUN-ID> -c none | caching read | write | rw – where you can select no cache, read cache, write cache or read-write cache. So the command I used to enable rw cache on the LUN was

naviseccli -h 256.256.256.256 chglun -l 24047 -c rw

Note that if you have FAST Cache installed you can also use this command to set FAST Cache for a LUN using the -fastcache 0 | 1 switch.

My next issue was that, even though these components had normal LUN IDs like 3, 8 and so forth, their actual LUN ID when they were used as MetaLUN Components was changed to something else by Unisphere. So I ran a report for each array to list the configured MetaLUNs. I then opened the .xml file in Excel and copied the Component LUN IDs into a different column. Put some commands before and after the column and then saved it as a txt file that I could then run as a script. It took a little time to run, but a lot less time than it would have taken to change these settings by hand. If you are checking the resultas in Unisphere you should make sure that you’ve refreshed your screen, because it least in our environment it can take a while to show up.

One other thing to note is that, as the manual says, “The chglun command does not support thin LUNs”. Fair enough, so I can do chglun operations on Pool LUNs? Well, mostly. Here’s one we tried earlier:

c:\>naviseccli -h 256.256.256.256 chglun -l 130 -c rw
Error: chglun command failed
Switch not supported: -c
One or more of the specified switches is not supported for the input Pool lun.

c:\>