Perhaps someone on the Experts list can answer some questions for me.
1. Why is the Powershell forum now the Virtualization / Microsoft forum?
2. I am having a heck of a time trying to find answers to the PS cmdlets created by NetApp for NC. My biggest headache right now is finding how to use authentication, and to keept it while traversing mulstiple-clusters. It would be great if there were some TR's on PS Best practices, but the latest appears to be circa 2011. I know I had seen a discussion prior to the Community re-shuffle, but I can no longer find it, no matter what I put in the search.
3. How come I can't use PS cmdlets to assign Snapshot policies to volumes? (Don't tell me to do it via the ncssh cmdlet.)
4. I am still grapling with this final question; should I jump on PS, or just stay with the CLI over SSH?
All valid questions, can't comment on the forum but can easily set authentication for your clusters simply by using the "Add-NcCredential". The "Connect-NcController" cmdlet will read credentials from the cache assuming you've added them otherwise it will prompt you for credentials. EG:
PS C:\> Add-NcCredential -Controller cluster2.testlab.local -Credential (Get-Credential -Credential admin)
Name Credential HostUser
---- ---------- --------
cluster2.testlab.local System.Management.Automation.PSCredential TESTLAB\mbeattie
PS C:\> connect-nccontroller -Name cluster2.testlab.local -https
Name Address Vserver Version
---- ------- ------- -------
cluster2.testlab.... 192.168.100.3 NetApp Release 9.4: Fri Jun 08 22:50:12 UTC 2018
Note: The "Connect-NcController" cmdlet will read the cached credentials (IE you don't need to pass the -Credential paramater to it if you have added credentials for a cluster using "Add-NcCredential")
The "Update-NcVol" cmdlet can be used to modify properties of a volume (EG snapshot policy). Here is an example :
I would only use Invoke-NcSsh as an absolute last resort. You can use Invoke-NcSystemApi as an alternative to SSH but in the majority of all requirements there is a powershell cmdlet that will provide object based output rather than parsing SSH output string (the format of which is not guarenteed to remain constant in future ONTAP releases). I highly recommend you avoid using SSH if you can achive the desired result using the PSTK.
Hope that helps
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Get-NcVol -Controller ($NCClusters | ? name -eq "clu01")
Get-NcVol -Controller $NCClusters.clu01
OR - when i want the data from all the clusters (for the first option only):
Get-NcVol -Controller $NCClusters
4. I think yes, working with SSH output is not fun, here someone actually formatted for you the outputs and inputs of thousands of commands.
As a person who work with the top four vendors SDK's, it seems to me that NetApp has the most advanced PS Module out there, that is most compliant to the PS standards and really has almost 1:1 mapping between every API command they have to the PS one.
is it perfect? - Not, but i see vendors releasing PS Modules that their own commands dosen't pipe to one another, and the parameters has different name in each cmdlet.