Detaching an Instance from an Instance Pool

On Compute Cloud@Customer, when you detach an instance from a pool, you can choose whether to delete the instance or to retain the instance separate from the pool.

Using the CLI, you can choose whether to replace the detached instance by creating a new instance in the pool. If you don't replace the detached instance, then the pool size is decremented.

If load balancers are attached to the pool, then the instance is removed from the load balancers.

    1. In the Compute Cloud@Customer Console navigation menu, select Compute, then select Instance Pools.

    2. At the top of the page, select the compartment that contains the instance pool.
    3. Select the name of the instance pool from which you want to detach an instance.

    4. On the Instance Pool details page, under Resources, select Attached Instances.

    5. For the instance that you want to detach, select the Actions menu (An image of the three dot icon.), then select Detach.

    6. (Optional) To delete the instance and its boot volume, select the button under "Permanently terminate (delete) this instance and its attached boot volume."

    7. Select Confirm.

      The pool size is decreased.

  • Use the oci compute-management instance-pool detach-lb command and required parameters to detach an instance from an instance pool.

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

    Procedure

    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 detach: oci compute-management instance-pool list-instances

    2. Run the instance pool detach instance command.

      Syntax:

      oci compute-management instance-pool-instance detach \
      --instance-pool-id instance_pool_OCID --instance-id instance_OCID \
      --is-auto-terminate [true|false] --is-decrement-size [true|false]

      Provide the following options if you don't want the default behavior:

      --is-auto-terminate

      If true, permanently terminate (delete) the instance and its attached boot volume when the instance is detached from the instance pool. The default value is false.

      --is-decrement-size

      If true, decrement the pool size when the instance is detached from the instance pool. This is the default.

      If false, provision a new, replacement instance using the pool’s instance configuration after the existing instance is detached from the instance pool. The pool size remains the same as it was before you performed this detach operation.

      Example:

      In the following example, the specified instance is detached from the pool and terminated, and a new instance is provisioned for the pool.

      $ oci compute-management instance-pool-instance detach \
      --instance-pool-id ocid1.instancePool.unique_ID \
      --instance-id ocid1.instance.unique_ID \
      --is-auto-terminate true --is-decrement-size false

      The output of this command is the same as the output of the instance-pool get command.

  • This operation can't be performed using the API.