Automate NAR File Backup for EMC SAN’s

EMC-logo

I’ve never been able to find a how-to for grabbing nar files that worked with new versions of Navisphere CLI. Half the scripts I’ve seen just don’t work when you try them. So I decided to write my own. It’s dirty, I’m no programmer, but it works for me. Modify it to your liking.

The first thing you need to do is install Navisphere CLI. This will allow you to execute commands against the storage processors through your respective OS’ command line.

Go to https://support.emc.com/downloads. Searching for Navisphere CLI does not work at the time I wrote this article, so I searched for my storage system (VNX) and did a search in my browser for “Navisphere CLI”.

nar1

Once the CLI tools installed on your management server, you’ll want to save credentials to your security file so that commands you run against your storage system don’t need to have the password in them.

The normal convention is as follows. If you use LDAP, use -2 as the scope. If your goal is to only save NAR files, create a user with non-administrative rights, i.e. Operator.

naviseccli -addusersecurity -scope 0 -password <password> -user <user_name>

The next step is to list the NAR files on the subsystem. If there aren’t any listed, verify that logging is enabled and started.

The next part is to write your batch file to your liking. I am running a Windows system, storing and running commands from various directories on the C: drive. Modify the script to your OS/paths.

REM Start the script from where the naviseccli executable is stored
cd "C:\Program Files (x86)\EMC\Navisphere CLI"

REM **Takes the 5th column of output from the NAR Archive list on the SAN. Outputs that context to NARNow.txt
FOR /F "tokens=5 delims= " %%G IN ('"naviseccli -h 192.168.10.67 analyzer -archive -list"') DO ECHO %%G >> NARnow.txt

REM **Compares the two NAR file outputs from the previous batch run. Outputs the new files.
FC /c NARnow.txt NARold.txt > NARneed.txt

REM **Cleanup output from FC command
TYPE NARneed.txt | Find ".nar" > nar.txt

REM **Assigns the nar files needed to a varible 'nar'
FOR /f "tokens=1" %%g in (nar.txt) do (set nar=%%g)

REM **Grab the file
naviseccli -h 192.168.10.67 analyzer -archive -file %nar% -o -path C:\EMC\NAR

REM **Cleanup
del NARold.txt
copy NARnow.txt NARold.txt
del NARnow.txt
del NARneed.txt
del nar.txt

Basically what I’m doing is checking for a new NAR file on the SAN and grabbing it. Right now this script doesn’t store multiple new NAR files as variables, just part of my programming ineptitude… I’m sure with VBscript or the like this could be cleaned up quite a bit. For right now I just set the scheduled task to run every 6 hours and I get my files.

Automate NAR File Backup for EMC SAN’s

Change Clariion SP IP address – without SP Reboot!

Oh no, your network has updated and you have to change the IP address of your storage processors on your Clariion series array!!  I’ve done this on two separate CX SAN arrays without an issue. Follow these steps and you wont have a problem. This will work on a CX, CX3 and CX4 series storage array. 

First you need to download the Clariion CLI Software. In my scenario I am connecting to the SP’s on a Windows host. There are also downloads for *nix, HP-UX, Solaris, etc.

Download CLI Tools

If you dont have the CLI tools installed on a management box in your datacenter, now is the time to do it. If you have the CLI tools installed, you can skip this.

If you have an EMC SAN you should have access to Powerlink.

  • Download the Navisphere CLI Software for your respective OS.
  • Install on the machine that you will be connecting to the SP’s from.
  • Follow the default install steps.

Storage Domain Steps

Start by removing the storage system from a domain (if you dont know what this means or your SAN is in it’s own domain skip this step).

If the storage system to be reconfigured is the Master of a domain that contains other storage systems, assign a new master and remove the storage system to be reconfigured from its domain as follows:

  • Change the domain master:
    • Use Navisphere Manager to connect to one of the other arrays in the domain.
    • From the Navisphere Manager main menu, select File > Set Up Domain > Select Master. The Configure Domain dialog box appears.
    • In the Select Master window, highlight the new domain master and click OK

Note: If you are not logged into the new domain master, you may be asked to log into the array to be set as the domain master before the operation completes.

  • Remove the storage system from the domain:
    • Use Navisphere Manager to connect to one of the other arrays in the domain.
    • From the Navisphere Manager main menu, select File > Set Up Domain > Configure Domain. The Configure Domain dialog box appears.
    • In the Selected Systems field, highlight the storage system whose SP IP addresses you want to change, and click the arrow to send it to the Available Systems field.
    • Click Apply, and then click OK.
    • Exit Navisphere Manager.

If the storage system to be reconfigured is part of a domain that contains other storage systems, remove the storage system to be reconfigured from its domain as follows:

  • Use Navisphere Manager to connect to one of the other arrays in the domain.
    • From the Navisphere Manager main menu, select File > Set Up Domain > Configure Domain.  The Configure Domain dialog box appears.
    • In the Selected Systems field, highlight the storage system whose SP IP addresses you want to change, and click the arrow to send it to the Available Systems field.
    • Click Apply, and then click OK.
    • Exit Navisphere Manager.

Reset Security

Reset the security and domain information for SP A as follows:

  • Open a web browser and go to the setup page for SP A:

http://<Current_IP_Address_of_SP_A>/setup

    • Scroll to the bottom of the screen and click Destroy Security and Domain Information.
    • A warning screen will appear.  Select Yes and set click Submit to reset the security and domain information for SP A.
    • Wait for the management server to stop and then restart.
    • Go back to the setup page for SP A:

http://<Current_IP_Address_of_SP_A>/setup

    • Scroll down and click Restart Management Server.
    • A warning screen will appear.  Select Yes and click Submit to restart the management server.
    • Repeat the previous step to reset the security and domain information for SP B.

After the management server has been restarted on SP B, the array’s security and domain information will be in an un-initialized state, similar to the way it is shipped from the factory.

Change the IP

  • Open a command prompt
  • cd to the directory where the Navisphere naviseccli executable is installed (ie C:\Program Files\EMC\Navisphere CLI)
  • Run the following command based on your configuration (the x.x.x.x is your old SP IP address, the y.y.y.y is the new IP and gateway). If you are not changing gateways, then remove the -gateway y.y.y.y portion.
naviseccli -h x.x.x.x -user admin -password myPass -scope 0 networkadmin
 -set -address y.y.y.y -gateway y.y.y.y
  • You will get a prompt similar to this based on the commands:
Changing the IPv4 Address on SP A, Port 0, Virtual Port 0 from 192.168.1.60 to 192.168.10.60
Changing the IPv4 Gateway Address on SP A, Port 0, Virtual Port 0 from 192.168.1.1 to 192.168.10.1
This operation will cause a management server restart!
Do you wish to continue? (y/n) y
  • Hit “y” to commit the changes.
  • At this point you may have lost connectivity to your SP. One of two things will happen:
    • If it’s on the same segment, once the management server reboots you should be able to connect.
    • If it’s on a different network segment, you will probably have to change the VLAN assignment of the port. Instructions are below.

Change the VLAN

If you are switching VLAN’s, you will need to update the access port assignment that the SP plugs into. (The following is for Cisco devices).

  • Log into the switch
  • If you aren’t sure where the SP plugs into run these commands to find out.
  • Switch#conf t
  • Switch(config)#interface gi 2/10
  • Switch(config-if)#switchport access vlan 50

Troubleshooting

If your peer IP isnt updating, follow these steps:

  • Log into https://spa/setup
  • Scroll down and click Restart Management Server. No need to change the Peer IP in the GUI!

Finish up

  • Log into Unisphere with https://spa
  • Re-initialize global security by clicking Yes at the first prompt.

  • Add your old admin user credentials.

If you are using Unisphere you are done!! Document your changes and grab a coffee!!

Final steps if you are using Navisphere:

  • From the Navisphere Manager main menu, select File > Set Up Domain > Select Master. The Select Master dialog box appears.
  • Highlight the IP address of SP A and click OK.
Change Clariion SP IP address – without SP Reboot!