Microsoft Virtualization Discussions

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

cknight
38,274 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

cknight
6,996 Views

You should be able to connect to the vfiler context like this:


PS C:\> Connect-NaController dunn -Vfiler vfiler1


OntapiMajorVersion : 1
OntapiMinorVersion : 12
Protocol           : RPC
Vfiler             : vfiler1
Name               : dunn
Address            : 10.61.167.60
Port               : 0
Credentials        :
ValidateIncoming   : False
ValidateOutgoing   : False
Trace              : False


PS C:\> Add-NaQuota -Type user -Target vf1user -Volume testvol -Qtree "" -DiskLimit 50g


Name                           Value
----                           -----
Threshold                      -
FileLimit                      -
DiskLimit                      53687091200
PerformUserMapping             False
SoftFileLimit                  -
QuotaError                     NetApp.Ontapi.Filer.Quota.QuotaError
SoftDiskLimit                  -


PS C:\> Get-NaQuotaEntry


Line        : vf1user    user@/vol/testvol    52428800K    -    -    -    -
Qtree       :
QuotaError  : NetApp.Ontapi.Filer.Quota.QuotaError
QuotaTarget : vf1user
QuotaType   : user
Volume      : testvol

nashman69
6,894 Views

Thanks for the quick reply!  That worked perfectly.

nashman69
6,672 Views

Hello again,

The add-naquota and set-naquota change quota entries in the /etc/quotas file, but the quotas do not take effect until the quota is turned off and back on again.  Is there a way in powershell to toggle the quota "switch" off/on so that the changes take effect without having to ssh into the filer?

Thanks!

fjohn
6,672 Views

Diable-navolquota & Enable-navolquota

J

nashman69
6,008 Views

I'm having a problem understanding the get-naquotareport command.  Quotas on our vfiler are currently set by default at 500MB for all users with the exception of a few users.  Here is what my /etc/quotas file looks like:

#Quota Target type                    disk  files  thold  sdisk  sfile
#------------   ----                           ----    -----   -----     -----   -----
* user@vol/irf_vol1                    500M    -     -       400M   -  
domain\seiferr user@vol/irf_vol1 614400K - - 532480K -
domain\nastest user@/vol/irf_vol1 61440K - 40960K - -

As I would expect, I the follwing commands produce the desired output:

get-naquotaReport | where {$_.quotatarget -eq "domain\seiferr"}

DiskLimit     : 614400
DiskUsed      : 514396
FileLimit     : -
FilesUsed     : 3340
Qtree         :
QuotaTarget   : domain\seiferr
QuotaType     : user
QuotaUsers    : {domain\seiferr}
SoftDiskLimit : 532480
SoftFileLimit : -
Threshold     : -
Vfiler        : IRF1
Volume        : irf_vol1

(get-naquotaReport | where {$_.quotatarget -eq "domain\seiferr"}).diskused

514396

However, for any other users in the domain that are using the default user quota (ie, without a specific entry in the quotas file) of 500MB, the same command returns empty results.  I've noticed that users assigned the default quota have a blank "QuotaTarget" as follows:

get-naQuotaReport

DiskLimit     : 512000
DiskUsed      : 424
FileLimit     : -
FilesUsed     : 18
Qtree         :
QuotaTarget   :
QuotaType     : user
QuotaUsers    : {domain\wilschj}
SoftDiskLimit : 409600
SoftFileLimit : -
Threshold     : -
Vfiler        : IRF1
Volume        : irf_vol1

Therefore, I can understand why my command produces empty results.  Next, I tried running the following command to get my desired output:

get-naquotaReport | where {$_.quotaUsers -eq "{domain\wilschj}"}

This produces no result.  How do I get specific quota usage information for users that do not have specific entries in the /etc/quotas file?  Also, out of curiousity why is the QuotaTarget only populated for users with specific entries in the /etc/quotas file?

cknight
6,008 Views
QuotaUsers    : {domain\wilschj}

Therefore, I can understand why my command produces empty results.  Next, I tried running the following command to get my desired output:

get-naquotaReport | where {$_.quotaUsers -eq "{domain\wilschj}"}

This produces no result.  How do I get specific quota usage information for users that do not have specific entries in the /etc/quotas file?  Also, out of curiousity why is the QuotaTarget only populated for users with specific entries in the /etc/quotas file?

The curly braces on QuotaUsers indicates that the value is an array.  And it's a list of objects, not strings, so it takes a little more effort to filter by a specific user:

foreach ($q in Get-NaQuotaReport)

{

   if ($q.QuotaUsers -NE $null)

   {

      foreach ($user in $q.QuotaUsers)

      {

         if ($user.QuotaUserName -EQ "domain\wilschj")

         {

            $q

         }

      }

   }

}

alphatwoadmin
6,894 Views

I'd like to have the ability to view the Event logs for the various components, unless I have missed this already! Specifically snapmirror events which could then be parsed for errors etc.

If this already exists please let me know!

Dan

fjohn
6,894 Views

You can use read-nafile to place the contents of the snapmirror log in a variable.

$log=read-nafile /vol/vol0/etc/log/snapmirror.0

also see get-nafile

J

alphatwoadmin
6,894 Views

Thanks fjohn,  exactly what I was after and works a treat. Loving Data ONTAP powershell, brilliant.

Dan

bcoy
6,894 Views

I would like to be able to modify cifs shares specifically access permissions.

For example on the command line I would say "cifs access "Share" SID  Full"

Thanks.

cknight
6,894 Views

Hi, bcoy, thanks.  It appears the APIs for modifying CIFS shares' access permissions are fairly new.  I'll add that to the list to consider properly for an upcoming release (after Toolkit 1.1).

cknight
6,008 Views

CIFS ACL manipulation is now available in Toolkit 1.2.

bcoy
6,088 Views

Thanks for the addition. I tried the command and received this error:

PS C:\Users\user> Get-NaCifsShareAcl share
Get-NaCifsShareAcl : Unable to find API: cifs-share-acl-list-iter-start
At line:1 char:19
+ Get-NaCifsShareAcl <<<<  share
    + CategoryInfo          : InvalidOperation: (NetApp.Ontapi.Filer.NaController:NaController) [Get-NaCifsShareAcl],
   EAPINOTFOUND
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Cifs.GetNaCifsShareAcl

Ontapi   Version
------   -------
1.11     NetApp Release 8.0 7-Mode: Thu Mar 11 16:17:13 PST 2010

Any thoughts?

cknight
6,088 Views

Like many of the new cmdlets in Toolkit 1.2, Data ONTAP 7.3.3 or later is required for CIFS ACL control.  Data ONTAP 8.x does not yet provide CIFS ACL APIs.

bcoy
6,135 Views

How do I tell what version of ONTAPI is in a release?

cknight
6,135 Views

As it turns out, bcoy, the ONTAPI version isn't the best indicator of API support.  Data ONTAP 7.3.3 introduced the CIFS ACL and network configuration APIs used in PowerShell Toolkit 1.2, but Data ONTAP 8.x does not (yet) support those APIs.  Sorry about that!

geneh
6,905 Views

I would like to be able to use the PSTK against archived autosupport data.

Thanks,

Gene

cknight
6,894 Views

Hi, Gene.  Are you asking about the EMS data in /etc/log/ems?  Those logs are XML formatted, so they shouldn't be difficult to handle in PowerShell.

egrigson1
6,019 Views

As per this post I really would like to see consistency groups for snapshots exposed via the toolkit. Be careful what you wish for!

I've had a quick look through the existing commands and couldn't see anything. We're running Weblogic with Oracle and the official deployment guide states that the underlying storage array should offer consistency group functionality. I know Netapp offer it via Perl but whereas the Toolkit is almost plain English using Perl is more like Japanese (for me at least, and I don't speak Japanese). Like everyone else, I'm loving the toolkit - thanks a bunch!

Regards,

Ed.

cknight
6,019 Views

Hello, Ed.  We just released Toolkit 1.1 last week, which includes cmdlets to expose the consistency group APIs.  Glad you like the Toolkit!

egrigson1
6,019 Views

More awesomesauce from Netapp! I'd seen v1.1 was out but missed that consistency groups were part of it. I bet you love it when a plan comes together!

thanks,

Ed.

Public