<?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 Re: not able to bring the volume online. in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148430#M33039</link>
    <description>Thanks Sean.

You are right it needed a foreach loop.</description>
    <pubDate>Mon, 13 May 2019 08:49:47 GMT</pubDate>
    <dc:creator>Arjun_chris</dc:creator>
    <dc:date>2019-05-13T08:49:47Z</dc:date>
    <item>
      <title>not able to bring the volume online.</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148427#M33037</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying this code to bring the offline volumes to online state but i am seeing an error. Any help is much appriciated.&lt;/P&gt;
&lt;P&gt;#Verify the volume state&lt;/P&gt;
&lt;P&gt;$onlinevolumes = Get-NcVol&lt;/P&gt;
&lt;P&gt;$onlinevolumes&lt;/P&gt;
&lt;P&gt;if ($offlinevolumes = Get-NcVol |where {$_.State -ne "online"}) {&lt;/P&gt;
&lt;P&gt;Write-Host "Volumes found which is/are not in online state, non online volumes are:$offlinevolumes"&lt;/P&gt;
&lt;P&gt;$userresponse=Read-Host -Prompt "Press any to bring the volumes online"&lt;/P&gt;
&lt;P&gt;Set-NcVol ($offlinevolumes |select Name) -Online }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Else {Read-Host -Prompt "No non online volumes found,press any key yo continue"}&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;Set-NcVol : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;'Name'. Specified method is not supported.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;At line:13 char:11&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;+ Set-NcVol ($offlinevolumes |select Name) -Online }&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;+ CategoryInfo : InvalidArgument: (:) [Set-NcVol], ParameterBindingException&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;+ FullyQualifiedErrorId : CannotConvertArgument,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.Set &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;NcVol&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 12:33:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148427#M33037</guid>
      <dc:creator>Arjun_chris</dc:creator>
      <dc:date>2025-06-04T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: not able to bring the volume online.</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148428#M33038</link>
      <description>&lt;P&gt;I think you will need to loop through each volume for the Set-NcVol command. &amp;nbsp;That command is expecting a single volume, I believe. &amp;nbsp;You also don't need '|select Name' as part of the command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;foreach ($volume in $offlinevolumes) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Set-NcVol $volume -online&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**EDIT**&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You haven't defined $offlinevolumes before your if statement..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$offlinevolumes = Get-NcVol | where {$_state -ne "online"}&lt;/P&gt;
&lt;P&gt;Write-Host "Volumes found which is/are not in online state, non online volumes are:$offlinevolumes"&lt;/P&gt;
&lt;P&gt;$userresponse=Read-Host -Prompt "Press any to bring the volumes online"&lt;/P&gt;
&lt;P&gt;foreach ($volume in $offlinevolumes) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Set-NcVol $volume -Online&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 16:07:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148428#M33038</guid>
      <dc:creator>SeanLuce</dc:creator>
      <dc:date>2019-05-12T16:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: not able to bring the volume online.</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148430#M33039</link>
      <description>Thanks Sean.

You are right it needed a foreach loop.</description>
      <pubDate>Mon, 13 May 2019 08:49:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/not-able-to-bring-the-volume-online/m-p/148430#M33039</guid>
      <dc:creator>Arjun_chris</dc:creator>
      <dc:date>2019-05-13T08:49:47Z</dc:date>
    </item>
  </channel>
</rss>

