Create image API

The OpenStack Images (Glance) API for creating images, POST /v2/images is extended with these additional parameters specific to PowerVC.

Request parameters
Table 1. Parameters in the create image request
Name Style Type Required? Description

name

body

string

Required

Name for the image to be created.

os_distro

body

string

Required

Specifies the Linux® flavor.

endianness

body

string

Required

Specifies whether the OS is Big Endian or Little Endian.

architecture

body

string

NA

This value must be ppc64.

hypervisor_type

body

string

NA

This value must be phyp .

block_device_mapping

body

string

Required

List of dictionaries containing the properties of each volume being added to the image.

boot_index

body

integer

Required

Boot order of the volume.

volume_id

body

string

Required

ID of the volume.

source_type

body

string

Required

For PowerVC this must be volume, as SAN volumes are currently supported as source images.

destination_type

body

string

NA

For PowerVC this must be volume, as SAN volumes are currently supported as source images.

delete_on_termination

body

Boolean

Optional

Whether the volume should be deleted when the instance is deleted.

Example 1: Creating an image with 1 boot volume using the create image API.
Request
{"name": "SampleImage",
  "os_distro": "ubuntu",
  "endianness": "little-endian",
  "visibility": "public",
  "min_disk": 1,
  "architecture": "ppc64",
  "hypervisor_type": "phyp",
  "disk_format": "raw",
  "container_format": "bare",
  "root_device_name": "/dev/sda",
  "block_device_mapping": "[{\"guest_format\":null,
\"boot_index\":0,
\"no_device\":null,\"image_id\":null,
\"volume_id\":\"0142b1e1-b4c5-452c-b346-3f2f25af8d94\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true}]",
  "bdm_v2": "true" }
Response
{"container_format": "bare",
  "min_ram": 0,
  "updated_at": "2015-03-23T10:29:18Z",
  "file": "/v2/images/53478c20-0ffc-4549-b1b0-e4b616b3bf44/file",
  "owner": "12a34f9ad0de45e6a1dc101f3e0b5b03",
  "id": "53478c20-0ffc-4549-b1b0-e4b616b3bf44",
  "size": null,
  "os_distro": "ubuntu",
  "root_device_name": "/dev/sda",
  "self": "/v2/images/53478c20-0ffc-4549-b1b0-e4b616b3bf44",
  "tags": [

  ],
  "disk_format": "raw",
  "bdm_v2": "true",
  "endianness": "little-endian",
  "schema": "/v2/schemas/image",
  "status": "queued",
  "block_device_mapping": "[{\"guest_format\":null,
\"boot_index\":0,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"0142b1e1-b4c5-452c-b346-3f2f25af8d94\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true}]",
  "visibility": "public",
  "min_disk": 1,
  "virtual_size": null,
  "name": "SampleImage",
  "hypervisor_type": "phyp",
  "created_at": "2015-03-23T10:29:18Z",
  "protected": false,
  "architecture": "ppc64",
  "checksum": null}
Example 2: Creating an image with 2 data volumes and 1 boot volume using the create image API.
Request
{"name":"Sample_image_2",
"os_distro":"rhel",
"endianness":"little-endian",
"visibility":"private",
"min_disk":1,
"architecture":"ppc64",
"hypervisor_type":"phyp",
"disk_format":"raw",
"container_format":"bare",
"root_device_name":"/dev/sda",
"block_device_mapping": "[
{
\"guest_format\":null,
\"boot_index\":0,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"a0857654-3e30-415e-8f16-2c45c6e15ab2\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
},
{
\"guest_format\":null,
\"boot_index\":1,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"8ad98a4b-5886-4161-8713-89e27791e0e8\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
},
{
\"guest_format\":null,
\"boot_index\":2,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"026c454e-12d2-46b1-9510-6ceb217d5aca\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
}]",
"bdm_v2":"true"}
Response
{"container_format": "bare",
"min_ram": 0,
"updated_at": "2021-09-29T10:21:18Z",
"file": "/v2/images/89bfac9b-4a61-495a-b6fb-fdda9c16d10e/file",
"owner": "94f5742aaf7e450d8b59ce793fad0b20",
"id": "53478c20-0ffc-4549-b1b0-e4b616b3bf44",
"size": 0,
"os_distro": "rhel",
"root_device_name": "/dev/sda",
"self": "/v2/images/89bfac9b-4a61-495a-b6fb-fdda9c16d10e",
"tags": [],
"disk_format": "raw",
"bdm_v2": "true",
"endianness": "little-endian",
"schema": "/v2/schemas/image",
"status": "active",
"block_device_mapping": "[
{
\"guest_format\":null,
\"boot_index\":0,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"a0857654-3e30-415e-8f16-2c45c6e15ab2\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
},
{
\"guest_format\":null,
\"boot_index\":1,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"8ad98a4b-5886-4161-8713-89e27791e0e8\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
},
{
\"guest_format\":null,
\"boot_index\":2,
\"no_device\":null,
\"image_id\":null,
\"volume_id\":\"026c454e-12d2-46b1-9510-6ceb217d5aca\",
\"disk_bus\":null,
\"volume_size\":null,
\"source_type\":\"volume\",
\"device_type\":\"disk\",
\"snapshot_id\":null,
\"destination_type\":\"volume\",
\"delete_on_termination\":true
}]",
"visibility": "private",
"min_disk": 1,
"virtual_size": null,
"name": "Sample_image_2",
"hypervisor_type": "phyp",
"created_at": "2021-09-29T10:21:18Z",
"protected": false,
"architecture": "ppc64",
"checksum": "d41d8cd98f00b204e9800998ecf8427e"}