<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Some newbie questions on Controllers, Nodes, object types and filtering out nodes in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Some-newbie-questions-on-Controllers-Nodes-object-types-and-filtering-out-nodes/m-p/141764#M5834</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am just getting started with PowerShell in general and the NetApp PowerShell toolkit, and I have a couple of newbie questions.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;From my first Powershell scripts, I understand that a Clustered ONTAP cluster is referred to as a "(Nc)Controller" and&lt;BR /&gt;the nodes as "(Nc)Node".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the following connection to a clustered ONTAP system:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$credentials = get-credential&lt;BR /&gt;$controller = Connect-NcController –Name na-test-cl1 -Credential $credentials -https&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I am confused why these three actions work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get-ncclusternode | get-ncdisk&lt;BR /&gt;get-ncnode | get-ncdisk&lt;BR /&gt;get-ncdisk -Controller $controller&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while putting the clustername (without using a variablename) on the commandline like this doesn't work "as I would expect":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get-ncdisk -Controller na-test-cl1&lt;/P&gt;
&lt;P&gt;Returns:&lt;/P&gt;
&lt;P&gt;get-ncdisk : Incorrect credentials for na-test-cl1.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ get-ncdisk -Controller na-test-cl1&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : InvalidOperation: (na-test-cl1:NcController) [Get-NcDisk], NaAuthException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Disk.GetNcDisk&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More specifically, I get from piping the output of get-ncclusternode and get-ncnode to Get-Member that &lt;BR /&gt;they return objects of types DataONTAP.C.Types.Cluster.ClusterNodeInfo and DataONTAP.C.Types.System.NodeDetailsInfo respectively.&lt;BR /&gt;$controller is of type NetApp.Ontapi.Filer.C.NcController&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How/why does get-ncdisk figure out how to&amp;nbsp;return disk information from three different object types, yet it doesn't understand a literal such as na-test-cl1 ?&lt;BR /&gt;So the values passed to "-Controller" and "-NodeName" must always be object instances ?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Lastly, I am trying to achieve the following:&lt;/P&gt;
&lt;P&gt;I would like to go over a cluster's nodes and create an excel file per HA pair, containing the shelf info and disk info for that HA pair.&lt;BR /&gt;I want an excel file per HA pair in the cluster, not per node.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How do I go about filtering out the HA pair info ?&lt;/P&gt;
&lt;P&gt;I can get the nodes in the cluster via:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$nodes = Get-NcclusterNode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I can get a node's HA partner like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$partner = get-ncclusterhapartner -node $node&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but what would be the recommended PowerShell way filter out partner nodes to avoid going over both nodes of an HA pair in a cluster when looking up the shelf &amp;amp; disk info ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I am coming from a Perl scripting background so I guess getting my head around an object based approach is what's going to be the biggest challenge).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for answering one or two questions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jul 2018 16:34:04 GMT</pubDate>
    <dc:creator>uptimenow</dc:creator>
    <dc:date>2018-07-27T16:34:04Z</dc:date>
    <item>
      <title>Some newbie questions on Controllers, Nodes, object types and filtering out nodes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Some-newbie-questions-on-Controllers-Nodes-object-types-and-filtering-out-nodes/m-p/141764#M5834</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am just getting started with PowerShell in general and the NetApp PowerShell toolkit, and I have a couple of newbie questions.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;From my first Powershell scripts, I understand that a Clustered ONTAP cluster is referred to as a "(Nc)Controller" and&lt;BR /&gt;the nodes as "(Nc)Node".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the following connection to a clustered ONTAP system:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$credentials = get-credential&lt;BR /&gt;$controller = Connect-NcController –Name na-test-cl1 -Credential $credentials -https&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I am confused why these three actions work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get-ncclusternode | get-ncdisk&lt;BR /&gt;get-ncnode | get-ncdisk&lt;BR /&gt;get-ncdisk -Controller $controller&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while putting the clustername (without using a variablename) on the commandline like this doesn't work "as I would expect":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get-ncdisk -Controller na-test-cl1&lt;/P&gt;
&lt;P&gt;Returns:&lt;/P&gt;
&lt;P&gt;get-ncdisk : Incorrect credentials for na-test-cl1.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ get-ncdisk -Controller na-test-cl1&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : InvalidOperation: (na-test-cl1:NcController) [Get-NcDisk], NaAuthException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Disk.GetNcDisk&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More specifically, I get from piping the output of get-ncclusternode and get-ncnode to Get-Member that &lt;BR /&gt;they return objects of types DataONTAP.C.Types.Cluster.ClusterNodeInfo and DataONTAP.C.Types.System.NodeDetailsInfo respectively.&lt;BR /&gt;$controller is of type NetApp.Ontapi.Filer.C.NcController&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How/why does get-ncdisk figure out how to&amp;nbsp;return disk information from three different object types, yet it doesn't understand a literal such as na-test-cl1 ?&lt;BR /&gt;So the values passed to "-Controller" and "-NodeName" must always be object instances ?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Lastly, I am trying to achieve the following:&lt;/P&gt;
&lt;P&gt;I would like to go over a cluster's nodes and create an excel file per HA pair, containing the shelf info and disk info for that HA pair.&lt;BR /&gt;I want an excel file per HA pair in the cluster, not per node.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How do I go about filtering out the HA pair info ?&lt;/P&gt;
&lt;P&gt;I can get the nodes in the cluster via:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$nodes = Get-NcclusterNode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I can get a node's HA partner like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$partner = get-ncclusterhapartner -node $node&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but what would be the recommended PowerShell way filter out partner nodes to avoid going over both nodes of an HA pair in a cluster when looking up the shelf &amp;amp; disk info ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I am coming from a Perl scripting background so I guess getting my head around an object based approach is what's going to be the biggest challenge).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for answering one or two questions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 16:34:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Some-newbie-questions-on-Controllers-Nodes-object-types-and-filtering-out-nodes/m-p/141764#M5834</guid>
      <dc:creator>uptimenow</dc:creator>
      <dc:date>2018-07-27T16:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Some newbie questions on Controllers, Nodes, object types and filtering out nodes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Some-newbie-questions-on-Controllers-Nodes-object-types-and-filtering-out-nodes/m-p/432925#M6514</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/7786"&gt;@uptimenow&lt;/a&gt;I know this probably wont help you, but maybe it will help someone else with the same question. I had the same thoughts regarding HA pairs and came up with this:&lt;/P&gt;&lt;PRE&gt;Get-NcNode | ForEach-Object {&lt;BR /&gt;[PSCustomObject]@{&lt;BR /&gt;Model = [String] $_.NodeModel&lt;BR /&gt;Nodes = @( $_.Node ) + @( ( Get-NcClusterHaPartner -Node $_.Node ).Partner ) | Sort-Object&lt;BR /&gt;}&lt;BR /&gt;} | Select-Object * -Unique&lt;/PRE&gt;&lt;P&gt;which will give you an object that lists the HA pairs:&lt;/P&gt;&lt;PRE&gt;Model Nodes&lt;BR /&gt;----- -----&lt;BR /&gt;FAS8040 {dc2-dot-01, dc2-dot-02}&lt;BR /&gt;FAS8200 {dc2-dot-03, dc2-dot-04}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which you could then use to do something like this:&lt;/P&gt;&lt;PRE&gt;Get-NcNode | ForEach-Object {&lt;BR /&gt;[PSCustomObject]@{&lt;BR /&gt;Model = [String] $_.NodeModel&lt;BR /&gt;Nodes = @( $_.Node ) + @( ( Get-NcClusterHaPartner -Node $_.Node ).Partner ) | Sort-Object&lt;BR /&gt;}&lt;BR /&gt;} | Select-Object * -Unique | ForEach-Object {&lt;BR /&gt;$_.Nodes | Select-Object -First 1 | ForEach-Object {&lt;BR /&gt;Get-NcShelf -Node $_&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;Which will let you run commands against the first controller in the pair ordered alphabetically. But I would like to point out that you technically could have different configurations on each controller so you may actually want to run against both controllers in the pair regardless... I would recommend running against both controllers and then using Group-Object based on a commonality instead (ShelfID or similar).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 19:20:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Some-newbie-questions-on-Controllers-Nodes-object-types-and-filtering-out-nodes/m-p/432925#M6514</guid>
      <dc:creator>maxxoverclocker</dc:creator>
      <dc:date>2022-03-10T19:20:49Z</dc:date>
    </item>
  </channel>
</rss>

