From f1e88d24ab1d812b0af069e460374d70f0fe11ff Mon Sep 17 00:00:00 2001 From: Pini Komarov Date: Mon, 11 Nov 2024 12:58:50 +0200 Subject: [PATCH 1/3] add db migration mysql client setup diffs set conditional params for ospdo pods set conditional params for ospdo pods mariadb upload ns update add ovn ospdo vars add dataplane ospdo vars set conditional params for ospdo pods set conditional params for ospdo pods mariadb upload ns update add ovn ospdo vars add dataplane ospdo vars updated with review update --- ...rating-databases-to-the-control-plane.adoc | 9 ++ ...ng-compute-services-to-the-data-plane.adoc | 3 + ...rating-databases-to-mariadb-instances.adoc | 2 +- .../modules/proc_migrating-ovn-data.adoc | 37 +++++++-- ...pology-specific-service-configuration.adoc | 83 ++++++++++++++++++- 5 files changed, 122 insertions(+), 12 deletions(-) diff --git a/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc b/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc index 3b8ecbc8f..4492830b5 100644 --- a/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc +++ b/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc @@ -6,6 +6,15 @@ ifdef::context[:parent-context: {context}] = Migrating databases to the control plane +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +:pod_ns: '"${RHOSO_NAMESPACE}"' +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +:pod_ns: '"${OSPDO_NAMESPACE}"' +endif::[] + + + To begin creating the control plane, enable back-end services and import the databases from your original {rhos_prev_long} {rhos_prev_ver} deployment. include::../modules/proc_retrieving-topology-specific-service-configuration.adoc[leveloffset=+1] diff --git a/docs_user/modules/proc_adopting-compute-services-to-the-data-plane.adoc b/docs_user/modules/proc_adopting-compute-services-to-the-data-plane.adoc index b0306f197..504633ad6 100644 --- a/docs_user/modules/proc_adopting-compute-services-to-the-data-plane.adoc +++ b/docs_user/modules/proc_adopting-compute-services-to-the-data-plane.adoc @@ -126,6 +126,9 @@ endif::[] ifeval::["{build}" == "downstream"] $(cat | base64 | sed \'s/^/ /') endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] + $(oc exec -n $ -t openstackclient openstackclient -- cat /home/cloud-admin/.ssh/id_rsa | base64 | sed 's/^/ /') +endif::[] EOF ---- + diff --git a/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc b/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc index ebb5c35bf..f3d0243a3 100644 --- a/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc +++ b/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc @@ -172,7 +172,7 @@ EOF . Restore the databases from `.sql` files into the control plane MariaDB: + ---- -$ oc rsh mariadb-copy-data << EOF +$ oc rsh -n {pod_ns} mariadb-copy-data << EOF # db schemas to rename on import declare -A db_name_map db_name_map['nova']='nova_cell1' diff --git a/docs_user/modules/proc_migrating-ovn-data.adoc b/docs_user/modules/proc_migrating-ovn-data.adoc index 3be3cab6b..ecdc34249 100644 --- a/docs_user/modules/proc_migrating-ovn-data.adoc +++ b/docs_user/modules/proc_migrating-ovn-data.adoc @@ -33,7 +33,16 @@ $ grep -rI 'ovn_[ns]b_conn' /var/lib/config-data/puppet-generated/ ---- .Procedure - ++ +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +. Get the {OpenShiftShort} master node that contains the {OpenStackShort} Controller: ++ +---- +$ oc get vmi -n $ -o jsonpath='{.items[0].metadata.labels.kubevirt\.io/nodeName}' +---- ++ +* Replace `` with your OSPdO namespace. +endif::[] . Prepare a temporary `PersistentVolume` claim and the helper pod for the OVN backup. Adjust the storage requests for a large database, if needed: + [source,yaml] @@ -44,7 +53,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: ovn-data-cert - namespace: openstack + namespace: {pod_ns} spec: commonName: ovn-data-cert secretName: ovn-data-cert @@ -54,6 +63,7 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: + namespace: {pod_ns} name: ovn-data spec: storageClassName: $STORAGE_CLASS @@ -69,10 +79,19 @@ metadata: name: ovn-copy-data annotations: openshift.io/scc: anyuid +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] k8s.v1.cni.cncf.io/networks: internalapi +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] + '[{"name": "internalapi-static", "namespace": $, "ips": [""]}]' +endif::[] labels: app: adoption + namespace: {pod_ns} spec: +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] + nodeName: '{{ }}' +endif::[] containers: - image: $OVSDB_IMAGE command: [ "sh", "-c", "sleep infinity"] @@ -99,11 +118,15 @@ spec: secretName: ovn-data-cert EOF ---- +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] ++ +* Replace `` with the {OpenStackShort} node that contains the Controller. +endif::[] . Wait for the pod to be ready: + ---- -$ oc wait --for=condition=Ready pod/ovn-copy-data --timeout=30s +$ oc wait --for=condition=Ready -n {pod_ns} pod/ovn-copy-data --timeout=30s ---- . If the podified internalapi cidr is different than the source internalapi cidr, add an iptables accept rule on the Controller nodes: @@ -117,8 +140,8 @@ $ $CONTROLLER1_SSH sudo iptables -I INPUT -s {PODIFIED_INTERNALAPI_NETWORK} -p t * If you did not enable TLS everywhere, run the following command: + ---- -$ oc exec ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6641 > /backup/ovs-nb.db" -$ oc exec ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6642 > /backup/ovs-sb.db" +$ oc exec -n {pod_ns} ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6641 > /backup/ovs-nb.db" +$ oc exec -n {pod_ns} ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6642 > /backup/ovs-sb.db" ---- * If you enabled TLS everywhere, run the following command: + @@ -193,8 +216,8 @@ $ oc exec ovn-copy-data -- bash -c "ovsdb-client get-schema --ca-cert=/etc/pki/t .. If you did not enable TLS everywhere, use the following command: + ---- -$ oc exec ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_NB_IP:6641 < /backup/ovs-nb.db" -$ oc exec ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_SB_IP:6642 < /backup/ovs-sb.db" +$ oc exec -n $ ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_NB_IP:6641 < /backup/ovs-nb.db" +$ oc exec -n $ ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_SB_IP:6642 < /backup/ovs-sb.db" ---- .. If you enabled TLS everywhere, use the following command: diff --git a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc index df7000f06..0709b78f9 100644 --- a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc +++ b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc @@ -9,10 +9,18 @@ Before you migrate your databases to the {rhos_long} control plane, retrieve the * To compare your {OpenStackShort} database with the adopted {rhos_acro} database .Prerequisites +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] + +:pod_annotations: '${MARIADB_CLIENT_ANNOTATIONS}' +endif::[] +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +:pod_annotations: '--overrides="$RUN_OVERRIDES" -n "${OSPDO_NAMESPACE}"' +endif::[] * Define the following shell variables. Replace the example values with values that are correct for your environment: + ---- +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] ifeval::["{build}" != "downstream"] CONTROLLER1_SSH="ssh -i ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa root@192.168.122.100" MARIADB_IMAGE=quay.io/podified-antelope-centos9/openstack-mariadb:current-podified @@ -42,10 +50,77 @@ $ sudo grep -rI 'listen mysql' -A10 /var/lib/config-data/puppet-generated/ | gre . Export the shell variables for the following outputs and test the connection to the {OpenStackShort} database: + ---- -export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;') echo "$PULL_OPENSTACK_CONFIGURATION_DATABASES" ---- +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +---- +export CONTROLLER1_SSH="oc -n $OSPDO_NAMESPACE rsh -c openstackclient openstackclient ssh controller-0.ctlplane" +---- +* With OSPdO, the `mariadb-client` needs to run on the same {rhocp_long} node where the {OpenStackShort} Controller node is running. In addition, the `internalapi-static` network needs to be attached to the pod. +---- +export PASSWORD_FILE="tripleo-passwords.yaml" +export OSPDO_NAMESPACE="openstack" +---- +. Get the passwords file: ++ +---- +$ oc get secret tripleo-passwords -n $OSPDO_NAMESPACE -o json | jq -r '.data["tripleo-overcloud-passwords.yaml"]' | +base64 -d >"${PASSWORD_FILE}" +---- + +. Get the name of the {OpenShiftShort} node where the {OpenStackShort} Controller virtual machine is running: ++ +---- +$ export CONTROLLER_NODE=$(oc get vmi -ojson | jq -r '.items[0].status.nodeName') +$ export SOURCE_OVN_OVSDB_IP=172.17.0.160 # get this from the source OVN DB + +$ export SOURCE_DB_ROOT_PASSWORD=$(grep <"${PASSWORD_FILE}" ' MysqlRootPassword:' | awk -F ': ' '{ print $2; }') || { + echo "Failed to get the source DB root password" + exit 1 +} +---- +. Find the mysql service IP in the `ctlplane-export.yaml` section of the `tripleo-exports-default` ConfigMap: ++ +---- +$ cpexport=$(oc -n "${OSPDO_NAMESPACE}" get cm tripleo-exports-default -o json | jq -r '.data["ctlplane-export.yaml"]') +$ export SOURCE_MARIADB_IP=$(echo "$cpexport" | sed -e '0,/ MysqlInternal/d' | sed -n '0,/host_nobrackets/s/^.*host_nobrackets\:\s*\(.*\)$/\1/p') ++ +$ export MARIADB_IMAGE='quay.io/podified-antelope-centos9/openstack-mariadb:current-podified' ++ +$ RUN_OVERRIDES='{ + "apiVersion": "v1", + "metadata": { + "annotations": { + "k8s.v1.cni.cncf.io/networks": "[{\"name\": \"internalapi-static\",\"namespace\": \"openstack\", \"ips\":[\"172.17.0.99/24\"]}]" + } + }, + "spec": { + "nodeName": "'"$CONTROLLER_NODE"'", + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": ["ALL"] + }, + "runAsNonRoot": true, + "seccompProfile": { + "type": "RuntimeDefault" + } + } + } +}' +---- +.Procedure + +. Export the shell variables for the following outputs and test the connection to the {OpenStackShort} database: ++ +---- +$ export PULL_OPENSTACK_CONFIGURATION_DATABASES="$(oc run mariadb-client -q --image "${MARIADB_IMAGE}" \ + -i --rm --restart=Never {pod_annotations} -- mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;')" +---- +endif::[] + [NOTE] The `nova`, `nova_api`, and `nova_cell0` databases are included in the same database host. @@ -53,7 +128,7 @@ The `nova`, `nova_api`, and `nova_cell0` databases are included in the same data . Run `mysqlcheck` on the {OpenStackShort} database to check for inaccuracies: + ---- -export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ mysqlcheck --all-databases -h $SOURCE_MARIADB_IP -u root -p"$SOURCE_DB_ROOT_PASSWORD" | grep -v OK) echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK" ---- @@ -61,7 +136,7 @@ echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK" . Get the {compute_service_first_ref} cell mappings: + ---- -export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ mysql -rsh "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" nova_api -e \ 'select uuid,name,transport_url,database_connection,disabled from cell_mappings;') echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS" @@ -70,7 +145,7 @@ echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS" . Get the hostnames of the registered Compute services: + ---- -export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" nova_api -e \ "select host from nova.services where services.binary='nova-compute';") echo "$PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES" From f1260aa7194fb7748068c0912e18081266266a9f Mon Sep 17 00:00:00 2001 From: Pini Komarov Date: Tue, 26 Nov 2024 01:21:33 +0200 Subject: [PATCH 2/3] return to original, ospdo uses ifevalfor ns --- ...rating-databases-to-the-control-plane.adoc | 9 ----- ...rating-databases-to-mariadb-instances.adoc | 7 +++- .../modules/proc_migrating-ovn-data.adoc | 37 +++++++++++++++---- ...pology-specific-service-configuration.adoc | 29 ++++++++++++--- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc b/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc index 4492830b5..3b8ecbc8f 100644 --- a/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc +++ b/docs_user/assemblies/assembly_migrating-databases-to-the-control-plane.adoc @@ -6,15 +6,6 @@ ifdef::context[:parent-context: {context}] = Migrating databases to the control plane -ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] -:pod_ns: '"${RHOSO_NAMESPACE}"' -endif::[] -ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] -:pod_ns: '"${OSPDO_NAMESPACE}"' -endif::[] - - - To begin creating the control plane, enable back-end services and import the databases from your original {rhos_prev_long} {rhos_prev_ver} deployment. include::../modules/proc_retrieving-topology-specific-service-configuration.adoc[leveloffset=+1] diff --git a/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc b/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc index f3d0243a3..aaf6891a2 100644 --- a/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc +++ b/docs_user/modules/proc_migrating-databases-to-mariadb-instances.adoc @@ -172,7 +172,12 @@ EOF . Restore the databases from `.sql` files into the control plane MariaDB: + ---- -$ oc rsh -n {pod_ns} mariadb-copy-data << EOF +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +$ oc rsh mariadb-copy-data << EOF +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +$ oc rsh -n $OSPDO_NAMESPACE mariadb-copy-data << EOF +endif::[] # db schemas to rename on import declare -A db_name_map db_name_map['nova']='nova_cell1' diff --git a/docs_user/modules/proc_migrating-ovn-data.adoc b/docs_user/modules/proc_migrating-ovn-data.adoc index ecdc34249..556dd9a75 100644 --- a/docs_user/modules/proc_migrating-ovn-data.adoc +++ b/docs_user/modules/proc_migrating-ovn-data.adoc @@ -53,7 +53,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: ovn-data-cert - namespace: {pod_ns} + namespace: openstack spec: commonName: ovn-data-cert secretName: ovn-data-cert @@ -63,7 +63,9 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - namespace: {pod_ns} +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] + namespace: $OSPDO_NAMESPACE +endif::[] name: ovn-data spec: storageClassName: $STORAGE_CLASS @@ -87,7 +89,9 @@ ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] endif::[] labels: app: adoption - namespace: {pod_ns} +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] + namespace: $OSPDO_NAMESPACE +endif::[] spec: ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] nodeName: '{{ }}' @@ -126,7 +130,12 @@ endif::[] . Wait for the pod to be ready: + ---- -$ oc wait --for=condition=Ready -n {pod_ns} pod/ovn-copy-data --timeout=30s +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +$ oc wait --for=condition=Ready pod/ovn-copy-data --timeout=30s +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +$ oc wait --for=condition=Ready -n $OSPDO_NAMESPACE pod/ovn-copy-data --timeout=30s +endif::[] ---- . If the podified internalapi cidr is different than the source internalapi cidr, add an iptables accept rule on the Controller nodes: @@ -140,8 +149,14 @@ $ $CONTROLLER1_SSH sudo iptables -I INPUT -s {PODIFIED_INTERNALAPI_NETWORK} -p t * If you did not enable TLS everywhere, run the following command: + ---- -$ oc exec -n {pod_ns} ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6641 > /backup/ovs-nb.db" -$ oc exec -n {pod_ns} ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6642 > /backup/ovs-sb.db" +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +$ oc exec ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6641 > /backup/ovs-nb.db" +$ oc exec ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6642 > /backup/ovs-sb.db" +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +$ oc exec -n $OSPDO_NAMESPACE ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6641 > /backup/ovs-nb.db" +$ oc exec -n $OSPDO_NAMESPACE ovn-copy-data -- bash -c "ovsdb-client backup tcp:$SOURCE_OVSDB_IP:6642 > /backup/ovs-sb.db" +endif::[] ---- * If you enabled TLS everywhere, run the following command: + @@ -216,8 +231,14 @@ $ oc exec ovn-copy-data -- bash -c "ovsdb-client get-schema --ca-cert=/etc/pki/t .. If you did not enable TLS everywhere, use the following command: + ---- -$ oc exec -n $ ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_NB_IP:6641 < /backup/ovs-nb.db" -$ oc exec -n $ ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_SB_IP:6642 < /backup/ovs-sb.db" +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +$ oc exec ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_NB_IP:6641 < /backup/ovs-nb.db" +$ oc exec ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_SB_IP:6642 < /backup/ovs-sb.db" +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +$ oc exec -n $RHOSO_NAMESPACE ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_NB_IP:6641 < /backup/ovs-nb.db" +$ oc exec -n $RHOSO_NAMESPACE ovn-copy-data -- bash -c "ovsdb-client restore tcp:$PODIFIED_OVSDB_SB_IP:6642 < /backup/ovs-sb.db" +endif::[] ---- .. If you enabled TLS everywhere, use the following command: diff --git a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc index 0709b78f9..18da997dc 100644 --- a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc +++ b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc @@ -50,11 +50,15 @@ $ sudo grep -rI 'listen mysql' -A10 /var/lib/config-data/puppet-generated/ | gre . Export the shell variables for the following outputs and test the connection to the {OpenStackShort} database: + ---- -export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client --overrides="$RUN_OVERRIDES" -n $OSPDO_NAMESPACE -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;') echo "$PULL_OPENSTACK_CONFIGURATION_DATABASES" ---- -endif::[] ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] ---- export CONTROLLER1_SSH="oc -n $OSPDO_NAMESPACE rsh -c openstackclient openstackclient ssh controller-0.ctlplane" @@ -128,7 +132,12 @@ The `nova`, `nova_api`, and `nova_cell0` databases are included in the same data . Run `mysqlcheck` on the {OpenStackShort} database to check for inaccuracies: + ---- -export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client --overrides="$RUN_OVERRIDES" -n $OSPDO_NAMESPACE -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] mysqlcheck --all-databases -h $SOURCE_MARIADB_IP -u root -p"$SOURCE_DB_ROOT_PASSWORD" | grep -v OK) echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK" ---- @@ -136,7 +145,12 @@ echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK" . Get the {compute_service_first_ref} cell mappings: + ---- -export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client --overrides="$RUN_OVERRIDES" -n $OSPDO_NAMESPACE -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] mysql -rsh "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" nova_api -e \ 'select uuid,name,transport_url,database_connection,disabled from cell_mappings;') echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS" @@ -145,7 +159,12 @@ echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS" . Get the hostnames of the registered Compute services: + ---- -export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client {pod_annotations} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client ${MARIADB_CLIENT_ANNOTATIONS} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] +ifeval::["{OpenStackPreviousInstaller}" == "director_operator"] +export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client --overrides="$RUN_OVERRIDES" -n $OSPDO_NAMESPACE -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \ +endif::[] mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" nova_api -e \ "select host from nova.services where services.binary='nova-compute';") echo "$PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES" From a085632336e816bc63c36bac1b86eec569302451 Mon Sep 17 00:00:00 2001 From: Pini Komarov Date: Tue, 26 Nov 2024 01:22:44 +0200 Subject: [PATCH 3/3] remove ns variable --- ...retrieving-topology-specific-service-configuration.adoc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc index 18da997dc..8fa1c2707 100644 --- a/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc +++ b/docs_user/modules/proc_retrieving-topology-specific-service-configuration.adoc @@ -9,13 +9,6 @@ Before you migrate your databases to the {rhos_long} control plane, retrieve the * To compare your {OpenStackShort} database with the adopted {rhos_acro} database .Prerequisites -ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] - -:pod_annotations: '${MARIADB_CLIENT_ANNOTATIONS}' -endif::[] -ifeval::["{OpenStackPreviousInstaller}" != "director_operator"] -:pod_annotations: '--overrides="$RUN_OVERRIDES" -n "${OSPDO_NAMESPACE}"' -endif::[] * Define the following shell variables. Replace the example values with values that are correct for your environment: +