Managing Instance Pool Load Balancer Attachments

These procedures describe how to attach a load balancer to an instance pool or detach a load balancer attachment from an instance pool.

Using the Compute Web UI

  1. In the navigation menu, click Compute, and then click Instance Pools.

  2. If the instance pool for which you want to manage load balancer attachments is not listed, use the Compartment drop-down menu above the instance pools list to select the correct compartment.

  3. Click the name of the pool that you want to manage.

  4. On the instance pool details page, scroll to the Resources section and click Load Balancers.

    • To attach a load balancer, click the Attach Load Balancer button.

      On the Attach Load Balancer dialog, specify the load balancer, backend set, port number, and VNIC as described in Creating an Instance Pool, and click the Attach Load Balancer button.

    • To remove a load balancer attachment, click the Actions menu for the load balancer attachment that you want to remove, and click Detach.

      The load balancer attachment remains visible in the load balancers list in the Detached state for at least 24 hours, up to 24.5 hours. No further action is needed to detach the load balancer attachment.

Using the OCI CLI

  • To attach a load balancer to an instance pool:

    1. Get the following information:

      • OCID of the instance pool to which you want to attach a load balancer: oci compute-management instance-pool list

      • OCID of the load balancer and name of the backend set: oci lb load-balancer list

      • Port value to use when creating the backend set.

      • VNIC to associate with the load balancer. The value can be PrimaryVnic or the display name of one of the secondary VNICs on the instance configuration that is associated with the instance pool.

    2. Run the instance pool attach load balancer command.

      Example:

      $ oci compute-management instance-pool attach-lb \
      --instance-pool-id ocid1.instancePool.unique_ID \
      --load-balancer-id ocid1.loadbalancer.unique_ID \
      --backend-set-name BES1 --port 80 --vnic-selection PrimaryVnic
  • To remove or detach a load balancer from an instance pool:

    1. Get the following information:

      • OCID of the instance pool

      • OCID of the load balancer

      • Backend set name

    2. Run the instance pool detach load balancer command.

      Example:

      $ oci compute-management instance-pool detach-lb \
      --instance-pool-id ocid1.instancePool.unique_ID \
      --load-balancer-id ocid1.loadbalancer.unique_ID \
      --backend-set-name BES1

      When you get or list the instance pool, the load balancer attachment remains visible in state DETACHED for at least 24 hours, up to 24.5 hours. No further action is needed to detach the load balancer attachment.