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

Question: ChangePdStateREDFISH.py fails with the operation is not supported #232

Closed b4ldr closed 2 years ago

b4ldr commented 2 years ago

I have attempted to use this script to try and ofline a disk however i get the following error message

$ ./ChangePdStateREDFISH.py --convert offline --disk-fqdd Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1 -ip 10.193.1.218 -u root

- Argument -p not detected, pass in iDRAC user root password: 

- FAIL, POST command failed to change disk Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1 to offline, status code 400 returned

- POST command failure results:
 {'error': {'@Message.ExtendedInfo': [{'Message': 'Unable to complete the operation because either the Fully Qualified Device Descriptor (FQDD) entered did not match any virtual drive (VD), the physical drives available, or the operation is not supported on the physical drive (s).', 'MessageArgs': [], 'MessageArgs@odata.count': 0, 'MessageId': 'IDRAC.2.7.STOR009', 'RelatedProperties': [], 'RelatedProperties@odata.count': 0, 'Resolution': "Make sure of the following and retry the operation: 1) A physical drive or virtual drive with the FQDD entered exists. 2) The physical drive (s) supports the operation being tried. For more information about supported physical drives, see the iDRAC User's Guide available on the support site.", 'Severity': 'Warning'}], 'code': 'Base.1.12.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information'}}

The disk in questions is configured as follows. Are you able to provide any pointers on what i may be doing wrong.

{ '@odata.context': '/redfish/v1/$metadata#Drive.Drive',
  '@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Integrated.1-1/Drives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
  '@odata.type': '#Drive.v1_12_1.Drive',
  'Actions': { '#Drive.SecureErase': { '@Redfish.OperationApplyTimeSupport': { '@odata.type': '#Settings.v1_3_3.OperationApplyTimeSupport',
                                                                               'SupportedValues': [ 'Immediate',
                                                                                                    'OnReset']},
                                       'target': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Integrated.1-1/Drives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1/Actions/Drive.SecureErase'}},
  'Assembly': {'@odata.id': '/redfish/v1/Chassis/System.Embedded.1/Assembly'},
  'BlockSizeBytes': 512,
  'CapableSpeedGbs': 6,
  'CapacityBytes': 4000225165312,
  'Description': 'Disk 1 in Backplane 1 of Integrated RAID Controller 1',
  'EncryptionAbility': 'None',
  'EncryptionStatus': 'Unencrypted',
  'FailurePredicted': False,
  'HotspareType': 'None',
  'Id': 'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
  'Identifiers': [ { 'DurableName': 'redacted',
                     'DurableNameFormat': 'NAA'}],
  'Identifiers@odata.count': 1,
  'Links': { 'Chassis': { '@odata.id': '/redfish/v1/Chassis/Enclosure.Internal.0-1:RAID.Integrated.1-1'},
             'Oem': { 'Dell': { '@odata.type': '#DellOem.v1_3_0.DellOemLinks',
                                'CPUAffinity': [],
                                'CPUAffinity@odata.count': 0}},
             'PCIeFunctions': [],
             'PCIeFunctions@odata.count': 0,
             'Volumes': [ { '@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Integrated.1-1/Volumes/Disk.Virtual.3:RAID.Integrated.1-1'}],
             'Volumes@odata.count': 1},
  'Location': [],
  'LocationIndicatorActive': None,
  'Manufacturer': 'TOSHIBA',
  'MediaType': 'HDD',
  'Model': 'TOSHIBA MG04ACA4',
  'Name': 'Physical Disk 0:1:1',
  'NegotiatedSpeedGbs': 6,
  'Oem': { 'Dell': { '@odata.type': '#DellOem.v1_3_0.DellOemResources',
                     'DellPhysicalDisk': { '@odata.context': '/redfish/v1/$metadata#DellPhysicalDisk.DellPhysicalDisk',
                                           '@odata.id': '/redfish/v1/Systems/System.Embedded.1/Storage/RAID.Integrated.1-1/Drives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1/Oem/Dell/DellDrives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
                                           '@odata.type': '#DellPhysicalDisk.v1_6_0.DellPhysicalDisk',
                                           'AvailableSparePercent': None,
                                           'Certified': 'Yes',
                                           'Connector': 0,
                                           'CryptographicEraseCapable': 'Capable',
                                           'Description': 'An instance of '
                                                          'DellPhysicalDisk '
                                                          'will have Physical '
                                                          'Disk specific data.',
                                           'DeviceProtocol': None,
                                           'DeviceSidebandProtocol': None,
                                           'DriveFormFactor': '3.5Inch',
                                           'EncryptionProtocol': 'None',
                                           'ErrorDescription': None,
                                           'ErrorRecoverable': 'NotApplicable',
                                           'ForeignKeyIdentifier': None,
                                           'FreeSizeInBytes': 0,
                                           'Id': 'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
                                           'LastSystemInventoryTime': '2022-11-21T22:56:50+00:00',
                                           'LastUpdateTime': '2022-11-21T22:56:49+00:00',
                                           'ManufacturingDay': 0,
                                           'ManufacturingWeek': 0,
                                           'ManufacturingYear': 0,
                                           'Name': 'DellPhysicalDisk',
                                           'NonRAIDDiskCachePolicy': 'Unknown',
                                           'OperationName': 'None',
                                           'OperationPercentCompletePercent': 0,
                                           'PCIeCapableLinkWidth': 'None',
                                           'PCIeNegotiatedLinkWidth': 'None',
                                           'PPID': 'redacted',
                                           'PowerStatus': 'Spun-Up',
                                           'PredictiveFailureState': 'SmartAlertAbsent',
                                           'ProductID': None,
                                           'RAIDType': 'Unknown',
                                           'RaidStatus': 'Online',
                                           'SASAddress': 'redacted',
                                           'Slot': 1,
                                           'SystemEraseCapability': 'CryptographicErasePD',
                                           'T10PICapability': 'NotSupported',
                                           'UsedSizeInBytes': 4000225165312,
                                           'WWN': 'redacted'}}},
  'Operations': [],
  'Operations@odata.count': 0,
  'PartNumber': 'PH-095M6K-TB200-88B-3GF1-A01',
  'PhysicalLocation': { 'PartLocation': { 'LocationOrdinalValue': 1,
                                          'LocationType': 'Slot'}},
  'PredictedMediaLifeLeftPercent': 0,
  'Protocol': 'SATA',
  'Revision': 'FK3D',
  'RotationSpeedRPM': 7200,
  'SerialNumber': 'redacted',
  'Status': {'Health': 'OK', 'HealthRollup': 'OK', 'State': 'Enabled'},
  'WriteCacheEnabled': False}
texroemer commented 2 years ago

Hi @b4ldr

What type of RAID level is this disk assigned to? This feature only works on RAID levels which support fault tolerance. See example below where i bring a disk offline which is part of a RAID 1.

 C:\Python310>python ChangePdStateREDFISH.py -ip 192.168.0.120 -u root -p calvin --get-virtualdisks RAID.Mezzanine.1-1

- Volume(s) detected for RAID.Mezzanine.1-1 controller -

Disk.Virtual.0:RAID.Mezzanine.1-1, Volume type: NonRedundant
Disk.Virtual.1:RAID.Mezzanine.1-1, Volume type: Mirrored

C:\Python310>python ChangePdStateREDFISH.py -ip 192.168.0.120 -u root -p calvin --disk-fqdd Disk.Bay.9:Enclosure.Internal.0-1:RAID.Mezzanine.1-1 --convert offline
- PASS, POST command passed for ChangePDState action
- INFO, Job ID JID_690952012885 successfully created to change disk "Disk.Bay.9:Enclosure.Internal.0-1:RAID.Mezzanine.1-1" to "offline"
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."
- INFO, job status not completed, current status: "Job in progress."

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

@odata.context: /redfish/v1/$metadata#DellJob.DellJob
@odata.id: /redfish/v1/Managers/1/Oem/Dell/Jobs/JID_690952012885
@odata.type: #DellJob.v1_2_0.DellJob
ActualRunningStartTime: 2022-11-21T23:33:22
ActualRunningStopTime: 2022-11-21T23:34:44
CompletionTime: 2022-11-21T23:34:44
Description: Job Instance
EndTime: TIME_NA
Id: JID_690952012885
JobState: Completed
JobType: RealTimeNoRebootConfiguration
Message: Job completed successfully.
MessageArgs: []
MessageArgs@odata.count: 0
MessageId: PR19
Name: Configure: RAID.Mezzanine.1-1
PercentComplete: 100
StartTime: 2022-11-21T23:33:21
TargetSettingsURI: None
b4ldr commented 2 years ago

What type of RAID level is this disk assigned to? This feature only works on RAID levels which support fault tolerance.

Ahh i see that's the problem then. theses disks are all configured as NoneRaid to act in a JBOD fashion. i wanted to have some way to disable the disk in such away that it is not visible to the OS.

ill close this as invalid but if you have pointers on some action i could do to achieve the above that would be great :)

texroemer commented 2 years ago

Currently not supported from iDRAC, a way to disable non RAID drive but i'll escalate this request to iDRAC internal team at Dell, see if there are any future plans to add this support.

For a way to achieve this ask now could be to SSH to the OS and then run commands locally to bring a drive offline.

b4ldr commented 2 years ago

thanks for the confirmation that this is not the right way to go, will explore other solutions for now