Ask Your Question
0

cinder create volume API

asked 2014-01-31 01:34:12 -0500

parash_hallur gravatar image

This is the request payload to create cinder volume

{
   "volume":{
      "availability_zone":"nova",
      "bootable":"true",
      "description":null,
      "size":2,
      "display_name":"my-new-vol2",
      "imageRef":"f855b40a-66c7-4b6e-8a46-f229e70a2d0f",
      "metadata":{

      }
   }
}

How do I specify the volume-type to be used for volume creation?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-03-08 10:03:36 -0500

karthikprabhu gravatar image

HI,

If you are creating cinder volume from the CLI, I would suggest you first list the volumes types by using cinder type-list and then uses one of them during volume creation as

cinder create 1 --name test --volume-type <namefromabove command>
edit flag offensive delete link more
0

answered 2017-02-23 19:12:53 -0500

nishpatwa gravatar image

updated 2017-02-24 13:15:50 -0500

Hi thanks for posting the question.

Follow this API documentation to specify the volume_type while creating a volume.

https://developer.openstack.org/api-ref/block-storage/v2/index.html?expanded=list-consistency-group-snapshots-detail,create-consistency-group-snapshot-detail,update-volume-type-detail,create-volume-detail#create-volume

Below is an example from the document for your reference:

{
    "volume": {
        "size": 10,
        "availability_zone": null,
        "source_volid": null,
        "description": null,
        "multiattach ": false,
        "snapshot_id": null,
        "name": null,
        "imageRef": null,
        "volume_type": null,
        "metadata": {},
        "source_replica": null,
        "consistencygroup_id": null
    },
    "OS-SCH-HNT:scheduler_hints": {
        "same_host": [
            "a0cf03a5-d921-4877-bb5c-86d26cf818e1",
            "8c19174f-4220-44f0-824a-cd1eeef10287"
        ]
    }
}

I hope that clears your doubt

Thanks,

Nish Patwa

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-01-31 01:34:12 -0500

Seen: 316 times

Last updated: Mar 08 '17