- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Remote Server Management
- >
- Get-HPESAPhysicalDrive pipe to New-HPESALogicalDri...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2018 06:46 AM - edited 12-07-2018 07:33 AM
12-06-2018 06:46 AM - edited 12-07-2018 07:33 AM
Quick question when trying to dynamically createa a RAID on a given server. 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. The code I have is as follows:
$getslot = $connectsa | Get-HPESAControllerConfiguration $slot = $getslot.ControllerConfiguration.ControllerLocation $raidcard = $slot[0] $physicalDrive = $connectsa | Get-HPESAPhysicalDrive -ControllerLocation $raidcard
The above gets the drives connected to the HBA card that's in slot0. The output is:
1I:1:1
1I:1:2
1I:1:3
1I:1:4
1I:1:5
I then run:
$driveslots = $physicalDrive.PhysicalDrive.location -join ','
Which gives me:
"1I:1:1,1I:1:2,1I:1:3,1I:1:4,1I:1:5"
However, when I take my $Driveslots and try to use it in the New-HPESALogicalDrive, it fails:
$ConnectSA | New-HPESALogicalDrive -ControllerLocation $raidcard -Raid Raid5 -DataDrive $driveslots
But the command fails saying it is not the correct syntax for the -DataDrive property.
I have to manually enter the phsycal drives in the following format:
$ConnectSA | New-HPESALogicalDrive -ControllerLocation $raidcard -Raid Raid5 -DataDrive @(,@("1I:1:1","1I:1:2","1I:1:3","1I:1:4","1I:1:5"))
How do I have to manipulate the $physicaldrive variable to get something that the New-HPESALogicalDrive command will recognize in the -DataDrive property? I want to be able to create a RAID no matter what bay/box the drives are in.
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2018 08:53 PM
12-09-2018 08:53 PM
SolutionHi,
The syntax issue what you are facing is due to PowerShell wrong syntax. This is not related to the HPESmartArrayCmdlets module.
The -DataDrive parameter of the Cmdlet New-HPESALogicalDrive accpets double dimension array, where as
$physicalDrive.PhysicalDrive.location
return single dimension array which leads to synatx error
Use following snippet and pass it to the -DataDrive
$dataDrive = @(,$physicalDrive.PhysicalDrive.Location)
I am a HPE Employee