Archive

Posts Tagged ‘netapp’

NetApp SnapMirror Monitor Script – Part 3 with DataONTAP PowerShell Toolkit v1.0

June 15th, 2010 Jase 2 comments

My second attempt also worked out pretty well, but the DataONTAP PowerShell Toolkit, has been released, and I wanted to update my script to leverage a supported toolkit. If you have a NetApp, and are getting deeper into using Powershell, this toolkit is for you.

I’m not going to go deep into the details of how this script works, as most of that is covered in the previous post.

What I am going to detail is the difference between the old and new scripts.

The Old 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

The New Script

#Load the DataONTAP Module
Import-Module DataONTAP

#Connect to the Filer
Connect-NaController netapp2

#Pull The Data
$body = Get-NaSnapmirror|Select SourceLocation,DestinationLocation,Status,State,LagTime,LastTransferSize,LastTransferDuration|Out-String

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

The only differences between the 2 scripts are at lines 5 and 8.

Line 5:

  • Connect-NaServer -Filer becomes Connect-NaController

Line 8:

  • Source becomes SourceLocation
  • Destination becomes DestinationLocation
  • Lag becomes LagTime
  • LastTransferDurration becomes LastTransferDuration (obvious typo in PoshOnTap)

Other than those 2 lines, the scripts are identical.

I’d like to give a shout out to Glenn Sizemore for leading the way with PoshOnTap and NetApp for following his lead with the DataONTAP PowerShell Toolkit.

Update to this post
I was digging a little deeper on this post, and apparently dates are returned as INT64 Integers.  Makes things a little messy, and requires some data manipulation.

There’s a post about it on the NetApp Communities that details a workaround (again, kind of messy).  PoshOnTap handles dates better, so maybe NetApp will see the issue, and quickly release a v1.1 of the toolkit to correct the problem.  Nevertheless, I’ll continue using the supported (albeit a little more clunky with regard to dates) toolkit.

As soon as I find a clean/optimized way to address the situation, I will update this post.

Using Powershell I can execute the same command, and actually get more information.
Categories: Virtualization Tags: , , ,

Using the Data ONTAP PowerShell Toolkit to add vSphere Storage

June 9th, 2010 Jase 3 comments

Over the past year or so, I have started using PowerShell more and more.

I was really exited to see the release of the NetApp Data ONTAP PowerShell Toolkit 1.0. I say this, because I have been using the “unsupported” PoshOnTap PowerShell extensions for some NetApp management. I have to give credit where credit is due, and Glenn Sizemore has done a great job with PoshOnTap.

PowerShell is really powerful, and because more and more vendors are providing more and more modules for the management of different aspects of the enterprise. With one script, I can create a NetApp volume, export it as an NFS export, and then connect it to all of my VMware vSphere hosts.

Note: This script is meant to be run from the vSphere PowerCLI.

##########################################################
# Create-And-Add-Storage-example.ps1
# Jase McCarty 6/7/2010
# Posh Script to add a volume on a NetApp Filer
# and present it to all vSphere hosts
##########################################################

# Add the vSphere PowerCLI SnapIn and the DATA ONTAP Module
Import-module DataONTAP

# Set my variables
$vCenter = vcenter.jasemccarty.com
$Filer = netapp1.jasemccarty.com
$aggr = aggr1
$newvol = volx

# Connect to vCenter and our NetApp Filer
Connect-VIServer $vCenter
Connect-NaController $Filer

# Create a new volume
New-NaVol $newvol $aggr 500g

# Set some options for the new volume
Set-NaVolOption $newvol no_atime_update yes
Set-NaVolOption $newvol fractional_reserve 0

# Set the SnapShot Reserve to 0
Set-NaSnapshotreserve  $newvol 0
Set-NaSnapshotschedule $newvol -Weeks 0 -Days 0 -Hours 0

# Add an NFS export
Add-NaNfsExport /vol/$newvol -Persistent -ReadWrite all-hosts -NoSuid -SecurityFlavors sys,krb5

# Get all the vSphere Hosts and add the NFS export
$Hosts = Get-VMHost
ForEach ($H in $Hosts)
{
 New-Datastore -Nfs -VMHost $_.Name -NAME $newvol -Path /vol/$newvol -NfsHost $Filer;
}

**Note, this is a pretty incomplete script.  Security for the export will have to be addressed, and the Filer management IP (netapp1.jasemccarty.com) is probably not the same as the IP used for the NFS export.  This is just an example of how this can be used.

Pretty cool.  I can only imagine the Poshibilities.

Annie Get Your Gun – Virtual Casualties of War?

June 3rd, 2010 Jase No comments

Casualties of war?
How does that fit with Annie Get Your Gun?

Annie Get Your Gun is a fictional musical loosely based on Annie Oakley, an American sharpshooter born in 1860, and her husband, Frank Butler. In Act II of the musical, Annie and Frank are planning to get married.  Annie wants a big wedding, while Frank wants a small wedding.  They decide to resolve the conflict by having one last duel to decide how they will proceed.  In the musical, this leads into the song “Anything you can do” (I can do better).

How does this relate to technology?
Well, the thing that got me started thinking about this blog post, primarily has to do with the back and forth on Twitter and blogosphere from the likes of NetApp, EMC, and recently HP.

I’m not going to name names, because that’s not what is important.  What is important, is how life reflects art.  Here are a few comparisons that illustrate what I mean:

Annie/Frank Storage Vendors
Expert Sharpshooters Enterprise Storage Vendors
Have many talents (listed in the song) Provide a wide variety of features and options
Wants to get married Wants to provide the best storage for customers

Experts
In the musical, both Annie and Frank are expert sharpshooters and very capable people.  For everything one can do, the other says that they can do better.   It is not that one is truly better than the other, they are both experts.  They are both top of their game.  No one can dispute that.

The Goal
In the musical, the end goal is getting married.  Now I don’t foresee NetApp, EMC, and HP (or any combination of) getting “married”/merging/etc.  I do see the goal for the storage vendors to provide the best products ad services for all customers.

In the end, Annie lets Frank win to calm the waters so they can get on with their end goal of getting married.  Who is going to calm the waters?

The Casualties
I see a couple casualties in this war of words.

  1. The storage vendors
    I understand that people are passionate about their products… Sometimes at the expense of appearing unprofessional.
  2. The virtualization community
    People that know/work with parties on both sides can be put in a crossfire when one is pit against another…

It is odd to see one or more vendors say they are “fierce competitors” and also “good friends” while seeing this back and forth about products and their capabilities.  Some of this has really gotten downright dirty.

I would like to see things calm down… Maybe we can setup a virtual DMZ and come to a peace accord or something.

When attacks appear personal it gets a lot worse.  If it can just be kept out of the personal space, left to the facts, and discussed with an “appropriate” amount of passion…  Maybe it could end up simply being a  spirited debate.

Categories: Virtualization Tags: , ,

NetApp SnapMirror Monitor Script – Part 2 using PoshOnTap

March 21st, 2010 Jase 2 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.

NetApp Rapid Cloning Utility (RCU) 3.0

February 15th, 2010 Jase 4 comments

I received a beta copy of the NetApp Rapid Cloning Utility 3.0 the other day, and figured I would give it a spin this weekend.  Almost a year ago, the RCU 2.0 was mentioned in a NetApp blog posting: Sneak Peek – NetApp Rapid Cloning Utility (RCU) 2.0.  In December of 2009, NetApp provided a video of the new release: Sneak Preview – NetApp RCU 3.0. Also in December, Vaughn Stewart provided a post with more detail: Preview: Rapid Cloning Utility 3.0 vCenter Plug-in.  All of the same features are there with some additions, including vSphere and VMware View 4 support.

Test Lab
To give the RCU 3.0 Beta a spin, I fired up a virtual lab consisting of 2 ESXi 4.0 Update 1 hosts, 1 vCenter Server VM, and the NetApp ONTAP Simulator (7.3.2).  There is a limitation of the ONTAP Simulator (7.3.2) because to “rapidly clone” guests, a FlexClone license is required.  To overcome this limitation, I used the FlexClone license from the 8.0 ONTAP Simulator, which appears to work fine in the 7.3.2 ONTAP Simulator.

Features
Some of the features include:

  • Support for vSphere with both ESX(i) 4.0 and 3.5 hosts
  • VMFS datastore creation over FCP and iSCSI protocols
  • Multi-VMDK file cloning (distribute VM files across multiple datastores)
  • Deduplication on datastores
  • Auto-grow on NFS datastores
  • Grow datastores, and shrink (NFS only) datastores
  • Customizable clone count increment
  • Automatic import of VMs into VMware View Server (including View 4.0)
  • Support for XenDesktop
  • Support for vWorkspace
  • Ability to group deployed VMs by folder
  • Redeploying from VM/Template to previously deployed VMs

I really like the last two features… Grouping by folder and Redeploying VMs are great additions.

Grouping by folder
If you have deployed a lot of VMs, and want a logical separation in the VMs and Templates view, folders make it easy.  The RCU 2.x utility would simply create the VMs, but you (the admin) would have to logically separate them.

Redeploying VMs
With deployed VMs being a file level FlexClone of a master VM or Template, as patches or applications are added, the difference between the master and the clones is going to get bigger.  What if an application is added, or an existing application is upgraded?  Like Microsoft Office?  Or other applications?  This feature makes it easy to update your master, and then redeploy your clones.  Very slick.

Wish List
I also have a wish list for the RCU 3.0.  I’d like to see the VSC 1.0, the RCU 2.x/3.x, and the SMVI interfaces all combine into a single entity. The RCU and the VSC both have their own tomcat installation, and I would assume that they could be run together.  I understand that these are licensed separately, but at some point it would be good to see them provided as a single package.  Who knows, maybe in RCU 3.1?

I’m looking forward to the release of  RCU 3.0, which I hear should be around 2/18/2010.

Update: I’ve heard conflicting reports for the GA release of RCU 3.0.  I’ve heard 2/18 and I’ve heard 2/24.  I’ll go ahead and assume that it will be released sometime in the next 2 weeks.

Update 2: The RCU 3.0 has been officially released.  Find out more here.

Categories: Virtualization Tags: , ,