For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pl/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pl/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/pl/guides/public-cloud/network-services/weight-load-balancer-member.md.
Learn how to adjust the weight of 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.
Verify that both members are receiving traffic by running this script:
#!/bin/shwhile true; do curl http://<FIP>/ sleep 1done
You should see alternating responses from the two members:
<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>
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 Execute.
To set the weight of a member to 0, run the following commmand:
$ openstack loadbalancer member set --weight 0 <pool> <member_0>
To log in with a specific OpenStack user: Open the Horizon login page and enter the OpenStack user credentials previously created, then click on Connect. You can also open Horizon from the OVHcloud Console: on the home page of your Public Cloud project, click OpenStack Horizon in the Documentation and support section.
Select the appropriate region from the top left drop-down menu.
In the left tab, click the Network tab then on Load Balancers.
Click the load balancer concerned.
In the tab, click on Pools and then on the pool in which the member is.
In the tab, click on Members and then on Edit Member.
Edit the Weight to 0, then click on Update.
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 for this functionality in a future update. However, this will only be possible once this feature is supported by OpenStack.
Replace <POOL_ID> with the ID of your Pool. For more details on the available options for this resource, refer to the official documentation 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.
You can check the member’s status using the following command:
$ openstack loadbalancer member list <pool_name>
You should see:
---------------------------------------------------------------------------------------------------id name provisioning_status operating_status weight---------------------------------------------------------------------------------------------------27cfe834-7fef-4548-b71b-fa0ce67222f8 member_1 ACTIVE ONLINE 1118756ba-2cae-4141-b9c2-8b18b120c8dc member_0 ACTIVE DRAINING 0---------------------------------------------------------------------------------------------------
To check the member's status, click on Network in the left tab then on Load Balancers.
Click on the load balancer concerned.
In the tab, click on Pools and then on the pool in which the member is.
Click the Members tab:
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:
#!/bin/shwhile true; do curl http://<FIP>/ sleep 1done
You should now only see responses from member_1:
<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):
Replace <POOL_ID> with the ID of your Pool. For more details on the available options for this resource, refer to the official documentation 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.
To restore traffic from being routed to a specific member, set its weight to 1:
$ openstack loadbalancer member set --weight 1 <pool> <member_0>
Log in to the Horizon interface. You can also open Horizon from the OVHcloud Console: on the home page of your Public Cloud project, click OpenStack Horizon in the Documentation and support section.
Select the appropriate region from the top left drop-down menu.
In the left tab, click on Network then on click Load Balancers.
Click the load balancer concerned.
In the tab, click on Pools and then on the pool in which the member is.
Click on the Members tab, and then on Edit Member next to the corresponding member.
You can edit the Weight to 1 then click on Update
Step 7 - Verify that both members are now receiving traffic
You should see alternating responses from the two members:
<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>