Updating an Instance

Topics

Note:

You should always use your orchestrations to manage resources that you’ve created using orchestrations. Don’t, for example, use the web console or the CLI or REST API to update an object that you created using an orchestration. This could cause your orchestration to either attempt to re-create the object and associated resources, or to go into an error state. See Workflows for Updating Orchestrations v2.

Attaching a Public IP Address to an Instance on the Shared Network

You can associate a public IP address with an instance either while creating the instance, or while creating or updating an IP reservation. If you’ve already created an instance with an interface on the shared network, then you can also associate a public IP address with the interface on the shared network by updating the instance.

Note:

When you attach an IP reservation to a running instance, then if you delete and re-create or shut down and restart the instance, the IP reservation reverts to whatever was specified while creating the instance and any updates made to the IP reservation are lost. You must update the IP reservation again.

To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify the instance that you want to associate a public IP address with. From the menu icon menu, select View.
  3. On the instance details page, click Assign Public IP.
  4. In the Assign Public IP dialog box, the Create IP Reservation option is selected by default.
    • To create a new IP reservation and assign it to the instance, enter a name for the IP reservation and click Assign.
    • To select an existing IP reservation, deselect the Create IP Reservation check box, select an IP reservation from the Existing IP Reservations drop-down list, and then click Assign.

You can also associate an IP reservation with an instance when you create or update the IP reservation. See Reserving a Public IP Address or Updating an IP Reservation.

Internally, an IP reservation is associated with an instance through the instance’s vcable. A vcable provides an attachment point to a specific network interface on an instance. The vcable of an instance is created automatically when the instance is launched and is deleted when the instance is deleted.

The process of adding a virtual link between an instance and an IP reservation is also referred to as IP association.

To find out the vcable ID of your instance using the CLI, use the opc compute instance get command. To associate an IP reservation with an instance using the CLI, use the opc compute ip-association add command and specify the vcable ID. For help with these commands, run each command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To find out the vcable ID of your instance using the API, use the GET /instance/name method. To associate an IP reservation with an instance using the API, use the POST /ip/association/ method. See REST API for Oracle Cloud Infrastructure Compute Classic.

Attaching a Storage Volume to an Instance

A storage volume is a virtual disk that provides persistent block storage space for instances in Compute Classic. You can provide or increase the block storage capacity for an instance by attaching storage volumes.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • You must have created the storage volume that you want to attach to your instance. See Creating a Storage Volume.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify the instance to which you want to attach a storage volume. From the menu icon menu, select View.
  3. On the instance details page, click Attach Storage Volume.
  4. Select the volume that you want to attach.
  5. The Attach as Disk # field is filled automatically with the next available index at which the volume can be attached. You can leave this field at the automatically selected disk number or enter a higher number up to 10.

    The disk number that you specify here determines the device name. The disk attached at index 1 is named /dev/xvdb, the disk at index 2 is /dev/xvdc, the disk at index 3 is /dev/xvdd, and so on.

    Make a note of the disk number. You’ll need it later when you mount the storage volume on the instance.

  6. Click Attach.

You can also attach a storage volume to a running instance from the Storage page. See Attaching a Storage Volume to an Instance.

To attach a storage volume to an instance using the CLI, you must add a storage attachment object by using the opc compute storage-attachment add command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To attach a storage volume to an instance using the API, you must add a storage attachment object by using the POST /storage/attachment method. See REST API for Oracle Cloud Infrastructure Compute Classic.

After attaching a storage volume to an instance, to access the block storage, you must mount the storage volume on your instance. See Mounting and Unmounting a Storage Volume.

Detaching a Storage Volume from an Instance

When you no longer require access to a storage volume, you can unmount it and detach it from your instance.

After you detach a storage volume from an instance, you can no longer read from or write data to the storage volume, unless you attach the volume to any instance.

Note:

You can’t detach or delete a storage volume that was attached while creating an instance.

If you’re sure that a storage volume is no longer required, then back up the data elsewhere and delete the storage volume.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • Ensure that you’ve unmounted the storage volume that you want to detach. See Unmounting a Storage Volume.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify the instance that you want to update. From the menu icon menu, select View.
  3. On the instance details page, identify the storage volume that you want to detach. From the menu icon menu, select Detach Storage Volume.

To detach a storage volume from an instance using the CLI, you must remove a storage attachment object by using the opc compute storage-attachment delete command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To detach a storage volume from an instance using the API, you must remove a storage attachment object, by using the DELETE /storage/attachment/name method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

Adding an Instance to a Security List

When you add an instance to a security list, the instance can communicate freely with all the other instances in the same security list. Any security rules that are defined for the security list are applicable to all the instances in that security list.

Internally, an instance is associated with security lists by using the instance’s vcable, which provides an attachment point to a specific network interface on the instance. You can dynamically add or remove an instance from a security list, without stopping the instance.

You can add an instance to up to five security lists.

Caution:

When you add an instance to a security list, all the security rules that use that security list—as either the source or destination—are applicable to the instance. Consider a security list that is the destination in two security rules, one rule that allows SSH access from the public Internet and another rule permitting HTTPS traffic from the public Internet. When you add an instance to this security list, the instance is accessible from the public Internet over both SSH and HTTPS. Keep this in mind when you decide the security lists that you want to add an instance to.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • You must have created the security list that you want to add your instance to. See Creating a Security List.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify the instance that you want to update. From the menu icon menu, select View.
  3. On the instance details page, click Add to Security List.
  4. Select the security list that you want to add your instance to, and click Attach.

To add an instance to a security list using the CLI, you must first find out the vcable ID of the instance. To find out the vcable ID of an instance, use the opc compute instance get command. Next, to create an association between the vcable ID and the security list, use the opc compute sec-association add command and specify the vcable ID. For help with these commands, run each command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To add an instance to a security list using the API, you must first find out the vcable ID of the instance. To find out the vcable ID of an instance using the API, use the GET /instance/name method. Next, to create an association between the vcable ID and the security list, use the POST /secassociation/ method and specify the vcable ID. See REST API for Oracle Cloud Infrastructure Compute Classic.

Note:

When an instance is deleted and re-created or shut down and restarted, any security lists to which you had added the instance manually (that is, not during instance creation), must be associated again.

Removing an Instance from a Security List

To prevent other hosts from accessing an instance, you can remove the instance from the security lists that it is attached to. This may be required when you want to perform maintenance activities, change or upgrade applications, and so on.

To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Internally, an instance is associated with security lists by using the instance’s vcable. When you add an instance to a security list, a security association is created between the vcable and the specified security list. To remove an instance from a security list, you must delete the security association that binds the instance to the security list.

Note:

When you remove an instance from a security list, the security rules that are defined for the security list are no longer applicable to the instance, and the instance can’t communicate with other instances in the security list. An instance that isn’t associated with any security list is completely inaccessible.

When an instance that you had previously removed from the /default/default security list is deleted and re-created or shut down and restarted, you must remove the instance from the security list again after the instance starts.

To remove an instance from a security list using the web console:
  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify the instance that you want to update. From the menu icon menu, select View.
  3. On the instance details page, go to the security list that you want to remove your instance from. From the menu icon menu, select Remove from Security List.

To remove an instance from a security list using the CLI, you must remove a security association by using the opc compute sec-association delete command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To remove an instance from a security list using the API, you must remove a security association, by using the DELETE /secassociation/name method. See REST API for Oracle Cloud Infrastructure Compute Classic.

Resizing an Instance

A shape is a resource profile that specifies the number of OCPUs and the amount of memory to be allocated to an instance in Compute Classic. The shape determines the type of disk drive that your instance uses. You specify the shape of an instance while creating the instance. However, if your instance is managed by an orchestration, then you can change the shape of an instance even after the instance has been created. This is useful if you find that your application workload has increased and you would like to add OCPUs and memory to your instance.

Here’s an overview of the process for resizing an instance:

  1. If your instance was created using orchestrations v2, suspend the orchestration and ensure that the instance you want to resize is nonpersistent. If your instance was created using orchestrations v1, terminate the instance orchestration v1 to delete the instance.

    Caution:

    If you delete an instance that uses a nonpersistent boot disk, any changes that you may have made to the boot disk after the instance was created are lost.

    Note:

    If you want to change the shape of an instance that you have created using orchestration v1, ensure that you terminate only the instance orchestration and not the master orchestration. That way, only your instance is deleted and re-created and storage volumes or other resources defined in other orchestrations are not deleted.

  2. Update the orchestration with the required shape.

  3. Start the orchestration. This re-creates the instance with the updated instance configuration.

To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. On the Instances page, identify and note the name of the instance that you want to update.
  3. Go to the orchestration that controls the instance that you want to delete.

    Caution:

    If your instance was created using Orchestrations v1, ensure that you don’t unintentionally go to the master orchestration or any other orchestration. Stopping the master orchestration or a storage volume orchestration will cause storage volumes or other resources defined in other orchestrations to be deleted.

  4. If your instance was created using orchestrations v1, then:
    1. From the menu icon menu, select Terminate.
      The status of the orchestration changes to Stopping. After all objects have been deleted, the status of the orchestration changes to Stopped.
    2. After the orchestration status changes to Stopped, from the menu icon menu, select Resize Instance.

      Note:

      This option is shown only for orchestrations that define instances. Master orchestrations or orchestrations that contain only storage volumes or other objects don’t display the Resize Instance option.

    3. In the Resize an Instance dialog box, if your orchestration contains multiple instances, select the appropriate instance. If your orchestration contains only one instance, it is selected by default. Select the shape you want to use and then click Resize.
    The orchestration is updated with the specified shape.
  5. If your instance was created using orchestrations v2, then:
    1. From the menu icon menu, select Suspend.
      The status of the orchestration changes to Suspending. After all nonpersistent objects have been deleted, the status of the orchestration changes to Suspended.
    2. After the orchestration status changes to Suspended, from the menu icon menu, select Update.
    3. On the orchestrations details page, in the Instance section, go to the instance that you want to modify. From the menu icon menu, select Properties.
    4. In the Object Properties dialog box, ensure that the Persistent check box isn’t selected. If it is selected, deselect it, then click Update. This ensures that the status of the instance changes to Inactive.
    5. On the orchestrations details page, in the Instance section, go to the instance that you want to modify. From the menu icon menu, select Update.
    6. On the Instance Details page, select the Shape that you want to use, and then click Update.
    The orchestration is updated with the specified shape.
  6. Start the orchestration. This re-creates the instance with the updated instance configuration.
    The orchestration is started and the instance is re-created using the specified shape.

To verify the shape your instance uses, you can view the appropriate orchestration, or after the instance is running, go to the Instances page and view the details of the instance.

To use the CLI to change the shape of an instance that you have created using orchestration v1, stop, update, and restart the instance orchestration v1 using the opc compute orchestration update ––action STOP, opc compute orchestration update, and opc compute orchestration update ––action START commands. For help with these commands, run each command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To use the API to change the shape of an instance that you have created using orchestration v1, use the PUT /orchestration/name method with the query argument action=STOP to stop the orchestration v1. To update the orchestration, use the PUT /orchestration/name method with the updated instance shape. Finally, to restart the orchestration, use the PUT /orchestration/name method with the query argument action=START. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.