Fujitsu PRIMERGY: Configuring RAID via iRMC REST API

Fujitsu published iRMC S4 REST API. With the latest firmware (version 8.4x), you can configure RAID via API. That means you don't need to bring up the RAID configuration utility to create logical drives on a new machine, or you can manage the RAID card and logical drives even though ServerView RAID does not support the OS you are using. This feature is good to have so you can replicate the same configuration to multiple servers at the same time.

I will explain how to create/delete logical drive(s) via iRMC REST API. As a prerequisite, iRMC firmware must be at 8.4x or later.
In the following example, I will use iRMC user ID: admin, iRMC user password: admin, and iRMC IP address: 192.168.10.80.

  1. Check if the RAID profile is already there.
  2. 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    $ curl -u admin:admin -H"Accept: application/json" -X GET -i http://192.168.10.80/rest/v1/Oem/eLCM/ProfileManagement/
    HTTP/1.1 200 OK
    Date: Fri, 28 Oct 2016 23:15:29 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:15:29 GMT
    Content-Length: 145
    Content-Type: application/json; charset=UTF-8
     
    {
      "Links":{
        "profileStore":[
          {
            "@odata.id":"rest\/v1\/Oem\/eLCM\/ProfileManagement\/HWConfigurationIrmc"
          }
        ]
      }
    }
    If the profile is not created yet, run the following to create it:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    HTTP/1.1 202 Accepted
    Date: Fri, 28 Oct 2016 22:57:05 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 22:57:05 GMT
    Content-Length: 154
    Content-Type: application/json; charset=UTF-8
    Location: rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc
     
    {
      "Session":{
        "Id":16,
        "Tag":"",
        "WorkSequence":"obtainProfileParameters",
        "Start":"",
        "Duration":0,
        "Status":"activated"
      }
    }
  3. Review the current configuration. The following example shows that there is one RAID card, and six physical SATA hard drives in slot 0, 1, 2, 4, 5, and 6 which are all 465GB drives. There is no logical drive configured.
  4. 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    $ curl -u admin:admin -H"Accept: application/json" -X GET -i http://192.168.10.80/rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc
    HTTP/1.1 200 OK
    Date: Fri, 28 Oct 2016 23:00:40 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:00:40 GMT
    Content-Length: 3881
    Content-Type: application/json; charset=UTF-8
    Content-disposition: attachment; filename="rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc";
     
    {
      "Server":{
        "HWConfigurationIrmc":{
          "Adapters":{
            "RAIDAdapter":[
              {
                "@AdapterId":"RAIDAdapter0",
                "@ConfigurationType":"Addressing",
                "PCIId":{
                  "Vendor":"1000",
                  "Device":"005B",
                  "ControllerIndex":0
                },
                "Features":{
                  "RaidLevel":"0,1,5,6,10,50,60",
                  "Stripe":{
                    "@Unit":"KB",
                    "#text":"8,16,32,64,128,256,512,1024"
                  },
                  "InitMode":"no,fast,slow",
                  "WriteMode":"WriteBack,WriteThrough,AlwaysWriteBack",
                  "ReadMode":"NoReadAhead,ReadAhead",
                  "CacheMode":"Direct,Cached",
                  "DiskCacheMode":"Enabled,Disabled,Unchanged"
                },
                "BGIRate":30,
                "MDCRate":30,
                "RebuildRate":30,
                "EnableCopyback":"Enabled",
                "EnableCopybackOnSMART":"Enabled",
                "EnableCopybackOnSSDSMART":"Enabled",
                "AutoRebuild":"Enabled",
                "PhysicalDisks":{
                  "PhysicalDisk":[
                    {
                      "@Number":"0",
                      "@Action":"None",
                      "Slot":0,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"1",
                      "@Action":"None",
                      "Slot":1,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"2",
                      "@Action":"None",
                      "Slot":2,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"4",
                      "@Action":"None",
                      "Slot":4,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"5",
                      "@Action":"None",
                      "Slot":5,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"6",
                      "@Action":"None",
                      "Slot":6,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    }
                  ]
                },
                "Arrays":null,
                "LogicalDrives":null
              }
            ]
          }
        }
      }
    }
  5. Create logical drive(s). I will create one RAID1 volume with two HDDs, and one RAID5 volume with the remaining four HDDs. To do this, you need to create a configuration file to send to iRMC. Then send a request to iRMC to create volumes.
    If you want to specify drive slots for each logical volume, you can do that. Read the API manual for details.
  6. 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    $ cat create_logical_drives.json
    {
      "Server":{
        "HWConfigurationIrmc":{
          "@Processing":"execute",
          "Adapters":{
            "RAIDAdapter":[
              {
                "@AdapterId":"RAIDAdapter0",
                "@ConfigurationType":"Addressing",
                "LogicalDrives":{
                  "LogicalDrive":[
                    {
                      "@Number":0,
                      "@Action":"Create",
                      "RaidLevel":"1"
                    },
                    {
                      "@Number":1,
                      "@Action":"Create",
                      "RaidLevel":"5"
                    }
                  ]
                },
              }
            ]
          },
          "@Version":"1.00"
        },
        "@Version":"1.01"
      }
    }
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    $ curl -u admin:admin -H"Accept: application/json" -X POST -i http://192.168.10.80/rest/v1/Oem/eLCM/ProfileManagement/set --data @create_logical_drives.json
    HTTP/1.1 202 Accepted
    Date: Fri, 28 Oct 2016 23:29:20 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:29:20 GMT
    Content-Length: 143
    Content-Type: application/json; charset=UTF-8
     
    {
      "Session":{
        "Id":17,
        "Tag":"",
        "WorkSequence":"applyProfile",
        "Start":"",
        "Duration":0,
        "Status":"activated"
      }
    }
  7. Wait for the request to be completed.
  8. Check the current session status.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    $ curl -u admin:admin -H"Accept: application/json" -X GET -i http://192.168.10.80/sessionInformation/17/status
    HTTP/1.1 200 OK
    Date: Fri, 28 Oct 2016 23:36:16 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:36:16 GMT
    Content-Length: 177
    Content-Type: application/json; charset=UTF-8
     
    {
      "Session":{
        "Id":17,
        "Tag":"",
        "WorkSequence":"applyProfile",
        "Start":"2016\/10\/28 16:30:00",
        "Duration":145,
        "Status":"terminated regularly"
      }
    }
    Check the current log.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    $ curl -u admin:admin -H"Accept: application/json" -X GET -i http://192.168.10.80/sessionInformation/17/log
    HTTP/1.1 200 OK
    Date: Fri, 28 Oct 2016 23:36:20 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:36:20 GMT
    Content-Length: 2510
    Content-Type: application/json; charset=UTF-8
    Content-disposition: attachment; filename="sessionInformation/17/log";
     
    {
      "SessionLog":{
        "Id":17,
        "Tag":"",
        "WorkSequence":"applyProfile",
        "Entries":{
          "Entry":[
            {
              "@date":"2016\/10\/28 16:29:20",
              "#text":"CreateSession: Session 'applyProfile' created with id 17"
            },
            {
              "@date":"2016\/10\/28 16:29:20",
              "#text":"AttachWorkSequence: Attached work sequence 'applyProfile' to session 17"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"LCMScheduler: Launch ApplyProfileParameters"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ValidateProfile: Profile successfully validated"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ApplyProfileParameters: Sub profile 'BiosConfig' not found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ApplyProfileParameters: Sub profile 'IrmcConfig' not found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ApplyProfileParameters: Sub profile 'AdapterConfigIrmc' not found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ApplyProfileParameters: Sub profile 'OSInstallation' not found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"ApplyProfileParameters: Sub profile 'HWConfiguration' not found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"FindSubProfile: Sub profile 'HWConfigurationIrmc' found"
            },
            {
              "@date":"2016\/10\/28 16:30:00",
              "#text":"LOG-1-HWConfigurationIrmc: Start processing of Sub profile 'HWConfigurationIrmc'"
            },
            {
              "@date":"2016\/10\/28 16:32:14",
              "#text":"createLogicalDrive: drv[0] Create Drive [RAID Level = 1]"
            },
            {
              "@date":"2016\/10\/28 16:32:22",
              "#text":"createLogicalDrive: drv[1] Create Drive [RAID Level = 5]"
            },
            {
              "@date":"2016\/10\/28 16:32:25",
              "#text":"LOG-2-HWConfigurationIrmc-Success: Finished processing of Sub profile 'HWConfigurationIrmc' with status 'Success'"
            },
            {
              "@date":"2016\/10\/28 16:32:25",
              "#text":"LCMScheduler: LCM object is being destroyed as automatic termination was configured"
            },
            {
              "@date":"2016\/10\/28 16:32:25",
              "#text":"TerminateSession: 'applyProfile' is being terminated"
            }
          ]
        }
      }
    }
  9. Check if the logical drives are configured. You can see the status on iRMC Web GUI, or rescan the profile.
  10. Delete the current profile.
    1
    $ curl -u admin:admin -H"Accept: application/json" -X DELETE -i http://192.168.10.80/rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc
    Rescan the configuration. View the latest profile. As you can see, logical drive 0 (RAID 1) and logical drive 1 (RAID 5) are newly created.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    $ curl -u admin:admin -H"Accept: application/json" -X GET -i http://192.168.10.80/rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc
    HTTP/1.1 200 OK
    Date: Fri, 28 Oct 2016 23:51:08 GMT
    Server: iRMC S4 Webserver
    Expires: Thu, 27 Oct 2016 23:51:08 GMT
    Content-Length: 6625
    Content-Type: application/json; charset=UTF-8
    Content-disposition: attachment; filename="rest/v1/Oem/eLCM/ProfileManagement/HWConfigurationIrmc";
     
    {
      "Server":{
        "HWConfigurationIrmc":{
          "Adapters":{
            "RAIDAdapter":[
              {
                "@AdapterId":"RAIDAdapter0",
                "@ConfigurationType":"Addressing",
                "PCIId":{
                  "Vendor":"1000",
                  "Device":"005B",
                  "ControllerIndex":0
                },
                "Features":{
                  "RaidLevel":"0,1,5,6,10,50,60",
                  "Stripe":{
                    "@Unit":"KB",
                    "#text":"8,16,32,64,128,256,512,1024"
                  },
                  "InitMode":"no,fast,slow",
                  "WriteMode":"WriteBack,WriteThrough,AlwaysWriteBack",
                  "ReadMode":"NoReadAhead,ReadAhead",
                  "CacheMode":"Direct,Cached",
                  "DiskCacheMode":"Enabled,Disabled,Unchanged"
                },
                "BGIRate":30,
                "MDCRate":30,
                "RebuildRate":30,
                "EnableCopyback":"Enabled",
                "EnableCopybackOnSMART":"Enabled",
                "EnableCopybackOnSSDSMART":"Enabled",
                "AutoRebuild":"Enabled",
                "Arrays":{
                  "Array":[
                    {
                      "@Number":0,
                      "@ConfigurationType":"Addressing",
                      "PhysicalDiskRefs":{
                        "PhysicalDiskRef":[
                          {
                            "@Number":"0"
                          },
                          {
                            "@Number":"1"
                          }
                        ]
                      }
                    },
                    {
                      "@Number":1,
                      "@ConfigurationType":"Addressing",
                      "PhysicalDiskRefs":{
                        "PhysicalDiskRef":[
                          {
                            "@Number":"2"
                          },
                          {
                            "@Number":"4"
                          },
                          {
                            "@Number":"5"
                          }
                        ]
                      }
                    }
                  ]
                },
                "LogicalDrives":{
                  "LogicalDrive":[
                    {
                      "@Number":0,
                      "@Action":"None",
                      "RaidLevel":"1",
                      "ArrayRefs":{
                        "ArrayRef":[
                          {
                            "@Number":0
                          }
                        ]
                      },
                      "WriteMode":"WriteThrough",
                      "ReadMode":"ReadAhead",
                      "CacheMode":"Direct",
                      "DiskCacheMode":"Disabled",
                      "Stripe":{
                        "@Unit":"KB",
                        "#text":64
                      },
                      "InitMode":"no",
                      "LDStatus":"Operational",
                      "Name":"LogicalDrive_0",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":1,
                      "@Action":"None",
                      "RaidLevel":"5",
                      "ArrayRefs":{
                        "ArrayRef":[
                          {
                            "@Number":1
                          }
                        ]
                      },
                      "WriteMode":"WriteThrough",
                      "ReadMode":"ReadAhead",
                      "CacheMode":"Direct",
                      "DiskCacheMode":"Disabled",
                      "Stripe":{
                        "@Unit":"KB",
                        "#text":64
                      },
                      "InitMode":"no",
                      "LDStatus":"Operational",
                      "Name":"LogicalDrive_1",
                      "Size":{
                        "@Unit":"GB",
                        "#text":930
                      }
                    }
                  ]
                },
                "PhysicalDisks":{
                  "PhysicalDisk":[
                    {
                      "@Number":"0",
                      "@Action":"None",
                      "Slot":0,
                      "PDStatus":"Operational",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"1",
                      "@Action":"None",
                      "Slot":1,
                      "PDStatus":"Operational",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"2",
                      "@Action":"None",
                      "Slot":2,
                      "PDStatus":"Operational",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"4",
                      "@Action":"None",
                      "Slot":4,
                      "PDStatus":"Operational",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"5",
                      "@Action":"None",
                      "Slot":5,
                      "PDStatus":"Operational",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    },
                    {
                      "@Number":"6",
                      "@Action":"None",
                      "Slot":6,
                      "PDStatus":"Available",
                      "Interface":"SATA",
                      "Type":"HDD",
                      "Vendor":"ATA",
                      "Product":"WDC WD5003ABYX-",
                      "Size":{
                        "@Unit":"GB",
                        "#text":465
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }

3 comments:

asddasasdsadsad said...

hi, thanks for this post. i am trying to delete the raid configuration. how to?
and not just one or n logical drives, i mean to clear all the configuration on all disks. do you have an idea ? thanks.

Unknown said...

Hi Masa -san,

I am truying create new RAID profile but I just got code 200 and nothing content when I get RAID profile via RESTfull API.

Please help clarify any changes in BIOS before create RAID profile.

I also sent your an email, please check and help me some comments.

Thanks
Trung

mgtechhead said...

Great blogpost - real gold - helped me alot to understand the way how to deal with json. I use Powershell - my first REST-Api Usage was writing Functions to manage Huawei Storage - check out my "blogger" mgtechhead . But as you manage here Fujistu iRMC - can you explain how to find the "network" properties they explain on page 40 - i can see WWNs on the irmc WebGui but cant find them per REST-API or CIM Client.

http://manuals.ts.fujitsu.com/file/13371/irmc-restful-spec-en.pdf

Good Bye, Folks!

As you may have heard, Fujitsu has completely discontinued Data Center Products and Solutions business in North America on April 1st, 2021. ...