Instantes updating the

Wednesday, July 11, 2018 by Finn

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.

From release 17.3.6 onwards, when you create an instance using the Create Instance wizard, a single orchestration v2 is created automatically to manage the instance and its associated resources. Storage volumes and networking objects used by the instance are created in the same orchestration. Instances are nonpersistent by default. However, storage volumes and other objects are created with persistence set to true, so that if you suspend the orchestration, instances are shut down, but storage volumes aren’t deleted. Terminating the orchestration, however, will cause all objects to be deleted and any data on storage volumes will be lost.

Earlier, when you created an instance using the Create Instance wizard, one or more orchestrations v1 were created automatically to manage the instance and its associated resources. For example, if you used the Create Instance wizard to create an instance and attach a new storage volume to it, then two separate orchestrations were created, one for the instance and the other for the storage volume. A master orchestration was also created, and the instance and storage volume orchestrations were referenced as objects in the master orchestration.

For example, if you created an instance and specified the name of the instance as vm1, the following orchestrations were created:

  • vm1_instance: This orchestration specified the instance to be created.

  • vm1_storage: This orchestration created the specified storage volumes, if any.

  • vm1_master: This orchestration specified the individual orchestrations for the instance and the storage volumes.

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 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 My Services. 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, 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, 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, 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, select Update.
    3. On the orchestrations details page, in the Instance section, go to the instance that you want to modify. From the 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, select Resize Instance.
    6. In the Resize an Instance dialog box, select the shape that you want to use and then click Resize.

    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 , , and commands. For help with these commands, run each command with the 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 method with the query argument to stop the orchestration v1. To update the orchestration, use the method with the updated instance shape. Finally, to restart the orchestration, use the method with the query argument . For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

https://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsg/updating-instance.html