ironic raid 请求报文
url
http://< controllerIp >:6385/v1/nodes/< node_uuid >/states/raid
request method
- PUT
request header
- X-Auth-Token : token
- X-OpenStack-Ironic-API-Version : 1.22 (之前与运营约定过)
request body
- Mandatory properties. These properties must be specified for each logical disk and have no default values.
- size_gb- Size (Integer) of the logical disk to be created in GiB.- MAXmay be specified if the logical disk should use all of the remaining space available. This can be used only when backing physical disks are specified (see below).
- raid_level- RAID level for the logical disk. Ironic supports the following RAID levels: 0, 1, 2, 5, 6, 1+0, 5+0, 6+0.
- Optional properties. These properties have default values and they may be overridden in the specification of any logical disk.
- volume_name- Name of the volume. Should be unique within the Node. If not specified, volume name will be auto-generated.
- is_root_volume- Set to- trueif this is the root volume. At most one logical disk can have this set to- true; the other logical disks must have this set to- false. The- root device hintwill be saved, if the driver is capable of retrieving it. This is- falseby default.
- Backing physical disk hints. These hints are specified for each logical disk to let Ironic find the desired disks for RAID configuration. This is machine-independent information. This serves the use-case where the operator doesn’t want to provide individual details for each bare metal node.
- share_physical_disks- Set to- trueif this logical disk can share physical disks with other logical disks. The default value is- false.
- disk_type-- hddor- ssd. If this is not specified, disk type will not be a criterion to find backing physical disks.
- interface_type-- sataor- scsior- sas. If this is not specified, interface type will not be a criterion to find backing physical disks.
- number_of_physical_disks- Integer, number of disks to use for the logical disk. Defaults to minimum number of disks required for the particular RAID level.
- Backing physical disks. These are the actual machine-dependent information. This is suitable for environments where the operator wants to automate the selection of physical disks with a 3rd-party tool based on a wider range of attributes (eg. S.M.A.R.T. status, physical location). The values for these properties are hardware dependent.
- controller- The name of the controller as read by the driver.
- physical_disks- A list of physical disks to use as read by the driver.
json sample 报文样例
sda和sdb做raid5做系统盘:
{
  "logical_disks": [{
    "size_gb": 100,
    "raid_level": "5",
    "controller": "test",
    "physical_disks": ["sda", "sdb"],
    "is_root_volume": true
   }]
}
sda和sdb做raid0+1,做系统盘,sdc、sdd和sde做raid5:
{
  "logical_disks":
    [
      {
        "size_gb": 50,
        "raid_level": "1+0",
        "controller": "RAID.Integrated.1-1",
        "is_root_volume": true,
        "physical_disks": [
                           "sda",
                           "sdb"
                          ]
      },
      {
        "size_gb": 100,
        "raid_level": "5",
        "controller": "RAID.Integrated.1-1",
        "physical_disks": [
                           "sdc",
                           "sdd",
                           "sde"
                          ]
      }
    ]
}
response
- 状态码 204 No Content
参见文章
https://docs.openstack.org/ironic/latest/admin/raid.html
https://developer.openstack.org/api-ref/baremetal/#set-raid-config
 
