Working with Instances

You can create compute instances as needed to meet your compute and application requirements. After you create an instance, you can access it securely from your computer, restart it, attach and detach volumes, and terminate it.

For general information about instances, see Compute Instance Concepts in the Oracle Private Cloud Appliance Concepts Guide.

Creating an Instance

See Tutorial – Launching Your First Instance for information about input you need to create an instance.

The following is the minimum information that you must provide to create an instance using the Compute Web UI:

  • A name for the instance

  • The compartment where you want to create the instance

  • An image or boot volume

  • A shape

  • A subnet

  • A public SSH key

    To log in to the instance, users need either an SSH key or a password, depending on how the image was built. If the instance will require SSH keys for authentication, you must provide the public key when you create the instance. You cannot provide the public SSH key after the instance is created.

To create an instance using the OCI CLI, you need the same information as listed above for the Compute Web UI except that you do not need an instance name. If you do not provide a name for the instance, the default name will be instanceYYYYMMDDhhmmss, where YYYYMMDDhhmmss is the creation date and time.

To modify launch options, use the OCI CLI. You cannot modify launch options or boot volume VPUs per GB after the instance is created.

An alternative way to create an instance is to create an instance configuration and use that configuration to launch an instance, as described in Using an Instance Configuration to Launch an Instance. When you use an instance configuration to create an instance, you can specify blockVolumes and secondaryVnics, as shown in the OCI CLI procedure in Creating an Instance Configuration by Entering Configuration Values.

Using the Compute Web UI

  1. Create or get the following resources and information:

    • An image or boot volume and the compartment where the image or boot volume is located

    • A virtual cloud network (VCN) and subnet and the compartment where the VCN and subnet are located

    • A public Secure Shell (SSH) key if users will connect to the instance using SSH

  2. On the Dashboard, do one of the following to open the Create Instance dialog:

    • Click the Compute/Create Virtual Machine Instance button.

    • Click the Compute/View Images button. For the image that you want to use to create the instance, click the Actions menu and click the Create Instance From Image option. You might have to change the compartment at the top of the image list to see the image you want.

      When you use the Create Instance From Image option, the image name is already entered in the Create Instance dialog and you cannot change it. You do not need to enter any of the information described in "Source Image" in the following step.

  3. In the Create Instance dialog, enter the following information:

    • Name: Enter a name for the instance. Instance names have the following characteristics:

      • Can be changed after the instance is created.

      • Do not need to be unique.

      • Can contain only alphanumeric characters and the hyphen (-) character.

      • Can be a maximum of 63 characters.

    • Create in Compartment: Select the compartment where you want to create the instance.

    • Fault Domain: (Optional) Select a fault domain. By default, the system automatically selects the best fault domain for the instance when the instance is created. If you specify a fault domain, and the requested fault domain cannot accommodate the instance, instance launch fails. The fault domain can be changed after the instance is created.

    • Source Image: Select an image or boot volume.

      1. Select the Source Type: Platform Image, Custom Image, or Boot Volume.

      2. If you selected Custom Image or Boot Volume, select the compartment where the image or boot volume that you want to use is located.

      3. 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 operating system, 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 OCI CLI to create the instance and specify the OCID of the image.

      The source image cannot be changed after the instance is created.

    • Shape: Select a shape. For a description of each compute instance shape, see Compute Shapes in the Oracle Private Cloud Appliance Concepts Guide.

      If you select a standard shape, the amount of memory and number of OCPUs are displayed. These numbers match the numbers shown for this shape in the table in the Oracle Private Cloud Appliance Concepts Guide.

      If you select the flexible shape, VM.PCAStandard1.Flex, you must specify the number of OCPUs you want and you can specify the total amount of memory you want. The default value for gigabytes of memory is 16 times the number you specify for OCPUs. Click inside each value field to see the minimum and maximum allowed values.

      The shape and shape configuration can be changed after the instance is created.

    • 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 cannot 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 the oci-growfs command from that package to extend the root partition and then grow the file system. For other operating systems or for custom images, follow the instructions for that operating system.

      • Boot volume performance (VPUs): Use the increment and decrement arrows to toggle between balanced performance (10 VPUs/GB) and high performance (20 VPUs/GB). For more information, see "Block Volume Performance Options" in the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

    • Subnet: Select a subnet.

      1. Select a VCN from the list. You might need to change the compartment to the compartment where the VCN is located.

      2. Select a subnet.

    • Public IP Address: To connect to the instance using SSH, check the Assign Public IP box to have a public IP address assigned to the instance. This box is checked by default if you specified a public subnet. If you do not check this box, or if you uncheck this box, and then want to assign a public IP address later, see Assigning an Ephemeral Public IP Address to an Instance for instructions.

    • Private IP Address: (Optional) Specify an available private IP address from the subnet's CIDR. By default, a private IP address is automatically assigned.

    • Hostname: (Optional) Enter a hostname if you are using DNS within the cloud network. The hostname must be unique across all VNICs in the subnet.

      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 cannot provide this SSH key after the instance is created.

    • Initialization Script: (Optional) Provide an initialization script. This is a file of data to be used for custom instance initialization.

    • Network Security Group: (Optional) By default, the new instance is not attached to any NSG. Check the box labeled Enable Network Security Group to add the primary VNIC for this instance to one or more NSGs.

      1. Select an NSG from the drop-down list. You might need to change the compartment to find the NSG you want.

      2. Click the Add Another NSG button if you want to attach to another NSG.

      3. 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, uncheck the Enable Network Security Groups box.

      To update NSG attachments for this instance later, see Updating a VNIC.

      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) Check the "Restore instance lifecycle state after infrastructure maintenance" box to specify that running instances should be automatically restarted after a maintenance operation such as live migration. This is the default. If this box is not checked, the instance is recovered in the stopped state. For more information, see Configuring the Compute Service for High Availability in the Oracle Private Cloud Appliance Administrator Guide.

    • Tagging: (Optional) Add defined or free-form tags for this instance as described in Adding Tags at Resource Creation. Tags can also be applied later.

  4. Click the Create Instance button in the dialog.

    On success, the instance details page is displayed. On the Configuration tab, the Shape Configuration column shows the shape, the number of OCPUs, the network bandwidth, and the total memory. On the Networking tab, the VNIC column shows the VCN and subnet, and the Instance Access column shows the primary private IP address and any assigned public IP address.

    To check the status of the instance launch, scroll to the Resources section and click Work Request(s).

    If instance launch fails because of resource constraints, try remedies such as the following:

    • Specify a different fault domain or do not specify any fault domain and allow the system to choose.

    • Specify a less resource-intensive shape.

    • Stop an instance that you do not need currently.

    • Terminate an instance that you no longer need.

    If the status of the work request is Failed, and no reason is given for the failure, the cause of the failure might be temporary. If no reason is given for the failure, wait a short time and then retry the instance create.

Using the OCI CLI

  1. Create or get the following resources and information:

    • The OCID of the compartment where you want to create the instance: oci iam compartment list

    • The name of the shape for this instance. Use the following command to list the available shapes and their characteristics. Use the OCID of the compartment where you want to create the instance. To list only shapes that are compatible with the image that you plan to use, specify the image OCID. See also Compute Shapes in the Oracle Private Cloud Appliance Concepts Guide.

      $ oci compute shape list --compartment-id compartment_OCID --image-id image_OCID

      If you specify the flexible shape, VM.PCAStandard1.Flex, then you must also specify the shape configuration, as shown in the following example. You must provide a value for ocpus. The memoryInGBs property is optional; the default value in GBs is 16 times the number of ocpus.

      --shape-config '{"ocpus": 32, "memoryInGBs": 512}'

      If you specify a standard shape, do not specify --shape-config. The number of OCPUs and amount of memory are set to the values shown for this shape in "Standard Shapes" in Compute Shapes in the Oracle Private Cloud Appliance Concepts Guide.

      The shape and shape configuration can be changed after the instance is created.

    • The OCID of the subnet where the VNIC that is attached to this instance will be created: oci compute vnic-attachment list

    • If you provide a value for the --hostname-label option, see the description of Hostname in the preceding Compute Web UI procedure.

    • One of the following to specify either an image or a boot volume.

      • The OCID of the image used to boot the instance: oci compute image list

        Note:

        Do not choose an image that has "-OKE-" in its display name. The "-OKE-" images can only be used with Private Cloud Appliance Container Engine for Kubernetes.

      • The OCID of the boot volume used to boot the instance: oci compute boot-volume-attachment list

    • A public Secure Shell (SSH) key to connect to the instance using SSH.

      Note:

      You cannot provide this SSH key after the instance is created.

    For a complete list of required and optional parameters, use the following command:

    $ oci compute instance launch -h

    You might want to specify the --availability-config option to set a recoveryAction value to be used after a compute node maintenance operation. The value of recoveryAction can be RESTORE_INSTANCE or STOP_INSTANCE. For the meaning of these settings, see Configuring the Compute Service for High Availability in the Oracle Private Cloud Appliance Administrator Guide.

    --availability-config '{"isLiveMigrationPreferred": true, "recoveryAction": "RESTORE_INSTANCE"}'

    The settings shown in this example are the default values. If you explicitly set isLiveMigrationPreferred, you must set it to true.

    See the Compute Web UI procedure for characteristics of the --display-name and --hostname-label values. See Adding Tags at Resource Creation to add defined and free-form tags.

  2. Construct an argument for the --source-details option.

    The --source-details argument can be a JSON file or a command-line string. Use the following command to show the correct format of the JSON properties and values:

    $ oci compute instance launch --generate-param-json-input source-details
    [
      "This parameter should actually be a JSON object rather than an array - pick one of the
      following object variants to use",
      {
        "bootVolumeId": "string",
        "sourceType": "bootVolume"
      },
      {
        "bootVolumeSizeInGBs": 0,
        "bootVolumeVpusPerGB": 0,
        "imageId": "string",
        "kmsKeyId": "string",
        "sourceType": "image"
      }
    ]

    For information about bootVolumeSizeInGBs, see "Boot volume size" in the preceding Compute Web UI procedure.

    For information about bootVolumeVpusPerGB, see "High Performance" in the preceding Compute Web UI procedure.

    Note:

    When you later list or get this instance, the value of bootVolumeVpusPerGB is null because this boot volume property is not stored in the instance object after the instance is launched. To check the value after instance launch, use the bv boot-volume list or get command and check the value of vpus-per-gb.

  3. (Optional) Construct an argument for the --launch-options option.

    Only the firmware property can be changed. The default value is BIOS. You can alternatively specify UEFI_64. If you do not provide a correct value for firmware, the instance might not launch properly. You cannot update the value of the firmware property with the instance update command.

    The following shows the default values:

    {
      "bootVolumeType": "PARAVIRTUALIZED",
      "firmware": "BIOS",
      "isConsistentVolumeNamingEnabled": false,
      "is-pv-encryption-in-transit-enabled": false,
      "networkType": "PARAVIRTUALIZED",
      "remoteDataVolumeType": "PARAVIRTUALIZED"
    }

    To change the value of the firmware property, specify the following option:

    --launch-options file://launch_options.json

    Where the following is the content of the launch_options.json file:

    {
      "bootVolumeType": "PARAVIRTUALIZED",
      "firmware": "UEFI_64",
      "isConsistentVolumeNamingEnabled": false,
      "is-pv-encryption-in-transit-enabled": false,
      "networkType": "PARAVIRTUALIZED",
      "remoteDataVolumeType": "PARAVIRTUALIZED"
    }
  4. (Optional) Construct an argument for the --metadata or --extended-metadata option.

    Custom user data can be attached to the instance by using the --metadata and --extended-metadata options. Metadata key/value pairs are string/string maps in JSON format. Extended metadata can be nested JSON objects. Metadata and extended metadata have the following restrictions:

    • Keys are limited to 255 characters.

    • Most key values are limited to 255 characters.

      • The value of the ssh_authorized_keys key can be more than 255 characters. This value must be a valid public key in OpenSSH format.

      • The value of user_data can be a maximum of 16KB. This value is data that Cloud-Init can use to run custom scripts or provide custom Cloud-Init configuration.

    • Metadata can have a maximum of 128 keys.

    • The combined size of the metadata and extended metadata can be a maximum of 32,000 bytes.

    SSH keys can alternatively be provided in the file argument of the --ssh-authorized-keys-file option. User data can alternatively be provided in the file argument of the --user-data-file option. Use the -h option for more information.

    In the example in the next step, the authorized keys file contains one or more public SSH keys in the format required by the SSH authorized_keys file. Use a newline character to separate multiple keys. SSH public keys can be provided as the value of the ssh_authorized_keys key in the --metadata option, or in the file argument of the --ssh-authorized-keys-file option. Use -h for more information.

  5. Run the instance launch command.

    Syntax:

    oci compute instance launch --availability-domain AD-1 \
    --compartment-id compartment_OCID --shape shape --subnet-id subnet_OCID \
    --source-details file://image_info.json

    Example:

    If you are using a public subnet, a public IP address is assigned by default, or you can set the --assign-public-ip option value to true. If you need to assign a public IP address later, see Assigning an Ephemeral Public IP Address to an Instance for instructions.

    If you have upgraded your applications to use /v2 Instance Metadata Service (IMDS) endpoints, use the --instance-options option to set areLegacyImdsEndpointsDisabled to true. By default, legacy (/v1) Instance Metadata Service routes are enabled. 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.

    $ oci compute instance launch --availability-domain AD-1 \
    --compartment-id ocid1.compartment.unique_ID --display-name ops1 \
    --shape VM.PCAStandard1.16 --subnet-id ocid1.subnet.unique_ID --source-details \
    '{"bootVolumeSizeInGBs":100,"bootVolumeVpusPerGB":20,"imageId":"ocid1.image.unique_ID","sourceType":"image"}' \
    --assign-public-ip true --ssh-authorized-keys-file ./.ssh/name_of_public_SSH_key_file \
    --instance-options '{"areLegacyImdsEndpointsDisabled": true}'
    {
      "data": {
        "agent-config": null,
        "availability-config": {
          "is-live-migration-preferred": null,
          "recovery-action": "RESTORE_INSTANCE"
        },
        "availability-domain": "AD-1",
        "capacity-reservation-id": null,
        "compartment-id": "ocid1.compartment.unique_ID",
        "dedicated-vm-host-id": null,
        "defined-tags": {},
        "display-name": "ops1",
        "extended-metadata": null,
        "fault-domain": "FAULT-DOMAIN-1",
        "freeform-tags": {},
        "id": "ocid1.instance.unique_ID",
        "image-id": "ocid1.image.unique_ID",
        "instance-options": {
          "are-legacy-imds-endpoints-disabled": true
        },
        "ipxe-script": null,
        "launch-mode": "PARAVIRTUALIZED",
        "launch-options": {
          "boot-volume-type": "PARAVIRTUALIZED",
          "firmware": "BIOS",
          "is-consistent-volume-naming-enabled": false,
          "is-pv-encryption-in-transit-enabled": false,
          "network-type": "PARAVIRTUALIZED",
          "remote-data-volume-type": "PARAVIRTUALIZED"
        },
        "lifecycle-state": "PROVISIONING",
        "metadata": {
          "ssh_authorized_keys": "public_SSH_key"
        },
        "platform-config": null,
        "preemptible-instance-config": null,
        "region": "region_name",
        "shape": "VM.PCAStandard1.16",
        "shape-config": {
          "baseline-ocpu-utilization": null,
          "gpu-description": null,
          "gpus": null,
          "local-disk-description": null,
          "local-disks": null,
          "local-disks-total-size-in-gbs": null,
          "max-vnic-attachments": 16,
          "memory-in-gbs": 256.0,
          "networking-bandwidth-in-gbps": 24.6,
          "ocpus": 16.0,
          "processor-description": null
        },
        "source-details": {
          "boot-volume-size-in-gbs": 100,
          "bootVolumeVpusPerGB": 20,
          "image-id": "ocid1.image.unique_ID",
          "kms-key-id": null,
          "source-type": "image"
        },
        "system-tags": null,
        "time-created": "2021-09-22T20:20:04.715304+00:00",
        "time-maintenance-reboot-due": null
      },
      "etag": "92180faa-3660-446c-9559-c12a6e6111f9",
      "opc-work-request-id": "ocid1.workrequest.unique_ID"
    }

    Use the work-requests work-request get command to monitor the status of the instance launch:

    $ oci work-requests work-request get --work-request-id ocid1.workrequest.unique_ID

    If the status of the work request is Failed, and no reason is given for the failure, the cause of the failure might be temporary. If no reason is given for the failure, wait a short time and then retry the instance create.

Retrieving Instance Metadata from Within the Instance

The Instance Metadata Service (IMDS) serves information about a running instance to users who are logged in to that instance. IMDS also provides information to cloud-init that you can use for various system initialization tasks.

Note:

To access IMDS metadata, use an instance image that is provided by Oracle.

The IMDS metadata includes instance information such as the following:

  • The SSH public key that enables users to log in to the instance

  • Instance attached VNICs, VNIC IDs

  • Instance CIDR blocks

In general, the IMDS instance metadata includes the following:

  • The same information that you see on the details page of an instance in the Compute Web UI and in the output of the instance get command in the OCI CLI.

  • Custom information that you add to an instance by using the --metadata, --extended-metadata, --ssh-authorized-keys-file, and --user-data-file options of the instance launch command. This metadata cannot be updated after instance launch. For a user logged into the instance, the instance metadata is read-only.

Upgrading to IMDS Version 2 Endpoints

The Instance Metadata Service is available in two versions: version 1 and version 2.

Important:

To increase the security of metadata requests, upgrade all applications to use the IMDS version 2 endpoints, if supported by the image. Then disable use of IMDS version 1 endpoints.

IMDS version 2 endpoints (IMDSv2) are supported on the Oracle Linux images listed in "Platform Images" in the "Feature Updates" chapter of the Oracle Private Cloud Appliance Release Notes. Other platform images and most other images do not support IMDSv2.

For each instance, perform the following steps to upgrade to IMDSv2:

  1. Identify applications that are making IMDSv1 requests.

    For example, cloud-init makes requests to /v# instance endpoints.

  2. Migrate the identified applications to support IMDSv2 endpoints.

    When you use /v2 endpoints, you must include the "Authorization: Bearer Oracle" header. See the examples in Retrieving IMDS Instance Metadata.

  3. Disable IMDSv1 endpoints.

    Perform one of the following steps, as described in Creating an Instance.

    • On the details page of an instance, under Instance Details, check the value of Legacy Instance Metadata Service Endpoints. If the value of Legacy Instance Metadata Service Endpoints is Enabled, click Edit on the Controls menu, and check the box for Legacy Instance Metadata Service Endpoints Disabled.

    • In the output from instance list or instance get, under instance-options, check the value of are-legacy-imds-endpoints-disabled. If the value of are-legacy-imds-endpoints-disabled is null or false, use the instance update command to specify the following option:

      --instance-options '{"areLegacyImdsEndpointsDisabled": true}'

    Future requests to legacy (v1) endpoints will be rejected with a 404 not found error.

Retrieving IMDS Instance Metadata

To retrieve the IMDS instance metadata, follow these steps:

  1. Log in to the instance.

  2. Use a cURL command to retrieve the metadata information from the HTTP endpoint.

    Information is provided through an HTTP endpoint that listens on 169.254.169.254. If an instance has multiple VNICs, you must send the request using the primary VNIC.

    Use the instance command to retrieve the instance metadata. Use the vnics command to retrieve the VNIC data.

    If you are using /v2 endpoints, as shown in the following examples, then you must include the "Authorization: Bearer Oracle" header.

    Example: Instance Metadata

    $ curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/
    {
        "availabilityDomain": "AD-1",
        "faultDomain": "FAULT-DOMAIN-1",
        "compartmentId": "ocid1.compartment.unique_ID",
        "displayName": "dev1",
        "hostname": "hostname",
        "id": "ocid1.instance.unique_ID",
        "image": "ocid1.image.unique_ID",
        "metadata": {
            "ssh_authorized_keys": "public_SSH_key"
        },
        "region": "PCA",
        "canonicalRegionName": "PCA",
        "ociAdName": "PCA",
        "regionInfo": null,
        "shape": "VM.PCAStandard1.1",
        "state": "RUNNING",
        "timeCreated": 1634943279000,
        "agentConfig": null
    }

    To retrieve a single value, specify the key name as shown in the following example.

    Example: VNIC Metadata

    $ curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/vnics/
    [
        {
            "vnicId": "ocid1.vnic.unique_ID",
            "privateIp": "privateIp",
            "vlanTag": 0,
            "macAddr": "00:13:97:9f:16:32",
            "virtualRouterIp": "virtualRouterIp",
            "subnetCidrBlock": "subnetCidrBlock"
        }
    ]

    You can view all of the data for one of multiple VNICs by specifying the array index for that VNIC data, or you can retrieve a single value for that specified VNIC:

    $ curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/vnics/0/privateIp
    privateIp

Updating an Instance

In addition to updating the properties of an instance, you might want to attach additional block volumes or secondary VNICs. See Creating and Attaching Block Volumes and Creating and Attaching a Secondary VNIC. You can also specify block volumes and secondary VNICs when you use an instance configuration to create an instance.

If you did not add a public IP address when you created the instance, and you want to assign a public IP address now, see Assigning an Ephemeral Public IP Address to an Instance for instructions.

You can update the display name, fault domain, shape, instance options, availability configuration, and tags of an instance. By using the OCI CLI, you can also update the instance metadata. See the descriptions of these properties in Creating an Instance.

If the updated instance cannot run because of resource constraints, see the suggested remedies in Creating an Instance.

Using the Compute Web UI

  1. On the Dashboard, click the Compute/View Instances button.

  2. If the instance that you want to update is not listed, use the Compartment drop-down menu above the instances list to select the correct compartment.

  3. For the instance that you want to update, click the Actions menu, and click the Edit option.

  4. In the Edit instance_name dialog, make the changes.

    When you update an instance by using the Compute Web UI, you can change the following:

    • Name of the instance

    • Fault domain

      When you change the fault domain of a stopped instance, the new fault domain is set in the instance properties. When you change the fault domain of a running instance, the instance is stopped, moved, and started on a new compute node in the new fault domain. See Stopping, Starting, and Resetting an Instance for how to prepare for an instance to stop. Stopping and starting an instance can take up to five minutes.

      If you specify a fault domain, and the requested fault domain cannot accommodate the instance, instance restart fails; the instance remains stopped. The new fault domain specification remains in the instance properties.

    • Shape

      When you change the shape of a stopped instance, the new shape and shape configuration are set in the instance properties. When you change the shape of a running instance, the instance is stopped, reconfigured, and restarted. See Stopping, Starting, and Resetting an Instance for how to prepare for an instance to stop. Stopping and starting an instance can take up to five minutes.

      If you select the flexible shape, VM.PCAStandard1.Flex, you must specify the number of OCPUs you want and you can specify the total amount of memory you want. The default value for GBs of memory is 16 times the number you specify for OCPUs. Click inside each value field to see the minimum and maximum allowed values.

      If the specified shape and shape configuration cannot be accommodated in the fault domain, instance restart fails; the instance remains stopped. The new shape and shape configuration remain in the instance properties.

    • Instance Options

      If you have upgraded your applications to use /v2 Instance Metadata Service (IMDS) endpoints, check this box to disable /v1 endpoints. For more information about the Instance Metadata Service, see Retrieving Instance Metadata from Within the Instance.

    • Availability configuration

      This sets whether an instance that has been stopped by the Compute service is restarted when resources become available (the default) or remains stopped. See Configuring the Compute Service for High Availability in the Oracle Private Cloud Appliance Administrator Guide.

    • Tags

  5. Click the Save Changes button.

    If you changed the fault domain, shape, or shape configuration of a running instance, you must confirm that you understand that the instance will be rebooted. For those changes, the instance will be stopped, reconfigured, and restarted.

Using the OCI CLI

  1. Get the OCID of the instance that you want to update: oci compute instance list

    If you want to change the fault domain of the instance, get the OCID of the fault domain:

    $ oci iam fault-domain list --compartment-id compartment_OCID \
    --availability-domain AD-1

    If you want to change the shape of the instance, get the name of the shape:

    $ oci compute shape list --compartment-id compartment_OCID --image-id image_OCID
  2. Run the instance update command.

    Syntax:

    oci compute instance update --instance-id instance_OCID \
    options_with_values_to_update

    For descriptions of instance properties that you can change, enter the following command and scroll to Optional Parameters:

    $ oci compute instance update -h

    Use --instance-options if you need to disable IMDSv1 endpoints for this instance. See Retrieving Instance Metadata from Within the Instance.

    You might want to specify the --availability-config option to set a recoveryAction value to be used after a compute node maintenance operation. For the meaning of this setting, see Configuring the Compute Service for High Availability in the Oracle Private Cloud Appliance Administrator Guide. For how to set this property and default values, see Creating an Instance. If you are using Terraform, see "Terraform Instance Update Requires Explicit Live Migration Setting" in Compute Service Issues in Known Issues and Workarounds in the Oracle Private Cloud Appliance Release Notes.

    See the Compute Web UI procedure for more information about changing the fault domain or shape.

    If you specify the flexible shape, VM.PCAStandard1.Flex, then you must also specify --shape-config You must provide a value for ocpus. The memoryInGBs property is optional; the default value in GBs is 16 times the number of ocpus.

    If you specify a standard shape, do not specify --shape-config. The number of OCPUs and amount of memory are set to the values shown for this shape in "Standard Shapes" in Compute Shapes in the Oracle Private Cloud Appliance Concepts Guide.

    Example:

    $ oci compute instance update --instance-id ocid1.instance.unique_ID \
    --shape VM.PCAStandard1.Flex --shape-config '{"ocpus": 16, "memoryInGBs": 512}'

Stopping, Starting, and Resetting an Instance

You can perform the following power actions on an instance: Start, stop, soft stop, reset, and soft reset. The following note applies to all of the stop and reset actions.

Important:

For soft stop and soft reset, any application that is running on the instance that takes more than 15 minutes to shut down could be improperly stopped, resulting in data corruption. For stop and reset, any application that is running on the instance will be immediately stopped, possibly resulting in data corruption. To avoid stopping the instance while applications are running, manually shut down the instance by using the commands available in the instance OS.

After the instance is shut down from the OS, then stop, soft stop, reset, or soft reset the instance from the appliance.

  • START. Power on the instance. The Compute service attempts to restart the instance in the same fault domain that it was in when it was stopped, or in the currently specified fault domain if the fault domain was updated while the instance was stopped. If the instance start operation fails, the instance remains stopped.

    If the start operation fails because of resource constraints, you could specify a different fault domain for the instance (see Updating an Instance), change the configuration of the instance, or stop, reconfigure, or terminate other instances.

    If the start operation fails, and no reason is given for the failure, the cause of the failure might be temporary. If no reason is given for the failure, wait a short time and then retry the instance start.

    Starting an instance can take up to five minutes.

  • STOP. Power off the instance. Compute resources are released and the instance is disconnected and unassigned from the compute node. See the important note at the beginning of this section.

    Stopping an instance can take up to five minutes.

    An instance that is Stopped cannot be migrated to a different compute node. See "Migrating Instances from a Compute Node" in Hardware Administration in the Oracle Private Cloud Appliance Administrator Guide.

  • SOFTSTOP. Gracefully shut down the instance by sending a shutdown command to the operating system. After waiting 15 minutes for the OS to shut down, the instance is powered off. See also the description of STOP and the important note at the beginning of this section.

  • RESET. Power off the instance and then power it back on. See the descriptions of STOP and START and the important note at the beginning of this section.

  • SOFTRESET. Gracefully reboot the instance by sending a shutdown command to the operating system. After waiting 15 minutes for the OS to shut down, the instance is powered off and then powered back on. See the important note at the beginning of this section.

Using the Compute Web UI

  1. On the Dashboard, click the Compute/View Instances button.

  2. If the instance that you want to manage is not listed, use the Compartment drop-down menu above the instances list to select the correct compartment.

  3. For the instance that you want to manage, click the Actions menu, and click the Start, Stop, or Reset option.

    By default, clicking Stop selects Soft Stop and clicking Reset selects Soft Reset. To stop or reset the instance immediately, click the Force option on the confirmation dialog.

  4. Click the Start Instance, Stop Instance, or Reboot Instance button on the confirmation dialog.

    In the Resources section of the instance details page, click Work Request(s) to check the status of the instance stop, start, or reboot.

Using the OCI CLI

  1. Get the OCID of the instance that you want to stop, start, or reset: oci compute instance list

  2. Run the stop, start, or reset command.

    Syntax:

    oci compute instance action --instance-id instance_OCID \
    --action {START | STOP | RESET | SOFTSTOP | SOFTRESET}

    For descriptions of these actions, enter:

    $ oci compute instance action -h

    Example:

    $ oci compute instance action --instance-id ocid1.instance.unique_ID --action RESET

    If you need more information about the instance state change, see the logs as described in "Accessing System Logs" in Status and Health Monitoring in the Oracle Private Cloud Appliance Administrator Guide.

Terminating an Instance

By default, the boot volume of the instance is preserved when you terminate the instance. You can attach the boot volume to a different instance as a data volume, or use it to launch a new instance. If you no longer need the boot volume, you can permanently delete it as described in Deleting a Boot Volume.

Using the Compute Web UI

  1. On the Dashboard, click the Compute/View Instances button.

  2. If the instance that you want to terminate is not listed, use the Compartment drop-down menu above the instances list to select the correct compartment.

  3. Click the instance that you want to terminate.

  4. On the instance details page, click the Controls menu and click the Terminate option.

    Click Work Request(s) in the Resources box to check the status of the instance terminate. After the TerminateInstance operation is 100% complete and in state Succeeded, the instance remains visible in the instance list in state Terminated for at least 24 hours, up to 24.5 hours. No further action is needed to terminate the instance.

Using the OCI CLI

  1. Get the OCID of the instance that you want to terminate: oci compute instance list

  2. Run the instance terminate command.

    Example:

    $ oci compute instance terminate --instance-id ocid1.instance.unique_ID

    Use the work-requests work-request get command to check the status of the instance terminate. After the TerminateInstance operation is percent-complete 100.0 and status SUCCEEDED, the instance remains visible in instance list or get in lifecycle-state TERMINATED for at least 24 hours, up to 24.5 hours. No further action is needed to terminate the instance.