---
title: "Using the weight feature on a Load Balancer member"
description: "Learn how to adjust the weight of a Load Balancer member"
url: https://docs.ovhcloud.com/en/guides/public-cloud/network-services/weight-load-balancer-member
lang: en
lastUpdated: 2025-10-01
---
# Using the weight feature on a Load Balancer member

## Objective

This guide explains how to use the weight feature to temporarily remove a Load Balancer member from receiving traffic for maintenance purposes.

### Using the weight feature

Octavia supports setting the weight of members from 0 to 256.

:::info
The weight of a member determines the portion of requests or connections it services compared to the other members of the pool. A higher weight means it will receive more traffic.\
For example, a member with a weight of 10 receives five times as much traffic as a member with a weight of 2.

:::

The weight must be a number from 1 to 256. A value of 0 means the member does not receive new connections but continues to service existing connections.

By setting the weight to 0, the member is effectively removed from the traffic pool, allowing you to perform upgrades or maintenance without service disruption.

## Prerequisites

- An <ManagerLink to="/">active OVHcloud account</ManagerLink>.
- An active [Public Cloud project](/en/guides/public-cloud/cross-functional/create-a-public-cloud-project.md).
- A [Load Balancer set up with multiple members](/en/guides/network/load-balancer/create-http-https.md).
- [OpenStack CLI installed and configured](/en/guides/public-cloud/cross-functional/compute-prepare-openstack-api-environment.md).

## Instructions


***

### OVHcloud Control Panel Access

- **Direct link:** <ManagerLink to="/#/pci/projects">Public Cloud Projects</ManagerLink>
- **Navigation path:** <code className="action">Public Cloud</code> > Select your project

***


### Step 1 - Create a Load Balancer with two members

Use the following repository to create a Load Balancer with two members:

- [simple\_http\_lb](https://github.com/yomovh/tf-at-ovhcloud/tree/main/simple_http_lb)

Verify that both members are receiving traffic by running this script:

```bash
#!/bin/sh

while true; do
  curl http://<FIP>/
  sleep 1
done
```

You should see alternating responses from the two members:

```html
<html><head><title>Load Balanced Member 1</title></head><body><h1>You hit your OVHCloud load balancer member #1 !</h1></body></html>
<html><head><title>Load Balanced Member 0</title></head><body><h1>You hit your OVHCloud load balancer member #0 !</h1></body></html>
```

### Step 2 - Set the Weight of a member to 0


**OVHcloud API**

Log in to the OVHcloud APIv6 interface according to the relevant guide ([First steps with the OVHcloud API](/en/guides/manage-and-operate/api/first-steps.md)).
In case the project ID is unknown, the API calls below allow you to retrieve it:
This call retrieves the list of projects:

🇪🇺EU▾

[GET/cloud/project](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project)

This call identifies the project via the "description" field:

🇪🇺EU▾

[GET/cloud/project/{serviceName}](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project/-serviceName-)

This call retrieves the pool id. Fill in the fields with the previously obtained information:
- **serviceName**: The Public Cloud project ID in the form of a 32-character string.
- **regionName**: The name of your region.

🇪🇺EU▾

[GET/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool)

You can leave the `loadbalancerId` field blank in order to obtain all the pools created in the region specified/
This call retrieves the member id. Fill in the fields with the previously obtained information:
- **serviceName**: The Public Cloud project ID in the form of a 32-character string.
- **regionName**: The name of your region.
- **poolId**: The Pool ID in the form of a 32-character string.

🇪🇺EU▾

[GET/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool/{poolId}/member](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool/-poolId-/member)

You can update a pool member with the following API call:

🇪🇺EU▾

[PUT/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool/{poolId}/member/{memberId}](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#put-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool/-poolId-/member/-memberId-)

Fill in the fields with the previously obtained information:
- **serviceName**: The Public Cloud project ID in the form of a 32-character string.
- **regionName**: The name of your region.
- **poolId**: The Pool ID in the form of a 32-character string.
- **memberId**: The Member ID in the form of a 32-character string.
- **weight**: Set the weight to 0.
Click on <code className="action">Execute</code>.
![public-cloud](/images/public-cloud/network-services/weight-load-balancer/member-api-update.png)

**Horizon**

There are two ways to access the Horizon interface:
- Log in with OVHcloud Single Sign-On: use the <code className="action">Horizon</code> link in the left-hand menu under "Management Interfaces" in your <code className="action">Public Cloud</code> project.
- To log in with a specific OpenStack user: Open the [Horizon login page](https://horizon.cloud.ovh.net/auth/login/) and enter the [OpenStack user credentials](/en/guides/public-cloud/cross-functional/create-and-delete-a-user.md) previously created, then click on <code className="action">Connect</code>.
Select the appropriate region from the top left drop-down menu.
In the left tab, click the <code className="action">Network</code> tab then on <code className="action">Load Balancers</code>.
Click the load balancer concerned.
In the tab, click on <code className="action">Pools</code> and then on the <code className="action">pool</code> in which the member is.
![public-cloud](/images/public-cloud/network-services/weight-load-balancer/pool-tab.png)In the tab, click on <code className="action">Members</code> and then on <code className="action">Edit Member</code>.
![Update Member Openstack dashboard](/images/public-cloud/network-services/weight-load-balancer/update-member_openstack_dashboard-1.png)Edit the `Weight` to 0, then click on <code className="action">Update</code>.
![Update weight](/images/public-cloud/network-services/weight-load-balancer/update-weight.png)

**CLI**

To set the weight of a member to 0, run the following commmand:
```bash
$ openstack loadbalancer member set --weight 0 <pool> <member_0>
```


### Step 3 - Verify Member Status

After setting the member’s weight to 0, its status will change from **ONLINE** to **DRAINING**.

:::info
It is important to note that in the current system, the member will remain in the **DRAINING** state even after all traffic has been drained.

:::

This can be confusing because some users expect a final status of **DRAINED** once all traffic has been redirected. However, the system does not automatically transition to **DRAINED**.

- **DRAINING** simply means that the member is no longer receiving traffic, not that it is still actively draining traffic.
- The **DRAINED** status is not yet supported in the current OpenStack API.

If having a final **DRAINED** status is critical for your operations, it is recommended to [submit a feature request to OVHcloud](https://github.com/ovh/public-cloud-roadmap) for this functionality in a future update. However, this will only be possible once this feature is supported by OpenStack.


**OVHcloud API**

Use the following API call:

🇪🇺EU▾

[GET/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool/{poolId}/member](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool/-poolId-/member)


**Horizon**

To check the member's status, click on <code className="action">Network</code> in the left tab then on <code className="action">Load Balancers</code>.
Click on the load balancer concerned.
In the tab, click on <code className="action">Pools</code> and then on the <code className="action">pool</code> in which the member is.
Click the <code className="action">Members</code> tab:
![Update weight](/images/public-cloud/network-services/weight-load-balancer/member-status-draining.png)

**CLI**

You can check the member’s status using the following command:
```bash
$ openstack loadbalancer member list <pool_name>
```
You should see:
```bash
---------------------------------------------------------------------------------------------------
id                                   name       provisioning_status  operating_status   weight
---------------------------------------------------------------------------------------------------
27cfe834-7fef-4548-b71b-fa0ce67222f8 member_1   ACTIVE               ONLINE             1
118756ba-2cae-4141-b9c2-8b18b120c8dc member_0   ACTIVE               DRAINING           0
---------------------------------------------------------------------------------------------------
```


**Terraform**

Create a `.tf` file to manage a V2 members resource within OpenStack. For example:
```python
resource "openstack_lb_monitor_v2" "monitor_1" {
 pool_id     = "<POOL_ID>"
 member {
 address       = "10.0.0.158"
 protocol_port = 8080
 weight = 0
 }
 
 member {
 address       = "10.0.0.200"
 protocol_port = 8080
 weight = 1
 }
}
```
Replace `<POOL_ID>` with the ID of your Pool. For more details on the available options for this resource, refer to the [official documentation](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs/resources/lb_monitor_v2) for the `openstack_lb_monitor_v2` resource on the Terraform Registry.
**Applying the Configuration**
To apply your Terraform configuration:
- Run `terraform init` to initialize the Terraform working directory.
- Run `terraform apply` to apply the changes defined in your configuration.
**Verification**
After running `terraform apply`, Terraform will provide you with a summary of the resources created, modified, or deleted. This confirms the creation or update of your Health Monitor.


### Step 4 - Confirm Traffic is directed to the active member

The member whose weight is 0 will have an Operating Status `Draining`. Run the test script again:

```bash
#!/bin/sh

while true; do
  curl http://<FIP>/
  sleep 1
done
```

You should now only see responses from `member_1`:

```html
<html><head><title>Load Balanced Member 1</title></head><body><h1>You hit your OVHCloud load balancer member #1 !</h1></body></html>
```

### Step 5 - Perform maintenance

Now that `member_0` is no longer receiving traffic, you can safely perform maintenance or upgrade tasks.

### Step 6 - Restore traffic to the member

Once the maintenance is complete, set the weight of `member_0` back to its original value (e.g., 1):


**OVHcloud API**

To update the weight, use the following API call:

🇪🇺EU▾

[PUT/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool/{poolId}/member/{memberId}](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#put-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool/-poolId-/member/-memberId-)

Fill in the fields with the previously obtained information:
- **serviceName**: The Public Cloud project ID in the form of a 32-character string.
- **regionName**: The name of your region.
- **poolId**: The Pool ID in the form of a 32-character string.
- **memberId**: The Member ID in the form of a 32-character string.
- **weight**: Set the weight to 1.
Click on <code className="action">Execute</code>.
![public-cloud](/images/public-cloud/network-services/weight-load-balancer/member-api-update-1.png)

**Horizon**

Log in to the [Horizon interface](https://horizon.cloud.ovh.net/auth/login/).
Select the appropriate region from the top left drop-down menu.
In the left tab, click on <code className="action">Network</code> then on click <code className="action">Load Balancers</code>.
Click the load balancer concerned.
In the tab, click on <code className="action">Pools</code> and then on the <code className="action">pool</code> in which the member is.
![Update Member Openstack dashboard](/images/public-cloud/network-services/weight-load-balancer/pool-tab.png)Click on the <code className="action">Members</code> tab, and then on <code className="action">Edit Member</code> next to the corresponding member.
![Update Member Openstack dashboard](/images/public-cloud/network-services/weight-load-balancer/update-member_openstack_dashboard.png)You can edit the Weight to 1 then click on <code className="action">Update</code>
![public-cloud](/images/public-cloud/network-services/weight-load-balancer/update-member-3-OpenStack_dashboard.png)

**CLI**

To restore traffic from being routed to a specific member, set its weight to 1:
```bash
$ openstack loadbalancer member set --weight 1 <pool> <member_0>
```


**Terraform**

Create a `.tf` file to manage a V2 members resource within OpenStack. For example:
```python
resource "openstack_lb_monitor_v2" "monitor_1" {
 pool_id     = "<POOL_ID>"
 member {
 address       = "10.0.0.158"
 protocol_port = 8080
 weight = 1
 }
 
 member {
 address       = "10.0.0.200"
 protocol_port = 8080
 weight = 1
 }
}
```
Replace `<POOL_ID>` with the ID of your Pool. For more details on the available options for this resource, refer to the [official documentation](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs/resources/lb_monitor_v2) for the `openstack_lb_monitor_v2` resource on the Terraform Registry.
**Applying the Configuration**
To apply your Terraform configuration:
- Run `terraform init` to initialize the Terraform working directory.
- Run `terraform apply` to apply the changes defined in your configuration.
**Verification**
After running `terraform apply`, Terraform will provide you with a summary of the resources created, modified, or deleted. This confirms the creation or update of your Health Monitor.


### Step 7 - Verify that both members are now receiving traffic

Re-use the script:

```bash
#!/bin/sh
while true; do
curl http://<FIP>/
sleep 1
done
```

You should see alternating responses from the two members:

```html
<html><head><title>Load Balanced Member 1</title></head><body><h1>You hit your OVHCloud load balancer member #1 !</h1></body></html>
<html><head><title>Load Balanced Member 0</title></head><body><h1>You hit your OVHCloud load balancer member #0 !</h1></body></html>
```

## Go further

Join our [community of users](https://community.ovhcloud.com/).
