Updated 2025-01-13

Creating an Instance Configuration

Instance configurations let you define the settings to use when creating compute instances. Use an instance configuration in the following scenarios:

  • To create one or more instances in an instance pool.
  • As a template for launching individual instances that are not part of a pool.

When you create an instance configuration, you can use an existing compute instance as a template, or you can provide a list of configuration settings.

You can optionally specify a secondary virtual network interface card (VNIC) and block volumes to attach to the instances that are created from an instance configuration. To do this, create the instance configuration by providing a list of configuration settings.

Limitations and Considerations

  • If you use an existing instance as a template to create an instance configuration, 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.
    • 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. For example, you use an instance in compartment A as the basis 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, the same compartment as the original instance.
  • If you provide a list of configuration settings to create an instance configuration, be aware of the following information:

    • When you create an instance from the instance configuration, many of the settings defined in the instance configuration cannot be changed. For example, the availability domain, compartment, image, shape, and subnet cannot be changed when you create the instance.
    • Many of the settings for creating instance configurations are the same as the settings in the create compute instance workflow. However, not all settings are available for instance configurations. For some settings, you can provide a value when you create an instance from the instance configuration.

    • For Linux instances: Using Secure Shell (SSH) keys with instance configurations:

      • If you add an SSH key when you create the instance configuration, that SSH key must be used to connect to all instances created from the instance configuration.
      • After you create the instance configuration, you cannot change the SSH key.
      • If you create an instance configuration without an SSH key, you can add an SSH key to individual instances created from the instance configuration.
      • If you use the instance configuration to create an instance pool, you should add an SSH key when you create the instance configuration.
  • When an instance pool creates instances in the pool based on an instance configuration, the pool's settings define the availability domain and subnet, regardless of the settings in the instance configuration.
  • 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.

Before You Begin

If you're providing a list of configuration settings, prepare the following items:

  • Set up a virtual cloud network (VCN) in which to launch the instances that are created from the instance configuration. For information about setting up cloud networks, see Networking.
  • (For Linux instances) If you want to use your own SSH key to connect using SSH to the instances that are created from the instance configuration, you need the public key from the SSH key pair that you plan to use. The key must be in OpenSSH format. For more information, see Managing Key Pairs on Linux Instances.
  • If you want to launch instances from the instance configuration by using a host capacity type other than on-demand capacity, prepare the capacity:

    • To launch an instance and have it count against a capacity reservation, you must have a capacity reservation in the same availability domain as the instance.
    • To place an instance on a dedicated virtual machine host, you must have a dedicated virtual machine host in the same availability domain and fault domain that you want to launch the instance in.

    The capacity types are mutually exclusive.

If you want to attach block volumes to the instances that are created from the instance configuration, perform one of the following actions: