Archive

Posts Tagged ‘poshontap’

VMworld 2010 Call for Papers – Need a little help

May 14th, 2010 No comments

Well I have submitted papers for the last 3 VMworlds, and unfortunately have not been selected.  I’ll admit some of those previous submissions were good enough, but missed a the oomph to put them over the top.

I submitted a paper, yes, just a single paper this year, and with some help, I could be selected.  This year, VMware is doing something a little different.  Public voting is being considered in the select process.

The paper I submitted details how to leverage VMware vSphere, NetApp SnapMirror, NetApp SnapManager for Virtual Infrastructure (SMVI), vSphere PowerCLI, and PoshOnTap to spin up a warm DR site.  I chose this topic, because this is how I set a solution up last year when VMware SRM did not support NFS storage.  This session talks about how to quickly recover a SnapMirror replicated site using PowerCLI, with some PoshOnTap included.

So if you feel like voting for my session, head over to VMworld.com at the following URL: http://www.vmworld.com/community/conferences/2010/cfpvote/pcbusiness.

You will be required to login to vote, but joining VMworld.com is free.

Thanks for any and all votes, and best of luck to everyone else who submitted a paper/presentation.

NetApp SnapMirror Monitor Script – Part 2 using PoshOnTap

March 21st, 2010 3 comments

My first attempt at this worked out pretty well, but I’ve been looking into PoshOnTap, and come up with a more efficient script.  PoshOnTap is really something to look at if you have a NetApp, and are getting deeper into using Powershell.

To get started, download PoshOnTap from http://poshontap.codeplex.com/, and install it.

Once PoshOnTap is installed, to use the cmdlets, it must be imported into your Powershell session using Import-Module PoshOnTap

Now to connect to my second filer, the one that is performing the SnapMirror role, I need to connect to it.  This is done with Connect-NaServer -Filer filername -UserName user -Password password. I’ve omitted the username and password, as my Filer is joined to my Active Directory Domain.  My Powershell session is being run from an account which is part of the domain.

In my previous post, I had to remotely execute a “snapmirror status” command using ssh through plink.  Not very elegant.  From the command line, “snapmirror status”, will only show Source, Destination, State, Lag, and Status.

Using Powershell I can execute the same type command, and actually get more information. Information like:

  • BaseTimeStamp (time of the last update)
  • BaseSnaphot (name of the Snapshot on the destination filer)
  • ContentState
  • CurrentTransferSize (showing the size of a current transfer)
  • CurrentTransferType
  • LastTransferSize (how many bytes were transferred)
  • LastTransferDuration (how long the last SnapMirror took)
  • LastTransferType (Did an initialization occur? Did an update take place?)

So how would I get the same information through Powershell?

Get-NaSnapMirror by itself will show the same information as snapmirror status does, albeit in a different order.

Now, if we change the output format from Format-Table (default) to Format-List (or FL) we will see some very different output.

Now to use some of that output for our monitoring.  I created the following script to pull more information than my last script

#Load the PoshOnTap Module
Import-Module PoshOnTap

#Connect to the Filer
Connect-NaServer -Filer netapp2

#Pull Our Data
get-NaSnapMirror|select Source,Destination,Status,State,Lag,LastTransferSize,LastTransferDurration|ft

Which returns

Now, to get the output into e-mail, I’m going to have to massage the output a little bit.  Here’s the resulting script:

#Load the PoshOnTap Module
Import-Module PoshOnTap

#Connect to the Filer
Connect-NaServer -Filer netapp2

#Pull The Data
$body = Get-NaSnapMirror|Select Source,Destination,Status,State,Lag,LastTransferSize,LastTransferDurration|Out-String

#Send e-mail
Send-MailMessage -From "user@yourdomain.com" -To "user@yourdomain" -Subject "NetApp Replication Script" -SmtpServer mail.domain.com -Body $body

Which will give an output something like this:

Pretty cool how Powershell will let us use less code, and get more done.

I can add “Where-Object { $_.Lag -gt “01:0:00″} |” between “Get-NaSnapMirror |” and “Select Source,” to only show the volumes that have a lag greater than 1 hour.  Again, pretty flexible.

Now I’m off to work on Part 3, where I post this information to a SQL database for historical purposes.

Using Powershell I can execute the same command, and actually get more information.