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

Unable to set stripesize using CreateVirtualDiskREDFISH.py #182

Closed stranger12345678 closed 3 years ago

stranger12345678 commented 3 years ago

I get the following error, while trying to use stripesize argument. Without stripesize arg, it goes well.

CreateVirtualDiskREDFISH.py -ip xx.xx.xx.xx -u admin -p xxxxxx --name VD3 --stripesize 64 -C RAID.Slot.5-1 -D Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.5-1 -R 0 -V y

64 is a valid stripesize, also tried other values like 256, 512. All throws same error.

texroemer commented 3 years ago

Hi @stranger12345678

For stripe size, you need to pass in the value in bytes, not kilobytes. The script help text was incorrect which i have updated. See example below of creating a VD with stripe size 64KB, i passed in the value 65536 bytes.

C:\Python39>CreateVirtualDiskREDFISH.py -ip 192.168.0.120 -u root -p calvin -C RAID.Slot.5-1 -V y -D Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.5-1,Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.5-1 -R 0 --stripesize 65536

- PASS: POST command passed to create "RAID0" virtual disk, status code 202 returned

- PASS, "realtime" JID_328112040439 jid successfully created for create virtual disk
- PASS, realtime jid "JID_328112040439" successfully created. Server will apply the configuration changes in real time, no server reboot needed
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "1"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "99"
- INFO, JobStatus not completed, current status: "Job in progress.", percent complete: "99"

--- PASS, Final Detailed Job Status Results ---

ActualRunningStartTime: 2021-09-28T01:40:04
ActualRunningStopTime: 2021-09-28T01:41:26
CompletionTime: 2021-09-28T01:41:26
Description: Job Instance
EndTime: TIME_NA
Id: JID_328112040439
JobState: Completed
JobType: RealTimeNoRebootConfiguration
Message: Job completed successfully.
MessageId: PR19
Name: Configure: RAID.Slot.5-1
PercentComplete: 100
StartTime: 2021-09-28T01:40:04

C:\Python39>CreateVirtualDiskREDFISH.py -ip 192.168.0.120 -u root -p calvin -vv RAID.Slot.5-1

- Volume(s) detected for RAID.Slot.5-1 controller -

 - Detailed Volume information for Disk.Virtual.1:RAID.Slot.5-1 -

@Redfish.Settings: {'@odata.context': '/redfish/v1/$metadata#Settings.Settings', '@odata.type': '#Settings.v1_3_0.Settings', 'SettingsObject': {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Volumes/Disk.Virtual.1:RAID.Slot.5-1/Settings'}, 'SupportedApplyTimes': ['Immediate', 'OnReset', 'AtMaintenanceWindowStart', 'InMaintenanceWindowOnReset']}
@odata.context: /redfish/v1/$metadata#Volume.Volume
@odata.id: /redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Volumes/Disk.Virtual.1:RAID.Slot.5-1
@odata.type: #Volume.v1_4_0.Volume
Actions: {'#Volume.CheckConsistency': {'@Redfish.OperationApplyTimeSupport': {'@odata.type': '#Settings.v1_3_0.OperationApplyTimeSupport', 'SupportedValues': ['Immediate', 'OnReset']}, 'target': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Volumes/Disk.Virtual.1:RAID.Slot.5-1/Actions/Volume.CheckConsistency'}, '#Volume.Initialize': {'@Redfish.OperationApplyTimeSupport': {'@odata.type': '#Settings.v1_3_0.OperationApplyTimeSupport', 'SupportedValues': ['Immediate', 'OnReset']}, 'InitializeType@Redfish.AllowableValues': ['Fast', 'Slow'], 'target': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Volumes/Disk.Virtual.1:RAID.Slot.5-1/Actions/Volume.Initialize'}}
BlockSizeBytes: 512
CapacityBytes: 8000450330624
Description: Virtual Disk 1 on RAID Controller in Slot 5
Encrypted: False
EncryptionTypes: ['NativeDriveEncryption']
EncryptionTypes@odata.count: 1
Id: Disk.Virtual.1:RAID.Slot.5-1
Identifiers: []
Identifiers@odata.count: 0
Links: {'Drives': [{'@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Drives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.5-1'}, {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Drives/Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.5-1'}], 'Drives@odata.count': 2}
Name: Virtual Disk 1
@odata.context: /redfish/v1/$metadata#DellVirtualDisk.DellVirtualDisk
@odata.id: /redfish/v1/Systems/System.Embedded.1/Storage/RAID.Slot.5-1/Volumes/Disk.Virtual.1:RAID.Slot.5-1/Oem/Dell/DellVolumes/Disk.Virtual.1:RAID.Slot.5-1
@odata.type: #DellVirtualDisk.v1_2_0.DellVirtualDisk
BusProtocol: SAS
Cachecade: NonCachecadeVD
Description: An instance of DellVirtualDisk will have data specific to the Virtual Disks in the system.
DiskCachePolicy: Disabled
Id: Disk.Virtual.1:RAID.Slot.5-1
LastSystemInventoryTime: 2021-08-21T02:26:56+00:00
LastUpdateTime: 2021-08-20T19:26:01+00:00
LockStatus: Unlocked
MediaType: HardDiskDrive
Name: DellVirtualDisk
ObjectStatus: Current
OperationName: None
OperationPercentComplete: 0
PrimaryStatus: OK
RaidStatus: Online
ReadCachePolicy: ReadAhead
RemainingRedundancy: 0
SpanDepth: 1
SpanLength: 2
StartingLBAinBlocks: 0
**StripeSize: 64KB**
T10PIStatus: Disabled
VirtualDiskTargetID: 1
WriteCachePolicy: WriteBack
Operations: []
Operations@odata.count: 0
OptimumIOSizeBytes: 65536
RAIDType: RAID0
Health: OK
HealthRollup: OK
State: Enabled
VolumeType: NonRedundant
stranger12345678 commented 3 years ago

Thanks @texroemer That worked.

stranger12345678 commented 3 years ago

Hi @texroemer Also while exporting config using ExportSystemConfigurationLocalREDFISH.py, it says stripesize is 128, even though actual stripe size is 64KB. And 128 too comes as commented and don't see any other field in the exported config, which says stripesize is 64

cat /tmp/export | grep StripeSize

        <!-- <Attribute Name="StripeSize">128</Attribute>-->
        <!-- <Attribute Name="StripeSize">128</Attribute>-->
texroemer commented 3 years ago

Exporting server configuration profile (SCP feature), VD stripesize value will always report double of the actual value, reason you see 128 for 64kb. If you want to create a 64KB VD using SCP, you will need to pass in a value of 128 for StripeSize.

Here are the converted values which this attribute is pulled from WSMAN.

C:\Python39>winrm g http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDEnumeration?InstanceID=Disk.Virtual.0:RAID.SL.8-1:RAIDStripeSize -u:root -p:calvin -r:https://192.168.0.120/wsman -SkipCNcheck -SkipCAcheck -encoding:utf-8 -a:basic -SkipRevocationCheck
DCIM_RAIDEnumeration
    AttributeName = RAIDStripeSize
    CurrentValue = 128(64 KB)
    FQDD = Disk.Virtual.0:RAID.SL.8-1
    InstanceID = Disk.Virtual.0:RAID.SL.8-1:RAIDStripeSize
    IsReadOnly = true
    PendingValue = null
    PossibleValues = 0, 1(512 Bytes), 2(1 KB), 4(2 KB), 8(4 KB), 16(8 KB), 32(16 KB), 64(32 KB), 128(64 KB), 256(128 KB), 512(256 KB), 1024(512 KB), 2048(1024 KB), 4096(2048 KB), 8192(4096 KB), 16384(8192 KB), 32768(16384 KB)
stranger12345678 commented 3 years ago

Thanks @texroemer. Tried with 256 as well and its displays 512.