Server Management - Remote Server Management
1825780 Members
1979 Online
109687 Solutions
New Discussion

Re: Query: New-HPESALogicalDrive multiple logical drives within single RAID5 set

 
Todd Lauder
Occasional Contributor

New-HPESALogicalDrive multiple logical drives within single RAID5 set

Hi all,

I'm trying to create multiple logical drives within one RAID5 set using the PowerShell HPE SmartArray cmdlets. Doing this in the GUI is easy, but I'm struggling with the automation. It will create the first logical drive and then overwrite it with the second logical drive. Is there any way to create multiple logical drives in one RAID5 set? See code below.

Code:

$Servers= "Server1.domain.local"
$Credential=Get-Credential
ForEach ($Server in $Servers)
{
$SAConnection= Connect-HPESA -IP $Server -Credential $Credential -DisableCertificateAuthentication
$iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication
Start-Sleep -s 60
$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection
If ($HostPower.Power -eq "Off")
{
Set-HPEiLoServerPower -Connection $iLOConnection -Power on
}
Else
{
Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false
}
Start-Sleep -s 60
$ControllerConfiguration= Get-HPESAConfigurationStatus -Connection $SAConnection
$SlotNumber= $ControllerConfiguration.ConfigurationStatus.ControllerLocation
$LogicalDrive= Get-HPESALogicalDrive -Connection $SAConnection
$RemoveLogicalDrives= $LogicalDrive.LogicalDrive.VolumeUniqueIdentifier
ForEach ($RemoveLogicalDrive in $RemoveLogicalDrives)
{
Remove-HPESALogicalDrive -Connection $SAConnection -ControllerLocation $SlotNumber -VolumeUniqueIdentifier $RemoveLogicalDrive
}
Start-Sleep -s 60
$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection
If ($HostPower.Power -eq "Off")
{
Set-HPEiLoServerPower -Connection $iLOConnection -Power on
}
Else
{
Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false
}
Start-Sleep -s 30
$PhysicalDrives= Get-HPESAPhysicalDrive -Connection $SAConnection -ControllerLocation $SlotNumber
$PhysicalDrivesSorted= $PhysicalDrives.PhysicalDrive.Location | Sort-Object
$Drive0= $PhysicalDrivesSorted[0]
$Drive1= $PhysicalDrivesSorted[1]
$Drive2= $PhysicalDrivesSorted[2]
$Drive3= $PhysicalDrivesSorted[3]
New-HPESALogicalDrive -Connection $SAConnection -ControllerLocation $SlotNumber -LogicalDriveName LogicalDrive1 -Raid Raid5 -DataDrive @(,@("$Drive0","$Drive1","$Drive2","$Drive3")) -CapacityGiB 150
Start-Sleep -s 30
Set-HPEiLoServerPower -Connection $iLOConnection -Power Off
Start-Sleep -s 30
Set-HPEiLoServerPower -Connection $iLOConnection -Power On
Start-Sleep -s 120
New-HPESALogicalDrive -Connection $SAConnection -ControllerLocation $SlotNumber -LogicalDriveName LogicalDrive2 -Raid Raid5 -DataDrive @(,@("$Drive0","$Drive1","$Drive2","$Drive3")) -CapacityGiB -1
Start-Sleep -s 30
Set-HPEiLoServerPower -Connection $iLOConnection -Power Off
Start-Sleep -s 60
$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection
If ($HostPower.Power -eq "Off")
{
Set-HPEiLoServerPower -Connection $iLOConnection -Power on
}
Else
{
Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false
}
Disconnect-HPEiLO -Connection $iLOConnection
Disconnect-HPESA -Connection $SAConnection
}

 

Thanks,
Todd

3 REPLIES 3
support_s
System Recommended

Query: New-HPESALogicalDrive multiple logical drives within single RAID5 set

System recommended content:

1. HPE XP Storage RAID Manager Reference Guide (01.67.01)

2. HPE XP Storage RAID Manager Installation and Configuration User Guide (1.67.00)

 

Please click on "Thumbs Up/Kudo" icon to give a "Kudo".

 

Thank you for being a HPE valuable community member.


Accept or Kudo

Todd Lauder
Occasional Contributor

Re: Query: New-HPESALogicalDrive multiple logical drives within single RAID5 set

Hello - thank you for your response, but is on a Gen10 server, not XP storage device.

BPSingh
HPE Pro

Re: Query: New-HPESALogicalDrive multiple logical drives within single RAID5 set

Greetings!

It looks like New-HPESALogicalDrive is designed to create the initial OS logical drive. It will accept multiple objects to enable multiple Logical drives to be created on multiple iLO destinations, but not multiple drives to a single iLO destination.  The limitation is iLO REST will only accept a single Logical Drive creation operation at a time and purely for the purpose of creating the initial OS drive.

Having said that, I would advise you to log a support ticket so that this scenario of creating multiple logical drives can be tested further in the lab.



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo