Create an Image
/20160918/images
When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and the OCID of the compartment that contains that instance.
When importing an exported image from Object Storage, specify the source information in imageSourceDetails. When importing an image based on the namespace, bucket name, and object name, use ImageSourceViaObjectStorageTupleDetails. When importing an image based on the Object Storage URL, use ImageSourceViaObjectStorageUriDetails.
The launchMode parameter specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
The bootVolumeType specifies the emulation type for the boot volume.
You can optionally specify a display name for the image. It does not need to be unique, and you can change it. Avoid entering confidential information.
Request
- application/json
-
opc-retry-token: string
Minimum Length:
1
Maximum Length:64
A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
object
-
compartmentId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the compartment you want the image to be created in. -
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace.
-
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name for the image. It does not need to be unique, and it is changeable. Avoid entering confidential information. Do not use a platform image name as a custom image name. -
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
-
imageSourceDetails:
object ImageSourceDetails
Discriminator:
sourceType
-
instanceId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the instance you want to use as the basis for the image. -
launchMode:
string
Allowed Values:
[ "NATIVE", "EMULATED", "PARAVIRTUALIZED", "VDPA", "CUSTOM" ]
Specifies the configuration mode for launching virtual machine (VM) instances. See the CreateImage description for descriptions of each possible value. -
launchOptions:
object LaunchOptions
Options for tuning the compatibility and performance of VM shapes. The values that you specify override any default values.
-
shouldIncludeDataVolumes:
boolean
Default Value:
false
Indicates whether attached data volumes should be included in the created image when creating an image from an Instance. This is only valid if instanceId is provided.
object
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
object
object
sourceType
-
operatingSystem:
string
Minimum Length:
1
Maximum Length:255
-
operatingSystemVersion:
string
Minimum Length:
1
Maximum Length:255
-
sourceImageType:
string
Allowed Values:
[ "QCOW2", "VMDK" ]
The format of the image to be imported. Only monolithic images are supported. This attribute is not used for exported Oracle images with the OCI image format. -
sourceType(required):
string
The source type for the image. Use objectStorageTuple when specifying the namespace, bucket name, and object name. Use objectStorageUri when specifying the Object Storage URL.
object
-
bootVolumeType:
string
Allowed Values:
[ "ISCSI", "SCSI", "IDE", "VFIO", "PARAVIRTUALIZED", "NVME" ]
Emulation type for the boot volume. See the description of LaunchInstance for descriptions of each possible value. -
firmware:
string
Allowed Values:
[ "BIOS", "UEFI_64" ]
Firmware used to boot VM. Select the option that matches your operating system. BIOS - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating systems that boot using MBR style bootloaders. UEFI_64 - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the default for platform images. -
isConsistentVolumeNamingEnabled:
boolean
Whether to enable consistent volume naming feature. Defaults to false.
-
isEncryptionInTransitEnabled:
boolean
Specifies whether in-transit encryption is enabled for the data volume's attachment.
-
isPvEncryptionInTransitEnabled:
boolean
Deprecated. Instead use isPvEncryptionInTransitEnabled in LaunchInstanceDetails.
-
networkType:
string
Allowed Values:
[ "E1000", "VFIO", "PARAVIRTUALIZED", "VDPA" ]
Emulation type for the physical network interface card (NIC). E1000 - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. VFIO - Direct attached Virtual Function network controller. This is the networking type when you launch an instance using hardware-assisted (SR-IOV) networking. PARAVIRTUALIZED - VM instances launch with paravirtualized devices using VirtIO drivers. -
remoteDataVolumeType:
string
Allowed Values:
[ "ISCSI", "SCSI", "IDE", "VFIO", "PARAVIRTUALIZED", "NVME" ]
Emulation type for volume.- ISCSI - ISCSI attached block storage device.
- SCSI - Emulated SCSI disk.
- IDE - Emulated IDE disk.
- VFIO - Direct attached Virtual Function storage. This is the default option for local data volumes on platform images.
- PARAVIRTUALIZED - Paravirtualized disk. This is the default for boot volumes and remote block storage volumes on platform images.
- NVME - NVMe disk.
object
-
object additionalProperties
The value of the tag. Only the String type is supported.
object
Response
- application/json
200 Response
-
etag: string
For optimistic concurrency control. See `if-match`.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
-
opc-work-request-id: string
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the work request. Use [GetWorkRequest](/api/#/en/workrequests/latest/WorkRequest/GetWorkRequest) with this ID to track the status of the request.
object
-
agentFeatures:
object InstanceAgentFeatures
Oracle Cloud Agent features supported on the image.
-
baseImageId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the image originally used to launch the instance. -
billableSizeInGBs:
integer(int64)
The size of the internal storage for this image that is subject to billing (1 GB = 1,073,741,824 bytes). Example: 100
-
compartmentId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the compartment containing the instance you want to use as the basis for the image. -
createImageAllowed(required):
boolean
Whether instances launched with this image can be used to create new images. For example, you cannot create an image of an Oracle Database instance.
-
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace.
-
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name for the image. It does not need to be unique, and it is changeable. Avoid entering confidential information. Do not use a platform image name as a custom image name. -
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
-
id(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the image. -
imageVolumeDetails:
object ImageVolumeDetails
Describes the Volumes that will be created when an Instance based on this Image is launched.
-
launchMode:
string
Allowed Values:
[ "NATIVE", "EMULATED", "PARAVIRTUALIZED", "VDPA", "CUSTOM" ]
Specifies the configuration mode for launching virtual machine (VM) instances. See the description of LaunchInstace for descriptions of each configuration mode. -
launchOptions:
object LaunchOptions
Options for tuning the compatibility and performance of VM shapes. The values that you specify override any default values.
-
lifecycleState(required):
string
Allowed Values:
[ "PROVISIONING", "IMPORTING", "AVAILABLE", "EXPORTING", "DISABLED", "DELETED" ]
-
listingType:
string
Allowed Values:
[ "COMMUNITY", "NONE" ]
The listing type of the image. The default value is "NONE". -
operatingSystem(required):
string
Minimum Length:
1
Maximum Length:255
The image's operating system. Example: Oracle Linux -
operatingSystemVersion(required):
string
Minimum Length:
1
Maximum Length:255
The image's operating system version. Example: 7.9 -
sizeInMBs:
integer(int64)
The boot volume size for an instance launched from this image (1 MB = 1,048,576 bytes). Note this is not the same as the size of the image when it was exported or the actual size of the image. Example: 47694
-
timeCreated(required):
string(date-time)
The date and time the image was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z
object
-
isManagementSupported:
boolean
This attribute is not used.
-
isMonitoringSupported:
boolean
This attribute is not used.
object
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
object
object
-
dataVolumes:
array dataVolumes
Maximum Number of Items:
32
An optional list of dataVolumes that will be defined at Instance creation time. This list will include any additional data volumes to be defined, but will not include the boot volume.
object
-
bootVolumeType:
string
Allowed Values:
[ "ISCSI", "SCSI", "IDE", "VFIO", "PARAVIRTUALIZED", "NVME" ]
Emulation type for the boot volume. See the description of LaunchInstance for descriptions of each possible value. -
firmware:
string
Allowed Values:
[ "BIOS", "UEFI_64" ]
Firmware used to boot VM. Select the option that matches your operating system. BIOS - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating systems that boot using MBR style bootloaders. UEFI_64 - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the default for platform images. -
isConsistentVolumeNamingEnabled:
boolean
Whether to enable consistent volume naming feature. Defaults to false.
-
isEncryptionInTransitEnabled:
boolean
Specifies whether in-transit encryption is enabled for the data volume's attachment.
-
isPvEncryptionInTransitEnabled:
boolean
Deprecated. Instead use isPvEncryptionInTransitEnabled in LaunchInstanceDetails.
-
networkType:
string
Allowed Values:
[ "E1000", "VFIO", "PARAVIRTUALIZED", "VDPA" ]
Emulation type for the physical network interface card (NIC). E1000 - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. VFIO - Direct attached Virtual Function network controller. This is the networking type when you launch an instance using hardware-assisted (SR-IOV) networking. PARAVIRTUALIZED - VM instances launch with paravirtualized devices using VirtIO drivers. -
remoteDataVolumeType:
string
Allowed Values:
[ "ISCSI", "SCSI", "IDE", "VFIO", "PARAVIRTUALIZED", "NVME" ]
Emulation type for volume.- ISCSI - ISCSI attached block storage device.
- SCSI - Emulated SCSI disk.
- IDE - Emulated IDE disk.
- VFIO - Direct attached Virtual Function storage. This is the default option for local data volumes on platform images.
- PARAVIRTUALIZED - Paravirtualized disk. This is the default for boot volumes and remote block storage volumes on platform images.
- NVME - NVMe disk.
object
-
object additionalProperties
The value of the tag. Only the String type is supported.
object
array
32
-
Array of:
object ImageVolume
Describes a volume that will be created and attached when an Image is launched as an Instance.
object
-
displayName:
string
A user-friendly description for the Volume, provided by the user.
-
index(required):
integer
The relative index of this volume. This value is used to identity the volume by relative location for updates. The index values will begin at 1.
-
sizeInMBs:
integer(int64)
The size of this volume for an instance launched from this image (1 MB = 1,048,576 bytes). Example: `47694`
400 Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
401 Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
404 Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
409 Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
500 Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
Default Response
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
object
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
Examples
Example - Create an image for the specified instance.
POST /20160918/images { "instanceId": "ocid1.instance.unique_ID, "compartmentId": "ocid1.compartment.unique_ID", "displayName": "MyCustomImage" }
Example - Import an image using the namespace, bucket name, and object name.
POST /20160918/images { "compartmentId": "ocid1.compartment.unique_ID", "imageSourceDetails": ( "bucketName": "MyBucket", "namespaceName": "MyNamespace", "objectName": "image_to_import.oci", "sourceType": "objectStorageTuple" } }
Example - Import an image using the Object Storage URL.
POST /20160918/images { "compartmentId": "ocid1.compartment.unique_ID", "displayName": "MyImportedImage", "imageSourceDetails": ( "sourceUri": "http://fqdn_or_ip_address/compute_images/uln-pca-image_to_import.oci", "sourceType": "objectStorageUri" } }