CLARiiON out-of-family upgrades and naviseccli

When upgrading a CLARiiON to a CX4 model using an EMC-supplied upgrade kit, the procedure guide insists on the following steps (amongst a myriad of other things):

“Lower the Background Verify priority setting on all LUNs to “Medium”.
Due to an issue found in all Out of Family conversions, in order to prevent multiple reboots of the Storage Processors, it is imperative that you ensure that all Luns have their Background Verify priority set to “Medium”. 
[snip]
After the conversion is done, set the BV to High, not ASAP.

This is a temporary workaround for this issue.  A permanent fix for this issue has been provided in this version of the Conversion Prep Software: ConversionPrep-04.28.xxx.5.506.” The powerlink knowledgebase article emc207789 has further information on the issue.

But when you have around 200 or more LUNs on an array, this can be a chronic PITA to modify. So my friend and colleague Mat (who doesn’t blog, even though he knows plenty about plenty) came up with the following commands. You’ll need naviseccli installed, as well as the usual suite of very useful Unix tools that run on Windows, like gawk and grep and suchlike.

naviseccli -user username -password password -scope 0 -h sp_ip_address getlun -verify | gawk “{printf $4;getline;print \” \”$3;getline}” | grep -v Medium | grep -v “N/A” | gawk “{print $1}” | sort | uniq >lunlist

for /f “usebackq” %%i in (`type lunlist`) do naviseccli -user username -password password -scope 0 -h sp_ip_address chglun -l %%i -v Medium

You could then reverse the scenario to change everything back to High (not ASAP).