Microsoft Virtualization Discussions

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

How about allowing the controller parameter to accept pipelined collections of NaController objects?

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

Hi Ben,

If you're working with a single connection, connections are transitive:

connect-nacontroller SIM1; get-navol

will list on the volumes on controller SIM1.  I can keep using other cmdlets without specifying the -Controller, and SIM1 will be used; until I connect to another controller that is.  Now if you're working with more than one controller, I suspect you'd like to put the connection objects in a collection.  Something like this simplistic example:

[object[]]$Simulators=$null;foreach ($SIM in @("SIM1", "SIM2", "SIM3")) {$NewSIM=Connect-nacontroller $SIM;$Simulators=$Simulators+$NewSIM}

Now that you've created a "connection collection", I also suspect you'd like to do something creative with it.  Perhaps you'd like to set some option on a group of controllers or list all the snapshots or volumes on a the controllers in your connection.  Sadly we don't accept pipeline for -Controller today, but perhaps you could use the foreach-object which does, something like:

$Simulators | foreach-object -Process {get-navol -Controller $_}

Which returns all the volumes on all three members of my "connection collection".

Happy Scripting

J

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

OK, Matthew, got it.  The system-cli ZAPI isn't supported, but sending commands via SSH is.  SSH support isn't built-in to .NET, but it can be done, so we'll definitely consider such a cmdlet.

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

I could have missed this in the Initialize-NaController cmdlet documentation, but incase I did not over look it, it would be nice to intialize the controller and be able to configure a vif. Also, it would be nice if there was a built in dicsovery for the initialize cmdlet. This way someone would just need to know the network the device is on and not the IP address.  I am responsiable for providing either documentaion or a script to standup a filer to a group of people that have never seen or touched a netapp. If I could get away with just asking them what address they want on the filer, as well as the password and one or two other options and I could then create a vif and configure those options that would be great.

Lastly,

I know I sound like a pain, but getting back to my unique situtation, I deploy these filers for the Marine Corps, they have a list of the options that need to be set and configured a certain way. Is there a way I can import these options so I do not need to manually hand jam them?

Thanks again, and I love the tool. This has made automating the configuration of a  VM infrastructure as simple as 140 lines of code.

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

With initialize-nacontroller you can set the first interface.  Sadly ifconfig and vifconfig didn't make the first cut as these are realitively new APIs.  Look for them in the near future.

As for options;  I have two small samples in documents on this community page.  In one, I show how to set options.  In the other, I show how to create an object collection from a text file, and perform a series of operations on the object collection (connect to a collection of controllers and set a couple options).  In short yes you can create an object collection consisting of options and their values, then loop through setting those option on all the controllers in another collection object.

Data ONTAP PowerShell Toolkit - HOWTO: Work with Many Controllers

Data ONTAP PowerShell Toolkit - HOWTO: Set Options

Happy Scripting

J

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

The Toolkit makes it very simple to standardize options across controllers.  For example, here's a script to export two entire sections of options from one controller to a file, and then set those same values on a different controller:

Import-Module DataONTAP

Connect-NaController dunn

Get-NaOption kerberos.* ldap.* | Export-CliXml Options.xml

Connect-NaController benson

Import-CliXml Options.xml | Set-NaOption

You can also use the Compare-NaOption cmdlet to find differences in option settings between any two controllers.

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

Hello, Brian.  The Data ONTAP API supports tunneling commands to vfilers, so the Toolkit supports this as well:

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


Test-NaCifs


stopped


Get-NaNfsExport


ActualPathname             Pathname                   SecurityRules
--------------             --------                   -------------
                           /vol/testvol               {}

Not all APIs may be sent to vfilers, but many can.

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

Thanks so much for the information. I will be looking more at this and posting up.

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

Thanks for the input. This little bit of code will make my life so much easier.

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

I followed your example above but I am outputting my options to a CSV file. I did this, so I could sample the output and know how to format my options from what I have been told that needs to be set. It seems that some of the options I am not able to set. I know it works, because I started first by exporting the options I wanted, so I could back them up and revert if needed. If I import the backup, I donot get any errors, but when I try to enable these options from a new file, I get errors. Can you help me with what i am doing? I know this is not the proper place to paste this, and for that I am sorry. Just thought I would attach it since it is the latest thread.

I have attached my code, my config file I want to use, and some of the options that are failing with the error messages. Some work just fine. I looked over the backup I made and it appears to be identical with the exception of some of the set values for the options. I have attached that csv as well. I thought it could have been an issue with the ONTap version, but I tried on 7.2.5.1 and 7.3.3 with the same options failing to be set.

Forums