How to Create a Volume-Backed Virtual Machine?

To create a Volume-backed Virtual Machine (with a boot disk on network block storage), include the block_device_mapping section in your API request. You can create boot volumes from an Image "source_type": "image", a Volume Snapshot "source_type": "snapshot", or attach an existing Volume "source_type": "volume".

In the example below, a new Virtual Machine is created with a boot Volume built from image 754e77f5-9a0c-4549-b49d-7bde34dc960f (Ubuntu 18.04.4 CUDA).

{
"server" : {
"name": "volume-backed",
"block_device_mapping_v2": [
{
"uuid": "754e77f5-9a0c-4549-b49d-7bde34dc960f",
"source_type": "image",
"destination_type": "volume",
"boot_index": 0,
"volume_size": "20",
"delete_on_termination": false
}
],
"flavorRef": "8f9a148d-b258-42f7-bcc2-32581d86e1f1",
"availability_zone": "nova",
"networks": [{ "uuid": "cc5f6f4a-2c44-44a4-af9a-f8534e34d2b7" }],
"key_name": "my_keypair",
"max_count": 1,
"min_count": 1
}
}

Where:

  • "name": "volume-backed" — name of the new Virtual Machine;
  • "uuid": "754e77f5-9a0c-4549-b49d-7bde34dc960f" — OpenStack ID of the source image;
  • "source_type": "image" — the boot Volume will be created from an image;
  • "volume_size": "20" — size of the new Volume in gigabytes;
  • "delete_on_termination": false — the boot Volume will not be deleted when the VM is deleted;
  • "flavorRef": "8f9a148d-b258-42f7-bcc2-32581d86e1f1" — OpenStack ID of the configuration;
  • "networks": [{ "uuid": "cc5f6f4a-2c44-44a4-af9a-f8534e34d2b7" }] — OpenStack ID of the network where the VM will receive an IP address;
  • "key_name": "my_keypair" — name of your Key Pair.

If delete_on_termination is set to true  the boot Volume will be deleted when the Virtual Machine is removed. When creating a VM from a Volume Snapshot, the Snapshot and its parent Volume are preserved regardless of this setting.

Setting delete_on_termination to false, ensures the boot Volume persists after VM deletion, allowing you to reuse it later.

Updated Date 28.11.2025