dell / iDRAC-Redfish-Scripting

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

Multiple VirtualDisks defined before running job with CreateVirtualDiskREDFISH.py #81

Closed nick0333 closed 4 years ago

nick0333 commented 5 years ago

Hello Tex,

I'm using the VirtualDisk creation logic from your CreateVirtualDiskREDFISH.py script to manage raid/vdisks across racks. The only downside is the time it takes when using this method for multiple vdisks. Is it feasible to define multiple vdisks on a server before running a job to create them to speed up the process. Say if we have 5-10 vdisks in a server. Any recommendations greatly appreciated.

Thanks! Nick

6str commented 5 years ago

Hi,

a different approach could be using an SCP file, for each class of server, to configure the disks. That should do it all in one go and mean just one reboot. using setImportServerConfigurationProfileLocalFilenameREDFISH

I've decided to go this way with our servers. one SCP file for all the common entries (about 90% of the config), a few per host entries with scripted logic, and the servers class entries which, for me currently, is just the disk config.

The downside is that you have to prepare an SCP file for each calls of server, but that's trivial and quite good, in a way, too. If someone wants to change the disk configuration, they can create and use different SCP files, which might be preferable to messing with your script.

Phill

On Thu, 31 Oct 2019 at 16:23, nick0333 notifications@github.com wrote:

Hello Tex,

I'm using the VirtualDisk creation logic from your CreateVirtualDiskREDFISH.py script to manage raid/vdisks across racks. The only downside is the time it takes when using this method for multiple vdisks. Is it feasible to define multiple vdisks before running a job to create them to speed up the process. Say if we have 5-10 vdisks in a server. Any recommendations greatly appreciated.

Thanks! Nick

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dell/iDRAC-Redfish-Scripting/issues/81?email_source=notifications&email_token=ANO5ZC6X34RGSBWLZCQOIG3QRMBARA5CNFSM4JHM6NB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HV26UKQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZCYWNHTP6WZSQXJO27TQRMBARANCNFSM4JHM6NBQ .

texroemer commented 5 years ago

Hi @nick0333

What @6str stated is correct. Redfish DMTF doesn't allow you to stack creating multiple VDs at once for one POST call. Once you execute the POST call to create a VD, a job will immediately get created and run to create the volume. But OEM Server Configuration Profile (SCP) feature can be used to stack creating multiple VDs on a server with one POST call.

Example below is an SCP file where it will create (2) RAID 0 volumes and (1) RAID 1 volume using one POST call. If you don't want a specific volume size, pass in a value of 0 for Size property which the iDRAC will create the volume using all disk space. In the SCP file example also, you will notice i have RAIDresetConfig attribute set to True. This will be destructive and clear any VDs currently on the server if detected first before creating the RAID volumes. If you don't want to delete current RAID volumes, make sure to set this attribute to False.

`<SystemConfiguration Model="PowerEdge C6420" ServiceTag="M536C3S" TimeStamp="Wed Nov  6 19:52:13 2019"> 
<!--Export type is Clone,XML,Selective--> 
<!--Exported configuration may contain commented attributes. Attributes may be commented due to dependency, destructive nature, preserving server identity or for security reasons.--> 
<Component FQDD="RAID.Mezzanine.1-1"> 
    <Attribute Name="RAIDresetConfig">True</Attribute> 
    <Attribute Name="RAIDforeignConfig">Clear</Attribute> 
    <Attribute Name="CurrentControllerMode">RAID</Attribute> 
    <Attribute Name="RAIDrekey">False</Attribute> 
    <Attribute Name="EncryptionMode">Local Key Management</Attribute> 
    <!-- <Attribute Name="KeyID">localkey</Attribute>--> 
    <!-- <Attribute Name="OldControllerKey">******</Attribute>--> 
    <!-- <Attribute Name="NewControllerKey">******</Attribute>--> 
    <Attribute Name="RAIDprMode">Manual</Attribute> 
    <Attribute Name="RAIDPatrolReadUnconfiguredArea">Enabled</Attribute> 
    <Attribute Name="RAIDloadBalancedMode">Automatic</Attribute> 
    <Attribute Name="RAIDccMode">Stop on Error</Attribute> 
    <Attribute Name="RAIDcopybackMode">On</Attribute> 
    <Attribute Name="RAIDpersistentHotspare">Disabled</Attribute> 
    <Attribute Name="RAIDControllerBootMode">Continue Boot On Error</Attribute> 
    <Attribute Name="RAIDEnhancedAutoImportForeignConfig">Disabled</Attribute> 
    <Attribute Name="RAIDrebuildRate">0</Attribute> 
    <Attribute Name="RAIDbgiRate">12</Attribute> 
    <Attribute Name="RAIDccRate">31</Attribute> 
    <Attribute Name="RAIDreconstructRate">30</Attribute> 
    <Component FQDD="Disk.Virtual.0:RAID.Mezzanine.1-1"> 
        <Attribute Name="RAIDaction">Create</Attribute> 
        <Attribute Name="LockStatus">Locked</Attribute> 
        <Attribute Name="BootVD">True</Attribute> 
        <Attribute Name="RAIDinitOperation">None</Attribute> 
        <Attribute Name="DiskCachePolicy">Disabled</Attribute> 
        <Attribute Name="RAIDdefaultWritePolicy">WriteBack</Attribute> 
        <Attribute Name="RAIDdefaultReadPolicy">ReadAhead</Attribute> 
        <Attribute Name="Name">Virtual Disk 0</Attribute> 
        <Attribute Name="Size">0</Attribute> 
        <Attribute Name="StripeSize">128</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.Mezzanine.1-1</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.2:Enclosure.Internal.0-1:RAID.Mezzanine.1-1</Attribute> 
    </Component> 
    <Component FQDD="Disk.Virtual.1:RAID.Mezzanine.1-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 1</Attribute> 
        <Attribute Name="Size">0</Attribute> 
        <Attribute Name="StripeSize">128</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">1</Attribute> 
        <Attribute Name="RAIDTypes">RAID 0</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.3:Enclosure.Internal.0-1:RAID.Mezzanine.1-1</Attribute> 
    </Component> 
    <Component FQDD="Disk.Virtual.2:RAID.Mezzanine.1-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 2</Attribute> 
        <Attribute Name="Size">0</Attribute> 
        <Attribute Name="StripeSize">128</Attribute> 
        <Attribute Name="SpanDepth">1</Attribute> 
        <Attribute Name="SpanLength">1</Attribute> 
        <Attribute Name="RAIDTypes">RAID 0</Attribute> 
        <Attribute Name="IncludedPhysicalDiskID">Disk.Bay.4:Enclosure.Internal.0-1:RAID.Mezzanine.1-1</Attribute> 
    </Component> 
    <Component FQDD="Enclosure.Internal.0-1:RAID.Mezzanine.1-1"> 
        <Component FQDD="Disk.Bay.0:Enclosure.Internal.0-1:RAID.Mezzanine.1-1"> 
            <Attribute Name="RAIDHotSpareStatus">No</Attribute> 
            <Attribute Name="RAIDPDState">Ready</Attribute> 
        </Component> 
        <Component FQDD="Disk.Bay.2:Enclosure.Internal.0-1:RAID.Mezzanine.1-1"> 
            <Attribute Name="RAIDHotSpareStatus">No</Attribute> 
            <Attribute Name="RAIDPDState">Ready</Attribute> 
        </Component> 
        <Component FQDD="Disk.Bay.3:Enclosure.Internal.0-1:RAID.Mezzanine.1-1"> 
            <Attribute Name="RAIDHotSpareStatus">No</Attribute> 
            <Attribute Name="RAIDPDState">Ready</Attribute> 
        </Component> 
        <Component FQDD="Disk.Bay.4:Enclosure.Internal.0-1:RAID.Mezzanine.1-1"> 
            <Attribute Name="RAIDHotSpareStatus">No</Attribute> 
            <Attribute Name="RAIDPDState">Ready</Attribute> 
        </Component> 
    </Component> 
    <Attribute Name="RAIDremoveControllerKey">False</Attribute> 
</Component> 
</SystemConfiguration> 
`
nick0333 commented 4 years ago

Thanks Phil & Tex for the updates. I've tried to stay away from SCP for raid config due to reboot requirement but it may ultimately be the way to go since I need to set Advanced properties on the VDs...

Is there an option to set Advanced properties "Read Policy" and "Write Policy" via redfish API without having to use SCP & reboot on iDRAC9? It doesn't seem to be there in the Settings options. If not, is this something that may be enabled in a future iDRAC release?

Any feedback appreciated! :)

Nick

texroemer commented 4 years ago

Hi @nick0333

Currently the only way to set individual RAID VD / controller attributes using Redfish is OEM SCP feature. But there is a plan to add this support in future iDRAC release for next year.

As a workaround, you could use RACADM CLI to stack creating multiple RAID volumes and set VD / controller attributes in real time with no server reboot.