<?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 Connecting and issueing commands to Multiple Storage Controllers Simulaneously in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36155#M1657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't tried it but what if you dumped (out-file) each scriptblock code into separate PS1 files then executed Start-Job on each PS1 file instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Oct 2011 16:12:44 GMT</pubDate>
    <dc:creator>joseconde</dc:creator>
    <dc:date>2011-10-14T16:12:44Z</dc:date>
    <item>
      <title>Connecting and issueing commands to Multiple Storage Controllers Simulaneously</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36150#M1656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script that connects to my all filers in a serial manner to gather information(volume space, aggr space, snapshots, etc....).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script takes a very long time to execute and I want to reduce the execution time by having it run in parallel.&amp;nbsp; I want to run the script in a thread for each controller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that the code in the thread executes until it tries to runs the code that connects to a storage controller.&amp;nbsp; From that point forward the thread is in a pepetual running state. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q:&amp;nbsp; Is it possible to have multiple threads each connected to a different storage controllers and running my script? If so what am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I have created ...... two different scriptblocks each one with code to connect to a different controller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo code below....&lt;/P&gt;&lt;P&gt;-----------------------------------&lt;/P&gt;&lt;P&gt;$thread1 = { connect to controller1 ; get all volnames ; dump volnames to log file1 }&lt;/P&gt;&lt;P&gt;$thread2 = { connect to controller2 ; get all volnames ; dump volnames to log file2 }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start-Job -Scriptblock $thread1&lt;/P&gt;&lt;P&gt;Start-Job -Scriptblock $thread2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wait for all Jobs to complete......&lt;/P&gt;&lt;P&gt;-----------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;connect to controller code.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$filer = "storagecontrollername"&lt;/P&gt;&lt;P&gt;$password = ConvertTo-SecureString "password" -AsPlainText -Force&lt;/P&gt;&lt;P&gt;$cred = New-Object -TypeName System.Manager.Automation.PSCredential -ArgumentList "root",$password&lt;/P&gt;&lt;P&gt;Connect-NaController $filer -Credential $cred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:44:00 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36150#M1656</guid>
      <dc:creator>elee</dc:creator>
      <dc:date>2025-06-05T06:44:00Z</dc:date>
    </item>
    <item>
      <title>Connecting and issueing commands to Multiple Storage Controllers Simulaneously</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36155#M1657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't tried it but what if you dumped (out-file) each scriptblock code into separate PS1 files then executed Start-Job on each PS1 file instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 16:12:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36155#M1657</guid>
      <dc:creator>joseconde</dc:creator>
      <dc:date>2011-10-14T16:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting and issueing commands to Multiple Storage Controllers Simulaneously</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36160#M1658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eugene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't tell if you are doing this from the pseudo code, but you need to import the DataONTAP module in each of the script blocks.&amp;nbsp; I tried this and got the expected results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PS C:\Users\Administrator&amp;gt; $thread1 = { ipmo Dataontap; connect-nacontroller 10.61.169.28; get-navol | out-file C:\log1.txt }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PS C:\Users\Administrator&amp;gt; $thread2 = { ipmo Dataontap; connect-nacontroller 10.61.169.29; get-navol | out-file C:\log2.txt }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PS C:\Users\Administrator&amp;gt; Start-Job -ScriptBlock $thread1 ; Start-Job -ScriptBlock $thread2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file log1.txt contained the volume listing for the first controller and log2.txt contained the volume listing for the second controller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;-Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 15:11:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36160#M1658</guid>
      <dc:creator>beam</dc:creator>
      <dc:date>2011-10-17T15:11:36Z</dc:date>
    </item>
    <item>
      <title>Connecting and issueing commands to Multiple Storage Controllers Simulaneously</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36164#M1659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simplify the code for connecting to the NetApp controllers by using the Add-NaCredential cmdlet.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you run this script once:&lt;/P&gt;&lt;P&gt;$filer = "storagecontrollername"&lt;/P&gt;&lt;P&gt;$password = ConvertTo-SecureString "password" -AsPlainText -Force&lt;/P&gt;&lt;P&gt;$cred = New-Object -TypeName System.Manager.Automation.PSCredential -ArgumentList "root",$password&lt;/P&gt;&lt;P&gt;Add-NaCredential -Controller "storagecontrollername" -Credential $cred&lt;/P&gt;&lt;P&gt;You can then run this script successfully (from the same Windows host while logged in as the same Windows user)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-NaController -Name "storagecontrollername"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 22:02:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36164#M1659</guid>
      <dc:creator>paleon</dc:creator>
      <dc:date>2011-10-28T22:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting and issueing commands to Multiple Storage Controllers Simulaneously</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36169#M1660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I created the below launch.ps1 script to launch filer specific scripts (each script only gets info from one controller) so that I can gather data from all my storage controllers at the same time and then write to individual log files for that storage controller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue right now is that the scripts launch but then stalls (no output to my log file) when calling on the Connect-NaController cmdlet.&amp;nbsp; From that point on nothing else is executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do to debug this issue?&amp;nbsp; Is thread safety an issue here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# --------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# PS script to launch all my scripts so they run in parallel&lt;/P&gt;&lt;P&gt;"Starting"&lt;/P&gt;&lt;P&gt;Get-Job | Remove-Job&lt;/P&gt;&lt;P&gt;$job1 = Start-Job -Filepath d:\scripts\filer1.ps1&lt;/P&gt;&lt;P&gt;$job2 = Start-Job -Filepath d:\scripts\filer2.ps1&lt;/P&gt;&lt;P&gt;$job3 = Start-Job -Filepath d:\scripts\filer3.ps1&lt;/P&gt;&lt;P&gt;$exit = $false&lt;/P&gt;&lt;P&gt;while ($exit -eq $false)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$a = @(Get-Job -State Running).count&lt;/P&gt;&lt;P&gt;"$a jobs are currently running."&lt;/P&gt;&lt;P&gt;if ($a -eq $true){$exit = $true}&lt;/P&gt;&lt;P&gt;sleep -Seconds 60&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;"Finished"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# ---------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# An example of the self contained scripts that are launched&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;function Connect2Filer&lt;/P&gt;&lt;P&gt;{ #code }&lt;/P&gt;&lt;P&gt;function GetDriveCountInformation&lt;/P&gt;&lt;P&gt;{ #code }&lt;/P&gt;&lt;P&gt;# MAIN&lt;/P&gt;&lt;P&gt;$filer = "ztop.somewhere.com"&lt;/P&gt;&lt;P&gt;$cs = Connect2Filer $filer&lt;/P&gt;&lt;P&gt;$dci = GetDriveCountInformation&lt;/P&gt;&lt;P&gt;$dci | out-file -filepath c:\temp\ztop.log -Append&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok ... guys I could not get the above code to work (XP and W2K3) and did not have the time to figureout why. I did a work around by replicating my scripts for each of my storage controllers. I then used a batch file to kick them all off so they would run in their own. Not pretty but it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kickoff.bat&lt;/P&gt;&lt;P&gt; ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;start "controller 1"&amp;nbsp; powershell .\myscript.controller1.ps1 &lt;/P&gt;&lt;P&gt;start "controller 2"&amp;nbsp; powershell .\myscript.controller2.ps1 &lt;/P&gt;&lt;P&gt;start "controller 3"&amp;nbsp; powershell .\myscript.controller3.ps1 &lt;/P&gt;&lt;P&gt;start "controller 4"&amp;nbsp; powershell .\myscript.controller4.ps1&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------- &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 21:27:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Connecting-and-issueing-commands-to-Multiple-Storage-Controllers-Simulaneously/m-p/36169#M1660</guid>
      <dc:creator>elee</dc:creator>
      <dc:date>2012-02-02T21:27:02Z</dc:date>
    </item>
  </channel>
</rss>

