From c953e7bee0ff6ffbf44a10942ac7eb886e22e2e8 Mon Sep 17 00:00:00 2001 From: Pini Komarov Date: Wed, 13 Nov 2024 16:47:25 +0200 Subject: [PATCH 1/2] add ospdo scaledown pre dataplane adoption docs Related patches : Jira: https://issues.redhat.com/browse/OSPRH-6618 fix lint fix lint updated with review --- docs_user/main.adoc | 4 + ...spdo-scale-down-pre-database-adoption.adoc | 204 ++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc diff --git a/docs_user/main.adoc b/docs_user/main.adoc index 82c076bf8..7b2b21fed 100644 --- a/docs_user/main.adoc +++ b/docs_user/main.adoc @@ -15,6 +15,10 @@ include::modules/proc_migrating-tls-everywhere.adoc[leveloffset=+1] include::assemblies/assembly_migrating-databases-to-the-control-plane.adoc[leveloffset=+1] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +include::assemblies/assembly_ospdo-scale-down-pre-database-adoption.adoc[leveloffset=+1] +endif::[] + include::assemblies/assembly_adopting-openstack-control-plane-services.adoc[leveloffset=+1] include::assemblies/assembly_adopting-the-data-plane.adoc[leveloffset=+1] diff --git a/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc b/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc new file mode 100644 index 000000000..8e283f2c3 --- /dev/null +++ b/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc @@ -0,0 +1,204 @@ +[id="ospdo_scale_down_pre_database_adoption_{context}"] + += Scaling down director Operator resources + +Before you migrate your databases to the control plane, you must scale down and remove director Operator (OSPdO) resources in order to use the {rhos_long} resources. + +.Procedure + +. Scale down the {rhos_acro} OpenStack Operator `controller-manager` to 0 replicas and temporarily delete the `OpenStackControlPlane` `OpenStackClient` pod, so that you can use the OSPdO `controller-manager` to clean up some of its resources. The cleanup is needed to avoid a pod name collision between the OSPdO OpenStackClient and the {rhos_acro} OpenStackClient. ++ +---- +$ oc patch csv -n openstack-operators openstack-operator.v0.0.1 --type json -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]" +$ oc delete openstackclients.client.openstack.org --all +---- ++ +. Delete the OSPdO `OpenStackControlPlane` custom resource (CR): ++ +---- +$ oc delete openstackcontrolplanes.osp-director.openstack.org -n openstack --all +---- +. Delete the OSPdO `OpenStackNetConfig` CR to remove the associated node network configuration policies: ++ +---- +$ oc delete osnetconfig -n openstack --all +---- +. Label the {OpenShiftShort} node that contains the OSPdO virtual machine (VM): ++ +---- +$ oc label nodes type=openstack +---- ++ +* Replace ` ` with the remaining master node that contains the OSPdO VM. +. Create a node network configuration policy for the third {OpenShiftShort} node. For example: ++ +---- +$ cat << EOF > /tmp/node3_nncp.yaml +apiVersion: nmstate.io/v1 +kind: NodeNetworkConfigurationPolicy +metadata: + labels: + osp/interface: enp7s0 + name: +spec: + desiredState: + dns-resolver: + config: + search: [] + server: + - 172.22.0.1 + interfaces: + - description: internalapi vlan interface + name: enp7s0.20 + state: up + type: vlan + vlan: + base-iface: enp7s0 + id: 20 + reorder-headers: true + ipv4: + address: + - ip: 172.17.0.7 + prefix-length: 24 + enabled: true + dhcp: false + ipv6: + enabled: false + - description: storage vlan interface + name: enp7s0.30 + state: up + type: vlan + vlan: + base-iface: enp7s0 + id: 30 + reorder-headers: true + ipv4: + address: + - ip: 172.18.0.7 + prefix-length: 24 + enabled: true + dhcp: false + ipv6: + enabled: false + - description: storagemgmt vlan interface + name: enp7s0.40 + state: up + type: vlan + vlan: + base-iface: enp7s0 + id: 40 + reorder-headers: true + ipv4: + address: + - ip: 172.19.0.7 + prefix-length: 24 + enabled: true + dhcp: false + ipv6: + enabled: false + - description: tenant vlan interface + name: enp7s0.50 + state: up + type: vlan + vlan: + base-iface: enp7s0 + id: 50 + reorder-headers: true + ipv4: + address: + - ip: 172.20.0.7 + prefix-length: 24 + enabled: true + dhcp: false + ipv6: + enabled: false + - description: Configuring Bridge br-ctlplane with interface enp7s0 + name: br-ctlplane + mtu: 1500 + type: linux-bridge + state: up + bridge: + options: + stp: + enabled: false + port: + - name: enp1s0 + vlan: {} + ipv4: + address: + - ip: 172.22.0.53 + prefix-length: 24 + enabled: true + dhcp: false + ipv6: + enabled: false + - bridge: + options: + stp: + enabled: false + port: + - name: enp6s0 + description: Linux bridge with enp6s0 as a port + ipv4: + enabled: false + ipv6: + enabled: false + mtu: 1500 + name: br-external + state: up + type: linux-bridge + nodeSelector: + kubernetes.io/hostname: + node-role.kubernetes.io/worker: "" +EOF + +$ oc apply -f /tmp/node3_nncp.yaml +---- +. Get the remaining OSPdO resources and delete everything. Do not delete the `OpenStackBaremetalSets` and `OpenStackProvisionServer` resources: ++ +---- +$ for i in $(oc get crd | grep osp-director | grep -v baremetalset | grep -v provisionserver | awk {'print $1'}); do echo Deleting $i...; oc delete $i -n openstack --all; done +---- +. Scale down OSPdO to 0 replicas: ++ +---- +$ ospdo_csv_ver=$(oc get csv -n openstack -l operators.coreos.com/osp-director-operator.openstack -o json | jq -r '.items[0].metadata.name') +$ oc patch csv -n openstack $ospdo_csv_ver --type json -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]" +---- +. Remove the webhooks from OSPdO: ++ +---- +$ oc patch csv $ospdo_csv_ver -n openstack --type json -p="[{"op": "remove", "path": "/spec/webhookdefinitions"}]" +---- +. Remove the finalizer from the OSPdO `OpenStackBaremetalSet` resource: ++ +---- +$ oc patch openstackbaremetalsets.osp-director.openstack.org -n openstack compute --type json -p="[{"op": "remove", "path": "/metadata/finalizers"}]" +---- +. Delete the `OpenStackBaremetalSet` and `OpenStackProvisionServer` resources: ++ +---- +$ oc delete openstackbaremetalsets.osp-director.openstack.org -n openstack --all +$ oc delete openstackprovisionservers.osp-director.openstack.org -n openstack --all +---- +. Annotate each {OpenStackShort} Compute `BareMetalHost` resource so that Metal3 does not start the node: ++ +---- +$ compute_bmh_list=$(oc get bmh -n openshift-machine-api |grep compute|awk '{printf $1 " "}') +$ for bmh_compute in $compute_bmh_list;do oc annotate bmh -n openshift-machine-api $bmh_compute baremetalhost.metal3.io/detached="";done +$ oc delete bmh -n openshift-machine-api $bmh_compute;done +---- +. Delete the OSPdO Operator Lifecycle Manager resources to remove OpenStack director Operator: ++ +---- +$ oc delete subscription osp-director-operator -n openstack +$ oc delete operatorgroup osp-director-operator -n openstack +$ oc delete catalogsource osp-director-operator-index -n openstack +$ oc delete csv $ospdo_csv_ver -n openstack +---- + +. Scale up the {rhos_acro} OpenStack Operator `controller-manager` to 1 replica so that the associated `OpenStackControlPlane` CR is reconciled and its `OpenStackClient` pod is recreated: ++ +---- +$ oc patch csv -n openstack-operators openstack-operator.v0.0.1 --type json -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "1"}]" +---- From 9eaa05351fcbfbfbf5fbfa3024c6a318938b9919 Mon Sep 17 00:00:00 2001 From: klgill <97464556+klgill@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:50:41 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Committing peer review comments. Co-authored-by: Roger Heslop --- .../assembly_ospdo-scale-down-pre-database-adoption.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc b/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc index 8e283f2c3..b9bb58de2 100644 --- a/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc +++ b/docs_user/modules/assembly_ospdo-scale-down-pre-database-adoption.adoc @@ -2,7 +2,7 @@ = Scaling down director Operator resources -Before you migrate your databases to the control plane, you must scale down and remove director Operator (OSPdO) resources in order to use the {rhos_long} resources. +Before you migrate your databases to the control plane, you must scale down and remove OpenStack director Operator (OSPdO) resources in order to use the {rhos_long} resources. .Procedure @@ -154,7 +154,7 @@ EOF $ oc apply -f /tmp/node3_nncp.yaml ---- -. Get the remaining OSPdO resources and delete everything. Do not delete the `OpenStackBaremetalSets` and `OpenStackProvisionServer` resources: +. Delete the remaining OSPdO resources. Do not delete the `OpenStackBaremetalSets` and `OpenStackProvisionServer` resources: + ---- $ for i in $(oc get crd | grep osp-director | grep -v baremetalset | grep -v provisionserver | awk {'print $1'}); do echo Deleting $i...; oc delete $i -n openstack --all; done @@ -188,7 +188,7 @@ $ compute_bmh_list=$(oc get bmh -n openshift-machine-api |grep compute|awk '{pri $ for bmh_compute in $compute_bmh_list;do oc annotate bmh -n openshift-machine-api $bmh_compute baremetalhost.metal3.io/detached="";done $ oc delete bmh -n openshift-machine-api $bmh_compute;done ---- -. Delete the OSPdO Operator Lifecycle Manager resources to remove OpenStack director Operator: +. Delete the OSPdO Operator Lifecycle Manager resources to remove OSPdO: + ---- $ oc delete subscription osp-director-operator -n openstack