Following on from yesterday’s EOY backup topic for ESXi, today I’ll document how to automate the backup of your VNX & VNX2 Array configurations.
As usual, I want this to be automated, set-and-forget and reliable. A combination of NavisecCLI and Powershell works beautifully for this.
Without any doubt, the best documentation or config backup tool is the array-config output which is an XML dump available manually using USM. The output is structured, logical, complete and viewable easily in a Internet browser.
This first example shows how to do a single array, the script further down allows you to do multiple arrays. Login to USM and click on View System Configuration. Then Next and wait for the report generation to complete.
Once done, click again on View System Configuration and then browse to the file location and open the report.
Report should open like this; Every detail on a well laid out format;
While this is ok as a once off, scheduling this can save time and allow hands-off processing.
The script oneliner below will connect to the array you specify (by arrayspaddress) capture the XML telemetry info and save to the output location specified. Run from a Powershell shell.
Change SERIAL to the array serial number or hostname, arrayspaddress, and change the date format (above is in ENG/AU) and output location as required. The current time and date is added to the filename automatically.
1 |
$configName = "SERIAL_" + $(date -f ddMMyyyy)+".xml" ; naviseccli -h arrayspaddress arrayconfig -capture -output c:\EMCFILES\Configs\$configName |
Results look like this in the folder:
But of course, we want this to work for multiple VNX arrays (VNX &/or VNX2) so the below will connect and save the telemetry info for all the arrays you specify in the $arrays variable.
Change the date format, and add your array sp addresses into $arrays as required to suit your environment. The output filename will be in the format “arraysp_date.xml” for each array address you process.
1 2 3 |
$arrays = @("array1sp","array2sp") Foreach ($arraysp in $arrays) { $configName = $arraysp+"_"+$(date -f ddMMyyyy)+".xml" ; naviseccli -h $arraysp arrayconfig -capture -output c:\CriticalConfigs\ArrayConfigs\$configName } |
Results look like this in the output folder; As in the first example, the current time and date is stamped into the filename, as is the array sp hostname (instead of SERIAL).
All examples on this page assume you have a credential lockbox setup, otherwise these will need to be added in the -u, -p and -scope parameters.
These XML files can be opened via the USM “view system configuration” option, for best effect.
And that’s a wrap for 2014. I hope it was a great year for you and your families and even better things come your way in 2015.
2 thoughts on “EMC VNX – Auto Array Configuration Backups using NavisecCLI and Powershell”