Attaching an Instance to an Instance Pool

On Compute Cloud@Customer, when you attach an instance to an instance pool, the pool size increases.

Important

If an autoscaling configuration is associated with the instance pool, then ensure that the autoscaling policy defines a target pool size that's large enough for the expanded pool. The next time the scheduled autoscaling policy runs, the target pool size is reset to the value that's set in the policy; if the policy size is smaller than the current size, instances are deleted.

If load balancers are attached to the pool, then the instance is also added to the load balancers.

Ensure the following conditions before you attach an instance to an instance pool:

  • Both the pool and the instance to be attached are running.

  • The instance isn't attached to another pool.

  • The instance is in the same fault domain as the pool.

  • The primary VNIC of the instance is in the same VCN and subnet as the pool.

  • If secondary VNICs are defined, then the secondary VNIC of the instance is in the same VCN and subnet as the secondary VNICs used by other instances in the pool.

To attach an instance that's in a fault domain that's not included in the pool instance configuration, or is using a VCN and subnet that aren't specified by the pool instance configuration, first update the instance configuration, then attach the instance.

Using the CLI

Use the oci compute-management instance-pool-instance attach command and required parameters to attach an instance to an instance pool.

  1. Get the information you need to run the command.

    • OCID of the instance pool that you want to update: oci compute-management instance-pool list

    • OCID of the instance that you want to attach: oci compute instance list

  2. Run the instance pool attach instance command.

    oci compute-management instance-pool-instance attach --instance-pool-id <instance_pool_OCID> --instance-id <instance_ocid>

For a complete list of CLI commands, flags, and options, see the Command Line Reference.