openstack/nova — pull request #16 by JuanCarlosM (2012-10-31 15:21:54+00:00)
Title: create volume from imageRef (to boot from volume)

Needed to BOOT from volume:

First create the volume with image:

POST /os-volumes

"volume": {
"availability_zone": null,
"display_description": null,
"snapshot_id": null,
"user_id": null,
"size": 10,
"display_name": "my-volume",
"imageRef": "6ac70a85-b327-4f72-a31d-09443e713922",
"volume_type": null,
}

and then, create the instance with this volume attached:

POST os-volumes_boot

"server": {
"name": "boot-from-volume",
"imageRef": "6ac70a85-b327-4f72-a31d-09443e713922",
"block_device_mapping":
[{
"volume_id":
"b04b0e85-613d-41a2-8d2a-bf3b6dcb40f8",
"device_name": "vda"}
],
"key_name": "yeaaaaaa",
"flavorRef": "6",
"max_count": 1,
"min_count": 1}}'