Microsoft Virtualization Discussions

What would YOU like to see in the Data ONTAP PowerShell Toolkit?

cknight
24,339 Views

The initial response to the Data ONTAP PowerShell Toolkit has been tremendous, but that doesn't mean we have all the answers!  We've only begun to tap the enormous potential of PowerShell, and the combination of this Toolkit with other 3rd-party modules (HyperV, PowerCLI, etc.) is where things really get interesting.  Here's your opportunity to tell us how you'd like to use the Toolkit and how we can improve it to help you get there.

I'll offer a few things we're already considering:

  • Snapvault
  • Consistency group
  • Snapshot multicreate
  • Reallocate
  • System.DateTime values in addition to Int64 values
  • Find-NaController (discover controllers on the network, including new, unconfigured ones)

Clinton

120 REPLIES 120

bigtruckguy
4,068 Views

Clinton, awesome stuff here.

I have been reading (again) about doing some powershell stuff.

A couple thing that I think would be nice is a "sunrise" report we use powercli for our vmware environment.  Its awesome in that it shows calculations of # of VM's left based on memory, cpu, number of vm's on/off, path issues to luns, issues, errors, etc.  http://www.virtu-al.net/2009/08/18/powercli-daily-report-v2/

Boy, would it be nice to cobble some of these sripts together and give a daily email (not I don't get enough) of:

cifs/nfs stuff

performance numbers (FC stats, etc)

LUNS, and partner I/O issues

looking through the logs for failed jobs (SMSQL, SME, etc)

snapshots over X days old

busy luns/clones

I am going to take a shot at this.  I'm pretty green with the PS stuff so I will see how far I get.

cknight
4,068 Views

Thanks, bigtruckguy.  I think what you're after is doable with NetApp's PowerShell offerings.  Once you get it working, I hope you can post it here.

Just how big is your truck?

darraghos
4,068 Views

Possibly some implementation of the 'lock status' commands. I find these very useful when you have a site that works with a lot of MS office documents as they imlement their own lock notification functionality whichcan lead to a notification within say excel, that a user has the document locked for editing (even though they dont). Its useful to be able to identify the user that actaully has the document open.

I think this may be possible thorugh the upcomnig 'invoke' cmdlet though.

PS: great toolkit!

cknight
4,068 Views

Thanks, darraghos, glad you like the Toolkit.  I've logged your request for lock cmdlets (it seems there would only be a couple needed), and as you say, what you seek should be possible with Toolkit 1.3's Invoke-NaSsh (posted today).

david_ovenden
4,068 Views

Hi Clinton,

This miight be similar to the DFM request in that it would be best as a separate toolkit, but I would like to be able to use Powershell for controlling Snapdrive.

I know we can fudge things using the sdcli commands, but a powershell "makeover" would be a major improvement.

David

cknight
4,068 Views
I would like to be able to use Powershell for controlling Snapdrive.

Hi, David.  Yes, that is a perfectly reasonable expectation!  I don't know the product plans for SDW, but we may consider adding a few of the more common host-side functions to the Toolkit.  Feel free to shoot me a PM with a list of host-based tasks that would address your more serious pain points.

sjallabais
4,068 Views

Please make it possible to pass a PSCredential object to Set-NaCifs, to avoid having

clear-text passwords in scripts. (and all other Cmdlets that needs username/password input)

..

Also, Set-NaCifs is unable to automatically register the computer account in AD like "cifs setup" does.

JLundfelt
4,068 Views

I'm looking for a way to monitor a filer to see the total NFS IOPS, per volume, per vmdk, e.g

Filer          Volume          VMDK                       IOPS

------          -----------          ----------                     --------

toaster     VMDS1          ServerA.vmdk          1057

toaster     VMDS3          Serverc.vmdk          1442

cknight
4,068 Views

Have a look at Toolkit 1.4, released today.  Invoke-NaSysstat can report IOPS statistics for volumes & LUNs.

JLundfelt
4,474 Views

Thanks for the fast response!

But is this just like doing a sysstat on the netapp? I am trying to get the actual utilization per VM in a NFS volume. Eitherway, I can't get it to work with my understanding of the syntax;

>get-navol

Name                      State       TotalSize  Used  Available Dedupe  FilesUsed FilesTotal Aggregate
----                      -----       ---------  ----  --------- ------  --------- ---------- ---------
VMDS_D1                   online         1.2 TB   78%   280.2 GB  True         465        32M aggr0
VMDS_D2                   online         1.2 TB   75%   316.1 GB  True         641        32M aggr0
VMDS_D3                   online         1.2 TB   80%   251.0 GB  True         865        32M aggr0
VMDS_D4                   online         1.2 TB   79%   266.3 GB  True         604        32M aggr0


>invoke-nasysstat -volume VMDS_D1 -controller toaster
WARNING: Failed to read volume instances.
WARNING: No performance data returned for the specified counter instance, exiting.

Thanks!

Jon

cknight
4,474 Views

Invoke-NaSysstat is patterned after sysstat, but it isn't limited to top-level controller performance metrics.

I'm not sure why it wouldn't find perf data for your volumes.  What is the output of "Get-NaPerfInstance volume", and what version of Data ONTAP are you using?  This is what you should see:

PS C:\Users\cknight> Invoke-NaSysstat -Volume opalis -i 1

    Read  Written  RdOps  WrOps TotOps   RdLat   WrLat  TotLat Volume
    ----  -------  -----  ----- ------   -----   -----  ------ ------
       0        0      0      0      0     0.0     0.0     0.0 opalis
       0    12 KB      0      3      3     0.0     0.1     0.1 opalis
       0    12 KB      0      3      3     0.0     0.1     0.1 opalis
       0        0      0      0      0     0.0     0.0     0.0 opalis
       0        0      0      0      0     0.0     0.0     0.0 opalis

JLundfelt
4,474 Views

Ontapi   Version
  ------   -------
  1.12     NetApp Release 7.3.3: Thu Mar 11 22:29:52 PST 2010

I think it doesn't like the -controller switch;

>invoke-nasysstat -volume VMDS_D1 -Count 1

   Read  Written  RdOps  WrOps TotOps   RdLat   WrLat  TotLat Volume
   ----  -------  -----  ----- ------   -----   -----  ------ ------
      0   124 KB      0     28     29     0.0     0.4     0.4 VMDS_D1

What I am really looking for is even more detail for NFS / iSCI to show the iOPS per VM, similar to Akorri!

Thanks,

Jon

erick_moore
4,473 Views

Is there a cmdlet for file cloning ala "clone start"? I see we have LUN cloning, and vol cloning, but I was wondering about file cloning.

Thanks,

Erick

cknight
4,474 Views

Hi, Erick.  Have you tried Start-NaClone?  The cmdlets in the clone category (Get-NaHelp -Category clone) use the sis-clone APIs to clone files or LUNs (which are just files).

drwoodberry
4,473 Views

The new feature to invoke ssh is very nice. I like being able to supply a command line arguement as a parameter and have it execute. However something I would like to see added into the toolkit is the ability to add disks of different speeds to an aggregate at one time. With the invoke ssh cmdlet, I can use the "-f" switch to be able to add disks, but I can not add different disk speeds at the same time. With this, you have to add one speed, wait for the aggregate to grow, then add the other speed. This takes a lot of time when trying to grow an aggregate from a script or the command line. Having the same ability that is in filer view would be great.

cking22001
4,692 Views

You have Restore-NaSnapshotFile and  Restore-NaSnapshotVolume (hopefully I am missing something)

In between you have 99% of what you might want to do script wise. One file? Use the GUI. A whole volume? I call that DR.

It is quite tedious when what needs to be restored is a couple of large sub-folders (1GB+) with 1000s of files in them.

At the very least you need a way to get files that are in a snapshot.

Then this (fictitious) command might be ok.

Get-NASnapshotListing -path /vol/nas/somesharedfolder/subfolder -snapname nightly.1 | Restore-NaSnapshotFile -snapname nightly.1

-ck

sizemore
4,692 Views

I think you could do that with the provider.

Mount-NaController -Name NTAP -Root /vol/nas/somesharedfolder/subfolder/.snapshot/nightly.1

Get-ChildItem NTAP:\ |
    Where-Object {$_.Type -eq 'file'} |
    Foreach-Object {

        Restore-NaSnapshotFile -Path $_.PSPath.split(':')[2] -snapname nightly.1

    }

~Glenn

cking22001
4,692 Views

Ok, Guess I need to read better. At first this did not work but I realized I was still on 1.2 but after upgrade to 1.4 you idea works well.

Thanks-ck

sizemore
4,692 Views

No problem, I'm glad it worked for you.  Keep those idea's comming there has to be something we haven't implemented yet.


~Glenn

dannyphobbs
4,628 Views

hi

great kit

i would like to see a command that can return all notifcations in a text based form so i can parse these via normal pshell methods

ie.                    Get-NaNotifications -severity

this would allow me to get notifications from the storage and present them on a central screen we use to display all the enviroment to different teams within the business

i cannot see a similiar command or easy method to do thia within the existing cmdlets

i read a thread above that mentioned the Read-NAFile  and maybe this could be used to collect the logs , however i an uncertain of where the notifications u see in the operations manager are stored ...are they in syslog ?

thanks

muynuboso
4,447 Views

I'm not certain what types of "notifications" you get out of Operations Manager so this might not be relevant, and I'm not saying that this is the only way or even the best way to retrieve "events"...but here's an example of how I deal with collecting events from the messages log of my controllers (and no potshots at my cruddy coding skills either! 😞

################################

# Controller Event Capture     #

#                              #

# Find your events in the      #

# variable $Controller_Events  #

# when completed...            #

################################

# Initialize your linked lists...

$Controller_Messages = New-Object Collections.Generic.LinkedList[PSObject]

$Controller_Events = New-Object Collections.Generic.LinkedList[PSObject]

# Number of Days you want to retrieve events from...

$Days = [double]2

# Read in the messages file and create a linked list of lines...

ForEach ($ln in ((Read-NaFile -Controller $YOURCONTROLLER -Path '/vol/vol0/etc/messages').Split("`r`n")))

    {

        $null = $Controller_Messages.AddLast($ln)

    }

# Initialize a counter variable...

$Count = 0

# Loop through each line and create a new linked list of custom objects... (I filter out repeats...but you don't have to...)

ForEach ($Line in ($Controller_Messages | Where {$_ -notlike '*last message*'} | Where {$_.length -gt 0}))

    {

        $NA_Event = New-Object -TypeName System.Management.Automation.PSObject

        If (((($Line.Split('[') | Select -First 1).trim()).substring(0,((($Line.Split('[') | Select -First 1).trim()).Length - 4))) -match '  ')

            {

                $NA_Event | Add-Member -Name 'TimeStamp' -MemberType NoteProperty -Value ([datetime]::ParseExact((($Line.Split('[') | Select -First 1).trim()).substring(0,((($Line.Split('[') | Select -First 1).trim()).Length - 4)),"ddd MMM  d HH:mm:ss", $null))

            }

        Else

            {

                $NA_Event | Add-Member -Name 'TimeStamp' -MemberType NoteProperty -Value ([datetime]::ParseExact((($Line.Split('[') | Select -First 1).trim()).substring(0,((($Line.Split('[') | Select -First 1).trim()).Length - 4)),"ddd MMM %d HH:mm:ss", $null))

            }

        $NA_Event | Add-Member -Name 'TimeZone' -MemberType NoteProperty -Value (($Line.Split('[') | Select -First 1).trim()).substring((($Line.Split('[') | Select -First 1).trim()).length - 3)

        $NA_Event | Add-Member -Name 'Source' -MemberType NoteProperty -Value (($Line.Split(':') | Select -Index 2).split('[') | Select -Last 1)

        $NA_Event | Add-Member -Name 'MessageIndex' -MemberType NoteProperty -Value $Count

        $NA_Event | Add-Member -Name 'EventType' -MemberType NoteProperty -Value ($Line.Split(':') | Select -Index 3).trim()

        $NA_Event | Add-Member -Name 'Severity' -MemberType NoteProperty -Value (($Line.Split(':') | Select -Index 4).Split(']')|Select -First 1)

        $NA_Event | Add-Member -Name 'Message' -MemberType NoteProperty -Value ([regex]::Split($Line,']:')| Select -Last 1).Trim()

        $Count++

        # You can modify the following to filter for only the severity that you'd like to collect...

        If ((($NA_Event.Severity -like '*error*') -or ($NA_Event.Severity -like '*warning*')) -and ($NA_Event.TimeStamp -ge (Get-Date).AddDays(-$Days)))

            {

                $null = $Controller_Events.AddLast($NA_Event)

            }

    }

I too would like to see a commandlet that handled it more efficiently however... Possibly a way to pull out events from the audit log as well...

Public