Creating an Instance Configuration
Instance configurations let you define the settings to use when creating compute instances.
Use an instance configuration when you want to create one or more instances in an instance pool. You can also use an instance configuration to launch individual instances that are not part of a pool using the SDKs, command line interface (CLI), or API.
To create an instance configuration in the Console, use an existing compute instance as a template. If you want to create an instance configuration by specifying a list of configuration settings, use the SDKs, CLI, or API.
Limitations and Considerations
When you create an instance configuration using an existing instance as a template, be aware of the following information:
- The instance configuration does not include any information from the instance's boot volume, such as installed applications, binaries, and files on the instance. To create an instance configuration that includes the custom setup from an instance, you must first create a custom image from the instance and then use the custom image to create a new instance. Finally, create the instance configuration based on the instance that you created from the custom image.
- The instance configuration does not include the contents of any block volumes that are attached to the instance. To include block volume contents with an instance configuration, first create a backup of the attached block volumes. Then, use the SDKs, CLI, or API to create the instance configuration, specifying the block volume backups in the list of configuration settings.
- Any instances created from the instance configuration are placed in the same compartment as the instance that was used as the basis for the instance configuration, regardless of the compartment of the instance configuration. For example, an instance in compartment A is used to create an instance configuration. You place the instance configuration in compartment B. Any instances created using that instance configuration will be located in compartment A.
- If the instance configuration is associated with a capacity reservation, that reservation is automatically applied to any instances or instance pools created using that instance configuration. As long as sufficient capacity is available, when the instances launch, they use capacity from the associated reservation.
Required IAM Policy
To use Oracle Cloud Infrastructure, you must be granted security access in a policy by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment to work in.
For administrators: For a typical policy that gives access to instance pools and instance configurations, see Let users manage Compute instance configurations, instance pools, and cluster networks.
Using the Console
- Open the navigation menu and click Compute. Under Compute, click Instances.
- Click the instance whose image you want to use as a template to create the instance configuration.
- Click More Actions, and then click Create Instance Configuration.
- Select the compartment you want to create the instance configuration in.
- Specify a name for the instance configuration. It doesn't have to be unique, and it cannot be changed later in the Console (but you can change it with the API). Avoid entering confidential information.
- Show Tagging Options: Optionally, you can add tags. If you have permissions to create a resource, you also have permissions to add free-form tags to that resource. To add 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 whether you should add tags, skip this option (you can add tags later) or ask your administrator.
- Click Create Instance Configuration.
Using the CLI
To create an instance configuration using the CLI, open a command prompt and run the instance-configuration create command:
oci compute-management instance-configuration create --compartment-id <COMPARTMENT_OCID> --instance-details <file://path/to/file.json>
<file://path/to/file.json> is the path to a JSON file that defines the instance details. For information about how to generate an example of the JSON file, see Advanced JSON Options.
For information about using the CLI, see Command Line Interface (CLI).
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 CreateInstanceConfiguration operation to create an instance configuration.