Oracle Cloud Infrastructure Documentation

Image Import/Export

Oracle Cloud Infrastructure Compute enables you to share custom images across tenancies and regions using image import/export.

Linux-Based Operating Systems

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.

Windows-Based Operating Systems

You can import custom Windows images. The following operating systems are supported:

  • Windows Server 2008 R2 Standard, Enterprise, and Datacenter
  • Windows Server 2012 Standard, Datacenter

  • Windows Server 2012 R2 Standard, Datacenter

  • Windows Server 2016 Standard, Datacenter

Verify Your Windows Operating System

When importing custom Windows images, you need to make sure that the version you select matches up with the Windows image that you imported. Failure to provide the correct version and SKU information could be a violation of your Microsoft Licensing Agreement.

Windows System Time Issue on Custom Windows Instances

If you change the time zone from the default setting on Windows VM instances, when the instance reboots or syncs with the hardware clock, the system time will revert back to the time for the default time zone. However, the time zone setting will stay set to the new time zone, so the system clock will be incorrect. You can fix this by setting the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation registry key to 1.

OCI-provided Windows Images already have the RealTimeIsUniversal registry key set by default, but you will need to do this for any custom Windows images that you import.

To fix this issue for custom Windows images:

  1. Open the Windows Registry Editor and navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation registry key.
  2. Create a new DWORD key named RealTimeIsUniversal and set the value to 1.
  3. Reboot the instance.
  4. Reset the time and time zone manually.

Exporting Windows Images

Image export is not supported for Windows images.

Bring Your Own Image Scenarios

You can also use image import/export to share custom images from Bring Your Own Image (BYOI) 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 after this is done, you can export the image, making it available for import in additional tenants and regions. The exported image format is OCI, which is a TAR file that contains a QCOW2 file and Oracle Cloud Infrastructure-specific metadata.

Best practices for replicating an image across regions

You can use the Console or API to replicate an image from one region to other regions. At a high level:

  1. Export the image to an Object Storage bucket in the same region as the image. For steps, see Exporting an Image.
  2. Create a pre-authenticated request with read-only access for the exported image. For steps, see Working with Pre-Authenticated Requests.
  3. Import the image to each region that you want to replicate it in. Use the pre-authenticated request URL as the Object Storage URL. For steps, see Importing an Image.

Object Storage Service URLs

When you import or export custom images using the Console, you may need to specify the Object Storage URL pointing to the location that you want to import the image from or export the image to. Object Storage URLs are structured as follows:

https://<host_name>/n/<namespace_name>/b/<bucket_name>/o/<object_name>

For example:

https://objectstorage.us-phoenix-1.oraclecloud.com/n/MyNamespace/b/MyBucket/o/MyCustomImage.qcow2

Pre-Authenticated Requests

When using import/export across tenants and regions you need to use an Object Storage pre-authenticated request. See Working with Pre-Authenticated Requests 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.

Note

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:

/o/MyCustomImage.qcow2

Exporting an Image

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

  1. Open the navigation menu. Under Core Infrastructure, go to Compute and click Custom Images.
  2. Find the custom image you want to export, click the Actions icon (three dots), and then click Export Image.
  3. In the Export Image dialog box, 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.
  4. Click Export Image.

After 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. To track the progress of the operation, you can monitor the associated work request. For more information, see Viewing the State of a Compute Work Request.

When 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, this means that the export failed, and you will need to go through the steps again to export the image.

Importing an 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

  1. Open the navigation menu. Under Core Infrastructure, go to Compute and click Custom Images.
  2. Click Import Image.
  3. Select the compartment name you want to import the image to.
  4. Enter a name for the image.
  5. Select the operating system.
  6. 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.
  7. Select the image type.
  8. Select the launch mode.

    • For custom images where the image format is OCI, Oracle Cloud Infrastructure selects the applicable launch mode based on the launch mode for the source image.

    • For custom images exported from Oracle Cloud Infrastructure where the image type is QCOW2, select Native Mode.

    • To import other custom images select Paravirtualized Mode or Emulated Mode. For more information, see Bring Your Own Image (BYOI).

  9. 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.
  10. Click Import Image.

After you click Import Image, you'll see the imported image in the Custom Images list for the compartment, with a status of IMPORTING. To track the progress of the operation, you can monitor the associated work request. For more information, see Viewing the State of a Compute Work Request.

When the import completes successfully, the status changes 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.

Editing Image Details

You can edit the details of custom images, such as the image name and compatible shapes for the image. For more information, see To edit the name or shape of a custom image in Managing Custom Images.

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.

To manage tags for an image

Using the API

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.

Use the following API operations for custom image import/export:.

X5 and X7 Compatibility for Image Import/Export

Oracle X5, X6, and X7 servers have different host hardware. As a result, using an X5 or X6 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 X7 hardware.

If you attempt to use an existing X5 image on X7 hardware, note the following:

  • CentOS 6 and all Windows versions are not cross-compatible.
  • Oracle Linux, Ubuntu 16.04, Ubuntu 14.04, and CentOS 7 are cross-compatible. However, you must update the kernel to the most recent version to install the latest device drivers. To do this, run the following commands from a terminal session:
    • Oracle Linux
      yum update
    • CentOS 7
      yum update
    • Ubuntu 16.04
      apt-get update
      apt-get dist-upgrade
    • Ubuntu 14.04
      apt-get update
      apt-get dist-upgrade
      apt-get install linux-hwe-generic-trusty

If you attempt to use an X6 image on non-X6 hardware, note the following:

  • Oracle Linux 6, Ubuntu 14.04, all CentOS versions, and all Windows versions are not cross-compatible.
  • Oracle Linux 7, Ubuntu 18.04, and Ubuntu 16.04 are cross-compatible. Use the Oracle-provided images for X6.

The primary device drivers that are different between X5, X6, 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.