2

Context: I am trying to automated a preseeded Linux installation on a Redfish-capable server. Ideally I want to keep this as vendor-agnostic as possible so I can support multiple types of servers (i.e. Dell, HP, Cisco, etc.), but I am working on a Dell R430 (iDRAC 8 with the latest firmware).

Description: I'm trying to find some reliable way to take information on a storage volume from Redfish and map this to a block device that Linux can understand so I can tell my installer what device to install to.

Example: I take two drives and using Redfish create myself a RAID-1 array. I now have this "Volume" object:

{                                                          
    "@Redfish.Settings": {                                                                                             
        "@odata.context": "/redfish/v1/$metadata#Settings.Settings",                                                                                                                                                                           
        "@odata.type": "#Settings.v1_1_0.Settings",                                                                                                                                                                                            
        "SettingsObject": {                                
            "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/Volumes/Disk.Virtual.0:RAID.Integrated.1-1/Settings"
        },                                                 
        "SupportedApplyTimes": [
            "Immediate",                                   
            "OnReset",                                     
            "AtMaintenanceWindowStart",
            "InMaintenanceWindowOnReset"
        ]                                                  
    },                                                     
    "@odata.context": "/redfish/v1/$metadata#Volume.Volume",
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/Volumes/Disk.Virtual.0:RAID.Integrated.1-1",
    "@odata.type": "#Volume.v1_0_3.Volume",
    "Actions": {                                           
        "#Volume.CheckConsistency": {
            "target": "/redfish/v1/Systems/System.Embedded.1/Storage/Volumes/Disk.Virtual.0:RAID.Integrated.1-1/Actions/Volume.CheckConsistency"
        },                                                 
        "#Volume.Initialize": {
            "InitializeType@Redfish.AllowableValues": [
                "Fast",                                    
                "Slow"                                     
            ],                                             
            "target": "/redfish/v1/Systems/System.Embedded.1/Storage/Volumes/Disk.Virtual.0:RAID.Integrated.1-1/Actions/Volume.Initialize"
        }                                                  
    },                                                     
    "BlockSizeBytes": 512,                                 
    "CapacityBytes": 199447543808,
    "Description": "Virtual Disk 0",
    "Encrypted": false,                                    
    "EncryptionTypes": [                                   
        "NativeDriveEncryption"
    ],                                                     
    "Id": "Disk.Virtual.0:RAID.Integrated.1-1",
    "Identifiers": [],                                     
    "Links": {                                             
        "Drives": [                                        
            {                                              
                "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/Drives/Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1"
            },                                             
            {                                              
                "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/Drives/Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1"
            }                                              
        ],                                                 
        "Drives@odata.count": 2
    },
    "Name": "Virtual Disk 0",
    "Operations": [],                                      
    "OptimumIOSizeBytes": 65536,
    "Status": {                                            
        "Health": "OK",                                    
        "HealthRollup": "OK",
        "State": "Enabled"                                 
    },                                                     
    "VolumeType": "Mirrored"                               
}

Is there anything here that I can reliably use to figure out what the block device path will be in Linux? In this case, I know it is:

$ lsblk /dev/sdc
NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdc                 8:32   0 185.8G  0 disk 
$ ls -al /dev/disk/by-id/ | grep sdc
scsi-361866da08170ff0026091a95033dd20a
wwn-0x61866da08170ff0026091a95033dd20a
$ ls -al /dev/disk/by-path/ | grep sdc
pci-0000:01:00.0-scsi-0:2:0:0

But so far I see no obvious way to get from the Redfish output to any of those values. Is there perhaps some other identifier on the Linux side that might get me closer so I can work backwards? Or somewhere else in Redfish I can query for the PCIe path? I do know iDRAC 9 can provide PCIe paths at the Chassis level but iDRAC 8 can't, but even then they do not seem to map in any way to these in-Linux paths.

First Edit: I have looked into using various tools on the Linux side to interrogate the RAID controller (megacli, perccli, several wrapper Python scripts to these like megaclisas.py), but so far nothing here helps with the mapping problem.

Joshua Boniface
  • 324
  • 3
  • 14
  • I don't have access to a physical idrac but the [API guide](https://dl.dell.com/topicspdf/idrac9-lifecycle-controller-v4x-series_api-guide_en-us.pdf) for 9 says there is this endpoint: `/redfish/v1/Dell/Systems//Storage/Volumes/DellVirtualDisk/ ` One of which properties is: `VirtualDiskTargetID`. What does the return value look like for your case of `sdc`? – Yolo Perdiem Dec 21 '21 at 20:29
  • 1
    we use the size, serial number or disk type (sas/sata/nvme/etc) to map that info between ilo5 redfish and linux. With lsblk -o serial you get the same info as with the volumeuniqueidentifier attribute of the logical volume in the redfish api of the ilo5. I have no idea if this is the same in the idrac. – natxo asenjo Dec 22 '21 at 19:08
  • 1
    to elaborate a little bit, dell poweredges have a boss card for instance, which is a small ssd raid controller usually for the system drive on the operating system. With %pre actions on our foreman kickstarts we detect the boss disks (lsblk -o model,kname) and we use that as the root disk. For proliants I have other internal tool that checks sata and sas disks, and if both are available, then sata is for root, sas for data. That sort of choices. – natxo asenjo Dec 22 '21 at 19:24

0 Answers0