Skip to main content

POST – Create a Volume

Use the POST method to initialize volume.

Request URL

POST https://<BMC_IPADDR>/redfish/v1/Systems/1/Storage/{Id}/Volumes

Request body

Field

Type

Description

Name

Note 1
String

The new name with at most 15 characters.

RAIDType

Note 1
String

RAID TYPEs that the RAID controller and current env support.

CapacityBytes

Note 2
String

At least 1048576.

ReadCachePolicy

String

"Off" or "ReadAhead"

WriteCachePolicy

String

“WriteThrough”, "UnprotectedWriteBack" or "ProtectedWriteBack"

Oem/Lenovo/IOPolicy

String

“DirectIO” or “CachedIO”

Oem/Lenovo/AccessPolicy

String

“ReadWrite”, “ReadOnly” or “Blocked”

Oem/Lenovo/DriveCachePolicy

String

“Unchanged”, “Disable” or “Enable”

Note 1: This property is mandatory and should not be an empty string when creating a volume.

Note 2: It will be converted to a unit of megabyte at backend, so the property in GET operation may be different with the input value in POST operation. The minimum of the value is 1048576 (1MB = 1024 * 1024).

Response

The response returns the created volumes information.

Status code

HTTP Status CodeError Message ID
201Created
500InternalError

Example

The following example is POST body.

{
"RAIDType": "RAID1",
"Name": "VD_1",
"Links": {
"Drives": [
{
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.9"
},
{
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.10"
}
]
}
}

The following example JSON response is returned.

{
"@odata.context": "/redfish/v1/$metadata#Volume.Volume",
"@odata.etag": "\"aa971f18d2f62e1a371c4\"",
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/239",
"@odata.type": "#Volume.v1_10_0.Volume",
"AccessCapabilities": [],
"Actions": {
"#Volume.Initialize": {
"title": "Initialize",
"InitializeType@Redfish.AllowableValues": [
"Fast"
],
"target": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/239/Actions/Volume.Initialize"
}
},
"BlockSizeBytes": 512,
"CapacityBytes": 998999326720,
"Description": "This resource is used to represent a volume for a Redfish implementation.",
"DisplayName": "VD_1",
"Encrypted": false,
"EncryptionTypes": [],
"Id": "239",
"Links": {
"DedicatedSpareDrives": [],
"Drives": [
{
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.9"
},
{
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.10"
}
]
},
"Name": "VD_1",
"Oem": {
},
"RAIDType": "RAID1",
"ReadCachePolicy": "Off",
"ReadCachePolicy@Redfish.AllowableValues": [
"Off",
"ReadAhead"
],
"Status": {
"State": "Enabled"
},
"StripSizeBytes": 262144,
"WriteCachePolicy": "WriteThrough",
"WriteCachePolicy@Redfish.AllowableValues": [
"WriteThrough",
"UnprotectedWriteBack",
"ProtectedWriteBack"
]
}

The following example is steps to create two volumes in a storage pool.

  1. Create first volume and implicit storage pool (Consumes entire drives).

    This creates a volume using the specified capacity of the specified drives (Disk.9, Disk.10). This action also implicitly creates a storage pool (Pool_1_5) containing all space from these drives.

    POST /redfish/v1/Systems/1/Storage/<storage_id>/Volumes

    Body:

    {
    "RAIDType": "RAID1",
    "Name": "VD_1",
    "CapacityBytes": 500000000000,
    "Links": {
    "Drives": [
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.9"
    },
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.10"
    }
    ]
    }
    }

    Note
    CapacityBytes is an optional property to specify the volume size. Omit the next steps only if you want a single volume using the full drive capacity.

    On success, Redfish service responds HTTP code 201 with the created volume resource, as below json payload.

     {
    "@odata.context": "/redfish/v1/$metadata#Volume.Volume",
    "@odata.etag": "\"aa971f18d2f62e1a371c4\"",
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/239",
    "@odata.type": "#Volume.v1_10_0.Volume",
    "AccessCapabilities": [],
    "Actions": {
    "#Volume.Initialize": {
    "title": "Initialize",
    "InitializeType@Redfish.AllowableValues": [
    "Fast"
    ],
    "target": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/239/Actions/Volume.Initialize"
    }
    },
    "BlockSizeBytes": 512,
    "CapacityBytes": 499999834112,
    "Description": "This resource is used to represent a volume for a Redfish implementation.",
    "DisplayName": "VD_1",
    "Encrypted": false,
    "EncryptionTypes": [],
    "Id": "239",
    "Links": {
    "DedicatedSpareDrives": [],
    "Drives": [
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.9"
    },
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.10"
    }
    ]
    },
    "Name": "VD_1",
    "Oem": {
    "Lenovo": {
    }
    },
    "RAIDType": "RAID1",
    "ReadCachePolicy": "Off",
    "ReadCachePolicy@Redfish.AllowableValues": [
    "Off",
    "ReadAhead"
    ],
    "Status": {
    "State": "Enabled"
    },
    "StripSizeBytes": 262144,
    "WriteCachePolicy": "WriteThrough",
    "WriteCachePolicy@Redfish.AllowableValues": [
    "WriteThrough",
    "UnprotectedWriteBack",
    "ProtectedWriteBack"
    ]
    }

  2. Identify the storage pool resource.

    The successful response from Step 1 contains the Oem.Lenovo.StoragePool property. The value of this property (e.g., "/redfish/v1/Systems/1/Storage/RAID_Slot4/StoragePools/Pool_1_5") is the Redfish resource identifier for the storage pool holding the remaining space. You will reference this ID to create the second volume.

  3. Create second volume from storage pool space.

    This creates another volume using the remaining free space within the storage pool (Pool_1_5) created implicitly in Step 1.

    POST /redfish/v1/Systems/1/Storage/<storage_id>/Volumes

    Body:

    {
    "RAIDType": "RAID1",
    "Name": "VD_2",
    "Oem": {
    "Lenovo": {
    "StoragePool": [
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/StoragePools/Pool_1_5"
    }
    ]
    }
    }
    }

    Note
    Omit CapacityBytes to automatically utilize all remaining free space in the specified pool.

    On success, Redfish service responds HTTP code 201 with the created volume resource, as below json payload.

    {
    "@odata.context": "/redfish/v1/$metadata#Volume.Volume",
    "@odata.etag": "\"a8b2b46546562ff976e56\"",
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/238",
    "@odata.type": "#Volume.v1_10_0.Volume",
    "AccessCapabilities": [],
    "Actions": {
    "#Volume.Initialize": {
    "target": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Volumes/238/Actions/Volume.Initialize",
    "InitializeType@Redfish.AllowableValues": [
    "Fast"
    ],
    "title": "Initialize"
    }
    },
    "BlockSizeBytes": 512,
    "CapacityBytes": 498999492608,
    "Description": "This resource is used to represent a volume for a Redfish implementation.",
    "DisplayName": "VD_2",
    "Encrypted": false,
    "EncryptionTypes": [],
    "Id": "238",
    "Links": {
    "DedicatedSpareDrives": [],
    "Drives": [
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.9"
    },
    {
    "@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot4/Drives/Disk.10"
    }
    ]
    },
    "Name": "VD_2",
    "Oem": {
    "Lenovo": {
    }
    },
    "RAIDType": "RAID1",
    "ReadCachePolicy": "Off",
    "ReadCachePolicy@Redfish.AllowableValues": [
    "Off",
    "ReadAhead"
    ],
    "Status": {
    "State": "Enabled"
    },
    "StripSizeBytes": 262144,
    "WriteCachePolicy": "WriteThrough",
    "WriteCachePolicy@Redfish.AllowableValues": [
    "WriteThrough",
    "UnprotectedWriteBack",
    "ProtectedWriteBack"
    ]
    }