Updating the Size of an Instance Pool

You can manually update the number of instances for an instance pool.

When you increase the size of an instance pool, the pool creates instances using the pool's instance configuration as a template. To add existing instances to the pool, you can instead attach instances to the pool.

When you decrease the size of an instance pool, the pool deletes (terminates) the extra instances. Instances are terminated in this order: the number of instances is balanced across availability domains, and then balanced across fault domains. Finally, within a fault domain, the oldest instance is terminated first. If you need to perform tasks on an instance before deletion, then detach the instance from the pool and then delete the instance separately.

To automatically adjust the number of instances in an instance pool based on performance metrics or a schedule, enable autoscaling for the instance pool.

To determine whether capacity is available for a specific shape before you resize an instance pool, use the CreateComputeCapacityReport operation.

    1. Open the navigation menu and click Compute. Under Compute, click Instance Pools.
    2. In the List scope section, select the compartment that contains the instance pool that you want to update.
    3. Click the name of the instance pool that you want to update to display the details page.
    4. Click Edit.
    5. In the Number of instances field, specify the updated number of instances for the instance pool, and then click Save.

    When you update the instance pool size, the operation triggers a scaling event. Be aware of the following:

    • If the instance pool's lifecycle state is Scaling, then the pool creates new instances or deletes existing instances at that time, to match the updated size of the pool. To balance the instances across placements (availability domain and fault domain), instances are deleted first based on how many instances from the instance pool are in that availability domain and fault domain. Within a placement, the oldest instances are terminated first.
    • If the instance pool's lifecycle state is Stopped, then, for an increase in size, new instances are configured for the pool, but are not launched. For a decrease in size, the instances are terminated.
    To track the progress of the operation and troubleshoot errors that occur during instance creation, use the associated work request.
    Important

    If the instance pool has been in the scaling or provisioning state for an extended period of time, then it might be because the number of instances requested has exceeded the tenancy's service limits for that shape and availability domain. Check the tenancy's service limits for Compute.
  • To update the size of an instance pool, use the instance-pool update command:

    oci compute-management instance-pool update --instance-pool-id <INSTANCE_POOL_OCID> --size <NUMBER>

    For a complete list of flags and variable options for the Compute Service CLI commands, see the command line reference for Compute.

  • Use the UpdateInstancePool operation to update the size of an instance pool.