Method | URI | Description |
---|---|---|
POST | /v2/{tenant_id}/volumes | Creates a volume. |
To create a bootable volume, include the image ID
and set the bootable
flag to
true
in the request body.
Normal response codes: 202
This table shows the URI parameters for the create volume request:
Name | Type | Description |
---|---|---|
| String | The unique identifier of the tenant or account. |
Example 3.1. Create volume: JSON request
{ "volume":{ "availability_zone":null, "source_volid":null, "display_description":null, "snapshot_id":null, "size":10, "display_name":"my_volume", "imageRef":null, "volume_type":null, "metadata":{ } } }
Example 3.2. Create volume: XML request
<?xml version="1.0" encoding="UTF-8"?> <volume xmlns="http://docs.openstack.org/openstack-block-storage/2.0/content" display_name="vol-001" display_description="Another volume." size="2"/>
This operation does not require a request body.
Example 3.3. Create volume: JSON response
{ "volume":{ "status":"creating", "display_name":"my_volume", "attachments":[ ], "availability_zone":"nova", "bootable":"false", "created_at":"2014-02-21T19:52:04.949734", "display_description":null, "volume_type":"None", "snapshot_id":null, "source_volid":null, "metadata":{ }, "id":"93c2e2aa-7744-4fd6-a31a-80c4726b08d7", "size":10 } }
Example 3.4. Create volume: XML response
<?xml version='1.0' encoding='UTF-8'?> <volume xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/volume/api/v1" status="creating" display_name="vol-001" availability_zone="nova" bootable="false" created_at="2014-02-21 20:18:33.122452" display_description="Another volume." volume_type="None" snapshot_id="None" source_volid="None" id="83960a54-8dad-4fd8-bc41-33c71e098e04" size="2"> <attachments/> <metadata/> </volume>
This operation does not return a response body.