<?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: Get-HPESAPhysicalDrive pipe to New-HPESALogicalDrive, syntax of Drive listing? in Server Management - Remote Server Management</title>
    <link>https://community.hpe.com/t5/server-management-remote-server/get-hpesaphysicaldrive-pipe-to-new-hpesalogicaldrive-syntax-of/m-p/7027985#M8251</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The syntax issue what you are facing is due to PowerShell wrong syntax. This is not related to the HPESmartArrayCmdlets module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The -DataDrive parameter of the Cmdlet New-HPESALogicalDrive accpets double dimension array, where as&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$physicalDrive.PhysicalDrive.location&lt;/PRE&gt;&lt;P&gt;return single &lt;SPAN&gt;dimension&amp;nbsp;&lt;/SPAN&gt;array&amp;nbsp; which leads to synatx error&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use following snippet and pass it to the -DataDrive&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$dataDrive = @(,$physicalDrive.PhysicalDrive.Location)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Dec 2018 04:53:21 GMT</pubDate>
    <dc:creator>GZahidi</dc:creator>
    <dc:date>2018-12-10T04:53:21Z</dc:date>
    <item>
      <title>Get-HPESAPhysicalDrive pipe to New-HPESALogicalDrive, syntax of Drive listing?</title>
      <link>https://community.hpe.com/t5/server-management-remote-server/get-hpesaphysicaldrive-pipe-to-new-hpesalogicaldrive-syntax-of/m-p/7027780#M8248</link>
      <description>&lt;P&gt;Quick question when trying to dynamically createa a RAID on a given server.&amp;nbsp; I want to get the list of physical drives, then in turn use that list (whatever it may be) to create a RAID from the list.&amp;nbsp; The code I have is as follows:&lt;/P&gt;&lt;PRE&gt;    $getslot = $connectsa | Get-HPESAControllerConfiguration
    $slot = $getslot.ControllerConfiguration.ControllerLocation
    $raidcard = $slot[0]
    $physicalDrive = $connectsa | Get-HPESAPhysicalDrive -ControllerLocation $raidcard&lt;/PRE&gt;&lt;P&gt;The above gets the drives connected to the HBA card that's in slot0. The output is:&lt;/P&gt;&lt;P class="p1"&gt;1I:1:1&lt;/P&gt;&lt;P class="p1"&gt;1I:1:2&lt;/P&gt;&lt;P class="p1"&gt;1I:1:3&lt;/P&gt;&lt;P class="p1"&gt;1I:1:4&lt;/P&gt;&lt;P class="p1"&gt;1I:1:5&lt;/P&gt;&lt;P class="p1"&gt;I then run:&lt;/P&gt;&lt;PRE&gt;   $driveslots = $physicalDrive.PhysicalDrive.location -join ','&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which gives me:&lt;/P&gt;&lt;P class="p1"&gt;"1I:1:1&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt;1I:1:2&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt;1I:1:3&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt;1I:1:4&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt;1I:1:5"&lt;/P&gt;&lt;P class="p1"&gt;However, when I take my $Driveslots and try to use it in the New-HPESALogicalDrive, it fails:&lt;/P&gt;&lt;PRE&gt;    $ConnectSA | New-HPESALogicalDrive -ControllerLocation $raidcard -Raid Raid5 -DataDrive $driveslots&lt;/PRE&gt;&lt;P class="p1"&gt;But the command fails saying it is not the correct syntax for the -DataDrive property.&lt;/P&gt;&lt;P class="p1"&gt;I have to manually enter the phsycal drives in the following format:&lt;/P&gt;&lt;PRE&gt;    $ConnectSA | New-HPESALogicalDrive -ControllerLocation $raidcard -Raid Raid5 -DataDrive @(,@("1I:1:1","1I:1:2","1I:1:3","1I:1:4","1I:1:5"))&lt;/PRE&gt;&lt;P class="p1"&gt;&lt;BR /&gt;How do I have to manipulate the $physicaldrive variable to get something that the New-HPESALogicalDrive command will recognize in the -DataDrive property?&amp;nbsp; I want to be able to create a RAID no matter what bay/box the drives are in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I don't see any examples in the guides or get-help explanations that show you how to get a drive list and turn that into a logical drive with the cmdlets.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 15:33:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-remote-server/get-hpesaphysicaldrive-pipe-to-new-hpesalogicaldrive-syntax-of/m-p/7027780#M8248</guid>
      <dc:creator>rookie1082</dc:creator>
      <dc:date>2018-12-07T15:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get-HPESAPhysicalDrive pipe to New-HPESALogicalDrive, syntax of Drive listing?</title>
      <link>https://community.hpe.com/t5/server-management-remote-server/get-hpesaphysicaldrive-pipe-to-new-hpesalogicaldrive-syntax-of/m-p/7027985#M8251</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The syntax issue what you are facing is due to PowerShell wrong syntax. This is not related to the HPESmartArrayCmdlets module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The -DataDrive parameter of the Cmdlet New-HPESALogicalDrive accpets double dimension array, where as&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$physicalDrive.PhysicalDrive.location&lt;/PRE&gt;&lt;P&gt;return single &lt;SPAN&gt;dimension&amp;nbsp;&lt;/SPAN&gt;array&amp;nbsp; which leads to synatx error&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use following snippet and pass it to the -DataDrive&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$dataDrive = @(,$physicalDrive.PhysicalDrive.Location)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 04:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-remote-server/get-hpesaphysicaldrive-pipe-to-new-hpesalogicaldrive-syntax-of/m-p/7027985#M8251</guid>
      <dc:creator>GZahidi</dc:creator>
      <dc:date>2018-12-10T04:53:21Z</dc:date>
    </item>
  </channel>
</rss>

