Skip to content

Commit 9809b7e

Browse files
Merge pull request #1204 from gthiemonge/fix_octavia_adoption
Fix Octavia adoption
2 parents 7292a21 + 6492d61 commit 9809b7e

14 files changed

Lines changed: 253 additions & 327 deletions

File tree

docs_user/modules/proc_adopting-the-loadbalancer-service.adoc

Lines changed: 45 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,14 @@
44
= Adopting the {loadbalancer_service}
55

66
[role="_abstract"]
7-
To adopt the {loadbalancer_first_ref}, you patch an existing `OpenStackControlPlane` custom resource (CR) where the {loadbalancer_service} is disabled. The patch starts the service with the configuration parameters that are provided by the {rhos_prev_long} ({OpenStackShort}) environment. Existing load balancers fail over after the adoption process to upgrade their image, and set up a network connection with the new control plane.
7+
To adopt the {loadbalancer_first_ref}, you patch an existing `OpenStackControlPlane` custom resource (CR) where the {loadbalancer_service} is disabled. The patch starts the service with the configuration parameters that are provided by the {rhos_prev_long} ({OpenStackShort}) environment. After completing the data plane adoption, you must trigger a failover of existing load balancers to upgrade their amphora virtual machines to use the new image and to establish connectivity with the new control plane.
88

99
.Procedure
1010

11-
. Create an alias for the `openstack` command:
11+
. Migrate the server certificate authority (CA) passphrase from the previous deployment:
1212
+
1313
----
14-
$ alias openstack="oc exec -t openstackclient -- openstack"
15-
----
16-
. Use the `CONTROLLER1_SCP` shell variable to set the value of the existing
17-
`CONTROLLER1_SSH` variable:
18-
+
19-
----
20-
$ CONTROLLER1_SCP=$(echo "$CONTROLLER1_SSH" | sed 's/^ssh/scp/g')
21-
----
22-
23-
. Run the following set of commands to regenerate the keys and certificates and install the data in {rhocp_long}. Convert the existing single certificate authority (CA) configuration into a dual CA configuration. You can use these commands to regenerate the keys and certificates and insert them into {OpenShiftShort}:
24-
+
25-
----
26-
include::../../tests/roles/octavia_adoption/tasks/octavia_certs.yaml[lines="7..83",indent=0]
27-
----
28-
29-
. Optional: Copy the existing public SSH key that you can use for connecting to the amphorae and install it into {OpenShiftShort}:
30-
+
31-
----
32-
${CONTROLLER1_SCP}:<octavia_ssh_pubkey_path> $HOME/octavia_sshkey.pub
33-
34-
# Install new data in k8s
35-
oc apply -f - <<EOF
36-
apiVersion: v1
37-
kind: ConfigMap
38-
metadata:
39-
name: octavia-ssh-pubkey
40-
data:
41-
key: $(cat $HOME/octavia_sshkey.pub)
42-
EOF
43-
44-
rm -f $HOME/octavia_sshkey.pub
45-
----
46-
+
47-
* Replace `<octavia_ssh_pubkey_path>` with the path that you configured by using the `OctaviaAmphoraSshKeyFile` parameter in the previous deployment. The default path is `/etc/octavia/ssh/octavia_id_rsa`. For example:
48-
+
49-
----
50-
parameter_defaults:
51-
OctaviaAmphoraSshKeyFile: /etc/octavia/ssh/octavia_id_rsa
14+
include::../../tests/roles/octavia_adoption/tasks/octavia_certs.yaml[lines="6..16",indent=0]
5215
----
5316

5417
. To isolate the management network, add the network interface for the VLAN base interface:
@@ -101,10 +64,10 @@ Specifies the name of the network interface in your {OpenShiftShort} setup.
10164
<mtu>::
10265
Specifies the `mtu` value in your environment.
10366

104-
. To connect pods that manage load balancer virtual machines (amphorae) and the OpenvSwitch pods that are managed by the OVN operator, configure the {loadbalancer_service} network attachment definition:
67+
. To connect pods that manage load balancer virtual machines (amphorae) and the OpenvSwitch pods the OVN operator manages, configure the {loadbalancer_service} network attachment definition:
10568
+
10669
----
107-
$ cat >> octavia-nad.yaml << EOF_CAT
70+
$ cat octavia-nad.yaml << EOF_CAT
10871
apiVersion: k8s.cni.cncf.io/v1
10972
kind: NetworkAttachmentDefinition
11073
metadata:
@@ -132,6 +95,11 @@ spec:
13295
}
13396
}
13497
EOF_CAT
98+
----
99+
100+
. Create the `NetworkAttachmentDefinition` CR:
101+
+
102+
----
135103
$ oc apply -f octavia-nad.yaml
136104
----
137105

@@ -149,9 +117,7 @@ spec:
149117
octavia:
150118
enabled: true
151119
template:
152-
apacheContainerImage: registry.redhat.io/rhel8/httpd-24:latest
153120
amphoraImageContainerImage: quay.io/gthiemonge/octavia-amphora-image
154-
databaseInstance: openstack
155121
octaviaHousekeeping:
156122
networkAttachments:
157123
- octavia
@@ -173,99 +139,62 @@ $ oc wait --for condition=Ready --timeout=600s octavia.octavia.openstack.org/oct
173139
. Ensure that the {loadbalancer_service} is registered in the {identity_service}:
174140
+
175141
----
142+
$ alias openstack="oc exec -t openstackclient -- openstack"
176143
$ openstack service list | grep load-balancer
177144
| bd078ca6f90c4b86a48801f45eb6f0d7 | octavia | load-balancer |
178-
$ openstack endpoint list | grep load-balancer
179-
| f1ae7756b6164baf9cb82a1a670067a2 | regionOne | octavia | load-balancer | True | public | https://octavia-public-openstack.apps-crc.testing |
180-
| ff3222b4621843669e89843395213049 | regionOne | octavia | load-balancer | True | internal | http://octavia-internal.openstack.svc:9876 |
145+
$ openstack endpoint list --service load-balancer
146+
+----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+
147+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
148+
+----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+
149+
| f1ae7756b6164baf9cb82a1a670067a2 | regionOne | octavia | load-balancer | True | public | https://octavia-public-openstack.apps-crc.testing |
150+
| ff3222b4621843669e89843395213049 | regionOne | octavia | load-balancer | True | internal | http://octavia-internal.openstack.svc:9876 |
151+
+----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+
181152
----
182153

183-
. Change the `ONBOOT` option in the network script for the management interface to `no` to ensure that the interface is disabled on reboot:
184-
185-
.. Connect to each of the Controller nodes on the old control plane, for example, `overcloud-controller-0`.
154+
.Post-adoption cleanup
186155

187-
.. Open the management interface configuration file in a text editor such as `vi`:
188-
+
189-
----
190-
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-o-hm0
191-
----
192-
+
193-
The script name is based on the previous `OctaviaMgmtPortDevName` setting and might differ in your environment.
156+
Before running the post-adoption cleanup, you can ensure that the connectivty between the new control plane and the adopted Compute nodes is functional by creating a new load balancer and checking that its `provisioning_status` becomes `ACTIVE`.
194157

195-
. Delete old flavors that are migrated to the new control plane:
196-
+
197158
----
198-
$ openstack flavor list --all | grep octavia
199-
| 484c351a-57ca-4a4b-8e6e-93d31596fec5 | octavia-amphora-4vcpus | 4096 | 3 | 0 | 4 | False |
200-
| 65 | octavia_65 | 1024 | 3 | 0 | 1 | False |
201-
| amphora-mvcpu-ha | octavia_amphora-mvcpu-ha | 4096 | 3 | 0 | 4 | False |
202-
| cf9d1d80-5680-4ed8-a051-e8ec4c5871e0 | octavia-amphora | 1024 | 3 | 0 | 1 | False |
203-
$ openstack flavor delete octavia_65
204-
$ openstack flavor delete octavia_amphora-mvcpu-ha
205-
$ openstack flavor list --all | grep octavia
206-
| 484c351a-57ca-4a4b-8e6e-93d31596fec5 | octavia-amphora-4vcpus | 4096 | 3 | 0 | 4 | False |
207-
| cf9d1d80-5680-4ed8-a051-e8ec4c5871e0 | octavia-amphora | 1024 | 3 | 0 | 1 | False |
159+
$ alias openstack="oc exec -t openstackclient -- openstack"
160+
$ openstack loadbalancer create --vip-subnet-id public-subnet --name lb-post-adoption --wait
208161
----
209162

210-
. Delete old {loadbalancer_service} flavors that are migrated to the new control plane:
211-
+
212-
----
213-
$ openstack loadbalancer flavor list
214-
+--------------------------------------+--------------------------+--------------------------------------+---------+
215-
| id | name | flavor_profile_id | enabled |
216-
+--------------------------------------+--------------------------+--------------------------------------+---------+
217-
| 5db54d9b-ba08-4b51-a859-0a81533604aa | octavia_amphora-mvcpu-ha | 4fa6a793-4c20-4480-be4f-806912840511 | True |
218-
| 6d649fd5-6322-4265-b5f3-c3277fc29ec8 | amphora-4vcpus | d9764a80-99f5-4f22-bbe0-3ddbdc5c485c | True |
219-
| 93f34308-24a7-42de-9065-959a3b36e7f6 | amphora | e75e50c8-7786-4623-abcf-bccbea59d213 | True |
220-
+--------------------------------------+--------------------------+--------------------------------------+---------+
221-
$ openstack loadbalancer flavor delete octavia_amphora-mvcpu-ha
222-
$ openstack loadbalancer flavor list
223-
+--------------------------------------+----------------+--------------------------------------+---------+
224-
| id | name | flavor_profile_id | enabled |
225-
+--------------------------------------+----------------+--------------------------------------+---------+
226-
| 6d649fd5-6322-4265-b5f3-c3277fc29ec8 | amphora-4vcpus | d9764a80-99f5-4f22-bbe0-3ddbdc5c485c | True |
227-
| 93f34308-24a7-42de-9065-959a3b36e7f6 | amphora | e75e50c8-7786-4623-abcf-bccbea59d213 | True |
228-
+--------------------------------------+----------------+--------------------------------------+---------+
229-
----
163+
After you complete the data plane adoption, perform the following cleanup steps to upgrade existing load balancers and remove old resources.
230164

231-
. Delete old flavor profiles that are migrated to the new control plane:
165+
. Trigger a failover for all existing load balancers to upgrade the amphorae virtual machines to use the new image and to establish connectivity with the new control plane:
232166
+
233167
----
234-
$ openstack loadbalancer flavorprofile list
235-
+--------------------------------------+----------------------------------+---------------+
236-
| id | name | provider_name |
237-
+--------------------------------------+----------------------------------+---------------+
238-
| 4fa6a793-4c20-4480-be4f-806912840511 | octavia_amphora-mvcpu-ha_profile | amphora |
239-
| d9764a80-99f5-4f22-bbe0-3ddbdc5c485c | amphora-4vcpus | amphora |
240-
| e75e50c8-7786-4623-abcf-bccbea59d213 | amphora | amphora |
241-
+--------------------------------------+----------------------------------+---------------+
242-
$ openstack loadbalancer flavorprofile delete octavia_amphora-mvcpu-ha_profile
243-
$ openstack loadbalancer flavorprofile list
244-
+--------------------------------------+----------------+---------------+
245-
| id | name | provider_name |
246-
+--------------------------------------+----------------+---------------+
247-
| d9764a80-99f5-4f22-bbe0-3ddbdc5c485c | amphora-4vcpus | amphora |
248-
| e75e50c8-7786-4623-abcf-bccbea59d213 | amphora | amphora |
249-
+--------------------------------------+----------------+---------------+
168+
$ openstack loadbalancer list -f value -c id | \
169+
xargs -r -n1 -P4 ${BASH_ALIASES[openstack]} loadbalancer failover --wait
250170
----
251171

252-
. Delete the old management network ports. Store the network ID of the old management network in the variable `WALLABY_LB_MGMT_NET_ID` to use later:
172+
. Delete old flavors that were migrated to the new control plane:
253173
+
254174
----
255-
$ for net_id in $(openstack network list -f value -c ID --name lb-mgmt-net); do desc=$(openstack network show "$net_id" -f value -c description); [ -z "$desc" ] && WALLABY_LB_MGMT_NET_ID="$net_id" ; done
256-
$ echo $WALLABY_LB_MGMT_NET_ID
257-
1e21f9c1-7485-4104-a2f3-eed098ab9cad
175+
$ openstack flavor delete octavia_65
176+
# The following flavors might not exist in OSP 17.1 deployments
177+
$ openstack flavor show octavia_amphora-mvcpu-ha && \
178+
openstack flavor delete octavia_amphora-mvcpu-ha
179+
$ openstack loadbalancer flavor show octavia_amphora-mvcpu-ha && \
180+
openstack loadbalancer flavor delete octavia_amphora-mvcpu-ha
181+
$ openstack loadbalancer flavorprofile show octavia_amphora-mvcpu-ha_profile && \
182+
openstack loadbalancer flavorprofile delete octavia_amphora-mvcpu-ha_profile
258183
----
259-
260-
. Delete all ports that are used in this network:
261184
+
262-
----
263-
$ for id in $(openstack port list --network "$WALLABY_LB_MGMT_NET_ID" -f value -c ID) ; do openstack port delete "$id" ; done
264-
----
185+
[NOTE]
186+
Some flavors might still be used by load balancers and cannot be deleted.
265187

266-
. Delete the old management network:
188+
. Delete the old management network and its ports:
267189
+
268190
----
191+
$ for net_id in $(openstack network list -f value -c ID --name lb-mgmt-net); do \
192+
desc=$(openstack network show "$net_id" -f value -c description); \
193+
[ -z "$desc" ] && WALLABY_LB_MGMT_NET_ID="$net_id" ; \
194+
done
195+
$ for id in $(openstack port list --network "$WALLABY_LB_MGMT_NET_ID" -f value -c ID); do \
196+
openstack port delete "$id" ; \
197+
done
269198
$ openstack network delete "$WALLABY_LB_MGMT_NET_ID"
270199
----
271200

tests/roles/dataplane_adoption/defaults/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ skip_patching_ansibleee_csv: false
234234
os_diff_dir: tmp/os-diff
235235
os_diff_data_dir: tmp/os-diff
236236
prelaunch_test_instance: true
237+
prelaunch_octavia_workload: false
237238
telemetry_adoption: true
238239

239240
# nodes data will be templated in as a separate

tests/roles/dataplane_adoption/tasks/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@
902902
- name: Adopted Octavia post-checks
903903
when: octavia_adoption|bool
904904
ansible.builtin.include_tasks:
905-
file: octavia_verify.yaml
905+
file: octavia_post.yaml
906906

907907
- name: Adopted Cinder post-checks
908908
ansible.builtin.include_tasks:

0 commit comments

Comments
 (0)