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

VirtualDiskTargetID is not preserved #258

Closed ddcdk closed 1 year ago

ddcdk commented 1 year ago

Hi, I have a scp file for raid configuration with several Virtual Disks as this :

<?xml version="1.0" encoding="utf-8"?>
<SystemConfiguration Model="PowerEdge R350" ServiceTag="16TJYP3" TimeStamp="Fri Jun  2 15:05:52 2023">
  <Component FQDD="RAID.Integrated.1-1">
    <Attribute Name="RAIDresetConfig">True</Attribute>
    <Attribute Name="RAIDforeignConfig">Clear</Attribute>
    <Attribute Name="RAIDrekey">False</Attribute>
    <Attribute Name="EncryptionMode">None</Attribute>
    <Attribute Name="EncryptionCapability">Not Capable</Attribute>
    <Attribute Name="SupportsLKMtoSEKMTransition">Yes</Attribute>
    <Attribute Name="RAIDprMode">Automatic</Attribute>
    <Attribute Name="RAIDPatrolReadUnconfiguredArea">Enabled</Attribute>
    <Attribute Name="RAIDloadBalancedMode">Automatic</Attribute>
    <Attribute Name="RAIDccMode">Normal</Attribute>
    <Attribute Name="RAIDcopybackMode">On</Attribute>
    <Attribute Name="RAIDpersistentHotspare">Disabled</Attribute>
    <Attribute Name="RAIDEnhancedAutoImportForeignConfig">Disabled</Attribute>
    <Attribute Name="RAIDrebuildRate">30</Attribute>
    <Attribute Name="RAIDbgiRate">30</Attribute>
    <Attribute Name="RAIDccRate">30</Attribute>
    <Attribute Name="RAIDreconstructRate">30</Attribute>
    <Attribute Name="RAIDremoveControllerKey">False</Attribute>
    <Component FQDD="Disk.Virtual.239:RAID.Integrated.1-1">
      <Attribute Name="RAIDaction">Create</Attribute>
      <Attribute Name="BootVD">True</Attribute>
      <Attribute Name="RAIDinitOperation">None</Attribute>
      <Attribute Name="DiskCachePolicy">Default</Attribute>
      <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute>
      <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute>
      <Attribute Name="Name">System</Attribute>
      <Attribute Name="Size">230854492160</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.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>
    </Component>
    <Component FQDD="Disk.Virtual.238:RAID.Integrated.1-1">
      <Attribute Name="RAIDaction">Create</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">DATA</Attribute>
      <Attribute Name="Size">225485783040</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.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>
    </Component>
    <Component FQDD="Disk.Virtual.237:RAID.Integrated.1-1">
      <Attribute Name="RAIDaction">Create</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 Disk237</Attribute>
      <Attribute Name="Size">483183820800</Attribute>
      <Attribute Name="StripeSize">512</Attribute>
      <Attribute Name="SpanDepth">1</Attribute>
      <Attribute Name="SpanLength">3</Attribute>
      <Attribute Name="RAIDTypes">RAID 5</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    </Component>
    <Component FQDD="Disk.Virtual.236:RAID.Integrated.1-1">
      <Attribute Name="RAIDaction">Create</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">Test</Attribute>
      <Attribute Name="Size">23219666944</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.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>
    </Component>
    <Component FQDD="Disk.Virtual.235:RAID.Integrated.1-1">
      <Attribute Name="RAIDaction">Create</Attribute>
      <Attribute Name="BootVD">False</Attribute>
      <Attribute Name="RAIDinitOperation">None</Attribute>
      <Attribute Name="DiskCachePolicy">Default</Attribute>
      <Attribute Name="RAIDdefaultWritePolicy">WriteBackForce</Attribute>
      <Attribute Name="RAIDdefaultReadPolicy">AdaptiveReadAhead</Attribute>
      <Attribute Name="Name">Test2</Attribute>
      <Attribute Name="Size">214748364800</Attribute>
      <Attribute Name="StripeSize">512</Attribute>
      <Attribute Name="SpanDepth">1</Attribute>
      <Attribute Name="SpanLength">3</Attribute>
      <Attribute Name="RAIDTypes">RAID 5</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
      <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1</Attribute>
    </Component>
    <Component FQDD="Enclosure.Internal.0-1:RAID.Integrated.1-1">
      <Component FQDD="Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1">
        <Attribute Name="RAIDHotSpareStatus">No</Attribute>
        <Attribute Name="RAIDPDState">Ready</Attribute>
        <Attribute Name="Cryptographic Erase">False</Attribute>
      </Component>
      <Component FQDD="Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1">
        <Attribute Name="RAIDHotSpareStatus">No</Attribute>
        <Attribute Name="RAIDPDState">Ready</Attribute>
        <Attribute Name="Cryptographic Erase">False</Attribute>
      </Component>
      <Component FQDD="Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1">
        <Attribute Name="RAIDHotSpareStatus">No</Attribute>
        <Attribute Name="RAIDPDState">Ready</Attribute>
        <Attribute Name="Cryptographic Erase">False</Attribute>
      </Component>
      <Component FQDD="Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1">
        <Attribute Name="RAIDHotSpareStatus">No</Attribute>
        <Attribute Name="RAIDPDState">Ready</Attribute>
        <Attribute Name="Cryptographic Erase">False</Attribute>
      </Component>
      <Component FQDD="Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1">
        <Attribute Name="RAIDHotSpareStatus">No</Attribute>
        <Attribute Name="RAIDPDState">Ready</Attribute>
        <Attribute Name="Cryptographic Erase">False</Attribute>
      </Component>
    </Component>
  </Component>
</SystemConfiguration>

When i import this scp profile on a server that has 3 existing virtual disks (Id 238,238 and 237), these existing virtual disks are correctly deleted and IDs of the new created virtual specified in scp file are not preserved. The new virtual disk Ids are created as the previous Ids already exists and then the new IDs start with the value 236. If i reset the raid configuration before, the IDs are preserved.

Is this an expected behavior ? Should i reset raid config before apply a raid scp file ?

Regards, Delfim Da Costa

texroemer commented 1 year ago

Hi @ddcdk

Are the VD Ids 238, 238 and 237 or is this a typo? If yes how were you able to create two VDs with the same ID? If you still have a server with 2 same VD IDs can you send me "racadm storage get vdisks -o" output.

Thanks Tex

ddcdk commented 1 year ago

Hi @texroemer, Sorry it's a typo, existing IDs are 239,238 and 237.

Regards, Delfim.

texroemer commented 1 year ago

Thanks for confirming and i was able to repro this behavior. I already escalated this issue to internal teams at Dell and should get fixed in iDRAC release planned for this Sept.

As a workaround for now please run ResetConfigStorageREDFISH script first before you import the SCP file to get the VD index correct (starts at 239).

Thanks Tex

ddcdk commented 1 year ago

Thanks, Delfim.