Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
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:
Clinton
Agree here.. I'm just starting to script automate CIFS vFilers and one pain point is lack of Get-NaCifsShareAcl. You can Set-NaCifsShareAcl just fine, but noway to check your work
Running 2.3.0.86 of toolkit against a vFiler stamped as [NetApp Release 8.1.2 7-Mode: Tue Oct 30 19:56:51 PDT 2012 Multistore] and still the Get-NaCifsShareAcl fails. When is Netapp going to fix this? They provide the cmdlet called Get-NaCifsShareAcl but it does not work. Seems silly to me to do that only to see the thing fail. You are also correct in saying that you can set the ACL but you can't turn around and check if it worked? Really dumb.
I am starting to do a lot of NetApp and VMWare scripting. Currently I am finding it difficult to pull the iSCSI node name from the vmware side and nocticed a nice command-let here "Get-NAIscsiSession" that shows all iscsi information. It would be nice if I could pull the InitiatorNodename section out into a variable to make it easy to create igroups. Something like:
$iscsiname = Get-NaIscsiSession.InitiatorNodename or something along those lines. Not sure how to do it if multiple sessions are there though. Just thinking outloud, but I love this toolkit.
For the NetApp Controller, you'd use get-nsiscsinodename. For the host?
PS C:\> $HostInitiator=get-naiscsisession;$HostInitiator.InitiatorNodeName
iqn.1991-05.com.microsoft:win-cjrn2t2kse0
PS C:\>
I just put the object returned by get-naiscsisession in a variable then output the InitiatiorNodeName of that variable. Does that work for you?
J
How about allowing the controller parameter to accept pipelined collections of NaController objects?
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
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.
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
Thanks so much for the information. I will be looking more at this and posting up.
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.
Thanks for the input. This little bit of code will make my life so much easier.
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.
Get-NaOption auditlog.* autologout.* autosupport.* backup.* bootfs.* cf.* cifs.* cksum.* console.* coredump.* disk.* dns.* ems.* ext_cache.* fcp.* flexcache.* fpolicy.* ftpd.* httpd.* ip.* iscsi.* kerberos.* ldap.* locking.* lun.* ndmpd.* nfs.* nis.* nlm.* pcnfsd.* ra.* raid.* replication.* rlm.* rmc.* rpc.* rsh.* security.* snaplock.* snapmirror.* snapvalidator.* snapvault.* snmp.* ssh.* ssh1.* ssh2.* ssl.* tape.* telnet.* tftpd.* timed.* trusted.* vfiler.* vol.* wafl.* webdav.* | Export-Csv Backup.csv #-Force
and then
Import-CSV Backup.csv | Set-NaOption
Certainly works as you stated. Now if I import backup.csv to another filer of the same version with the same licenses enabled, that works as well. Be aware that, as you mentioned, not all options are available in all versions (opions available in 7.3.3 might not be in 7.2.6 depending on when the feature was implemented). Also be aware that some options require a license to be enabled. Also, instead of editing the CSV manually, try setting desired option with set-naoption, then export it.
Happy Scripting
J
I guess I have an issue with the licenses. On the filer I am testing with I exported all my options, then I imported the filerconfig.csv and it barfed on some of the options. I will take your suggestion though and set the options first and then try to export. I was just trying to avoid setting some 250+ options.
You likely have some base set of licenses installed on all your controllers, and some controllers may have additional licenses. You could configure your script in such a way that you import the base, then do a license check before importing optional settings:
Import-csv base.csv | set-naoption
$Flexcache=get-nalicense |? {$_.Service -eq "flexcache_nfs"}
if($Flexcache.Code -ne $null) {import-csv flexcache.csv | set-naoption}
Imports the base, then checks for a flexcache_nfs license and imports those settings if the license is present.
J
I found out why the options were not importing properly. I had some extra white space after the option in the csv. I did not notice it at first because I was using EXCEL to view the file, but when I opened it in wordpad I was able to clearly see it. I corrected these and then I was able to import.
Glad to hear that you've got it. It you look over in samples, you'll find an example of a small powershell GUI to import options., Hope this helps.
Happy Scripting
J
I would like to see integration with DFM. I guess that would be the DFM PowerShell Toolkit though eh?
You must be peeking at the NetApp Managability SDK v4 to the right 🙂
J
As a previous poster noted, being able to configure network objects would be very useful:
More vfiler capabilities would be useful also. You don't have to tunnel all of these commands to vfilers especially with Data ONTAP 7.3.2 and later when many more ZAPIs were added to vfilers.
From the root administrator perspective, being able to do these would be much appreciated:
From a general vfiler perspective, being able to configure CIFS shares or NFS exports would also be ideal.
Is there a way to change individual user quotas on a vfiler using the toolkit? If not, what is the easiest way to do so?
Thanks!!