dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
609 stars 279 forks source link

Import Raid Profile With HotSpare Disk #233

Closed ddcdk closed 1 year ago

ddcdk commented 1 year ago

Hi, I try to import a Raid profile that contains virtual disks with dedicated hotspares. Once the import is made, the virtual disks are created but the hotspare disk is not assigned. To avoid a format issue in postdata, i have exported a running configuration, reset the raid config and tried to import the previous exported configuration. I try also using script "Set-ImportServerConfigurationProfileLocalFilenameREDFISH" unsuccessfully. The return result is "CompletedWithErrors", and the specific error is: { "Oem": { "Dell": { "@odata.type": "#DellManager.v1_0_0.ServerConfigurationProfileResults", "DisplayValue": "hotspare", "FQDD": "RAID.Integrated.1-1", "Name": "hotspare", "Status": "Failure" } }, "Severity": "Critical" } ... { "Message": "Unsupported Attribute Value for Attribute Name", "MessageID": "STOR042", "Oem": { "Dell": { "@odata.type": "#DellManager.v1_0_0.ServerConfigurationProfileResults", "DisplayValue": "RAIDHotSpareStatus", "FQDD": "RAID.Integrated.1-1", "Name": "RAIDHotSpareStatus", "NewValue": "Dedicated", "OldValue": "No", "Status": "Failure" } }, "Severity": "Critical" }

texroemer commented 1 year ago

Hi @ddcdk

Using Server Configuration Profile (SCP) feature to create VD and assign DHS, you must use attribute "RAIDdedicatedSpare" to assign the DHS within the VD FQDD node in the SCP file. Attribute "RAIDHotSpareStatus" can only be used for assigned a global hotspare, not dedicated which is why you received this error.

Example below of a SCP file which creates a RAID 1 and assigns DHS. I then apply the SCP file and completes successfully, creates the RAID with DHS assigned.

<SystemConfiguration> 
<Component FQDD="RAID.SL.3-1"> 
    <Component FQDD="Disk.Virtual.0:RAID.SL.3-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Unlocked</Attribute> 
        <Attribute Name="BootVD">False</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Default</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">Virtual Disk 0</Attribute> 
        <Attribute Name="Size">479559942144</Attribute> 
        <Attribute Name="StripeSize">512</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">2</Attribute> 
        <Attribute Name="RAIDTypes">RAID 1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.1:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="RAIDdedicatedSpare">Disk.Bay.3:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
    </Component> 
</Component> 
</SystemConfiguration> 

C:\Python310>python ImportSystemConfigurationLocalFilenameREDFISH.py -ip 192.168.0.120 -u root -p calvin --filename 2022-12-12_81150_export.xml --target RAID --shutdown-type Forced

- PASS, JID_708780000715 successfully created for ImportSystemConfiguration method

- INFO, "Importing Server Configuration Profile.", percent complete: 10
- INFO, "Waiting for the system to shut down.", percent complete: 20
- INFO, "Applying configuration changes.", percent complete: 20
- INFO, "Updating component configuration.", percent complete: 43
- INFO, "Staged component configuration is complete.", percent complete: 99
- PASS, job ID JID_708780000715 successfully marked completed

- Detailed configuration changes and job results for "JID_708780000715"

{'Message': 'The operation successfully completed.',
 'MessageID': 'SYS413',
 'Oem': {'Dell': {'@odata.type': '#DellManager.v1_0_0.ServerConfigurationProfileResults',
                  'DisplayValue': 'Virtual Disk 0',
                  'FQDD': 'RAID.SL.3-1',
                  'Name': 'Virtual Disk 0',
                  'NewValue': 'RAID 1,Solid State Disk 0:1:1,Solid State Disk '
                              '0:1:2,Virtual Disk Size in Bytes : '
                              '479559942144,Virtual Disk Stripe Size : 256 '
                              'Kb,Physical Disks per Span : 2',
                  'Status': 'Success'}},
 'Severity': 'OK'}
{'Message': 'The operation successfully completed.',
 'MessageID': 'SYS413',
 'Oem': {'Dell': {'@odata.type': '#DellManager.v1_0_0.ServerConfigurationProfileResults',
                  'DisplayValue': 'Solid State Disk 0:1:3',
                  'FQDD': 'RAID.SL.3-1',
                  'Name': 'Solid State Disk 0:1:3',
                  'NewValue': 'Dedicated',
                  'OldValue': 'No',
                  'Status': 'Success'}},
 'Severity': 'OK'}
{'Message': 'Successfully imported and applied Server Configuration Profile.',
 'MessageArgs': [],
 'MessageArgs@odata.count': 0,
 'MessageId': 'IDRAC.2.7.SYS053'}

- JID_708780000715 completed in: 0:06:44

Thanks Tex

ddcdk commented 1 year ago

Hi @texroemer, Thanks for your explanation. I figured out the issue, first i was setting the RaidHotSpareStatus attribute to Dedicated on the disk component under the enclosure component. Your explanation made me change this, but the problem was still present. Why i have an error? Let say i have a Raid 1 configuration on disk 0 and disk 1 (Config A) and another on disk 3 and disk 4 (Config B) On "Config A" i have created two Virtual Disk, let say VirtualDisk.239 and VirtualDisk.238. On "Config B" I have created one Virtual Disk, let say VirtualDisk.237. I assign a hotspare disk to VirtualDisk.239. This is the interesting part, as in the IDrac Web interface i have to assign a hotspare disk to a virtual disk (for dedicated hotspares) and not to a raid configuration as this concept does not exist in the interface. Then assigning a hotspare disk to VirtualDisk.239 also assign this hotspare disk to VirtualDisk.238 as these two virtual disks are in the same raid configuration "Config A". Once i export this configuration i see this in the export file :

<Component FQDD="Disk.Virtual.239:RAID.Integrated.1-1">
    <Attribute Name="RAIDaction">Create</Attribute>
    <Attribute Name="LockStatus">Unlocked</Attribute>
    <Attribute Name="BootVD">True</Attribute>
    <Attribute Name="isPassthru">False</Attribute>
    <Attribute Name="RAIDinitOperation">None</Attribute>
    <Attribute Name="DiskCachePolicy">Enabled</Attribute>
    <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute>
    <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute>
    <Attribute Name="Name">Virtual Disk239</Attribute>
    <Attribute Name="Size">107374182400</Attribute>
    <Attribute Name="StripeSize">256</Attribute>
    <Attribute Name="SpanDepth">1</Attribute>
    <Attribute Name="SpanLength">2</Attribute>
    <Attribute Name="RAIDTypes">RAID 1</Attribute>
    <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    <Attribute Name="RAIDdedicatedSpare">Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
</Component>
<Component FQDD="Disk.Virtual.238:RAID.Integrated.1-1">
    <Attribute Name="RAIDaction">Create</Attribute>
    <Attribute Name="LockStatus">Unlocked</Attribute>
    <Attribute Name="BootVD">False</Attribute>
    <Attribute Name="isPassthru">False</Attribute>
    <Attribute Name="RAIDinitOperation">None</Attribute>
    <Attribute Name="DiskCachePolicy">Enabled</Attribute>
    <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute>
    <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute>
    <Attribute Name="Name">Virtual Disk238</Attribute>
    <Attribute Name="Size">107374182400</Attribute>
    <Attribute Name="StripeSize">256</Attribute>
    <Attribute Name="SpanDepth">1</Attribute>
    <Attribute Name="SpanLength">2</Attribute>
    <Attribute Name="RAIDTypes">RAID 1</Attribute>
    <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    <Attribute Name="RAIDdedicatedSpare">Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
</Component>

Physical disk 2 is set as "RAIDdedicatedSpare" for the two virtual disks which is the right thing, but this is the reason for the error. On the import process the physical disk 2 must be set on only one Virtual Disk. These means that the result of the export command cannot be reused as this.

May be the export command should reflect this or may be the import command has to take this into account. I have not found any documentation explaining this.

Regards, Delfim.

texroemer commented 1 year ago

Thanks for these details which helped figured out the issue. You're using VD slicing where the same drives are being used to create multiple VDs. When you assign DHS to one of the sliced VDs, PERC will automatically assign DHS to the other sliced VDs since they are leveraging the same drives.

Now for the SCP import issue, iDRAC is reading the SCP file and tries to assign DHS to both volumes using the same disk which is not supported and fails. For one of the VD nodes in the SCP file, as a workaround you need to comment out "RAIDdedicatedSpare" attribute and SCP import job will now complete successfully.

Example of SCP file failing:

<SystemConfiguration>  
<Component FQDD="RAID.SL.3-1"> 
    <Component FQDD="Disk.Virtual.0:RAID.SL.3-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Unlocked</Attribute> 
        <Attribute Name="BootVD">False</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Default</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">VirtualDisk0</Attribute> 
        <Attribute Name="Size">107374182400</Attribute> 
        <Attribute Name="StripeSize">512</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">2</Attribute> 
        <Attribute Name="RAIDTypes">RAID 1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="RAIDdedicatedSpare">Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
    </Component> 
    <Component FQDD="Disk.Virtual.1:RAID.SL.3-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Unlocked</Attribute> 
        <Attribute Name="BootVD">False</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Default</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">VirtualDisk1</Attribute> 
        <Attribute Name="Size">107374182400</Attribute> 
        <Attribute Name="StripeSize">512</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">2</Attribute> 
        <Attribute Name="RAIDTypes">RAID 1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <!Attribute Name="RAIDdedicatedSpare">Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
    </Component> 
</Component> 
</SystemConfiguration> 

Example of SCP file passing:

<SystemConfiguration>  
<Component FQDD="RAID.SL.3-1"> 
    <Component FQDD="Disk.Virtual.0:RAID.SL.3-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Unlocked</Attribute> 
        <Attribute Name="BootVD">False</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Default</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">VirtualDisk0</Attribute> 
        <Attribute Name="Size">107374182400</Attribute> 
        <Attribute Name="StripeSize">512</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">2</Attribute> 
        <Attribute Name="RAIDTypes">RAID 1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="RAIDdedicatedSpare">Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
    </Component> 
    <Component FQDD="Disk.Virtual.1:RAID.SL.3-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Unlocked</Attribute> 
        <Attribute Name="BootVD">False</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Default</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">VirtualDisk1</Attribute> 
        <Attribute Name="Size">107374182400</Attribute> 
        <Attribute Name="StripeSize">512</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">2</Attribute> 
        <Attribute Name="RAIDTypes">RAID 1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute> 
        <!--Attribute Name="RAIDdedicatedSpare">Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.3-1</Attribute--> 
    </Component> 
</Component> 
</SystemConfiguration> 

Ideally you shouldn't have to be modifying the SCP file and import should pass with no issues. I already escalated this concern to an internal iDRAC team at Dell to make a behavioral change for a future iDRAC release (iDRAC should detect when same disk is used for DHS across multiple volumes to only list it for one volume in the SCP file).

Thanks Tex

ddcdk commented 1 year ago

Hi @texroemer,

Thanks for your help.