Ubuntu 24.04

OpenStack Flamingo : How to use Octavia2025/11/28

 

Install and Configure OpenStack Load Balancing as a Service (Octavia).

This example is based on the environment like follows.

------------+--------------------------+--------------------------+------------
            |                          |                          |
        eth0|10.0.0.30             eth0|10.0.0.50             eth0|10.0.0.51
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |  |  [ node01.srv.world ] |
|     (Control Node)    |  |     (Network Node)    |  |     (Compute Node)    |
|                       |  |                       |  |                       |
|  MariaDB    RabbitMQ  |  |      Open vSwitch     |  |        Libvirt        |
|  Memcached  Nginx     |  |     Neutron Server    |  |      Nova Compute     |
|  Keystone   httpd     |  |      OVN-Northd       |  |      Open vSwitch     |
|  Glance     Nova API  |  |  Nginx  iSCSI Target  |  |   OVN Metadata Agent  |
|  Cinder API           |  |     Cinder Volume     |  |     OVN-Controller    |
|                       |  |    Octavia Services   |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Install Octavia client tool.
root@dlp ~(keystone)#
apt -y install python3-octaviaclient
[2] Login as any Openstack user and create Loadbalancer instance.
It's OK to work on any node. (example below is on Control Node)
ubuntu@dlp ~(keystone)$
openstack subnet list

+--------------------+----------------+---------------------+------------------+
| ID                 | Name           | Network             | Subnet           |
+--------------------+----------------+---------------------+------------------+
| 0143ec7e-f39a-     | public-subnet  | 7457c2ad-572e-4cb9- | 10.0.0.0/24      |
| 43ac-8c12-         |                | 86c0-20f4e89da51b   |                  |
| 78e2b9d27ba7       |                |                     |                  |
| ca5e015c-a5cb-     | private-subnet | 3d439616-ee5c-49b9- | 192.168.100.0/24 |
| 4c2e-a390-         |                | ac27-9525818605d8   |                  |
| d0ac1bd05916       |                |                     |                  |
+--------------------+----------------+---------------------+------------------+

ubuntu@dlp ~(keystone)$
openstack loadbalancer create --name lb01 --vip-subnet-id private-subnet

+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| admin_state_up      | True                                 |
| availability_zone   | None                                 |
| created_at          | 2025-11-28T05:18:43                  |
| description         |                                      |
| flavor_id           | None                                 |
| id                  | 4111f806-a4c2-45c5-9eab-9c418101df51 |
| listeners           | None                                 |
| name                | lb01                                 |
| operating_status    | OFFLINE                              |
| pools               | None                                 |
| project_id          | b45ce8ac12c749e49e933c84334e79de     |
| provider            | amphora                              |
| provisioning_status | PENDING_CREATE                       |
| updated_at          | None                                 |
| vip_address         | 192.168.100.236                      |
| vip_network_id      | 3d439616-ee5c-49b9-ac27-9525818605d8 |
| vip_port_id         | edd8d568-5393-4c5b-8492-c573741fb9cd |
| vip_qos_policy_id   | None                                 |
| vip_subnet_id       | ca5e015c-a5cb-4c2e-a390-d0ac1bd05916 |
| vip_vnic_type       | normal                               |
| vip_sg_ids          | []                                   |
| tags                | None                                 |
| additional_vips     | []                                   |
+---------------------+--------------------------------------+

# after a few minutes, status turns to [ACTIVE] if instance successfully created

ubuntu@dlp ~(keystone)$
openstack loadbalancer list

+-----------+------+------------+-------------+---------------------+------------------+----------+
| id        | name | project_id | vip_address | provisioning_status | operating_status | provider |
+-----------+------+------------+-------------+---------------------+------------------+----------+
| 4111f806- | lb01 | b45ce8ac12 | 192.168.100 | ACTIVE              | OFFLINE          | amphora  |
| a4c2-     |      | c749e49e93 | .236        |                     |                  |          |
| 45c5-     |      | 3c84334e79 |             |                     |                  |          |
| 9eab-     |      | de         |             |                     |                  |          |
| 9c418101d |      |            |             |                     |                  |          |
| f51       |      |            |             |                     |                  |          |
+-----------+------+------------+-------------+---------------------+------------------+----------+
[3] Add a listener and pool to the instance and Configure loadbalancing to use 2 backend Web Server instances.
# create a listener that listens TCP 80

ubuntu@dlp ~(keystone)$
openstack loadbalancer listener create --name listener01 --protocol TCP --protocol-port 80 lb01

+-----------------------------+--------------------------------------+
| Field                       | Value                                |
+-----------------------------+--------------------------------------+
| admin_state_up              | True                                 |
| connection_limit            | -1                                   |
| created_at                  | 2025-11-28T05:22:52                  |
| default_pool_id             | None                                 |
| default_tls_container_ref   | None                                 |
| description                 |                                      |
| id                          | bce06e82-46eb-4b3f-b9af-6c2b0d4e700c |
| insert_headers              | None                                 |
| l7policies                  | None                                 |
| loadbalancers               | 4111f806-a4c2-45c5-9eab-9c418101df51 |
| name                        | listener01                           |
| operating_status            | OFFLINE                              |
| project_id                  | b45ce8ac12c749e49e933c84334e79de     |
| protocol                    | TCP                                  |
| protocol_port               | 80                                   |
| provisioning_status         | PENDING_CREATE                       |
| sni_container_refs          | []                                   |
| timeout_client_data         | 50000                                |
| timeout_member_connect      | 5000                                 |
| timeout_member_data         | 50000                                |
| timeout_tcp_inspect         | 0                                    |
| updated_at                  | None                                 |
| client_ca_tls_container_ref | None                                 |
| client_authentication       | NONE                                 |
| client_crl_container_ref    | None                                 |
| allowed_cidrs               | None                                 |
| tls_ciphers                 | None                                 |
| tls_versions                | None                                 |
| alpn_protocols              | None                                 |
| tags                        | None                                 |
| hsts_max_age                | None                                 |
| hsts_include_subdomains     | False                                |
| hsts_preload                | False                                |
+-----------------------------+--------------------------------------+

# add a pool to the listener

ubuntu@dlp ~(keystone)$
openstack loadbalancer pool create --name pool01 --lb-algorithm ROUND_ROBIN --listener listener01 --protocol TCP

+----------------------+--------------------------------------+
| Field                | Value                                |
+----------------------+--------------------------------------+
| admin_state_up       | True                                 |
| created_at           | 2025-11-28T05:23:21                  |
| description          |                                      |
| healthmonitor_id     |                                      |
| id                   | 01d09c77-a810-4a95-9e97-2b63df04ee32 |
| lb_algorithm         | ROUND_ROBIN                          |
| listeners            | bce06e82-46eb-4b3f-b9af-6c2b0d4e700c |
| loadbalancers        | 4111f806-a4c2-45c5-9eab-9c418101df51 |
| members              | None                                 |
| name                 | pool01                               |
| operating_status     | OFFLINE                              |
| project_id           | b45ce8ac12c749e49e933c84334e79de     |
| protocol             | TCP                                  |
| provisioning_status  | PENDING_CREATE                       |
| session_persistence  | None                                 |
| updated_at           | None                                 |
| tls_container_ref    | None                                 |
| ca_tls_container_ref | None                                 |
| crl_container_ref    | None                                 |
| tls_enabled          | False                                |
| tls_ciphers          | None                                 |
| tls_versions         | None                                 |
| tags                 | None                                 |
| alpn_protocols       | None                                 |
+----------------------+--------------------------------------+

# web server instances

ubuntu@dlp ~(keystone)$
openstack server list

+------------------+-------+--------+------------------+------------+----------+
| ID               | Name  | Status | Networks         | Image      | Flavor   |
+------------------+-------+--------+------------------+------------+----------+
| bd950f97-89f1-   | Web02 | ACTIVE | private=192.168. | Ubuntu2404 | m1.small |
| 40fa-a611-       |       |        | 100.77           |            |          |
| 9999638d1006     |       |        |                  |            |          |
| 4f1f7f28-a6d4-   | Web01 | ACTIVE | private=192.168. | Ubuntu2404 | m1.small |
| 48d0-9560-       |       |        | 100.94           |            |          |
| 84656c82b827     |       |        |                  |            |          |
+------------------+-------+--------+------------------+------------+----------+

# add web server instances to the pool member

ubuntu@dlp ~(keystone)$
openstack loadbalancer member create --subnet-id private-subnet --address 192.168.100.77 --protocol-port 80 pool01

+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| address             | 192.168.100.77                       |
| admin_state_up      | True                                 |
| created_at          | 2025-11-28T05:25:34                  |
| id                  | 84b6a5c9-c50c-4cc5-a62d-f38af8b8f7a0 |
| name                |                                      |
| operating_status    | NO_MONITOR                           |
| project_id          | b45ce8ac12c749e49e933c84334e79de     |
| protocol_port       | 80                                   |
| provisioning_status | PENDING_CREATE                       |
| subnet_id           | ca5e015c-a5cb-4c2e-a390-d0ac1bd05916 |
| updated_at          | None                                 |
| weight              | 1                                    |
| monitor_port        | None                                 |
| monitor_address     | None                                 |
| backup              | False                                |
| tags                | None                                 |
| vnic_type           | normal                               |
+---------------------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack loadbalancer member create --subnet-id private-subnet --address 192.168.100.94 --protocol-port 80 pool01

+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| address             | 192.168.100.94                       |
| admin_state_up      | True                                 |
| created_at          | 2025-11-28T05:25:58                  |
| id                  | 2e0b1702-b978-4a96-bc51-47b708237a04 |
| name                |                                      |
| operating_status    | NO_MONITOR                           |
| project_id          | b45ce8ac12c749e49e933c84334e79de     |
| protocol_port       | 80                                   |
| provisioning_status | PENDING_CREATE                       |
| subnet_id           | ca5e015c-a5cb-4c2e-a390-d0ac1bd05916 |
| updated_at          | None                                 |
| weight              | 1                                    |
| monitor_port        | None                                 |
| monitor_address     | None                                 |
| backup              | False                                |
| tags                | None                                 |
| vnic_type           | normal                               |
+---------------------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack loadbalancer member list pool01

+----------+------+------------+---------------------+----------+---------------+------------------+--------+
| id       | name | project_id | provisioning_status | address  | protocol_port | operating_status | weight |
+----------+------+------------+---------------------+----------+---------------+------------------+--------+
| 84b6a5c9 |      | b45ce8ac12 | ACTIVE              | 192.168. |            80 | NO_MONITOR       |      1 |
| -c50c-   |      | c749e49e93 |                     | 100.77   |               |                  |        |
| 4cc5-    |      | 3c84334e79 |                     |          |               |                  |        |
| a62d-    |      | de         |                     |          |               |                  |        |
| f38af8b8 |      |            |                     |          |               |                  |        |
| f7a0     |      |            |                     |          |               |                  |        |
| 2e0b1702 |      | b45ce8ac12 | ACTIVE              | 192.168. |            80 | NO_MONITOR       |      1 |
| -b978-   |      | c749e49e93 |                     | 100.94   |               |                  |        |
| 4a96-    |      | 3c84334e79 |                     |          |               |                  |        |
| bc51-    |      | de         |                     |          |               |                  |        |
| 47b70823 |      |            |                     |          |               |                  |        |
| 7a04     |      |            |                     |          |               |                  |        |
+----------+------+------------+---------------------+----------+---------------+------------------+--------+

# create a floating IP on public network

ubuntu@dlp ~(keystone)$
openstack floating ip create public

+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2025-11-28T05:26:34Z                 |
| description         |                                      |
| dns_domain          |                                      |
| dns_name            |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 10.0.0.226                           |
| floating_network_id | 7457c2ad-572e-4cb9-86c0-20f4e89da51b |
| id                  | 4c6e8a9b-b8de-4f29-be0c-38d7dcd59777 |
| name                | 10.0.0.226                           |
| port_details        | None                                 |
| port_id             | None                                 |
| project_id          | b45ce8ac12c749e49e933c84334e79de     |
| qos_policy_id       | None                                 |
| revision_number     | 0                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| subnet_id           | None                                 |
| tags                | []                                   |
| updated_at          | 2025-11-28T05:26:34Z                 |
+---------------------+--------------------------------------+

# associate floating IP with VIP of loadbalancer instace

ubuntu@dlp ~(keystone)$
VIPPORT=$(openstack loadbalancer show lb01 | grep vip_port_id | awk {'print $4'})

ubuntu@dlp ~(keystone)$
openstack floating ip set --port $VIPPORT 10.0.0.226
# verify settings to access to the floating IP

ubuntu@dlp ~(keystone)$
curl 10.0.0.226

Web Server on Instance01
ubuntu@dlp ~(keystone)$
curl 10.0.0.226

Web Server on Instance02
ubuntu@dlp ~(keystone)$
curl 10.0.0.226

Web Server on Instance01
ubuntu@dlp ~(keystone)$
curl 10.0.0.226

Web Server on Instance02
Matched Content