Creating an Instance Configuration by Entering Configuration Values
On Compute Cloud@Customer, you can create an instance configuration by entering values for individual instance configuration settings.
If you specify a boot volume size that's larger than the default, you need to extend the volume to take advantage of the larger size. See Resizing Volumes.
Avoid entering confidential information in names and tags.
Important Information About Using Marketplace Images to Create Instances
The first time you create an instance using a Marketplace image, you must use the Compute Cloud@Customer Console so that you can accept the user agreement. After that, you can use the Console, CLI, and API to create instances with a Marketplace image.
To maintain the integrity of Marketplace images, there are restrictions and permissible actions. For more information, see Marketplace Image Restrictions and Permissible Marketplace Image Administration.
-
In the Compute Cloud@Customer Console navigation menu, click Compute, then click Instance Configurations.
-
Click Create Instance Configuration.
-
In the Create Instance Configuration dialog box, enter the following information:
-
Name: Enter a name for the instance configuration.
-
Create in compartment: Select the compartment where you want this instance configuration to be created.
-
Compartment to create instances in: Select the compartment where you want the instances to be created.
-
Fault Domain: (Optional) You can select a fault domain. By default, the system automatically selects the best fault domain for instances. If you specify a fault domain, and the requested fault domain can't accommodate the instance, instance launch fails. See more information about fault domains in Creating an Instance.
-
Source Image: Select an image or boot volume.
-
Select the Source Type:
- Platform Image: Select to create an instance based on one of the Oracle Linux and Oracle Solaris images that are available in every compartment. See Compute Cloud@Customer Platform Images.
- Custom Image: Selectable if a custom image was created. You might need to select the compartment where the custom image is located. See Managing Custom Images.
- Boot Volume: Select to create the instance based on an existing boot volume. You might need to select the compartment where the boot volume is located.
- Marketplace Image: Selectable if Marketplace images are available on Compute Cloud@Customer. See Marketplace Images.
-
Select an image or boot volume from the list.
If you selected Platform Image, you see a tabular list with columns Operating System, OS Version, and Image Build (the date the image was built). You can use the drop-down menu arrow to the right of the OS version to select a different version. For example, for the Oracle Linux OS, you can use the drop-down menu to select 9, 8, or 7.9.
If you selected Custom Image, you see a tabular list with columns Name, Operating System, and OS Version. You can use the arrows in the column headings to sort the list. You can filter the list by using the Operating System drop-down menu above the list of images.
If you selected Boot Volume, you see a tabular list with columns Name, Size (GB), and Created (the date the boot volume was created). You can use the arrows in the column headings to sort the list. In the Boot Volume section (after the Shape section), you can customize the boot volume size.
If the list is too long to fit in one view, use the arrow buttons to view another page of the list.
To use a platform image that was previously available but is no longer listed, use the Console to create the instance and specify the OCID of the image.
If you selected a Marketplace image, select a Marketplace image. If this is the first time you've created an instance with this Marketplace image, an Agreement Panel is displayed. Before the instance is created, you must click Accept Agreement and confirm the agreement.
-
-
Shape: If you're using a platform image, select the VM.PCAStandard.E5.Flex shape, and configure the number of OCPUs and memory.
For the OCPU and memory values, click inside each value field to see the minimum and maximum allowed values. The OCPU and memory configuration can be changed after the instance is created.
For a description of the supported shape, see Compute Shape.
-
Boot Volume: (Optional) Check the box to specify a custom boot volume size or volume performance setting.
-
Boot volume size (GB): The default boot volume size for the selected image is shown. To specify a larger size, enter an integer number of gigabytes up to 16384 (16 TB) or use the increment and decrement arrows. You can't enter a value smaller than the default size.
If you specify a custom boot volume size, you need to extend the partition to take advantage of the larger size. Oracle Linux platform images include the
oci-utils
package. Use theoci-growfs
command from that package to extend the root partition and then grow the file system. For other OSs or for custom images, follow the instructions for that OS. -
Boot volume performance (VPUs): Use the increment and decrement arrows to toggle between balanced performance (10 VPUs/GB) and high performance (20 VPUs/GB).
-
-
Subnet: Select a subnet.
-
Select a VCN from the list. You might need to change the compartment to the compartment where the VCN is located.
-
Select a subnet.
-
-
Public IP Address: To use SSH to connect to instances created with this instance configuration, check the Assign Public IP box to have a public IP address assigned to the instances. This box is checked by default if you specified a public subnet. If you don't check this box, or if you clear this box, and then want to assign a public IP address later, see Assigning an Ephemeral Public IP Address to an Instance for instructions.
- Secondary VNICs: (Optional) Check the Create Additional VNIC box to create secondary VNICs for instances created with this instance configuration. For descriptions of the requested information requested, see Creating and Attaching a Secondary VNIC.
-
Private IP Address: (Optional) Specify an available private IP address from the subnet CIDR. By default, a private IP address is automatically assigned.
Note
Because the private IP address must be unique for each instance, don't specify a private IP address if you're going to use this instance configuration to create an instance pool.
-
DNS Record: (Optional) Check the Assign a private DNS record box to assign a DNS record to instances created with this instance configuration.
-
Hostname: (Optional) Enter a hostname if you're using DNS within the cloud network. The hostname must be unique across all VNICs in the subnet.
Note
Don't specify a host name if you are going to use this instance configuration to create an instance pool.
By default, the instance name is used for the hostname. The hostname can also be configured in the OS after the instance is created.
If this is a UNIX instance, see Creating a Mount Target and Mounting File Systems on UNIX-based Instances for more information about setting the host name correctly for mounting file systems.
-
SSH Keys: To connect to the instance using SSH, provide a public SSH key.
Note
You can't provide this SSH key after the instance is created.
-
Network Security Group: (Optional) By default, instances aren't attached to any NSG. Check the Enable Network Security Group box to add the primary VNIC for this instance to one or more NSGs.
-
Select an NSG from the drop-down list. You might need to change the compartment to find the NSG you want.
-
Click Add Network Security Group to attach to another NSG.
-
To remove an NSG from the list, click the trash can to the right of that NSG. To remove the last NSG or all NSGs, clear the Enable Network Security Groups box.
See Controlling Traffic with Network Security Groups for information about NSGs.
-
-
Instance Options: Check the box to disable Legacy Instance Metadata Service Endpoints. By default, legacy (
/v1
) Instance Metadata Service (IMDS) routes are enabled. If you have upgraded your applications to use/v2
endpoints, check this box to disable/v1
endpoints. For more information about the Instance Metadata Service, see Retrieving Instance Metadata from Within the Instance. For more information about upgrading your applications, see Upgrading to IMDS Version 2 Endpoints. -
Availability configuration: (Optional) By default, the system automatically selects the best instance availability option during a maintenance operation such as live migration. Check the Restore instance lifecycle state after infrastructure maintenance box to specify that running instances should be automatically restarted after a maintenance event. If this box isn't checked, the instance is recovered in the stopped state.
-
Tagging: (Optional) Add one or more tags to this resource. Tags can also be applied later. For more information about tagging resources, see Resource Tags.
-
-
Click Create Instance Configuration.
-
Use the oci compute-management instance-configuration create command and required parameters to create an instance configuration by entering configuration values.
oci compute-management instance-configuration create -c <compartment_OCID> --display-name <IC_name> --instance-details file://<custom_config_file>.json
The specified compartment is where this instance configuration is created. This compartment could be different from the compartment specified in the instance details JSON file, which is where the instances will be created.
The specified display name is the name of the instance configuration. If you don't provide a value for the
--display-name
option, the default name of the instance configuration isinstanceconfiguration YYYYMMDDhhmmss
, whereYYYYMMDDhhmmss
is the creation date and time.For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Procedure
-
Get the following information:
-
The OCID of the compartment where you want to create this instance configuration.
-
The OCID of the compartment where you want instances that use this instance configuration to be created.
-
The name of the availability domain for instances that use this instance configuration.
-
The OCID of the image or boot volume for instances that use this instance configuration.
-
The name of the shape for instances that use this instance configuration.
-
The OCID of the subnet for instances that use this instance configuration.
-
-
Create the configuration file that supplies input to the configuration create command.
The configuration file is a JSON file of property/value pairs.
-
Use the following command to generate the correct syntax of the configuration file and names of properties:
$ oci compute-management instance-configuration create --generate-param-json-input instance-details > instance_details.json
You don't need all the data that's output by this command. Copy only the information you need, being careful to keep each property in its correct context.
If you omit the fault domain specification, the system automatically selects the best fault domain. If you specify only a single fault domain, all instances are placed in only that fault domain.
If a fault domain that you specify doesn't have enough resources, instances might fail to launch:
-
When you create a single instance (Using an Instance Configuration to Create an Instance), and you specify a fault domain in the instance configuration, only that specified fault domain is used to create the instance. Resource constraints might cause the instance launch to fail.
-
When you create instances in a pool, fault domains specified in the placement configuration override fault domains specified in the instance configuration. See Creating an Instance Pool for more information.
You can specify secondary VNICs and subnets. If you specify a hostname label for a secondary VNIC, the specified hostname label must be unique across all VNICs in the subnet. If you provide a value for the
hostnameLabel
property, you must also set the value ofassignPrivateDnsRecord
totrue
.-
If the specified hostname label is already in use in the subnet, instance launch (Using an Instance Configuration to Create an Instance) will fail with the error "Hostname
hostname
already in use for the subnet." -
The
hostnameLabel
property is ignored when you use the instance configuration to create a pool of instances. By default, the instance name is used for the hostname.
If you omit the
assignPublicIp
property, a public IP address is assigned by default if you specify a public subnet. If you set this property tofalse
and then decide to assign a public IP address later, see Assigning an Ephemeral Public IP Address to an Instance for instructions.If users will use
ssh
to connect to the instance, specify the SSH public key as the value of thessh_authorized_keys
property in themetadata
block. You can't add the SSH public key after the instance is created.The
displayName
property is used for the instance name when you use thelaunch-compute-instance
command as described in Using an Instance Configuration to Create an Instance. If you don't provide a value for thedisplayName
property, the default name of instances isinstance YYYYMMDDhhmmss
, whereYYYYMMDDhhmmss
is the creation date and time.The
displayName
property is ignored when you create instances in a pool as described in Creating an Instance Pool. -
-
The following command shows which properties are required to create an instance:
$ oci compute instance launch -h
Scroll to the Required Parameters section. Optional parameters are described below the required parameters.
The names of the properties in the configuration file are similar to, but different from, the names of the
instance launch
options. Also, some properties are organized into groups of properties, such ascreateVnicDetails
,shapeConfig
, andsourceDetails
, as shown in the following example configuration file:{ "instanceType": "compute", "launchDetails": { "availabilityDomain": "AD-1", "compartmentId": "compartment_OCID", "createVnicDetails": { "assignPublicIp": true, "freeformTags": { "ConfigType": "Configuration for an XYZ instance." }, "subnetId": "subnet_OCID" }, "displayName": "instance_name", "instanceOptions": { "areLegacyImdsEndpointsDisabled": true }, "metadata": { "ssh_authorized_keys": "public_SSH_key" }, "shape": "shape_name", "shapeConfig": { "memoryInGBs": 512, "ocpus": 32 }, "sourceDetails": { "bootVolumeSizeInGBs": 100, "bootVolumeVpusPerGB": 20, "imageId": "image_OCID", "sourceType": "image" } } }
Use
instanceOptions
if you need to disable IMDSv1 endpoints for this instance. See Retrieving Instance Metadata from Within the Instance.Specify the flexible shape,
VM.PCAStandard.E5.Flex
, and also specify the shape configuration. You must provide a value forocpus
. ThememoryInGBs
property is optional; the default value in gigabytes is 16 times the number ofocpus
.For information about
bootVolumeSizeInGBs
, see "Boot volume size" in Creating an Instance Configuration from an Instance CLI tab.For information about
bootVolumeVpusPerGB
, see "High Performance" in Creating an Instance Configuration from an Instance CLI tab. When instances are launched, the value ofbootVolumeVpusPerGB
isnull
because this boot volume property isn't stored in the instance object after the instance is launched. To check the value, use theget boot volume
command and see the value ofvpus-per-gb
.To change the value of the
firmware
property, provide a value for thelaunchOptions
property. The default value is BIOS. You can alternatively specify UEFI_64. Other properties inlaunchOptions
can't be changed."launchOptions": { "bootVolumeType": "PARAVIRTUALIZED", "firmware": "UEFI_64", "isConsistentVolumeNamingEnabled": false, "isPvEncryptionInTransitEnabled": false, "networkType": "PARAVIRTUALIZED", "remoteDataVolumeType": "PARAVIRTUALIZED" }
-
-
Run the instance configuration create command.
Syntax:
oci compute-management instance-configuration create -c <compartment_OCID> --display-name <IC_name> --instance-details file://<custom_config_file>.json
The specified compartment is where this instance configuration is created. This compartment could be different from the compartment specified in the instance details JSON file, which is where the instances will be created.
The specified display name is the name of the instance configuration. If you don't provide a value for the
--display-name
option, the default name of the instance configuration isinstanceconfiguration YYYYMMDDhhmmss
, whereYYYYMMDDhhmmss
is the creation date and time.The output of this command is the same as the output of the
instance-configuration get
command.
-
Use the CreateInstanceConfiguration operation to create an instance configuration entering configuration values.
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.