-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #743 from pinikomarov/ospdo_adoption_docs_db_migra…
…tions ospdo adoption docs db migrations
- Loading branch information
Showing
4 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Before you migrate your databases to the {rhos_long} control plane, retrieve the | |
* 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 [email protected]" | ||
MARIADB_IMAGE=quay.io/podified-antelope-centos9/openstack-mariadb:current-podified | ||
|
@@ -42,26 +43,107 @@ $ 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: | ||
+ | ||
---- | ||
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" | ||
---- | ||
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. | ||
|
||
. Run `mysqlcheck` on the {OpenStackShort} database to check for inaccuracies: | ||
+ | ||
---- | ||
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" | ||
---- | ||
|
||
. Get the {compute_service_first_ref} cell mappings: | ||
+ | ||
---- | ||
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" | ||
|
@@ -70,7 +152,12 @@ echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS" | |
. Get the hostnames of the registered Compute services: | ||
+ | ||
---- | ||
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" | ||
|