Oracle Cloud Infrastructure Compute enables you to share custom images across tenancies and regions using image import/export. You can only import custom images that have been exported from Oracle Cloud Infrastructure, so you first need to export an image before you can import it.
The following Oracle Cloud Infrastructure operating systems support image import/export:
- Oracle Linux 6, Oracle Linux 7
- CentOS 6, CentOS 7
- Ubuntu 16.04, Ubuntu 14.04
For more information about these images, see Oracle-Provided Images.
Bring Your Own Image Scenarios
You can also use image import/export to share custom images from Bring Your Own Image scenarios across tenancies and regions, so you don't need to re-create the image manually in each region. You need to go through the steps required to manually create the image in one of the regions, but once this is done, you can export the image, making it available for import in additional tenants and regions. The exported image format is QCOW2.
Image import/export is not supported for Windows operating systems.
When you import or export custom images using the Console, you may need to specify the Object Storage URL pointing to the location to import the image from or export the image to. Object Storage URLs are structured as follows:
When using import/export across tenants and regions you need to use Pre-Authenticated Requests. See Using the Console for instructions on creating a pre-authenticated request. When you go through these instructions, after you click Create Pre-Authenticated Request, the Pre-Authenticated Request Details dialog opens. You need to make a copy of the pre-authenticated request URL displayed here, as this is the only time this will be displayed. This is the Object Storage URL you specify for import/export.
Pre-authenticated requests for a bucket
With image export, if you create the pre-authenticated request for a bucket, you will need to append the object name to the generated URL, for example:
You can use the console or API to export images, and the exported images are stored in the Oracle Cloud Infrastructure Object Storage service. To perform an image export, you need write access to the Object Storage bucket for the image. For more information, see Overview of Object Storage and Let users write objects to Object Storage buckets.
To export an image using the Console
- In the Console, click Compute, and then choose your Compartment.
- Click Custom Images and find the custom image you want to export.
- Click the Actions icon (), and then click Export Custom Image.
- In the Export Image dialog box, you specify the Object Storage location to export the image to. You have two options here: You can select a compartment and bucket, and then enter a name for the exported image, or you can enter the Object Storage URL.
- Click Export Image.
Once you click Export Image, the image status changes to EXPORTING. You can still launch instances while the image is exporting, but you can't delete the image until the export has finished. Once the export is complete, the image status changes to AVAILABLE. If the image status changes to AVAILABLE, but you don't see the exported image in the Object Storage location you specified, the export failed, and you will need to go through the steps again to export the image.
You can use the console or API to import exported images from Object Storage. To import an image, you need read access to the Object Storage object containing the image. For more information, see Let users download objects from Object Storage buckets.
To import an image using the Console
- In the Console, click Compute, and then choose your Compartment.
- Click Custom Images and then click Import Exported Image.
- Select the compartment name you want to import the image to.
- Enter a name for the image.
- Specify the Object Storage URL where the image is stored. When importing across regions or tenancies, you need to specify a pre-authenticated request URL.
- Optionally, you can apply tags. If you have permissions to create a resource, you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure if you should apply tags, skip this option (you can apply tags later) or ask your administrator.
- Click Import Exported Image.
Once you click Import Exported Image, you'll see the imported image in the Custom Images list for the compartment, with a status of IMPORTING. Once the import completes successfully, the status will change to AVAILABLE. If the status does not change, or no entry appears in the Custom Images list, the import failed. If the import failed, make sure you have read access to the Object Storage object, and that the object contains a supported image.
Managing Tags for an Image
You can apply tags to your resources, such images, to help you organize them according to your business needs. You can apply tags at the time you import an image, or you can update the image later with the desired tags.
In the Console, click Compute, and then click Images.
Click the image you're interested in.
Click the Tags tab to view or edit the existing tags. Or click Apply tag(s) to add new ones.
For more information, see Resource Tags.
Using the API
Use the following API operations for custom image import/export.
- ExportImage: Exports a custom image to Object Storage.
- CreateImage: To import an exported image, specify ImageSourceDetails in the request body.
X5 and X7 Compatibility for Image Import/Export
Oracle X5 and X7 servers have different host hardware. As a result, using an X5 image on an X7 bare metal or virtual machine (VM) instance may not work without additional modifications. Oracle Cloud Infrastructure recommends for X7 hosts that you use the Oracle-provided images for X7. See Oracle-Provided Image Release Notes for more information about which images support X7. These images have been explicitly created and tested with the new hardware.
If you do attempt to use an existing X5 image on X7 hardware, note that Ubuntu 14.04 and all Windows and CentOS versions are not cross-compatible.
Oracle Linux and Ubuntu 16.04 are cross-compatible, however you need to update the kernel to the most recent version to install the latest device drivers. To do so, run the following commands from a terminal session:
- Oracle Linux
- Ubuntu 16.04
apt-get update apt-get dist-upgrade
The primary device drivers that are different between X5 and X7 hosts are:
- Network device drivers
- NVMe drive device drivers
- GPU device drivers
Additional updates may be required depending on how you have customized the image.