Registering or Deregistering Instances

You can add an instance to a load balancer by registering it, or remove it from the load balancer by deregistering it. The load balancer routes inbound traffic to its healthy registered instances. As soon as an instance is deregistered from a load balancer, this load balancer stops routing the traffic to this instance.

Registering Instances with a Load Balancer

You must register instances with a load balancer to route the inbound traffic to these ones, called back-end instances. You can register additional instances with a load balancer at any time to handle an increase of the traffic load sent to your back-end instances.

To register back-end instances using their External IPs (EIPs) rather than their instance IDs, see the OSC CLI section below.

Registering an Instance Using Cockpit

  1. Click Services > Load Balancers.

  2. Click the load balancer you want to register an instance with.
    The load balancer is selected and its details appear.

  3. Click Instances.
    A panel with information about back-end instances registered with the load balancer appears.

  4. Click Register Instance .
    The REGISTER INSTANCE dialog box appears.

  5. From the Instance list, select the instance you want to register with the load balancer.

  6. Click Register to validate.
    The instance is registered with the load balancer and appears in the panel.

Registering Instances Using AWS CLI

To register one or more instances, use the register-instances-with-load-balancer command following this syntax:

Request sample
$ aws elb register-instances-with-load-balancer \
    --profile YOUR_PROFILE \
    --load-balancer-name LB_NAME \
    --instances i-01234567 \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

  • instances: One or more instance IDs.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The register-instances-with-load-balancer command returns the following elements:

  • Instances: Information about one or more registered instance. This element contains the following information for each registered instance:

    • InstanceId: The ID of the instance.

Result sample
 {
   "Instances":
       {
           "InstanceId": "i-01234567"
       },
}

The specified instances are registered with the load balancer.

Registering an Instance Using OSC CLI

See the LinkLoadBalancerBackendMachines command sample in the documentation of the OUTSCALE API.

Deregistering Instances from a Load Balancer

You can deregister a back-end instance from a load balancer in case of decrease of the traffic load on your back-end instances or if you need to service this instance. Deregistering an instance does not stop it.

Deregistering an Instance Using Cockpit

  1. Click Services > Load Balancers.

  2. Click the load balancer you want to deregister an instance from.
    The load balancer is selected and its details appear.

  3. Click Instances.
    A panel with information about back-end instances registered with the load balancer appears.

  4. Click the instance you want to deregister from the load balancer.

    Multiselection is available.

    The instance is selected.

  5. Click Deregister Instance .
    The DEREGISTER INSTANCE dialog box appears.

  6. Click Deregister to validate.
    The instance is deregistered from the load balancer and no longer appears in the panel.

    If an instance is receiving inbound traffic at the time you are deregistering it, the instance is only deregistered when the operation is finished.

Deregistering Instances Using AWS CLI

To deregister an instance, use the deregister-instances-from-load-balancer command following this syntax:

Request sample
$ aws elb deregister-instances-from-load-balancer \
    --profile YOUR_PROFILE \
    --load-balancer-name LB_NAME \
    --instances i-01234567 \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

  • instances: One or more instance IDs.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The deregister-instances-with-load-balancer command returns the following elements:

  • Instances: Information about one or more remaining instances registered with the load balancer. This element contains the following information for each registered instance:

    • InstanceId: The ID of the instance.

Result sample
{
    "Instances":
        {
            "InstanceId": "i-87654321"
        }
}

The specified instances are deregistered from the load balancer.

If an instance is receiving inbound traffic at the time you are deregistering it, the instance is only deregistered when the operation is finished.

Deregistering an Instance Using OSC CLI

See the UnlinkLoadBalancerBackendMachines command sample in the documentation of the OUTSCALE API.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.