IBM DS4500 – Automate Configuration Backup


As a precautionary measure it is prudent to backup the DS4500 configuration.  Automation of this task ensures a good copy of the arrays configuration is always available.

Pre-requisites

  • Windows/Unix/Linux server with IP connectivity to the storage array
  • SMCli.exe installed

This script was created to run on a windows server in the c:\Backup-FastT\ folder.  All configs are saved within the folder C:\FastT-Backup\Configs and are in the format config-<execution date>.cfg. I’ve also added a section which creates a mapping script which can be used to quickly restore host and mapping information to the array.

@ echo off
SETLOCAL
echo ###############################################
echo # DS4500 Configuration Backup Script
echo #
echo # Created by Chris Zurich
echo # Last Updated: Jan. 15th 2010
echo #################################################
:: Set Variables
set CDATE=%date:~4,2%-%date:~7,2%-%date:~10,4%
:: Set Definitions
:: Login to array
smcli <SP IP Address> -c "save storageSubsystem configuration file=\"c:\FastT-Backup\Configs\config-%CDATE%.cfg\" allConfig;"
echo // Create Hosts and host ports >> %CD%\configs\mapping-%CDATE%.script
findstr /c:"create host" %CD%\Configs\config-%CDATE%.cfg >> %CD%\configs\mapping-%CDATE%.script
echo. >> %CD%\configs\mapping-%CDATE%.script
echo // Create Host to LUN Mapping >> %CD%\configs\mapping-%CDATE%.script
findstr "Drive-to-LUN logicalUnitNumber" %CD%\Configs\config-%CDATE%.cfg >> %CD%\configs\mapping-%CDATE%.script
echo. >> %CD%\configs\mapping-%CDATE%.script
:: Delete log files older then 14 days
set LOGPATH=c:\FastT-Backup\Configs\
forfiles -p %LOGPATH% -m config-*.cfg -d -14 -c "cmd /c del /q @path"
forfiles -p %LOGPATH% -m mapping-*.script -d -14 -c "cmd /c del /q @path"
:: Done
ENDLOCAL
::exit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s