instance_configurations
Creates, updates, deletes, gets or lists an instance_configurations resource.
Overview​
| Name | instance_configurations |
| Type | Resource |
| Id | oci.compute.instance_configurations |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The instance configuration was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration. |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the instance configuration. |
deferredFields | array | Parameters that were not specified when the instance configuration was created, but that are required to launch an instance from the instance configuration. See the [LaunchInstanceConfiguration](#/en/iaas/latest/Instance/LaunchInstanceConfiguration) operation. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
instanceDetails | object | |
timeCreated | string (date-time) | The date and time the instance configuration was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z |
Summary information for an instance configuration.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the instance configuration. |
compartmentId | string | The OCID of the compartment containing the instance configuration. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
timeCreated | string (date-time) | The date and time the instance configuration was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | instanceConfigurationId, region | Gets the specified instance configuration | |
list | select | compartmentId, region | limit, page, sortBy, sortOrder | Lists the instance configurations in the specified compartment.<br /> |
launch | insert | instanceConfigurationId, region, instanceType | opc-retry-token, opc-compute-cluster-id | Creates an instance from an instance configuration.<br /><br />If the instance configuration does not include all of the parameters that are<br />required to create an instance, such as the availability domain and subnet ID, you must<br />provide these parameters when you create an instance from the instance configuration.<br />For more information, see the [InstanceConfiguration](#/en/iaas/latest/InstanceConfiguration/)<br />resource.<br /><br />To determine whether capacity is available for a specific shape before you create an instance,<br />use the [CreateComputeCapacityReport](#/en/iaas/latest/ComputeCapacityReport/CreateComputeCapacityReport)<br />operation.<br /> |
create | insert | region, compartmentId | opc-retry-token | Creates an instance configuration. An instance configuration is a template that defines the<br />settings to use when creating Compute instances.<br /> |
update | update | instanceConfigurationId, region | opc-retry-token, if-match | Updates the free-form tags, defined tags, and display name of an instance configuration. |
delete | delete | instanceConfigurationId, region | if-match | Deletes an instance configuration. |
change_compartment | exec | instanceConfigurationId, region, compartmentId | if-match, opc-request-id, opc-retry-token | Moves an instance configuration into a different compartment within the same tenancy.<br />For information about moving resources between compartments, see<br />[Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br /><br />When you move an instance configuration to a different compartment, associated resources such as<br />instance pools are not moved.<br /><br />Important: Most of the properties for an existing instance configuration, including the compartment,<br />cannot be modified after you create the instance configuration. Although you can move an instance configuration<br />to a different compartment, you will not be able to use the instance configuration to manage instance pools<br />in the new compartment. If you want to update an instance configuration to point to a different compartment,<br />you should instead create a new instance configuration in the target compartment using<br />[CreateInstanceConfiguration](/iaas/api/#/en/iaas/20160918/InstanceConfiguration/CreateInstanceConfiguration).<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment. |
instanceConfigurationId | string | The OCID of the instance configuration. |
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
limit | integer | For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50 |
opc-compute-cluster-id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the [compute cluster](/iaas/Content/Compute/Tasks/compute-clusters.htm) that the instance will be created in. |
opc-request-id | string | Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
opc-retry-token | string | 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). |
page | string | For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). |
sortBy | string | The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by availability domain if the scope of the resource type is within a single availability domain. If you call one of these "List" operations without specifying an availability domain, the resources are grouped by availability domain, then sorted. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). The DISPLAYNAME sort order is case sensitive. |
SELECT examples​
- get
- list
Gets the specified instance configuration
SELECT
id,
compartmentId,
deferredFields,
definedTags,
displayName,
freeformTags,
instanceDetails,
timeCreated
FROM oci.compute.instance_configurations
WHERE instanceConfigurationId = '{{ instanceConfigurationId }}' -- required
AND region = '{{ region }}' -- required
;
Lists the instance configurations in the specified compartment.<br />
SELECT
id,
compartmentId,
definedTags,
displayName,
freeformTags,
timeCreated
FROM oci.compute.instance_configurations
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
;
INSERT examples​
- launch
- create
- Manifest
Creates an instance from an instance configuration.<br /><br />If the instance configuration does not include all of the parameters that are<br />required to create an instance, such as the availability domain and subnet ID, you must<br />provide these parameters when you create an instance from the instance configuration.<br />For more information, see the [InstanceConfiguration](#/en/iaas/latest/InstanceConfiguration/)<br />resource.<br /><br />To determine whether capacity is available for a specific shape before you create an instance,<br />use the [CreateComputeCapacityReport](#/en/iaas/latest/ComputeCapacityReport/CreateComputeCapacityReport)<br />operation.<br />
INSERT INTO oci.compute.instance_configurations (
instanceType,
instanceConfigurationId,
region,
opc-retry-token,
opc-compute-cluster-id
)
SELECT
'{{ instanceType }}' /* required */,
'{{ instanceConfigurationId }}',
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-compute-cluster-id }}'
RETURNING
id,
agentConfig,
availabilityConfig,
availabilityDomain,
capacityReservationId,
clusterPlacementGroupId,
compartmentId,
dedicatedVmHostId,
definedTags,
displayName,
extendedMetadata,
faultDomain,
freeformTags,
imageId,
instanceConfigurationId,
instanceOptions,
ipxeScript,
isAIEnterpriseEnabled,
launchMode,
launchOptions,
licensingConfigs,
lifecycleState,
metadata,
placementConstraintDetails,
platformConfig,
preemptibleInstanceConfig,
region,
securityAttributes,
securityAttributesState,
shape,
shapeConfig,
sourceDetails,
timeCreated,
timeMaintenanceRebootDue
;
Creates an instance configuration. An instance configuration is a template that defines the<br />settings to use when creating Compute instances.<br />
INSERT INTO oci.compute.instance_configurations (
compartmentId,
definedTags,
displayName,
freeformTags,
source,
region,
opc-retry-token
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ displayName }}',
'{{ freeformTags }}',
'{{ source }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
deferredFields,
definedTags,
displayName,
freeformTags,
instanceDetails,
timeCreated
;
# Description fields are for documentation purposes
- name: instance_configurations
props:
- name: instanceConfigurationId
value: "{{ instanceConfigurationId }}"
description: Required parameter for the instance_configurations resource.
- name: region
value: "{{ region }}"
description: Required parameter for the instance_configurations resource.
- name: instanceType
value: "{{ instanceType }}"
description: |
The type of instance details. Supported instanceType is compute
default: compute
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment
containing the instance configuration.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined tags for this resource. Each key is predefined and scoped to a
namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm).
Example: `{"Operations": {"CostCenter": "42"}}`
- name: displayName
value: "{{ displayName }}"
description: |
A user-friendly name. Does not have to be unique, and it's changeable.
Avoid entering confidential information.
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-form tags for this resource. Each tag is a simple key-value pair with no
predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm).
Example: `{"Department": "Finance"}`
- name: source
value: "{{ source }}"
description: |
The source of the instance configuration. An instance configuration defines the
settings to use when creating Compute instances, including details
such as the base image, shape, and metadata. You can also specify the associated resources for the
instance, such as block volume attachments and network configuration.
When you create an instance configuration using an existing instance as a template, the instance
configuration does not include any information from the source instance's boot volume, such as installed
applications, binaries, and files on the instance. It also does not include the contents of
any block volumes that are attached to the instance.
To create an instance configuration that includes the custom setup from an instance's boot volume, you
must first create a custom image from the instance (see [CreateImage](#/en/iaas/latest/Image/CreateImage)).
Then, use the custom image to launch a new instance
(see [LaunchInstance](#/en/iaas/latest/Instance/LaunchInstance)). Finally, create the instance
configuration based on the instance that you created from the custom image.
To include block volume contents with an instance configuration, first create a backup of the attached block volumes
(see [CreateVolumeBackup](#/en/iaas/latest/VolumeBackup/CreateVolumeBackup)). Then, create the instance
configuration by specifying the list of settings, using
[InstanceConfigurationVolumeSourceFromVolumeBackupDetails](#/en/iaas/latest/datatypes/InstanceConfigurationVolumeSourceFromVolumeBackupDetails)
to include the block volume backups in the list of settings.
The following values are supported:
* `NONE`: Creates an instance configuration using the list of settings that you specify.
* `INSTANCE`: Creates an instance configuration using an existing instance as a template.
valid_values: ['NONE', 'INSTANCE']
default: NONE
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: 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).
description: 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).
- name: opc-compute-cluster-id
value: "{{ opc-compute-cluster-id }}"
description: The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the [compute cluster](/iaas/Content/Compute/Tasks/compute-clusters.htm) that the instance will be created in.
description: The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the [compute cluster](/iaas/Content/Compute/Tasks/compute-clusters.htm) that the instance will be created in.
UPDATE examples​
- update
Updates the free-form tags, defined tags, and display name of an instance configuration.
UPDATE oci.compute.instance_configurations
SET
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}'
WHERE
instanceConfigurationId = '{{ instanceConfigurationId }}' --required
AND region = '{{ region }}' --required
AND opc-retry-token = '{{ opc-retry-token}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
deferredFields,
definedTags,
displayName,
freeformTags,
instanceDetails,
timeCreated;
DELETE examples​
- delete
Deletes an instance configuration.
DELETE FROM oci.compute.instance_configurations
WHERE instanceConfigurationId = '{{ instanceConfigurationId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;
Lifecycle Methods​
- change_compartment
Moves an instance configuration into a different compartment within the same tenancy.<br />For information about moving resources between compartments, see<br />[Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br /><br />When you move an instance configuration to a different compartment, associated resources such as<br />instance pools are not moved.<br /><br />Important: Most of the properties for an existing instance configuration, including the compartment,<br />cannot be modified after you create the instance configuration. Although you can move an instance configuration<br />to a different compartment, you will not be able to use the instance configuration to manage instance pools<br />in the new compartment. If you want to update an instance configuration to point to a different compartment,<br />you should instead create a new instance configuration in the target compartment using<br />[CreateInstanceConfiguration](/iaas/api/#/en/iaas/20160918/InstanceConfiguration/CreateInstanceConfiguration).<br />
EXEC oci.compute.instance_configurations.change_compartment
@instanceConfigurationId='{{ instanceConfigurationId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;