Server Management - Remote Server Management
1748161 Members
3746 Online
108758 Solutions
New Discussion

New-HPESALogicalDrive - DataDrive attribute does not processes the variable value

 
sahilmutha
Occasional Collector

New-HPESALogicalDrive - DataDrive attribute does not processes the variable value

I am using the New-HPESALogicalDrive to create the Logical Drive in DL360. As per the syntax for -DataDrive, I am using double dimension array for it. But it is not able to create the logical drive. Below is my code snippet.

$SA_PhysicalDrives = (Get-HPESAPhysicalDrive -Connection $Connect_SA -ControllerLocation $SA_ControllerLocation).PhysicalDrive.Location
$DrivesToBeAttached = @($SA_PhysicalDrives[0..($NoOfPhysicalDrives-1)]) # I am doing this, since $NoOfPhysicalDrives is a user input.
New-HPESALogicalDrive -Connection $Connect_SA -LogicalDriveName $LogicalDriveName -ControllerLocation $SA_ControllerLocation -Raid $RAID -DataDrive @(,$DrivesToBeAttached)
After running the command like this, when I do Get-HPESALogicalDrive, I get the output like below. Also after reboot of the server, the drive is deleted automatically.
ControllerLocation : Slot 0
ControllerModel    : HPE Smart Array P408i-a SR Gen10
LogicalDriveName   : VMware Boot Volume
Raid               : Raid1
DataDrive          : {<Objs Version="1.1.0.1" 
                     xmlns="http://schemas.microsoft.com/powershell/2004/04">
                       <S>1I:1:1</S>
                     </Objs>, <Objs Version="1.1.0.1" 
                     xmlns="http://schemas.microsoft.com/powershell/2004/04">
                       <S>1I:1:2</S>
                     </Objs>}
SpareDrive         : {}

 

But, when I run it without having a variable, it gives a proper output.

New-HPESALogicalDrive -Connection $Connect_SA -LogicalDriveName $LogicalDriveName -ControllerLocation $SA_ControllerLocation -Raid $RAID -DataDrive @(,@("1I:1:1","1I:1:2"))

Output:

ControllerLocation : Slot 0
ControllerModel    : HPE Smart Array P408i-a SR Gen10
LogicalDriveName   : VMware Boot Volume
Raid               : Raid1
DataDrive          : {1I:1:1, 1I:1:2}
SpareDrive         : {}

 

1 REPLY 1
Bunsol
HPE Pro

Re: New-HPESALogicalDrive - DataDrive attribute does not processes the variable value

Try creating array and logical drive from the SSA GUI(You can try online or offline method) and check if the array dissapears after a reboot or not.  This will help isolate the issue.

Make suure that the firmware and driver of the controller are updated to the latest


If you feel this was helpful please click the KUDOS! Thumbs below!
I am an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo