Home > Command Line > SnapMirror failover

SnapMirror failover

January 22nd, 2009 Leave a comment Go to comments

So I helped a customer a few months ago (before SRM) to script a complete site failover. It will bring the DR site online within about 30 minutes, the scripts are a bit clunky and need a massive re-design, so I thought I’d post the originals here.

This, I think, is a great example of how flexible the NetApp systems are in that you can quickly and easily setup SSH access from a management host and script your heart away! Soon as I get the hang of the API, I’m sure there’ll be plenty more info coming along too.

This script will bring all volumes online on the DR filer, what’s more, an volume that is labelled as “_vm” at the end (which is a nice naming convention to use for all VMware volumes anyway), will get re-mapped to a new igroup you choose and already have setup for the DR ESX servers.

I’ve modified this script slightly since writing it to remove filer names, so I don’t expect it to work out of the box, as with my other scripts, it’s just meant to as an example of how this can be achieved.

[root@esx101 root]# cat failover.sh
#!/bin/bash

dr_vmware_igroup=”VMWare_DR”
dr_filer_name=”filer_dr”
dr_filer_command=”ssh -c 3des $dr_filer_name”

for netapp_volume in `$dr_filer_command snapmirror status | grep $dr_filer_name | grep -v “_vm” | cut -d”:” -f3 | cut -d ” ” -f1`; do
 echo $dr_filer_command snapmirror quiesce $netapp_volume
 echo $dr_filer_command snapmirror break $netapp_volume
 echo $dr_filer_command vol online $netapp_volume
done

for netapp_volume in `$dr_filer_command snapmirror status | grep $dr_filer_name | grep “_vm” | cut -d”:” -f3 | cut -d ” ” -f1`; do
 echo $dr_filer_command snapmirror quiesce $netapp_volume
 echo $dr_filer_command snapmirror break $netapp_volume
 echo $dr_filer_command vol online $netapp_volume
 for netapp_lun in `$dr_filer_command lun show | grep /vol/$netapp_volume | awk ‘{print $1}’`; do
  echo $dr_filer_command lun online $netapp_lun
  echo $dr_filer_command lun map $netapp_lun $dr_vmware_igroup
 done
done

VN:F [1.9.3_1094]
Rate this post:
Rating: 0.0/10 (0 votes cast)
SnapMirror failover, 10.0 out of 10 based on 1 rating

Similar Articles:

  1. SnapMirror Setup Script

  1. Ty
    July 22nd, 2010 at 16:11 | #1

    How are you Mr Kranz?

    Have you made any enhancements to the script since posting?

    Cheers, Ty

  2. July 23rd, 2010 at 11:31 | #2

    Hi Ty!

    Unfortuantely I’ve not been able to make any progress on any of the scripts here. I’ll be sure to update them as soon as I have though. I’m hoping to start converting them all to PowerShell first to make them more Windows friendly.

  1. No trackbacks yet.

Bad Behavior has blocked 712 access attempts in the last 7 days.

© 2009-2010 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.