Export or import image
The image export or import APIs let you export or import images from a backup node registered in PowerVC. You can also choose whether you want to upload an image to the IBM® Cloud Object Storage along with export. Similarly, the import image API allows you to import an image to PowerVC from a backup node registered in PowerVC. You can also choose whether you want to download an image from IBM Cloud Object Storage and then import it.
- Export an image to a backup node without upload to Cloud Object Storage
- Export an image to a backup node with upload to Cloud Object Storage
- Import an image from a backup node when an image backup is available
- Import an image with download from Cloud Object Storage when image backup is not available
Options for export or import image APIs
Method | URI | Description |
---|---|---|
POST |
|
Exports an image from a backup node (with or without upload to IBM COS). |
POST |
|
Imports an image from a backup node (with or without download from IBM COS). |
Export an image to a backup node without upload to Cloud Object Storage
This operation exports an image to a backup node in PowerVC without upload to COS. This API takes image ID, COS details, backup node hostname details in the request body as input and returns the image backup ID and the task URI in the response body.
- Normal Response Code: OK (201)
Name | Style | Type | Description |
---|---|---|---|
|
body |
string |
Display name of the exported image. |
|
body |
string |
Optional. Description of the image being exported. |
|
body |
string |
ID of the image to be exported. |
|
body |
string |
Optional. Backup node hostname. |
|
body |
Boolean |
Optional. Whether to upload image to COS. Default option is
True. |
{
"image-backup": {
"name": “export-to-backup-node”,
"description": “export to backup node without upload to cos”,
"src_image_id": “9c219888-1ab0-429e-9282-7cbc6957c839",
"backup_host": “vm-xxx”,
"upload_to_cos": ”False”
}
}
Name | Style | Type | Description |
---|---|---|---|
|
body |
integer |
ID of the image backup. |
|
body |
string |
For long running export and import API operations, the link to the task URI is returned that can be used to monitor the progress of import or export image operations. |
{
"image-backup": {
"backup_id": 23,
"task_uri": "https://9.x.x.x:9000/v3/40a58846608e4e908c43b547d4dfb58c/image-backups/get_progress?action=export&task_id=6f09caf1-0468-4101-9c4d-34d0b0690s89&backup_id=23"
}
}
Export an image to a backup node with upload to Cloud Object Storage
This operation exports an image to a backup node in PowerVC with upload to COS. This API takes image ID, COS details, backup node hostname details in the request body as input and returns the image backup ID and the task URI in the response body.
- Normal Response Code: OK (201)
Request parameters
Name | Style | Type | Description |
---|---|---|---|
|
body |
string |
Display name of the exported image. |
|
body |
string |
Optional. Description of the image being exported. |
|
body |
string |
ID of the image to be exported |
|
body |
string |
COS bucket name for uploading the image. If name is not provided, |
|
body |
string |
Optional. Backup node hostname. |
|
body |
Boolean |
Optional. Whether to upload image to COS. Default option is
True. |
{
"image-backup": {
"name": “export-to-cos”,
"description": “export to backup node with upload to cos”,
"src_image_id": “9c219888-1ab0-429e-9282-7cbc6957c839",
"cos_bucket": ”bucket-1”,
"backup_host": “vm-xxx”,
"upload_to_cos": ”True”
}
}
Name | Style | Type | Description |
---|---|---|---|
|
body |
integer |
ID of the image backup. |
|
body |
string |
For long running export and import API operations, the link to the task URI is returned that can be used to monitor the progress of import or export image operations. |
{
"image-backup": {
"backup_id": 23,
"task_uri": "https://9.x.x.x:9000/v3/40a58846608e4e908c43b547d4dfb58c/image-backups/get_progress?action=import&task_id=6f09caf1-0468-4101-9c4d-34d0b0690s89&backup_id=23"
}
}
Import an image from a backup node when an image backup is available
This operation imports an image to a backup node in PowerVC without download from COS. This API takes image ID, COS details, backup node hostname details in the request body as input and returns the image backup ID and the task URI in the response body.
- Normal Response Code: OK (201)
Name | Style | Type | Description |
---|---|---|---|
|
body |
string |
Display name of the imported image. |
|
body |
string |
Optional. Description of the image being imported. |
|
body |
string |
Optional. ID of the storage template. |
|
body |
string |
ID of the image backup. |
|
body |
string |
Optional. Backup node hostname. |
|
body |
Boolean |
Optional. Indicate if it is a raw image import. |
|
body |
string |
Optional. Operating system type for the raw image. Possible values are |
|
body |
string |
Optional. Architecture corresponding to the raw image. Possible values are |
{
"import-image": {
"name": "Import-from-Backup-node",
"description": "Importing an image from the backup node”,
"image_backup_id": 32,
"volume_type": "9c219888-1ab0-429e-9282-7cbc6957c839",
"backup_host": "vm-xxx"
}
}
uploadimage backup, image backup is downloaded from COS and imported. If the image backup ID is not provided, image backup is downloaded from the backup node to PowerVC without download from COS.
Name | Style | Type | Description |
---|---|---|---|
|
body |
integer |
ID of the image backup. |
|
body |
string |
For long running export and import API operations, the link to the task URI is returned that can be used to monitor the progress of import or export image operations. |
{
"image-backup": {
"backup_id": 23,
"task_uri": "https://9.x.x.x:9000/v3/40a58846608e4e908c43b547d4dfb58c/image-backups/get_progress?action=export&task_id=6f09caf1-0468-4101-9c4d-34d0b0690s89&backup_id=23"
}
}
Import an image with download from Cloud Object Storage when image backup is not available
This operation imports an image with download from COS. This API takes image ID, COS details, backup node hostname details in the request body as input and returns the image backup ID and the task URI in the response body.
- Normal Response Code: OK (201)
Request parameters
Name | Style | Type | Description |
---|---|---|---|
|
body |
string |
Display name of the imported image. |
|
body |
string |
Optional. Description of the image being imported. |
|
body |
string |
Optional. ID of the storage template. |
|
body |
string |
Name of the image OVA that is being imported. |
|
body |
string |
Name of the COS bucket from where the image must be downloaded. |
|
body |
string |
Optional. Backup node hostname. |
{
"import-image": {
"name": "Import-from-Backup-node",
"description": "Importing an image from the backup node”,
"volume_type": "9c219888-1ab0-429e-9282-7cbc6957c839",
"ova_name": "Export-Image-to-Backup_node_29.ova",
"cos_bucket": "bucket-1",
"backup_host": "vm-xxx"
}
}
Name | Style | Type | Description |
---|---|---|---|
|
body |
integer |
ID of the image backup. |
|
body |
string |
For long running export and import API operations, the link to the task URI is returned that can be used to monitor the progress of import or export image operations. |
upload_failedor
download_failed, you can provide the
image_backup_idin the import request body instead of the
cos_bucket
and
ova_name
.{
"image-backup": {
"backup_id": 32,
"task_uri": "https://9.x.x.x:9000/v3/40a58846608e4e908c43b547d4dfb58c/image-backups/get_progress?action=import&task_id=4f09caf1-0468-4101-9c4d-34d0b0690faa&backup_id=32"
}
}