Exporting an OMI to a Bucket
You can export an OUTSCALE Machine Image (OMI) to an OUTSCALE Object Storage (OOS) bucket to create a backup or to enable other accounts in the same Region or in a different one to copy it.
This action creates the necessary snapshots and manifest file in the bucket. The OMI can then be imported to another account using a pre-signed URL of its manifest file. For more information, see Creating a Pre-Signed URL.
Before exporting an OMI or a snapshot to another Region, you need to make sure that this action is authorized by all applicable third-party licenses. If the export is authorized, only an OMI export guarantees the application of third-party licenses in the target Region, whereas a snapshot export does not. |
Exporting an Image to a Bucket Using Cockpit v2
-
In the Images dashboard, check the box of the image you want to export to an OOS bucket.
The image is selected. -
Click Export to OOS.
The EXPORT IMAGE TO OOS BUCKET dialog box appears. -
Specify the information for the export:
-
Select the format of the export disk (
QCOW2
orRAW
). -
In the OOS bucket name field, type the name of the OOS bucket where you want to export the image.
You must have the appropriate write permissions for the bucket to which you want to export the image. For more information, see Managing Access to Your Buckets.
-
(optional) In the OOS bucket prefix field, type a prefix for the copy of the image in the OOS bucket.
For more information about prefixes, see About OOS > Objects.
-
-
Click Export.
The image is exported to the OOS bucket. To check the state of the image export task, see Getting Information About an OMI Export or Import Task.
Exporting an OMI to a Bucket Using OSC CLI
The CreateImageExportTask command exports an OUTSCALE machine image (OMI) to an OUTSCALE Object Storage (OOS) bucket.
This enables you to copy an OMI between accounts in different Regions.
This action creates the necessary snapshots and manifest file in the bucket. The OMI can then be imported to another account using a pre-signed URL of its manifest file. For more information, see Creating a Pre-Signed URL.
To copy an OMI in the same Region, you can also use the CreateImage method.
You cannot export a shared or public OMI, as they do not belong to you. To do so, you must first copy it to your account. The copy then belongs to you and you can export it. For more information, see About OMIs. |
$ osc-cli api CreateImageExportTask --profile "default" \
--ImageId "ami-12345678" \
--OsuExport '{
"DiskImageFormat": "qcow2",
"OsuBucket": "BUCKET",
"OsuPrefix": "PREFIX"
}'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
ImageId
: The ID of the OMI to export. -
OsuExport
: Information about the OOS export task to create.-
DiskImageFormat
: The format of the export disk (qcow2
|raw
). -
OsuApiKey
: (optional) Information about the OOS API key.-
ApiKeyId
: (optional) The API key of the OOS account that enables you to access the bucket. -
SecretKey
: (optional) The secret key of the OOS account that enables you to access the bucket.
-
-
OsuBucket
: The name of the OOS bucket where you want to export the object. -
OsuManifestUrl
: (optional) The URL of the manifest file. -
OsuPrefix
: (optional) The prefix for the key of the OOS object.
-
The CreateImageExportTask command returns the following elements:
-
ImageExportTask
: Information about the OMI export task.-
Comment
: If the OMI export task fails, an error message appears. -
ImageId
: The ID of the OMI to be exported. -
OsuExport
: Information about the OMI export task.-
DiskImageFormat
: The format of the export disk (qcow2
|raw
). -
OsuBucket
: The name of the OOS bucket the OMI is exported to. -
OsuManifestUrl
: The URL of the manifest file. -
OsuPrefix
: The prefix for the key of the OOS object corresponding to the image.
-
-
Progress
: The progress of the OMI export task, as a percentage. -
State
: The state of the OMI export task (pending/queued
|pending
|completed
|failed
|cancelled
). -
Tags
: One or more tags associated with the image export task.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
TaskId
: The ID of the OMI export task.
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"ImageExportTask": {
"Tags": [],
"ImageId": "ami-12345678",
"TaskId": "image-export-12345678",
"Comment": "Export of image ami-12345678",
"OsuExport": {
"OsuPrefix": "PREFIX/ami-12345678/",
"OsuBucket": "BUCKET",
"DiskImageFormat": "qcow2"
},
"State": "pending/queued",
"Progress": 0
}
}
Exporting an OMI to a Bucket Using oapi-cli
The CreateImageExportTask command exports an OUTSCALE machine image (OMI) to an OUTSCALE Object Storage (OOS) bucket.
This enables you to copy an OMI between accounts in different Regions.
This action creates the necessary snapshots and manifest file in the bucket. The OMI can then be imported to another account using a pre-signed URL of its manifest file. For more information, see Creating a Pre-Signed URL.
To copy an OMI in the same Region, you can also use the CreateImage method.
You cannot export a shared or public OMI, as they do not belong to you. To do so, you must first copy it to your account. The copy then belongs to you and you can export it. For more information, see About OMIs. |
$ oapi-cli --profile "default" CreateImageExportTask \
--ImageId "ami-12345678" \
--OsuExport '{
"DiskImageFormat": "qcow2",
"OsuBucket": "BUCKET",
"OsuPrefix": "PREFIX"
}'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
ImageId
: The ID of the OMI to export. -
OsuExport
: Information about the OOS export task to create.-
DiskImageFormat
: The format of the export disk (qcow2
|raw
). -
OsuApiKey
: (optional) Information about the OOS API key.-
ApiKeyId
: (optional) The API key of the OOS account that enables you to access the bucket. -
SecretKey
: (optional) The secret key of the OOS account that enables you to access the bucket.
-
-
OsuBucket
: The name of the OOS bucket where you want to export the object. -
OsuManifestUrl
: (optional) The URL of the manifest file. -
OsuPrefix
: (optional) The prefix for the key of the OOS object.
-
The CreateImageExportTask command returns the following elements:
-
ImageExportTask
: Information about the OMI export task.-
Comment
: If the OMI export task fails, an error message appears. -
ImageId
: The ID of the OMI to be exported. -
OsuExport
: Information about the OMI export task.-
DiskImageFormat
: The format of the export disk (qcow2
|raw
). -
OsuBucket
: The name of the OOS bucket the OMI is exported to. -
OsuManifestUrl
: The URL of the manifest file. -
OsuPrefix
: The prefix for the key of the OOS object corresponding to the image.
-
-
Progress
: The progress of the OMI export task, as a percentage. -
State
: The state of the OMI export task (pending/queued
|pending
|completed
|failed
|cancelled
). -
Tags
: One or more tags associated with the image export task.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
TaskId
: The ID of the OMI export task.
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"ImageExportTask": {
"Tags": [],
"ImageId": "ami-12345678",
"TaskId": "image-export-12345678",
"Comment": "Export of image ami-12345678",
"OsuExport": {
"OsuPrefix": "PREFIX/ami-12345678/",
"OsuBucket": "BUCKET",
"DiskImageFormat": "qcow2"
},
"State": "pending/queued",
"Progress": 0
}
}
Related Pages
Corresponding API Methods