From c0e39c5716301566190788c4201d4cf4d15a2158 Mon Sep 17 00:00:00 2001 From: Guillermo Calvino Date: Tue, 18 Apr 2023 13:00:54 +0200 Subject: [PATCH 1/2] Charmed OSM upgrade to v12 procedure Signed-off-by: Guillermo Calvino --- 19-lts-upgrade.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/19-lts-upgrade.md b/19-lts-upgrade.md index 2afd815..f163a81 100644 --- a/19-lts-upgrade.md +++ b/19-lts-upgrade.md @@ -563,6 +563,93 @@ juju scale-application ro 1 At this point, OSM LTS is operational and ready to use. +## Upgrade of 10.1 LTS to 12 LTS + +This procedure covers both the upgrade of 10.1 to 12 LTS. There are two installation methods, each with its own set of procedures: + +* [Kubernetes Installation Option](#kubernetes-installation-to-12) +* [Charmed Installation Option](#charmed-installation-to-12) + +### Kubernetes Installation to 12 + +TBD + +### Charmed Installation to 12 + +#### Back up the Databases + +First of all we will stop OSM services, so no changes are done while we do the backup. + +```bash +juju scale-application grafana 0 +juju scale-application prometheus 0 +juju scale-application kafka-k8s 0 +juju scale-application keystone 0 +juju scale-application lcm 0 +juju scale-application mon 0 +juju scale-application nbi 0 +juju scale-application ng-ui 0 +juju scale-application pla 0 +juju scale-application pol 0 +juju scale-application ro 0 +juju scale-application zookeeper-k8s 0 +``` + +Wait for all the applications to scale to 0. The output of `juju status` should look similar to the following, with only `mariadb-k8s` and `mongodb-k8s` units left. +``` +Model Controller Cloud/Region Version SLA Timestamp +osm osm-vca microk8s/localhost 2.8.13 unsupported 20:57:44Z + +App Version Status Scale Charm Store Rev OS Address Notes +grafana docker.io/ubuntu/grafana@sh... active 0 grafana jujucharms 4 kubernetes 10.152.183.45 +kafka-k8s rocks.canonical.com:443/wur... active 0 kafka-k8s jujucharms 21 kubernetes 10.152.183.248 +keystone keystone:10.0.3 active 0 keystone jujucharms 9 kubernetes 10.152.183.114 +lcm lcm:10.0.3 active 0 lcm jujucharms 8 kubernetes 10.152.183.70 +mariadb-k8s rocks.canonical.com:443/mar... active 1 mariadb-k8s jujucharms 35 kubernetes 10.152.183.177 +mon mon:10.0.3 active 0 mon jujucharms 5 kubernetes 10.152.183.227 +mongodb-k8s mongo:latest active 1 mongodb-k8s jujucharms 29 kubernetes 10.152.183.63 +nbi nbi:10.0.3 active 0 nbi jujucharms 12 kubernetes 10.152.183.163 +ng-ui ng-ui:10.0.3 active 0 ng-ui jujucharms 21 kubernetes 10.152.183.180 +pla pla:10.0.3 active 0 pla jujucharms 9 kubernetes 10.152.183.7 +pol pol:10.0.3 active 0 pol jujucharms 4 kubernetes 10.152.183.104 +prometheus docker.io/ed1000/prometheus... active 0 prometheus jujucharms 4 kubernetes 10.152.183.120 +ro ro:10.0.3 active 0 ro jujucharms 4 kubernetes 10.152.183.159 +zookeeper-k8s rocks.canonical.com:443/k8s... active 0 zookeeper-k8s jujucharms 37 kubernetes 10.152.183.201 + +Unit Workload Agent Address Ports Message +mariadb-k8s/0* active idle 10.1.244.152 3306/TCP ready +mongodb-k8s/0* active idle 10.1.244.156 27017/TCP ready +``` + +Now, the databases can be backed up using the following commands: + +```bash +mariadb_unit=$(juju status | grep -i mariadb | tail -1 | awk -F" " '{print $1}' | tr -d '[*]') +mariadb_pod=$(microk8s.kubectl get pod -n osm | grep -i mariadb | tail -1 | awk -F" " '{print $1}') +juju run-action $mariadb_unit backup --wait -m osm +microk8s.kubectl cp osm/$mariadb_pod:/var/lib/mysql/backup.sql.gz backup.sql.gz + +mongodb_unit=$(juju status | grep -i mongodb | tail -1 | awk -F" " '{print $1}'| tr -d '[*]') +mongodb_pod=$(microk8s.kubectl get pod -n osm | grep -i mongodb | tail -1 | awk -F" " '{print $1}') +microk8s.kubectl exec -n osm -it $mongodb_pod -- mongodump --gzip --archive=/data/backup.archive +microk8s.kubectl cp osm/$mongodb_pod:/data/backup.archive backup.archive +``` + +#### Upgrade OSM Application + +```bash +juju attach-resource -m osm lcm image=opensourcemano/lcm:12 +juju attach-resource -m osm mon image=opensourcemano/mon:12 +juju attach-resource -m osm nbi image=opensourcemano/nbi:12 +juju attach-resource -m osm ng-ui image=opensourcemano/ng-ui:12 +juju attach-resource -m osm pla image=opensourcemano/pla:12 +juju attach-resource -m osm pol image=opensourcemano/pol:12 +juju attach-resource -m osm ro image=opensourcemano/ro:12 +juju attach-resource -m osm keystone keystone-image=opensourcemano/keystone:12 +``` + +At this point, OSM has been upgraded. + ## Testing Upgrade ### Changing Credentials -- GitLab From a271b1dac51def847294849802192b8181fb9bb5 Mon Sep 17 00:00:00 2001 From: Guillermo Calvino Date: Tue, 18 Apr 2023 13:49:21 +0200 Subject: [PATCH 2/2] Using v12.0.6 instead of v12 Signed-off-by: Guillermo Calvino --- 19-lts-upgrade.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/19-lts-upgrade.md b/19-lts-upgrade.md index f163a81..c6abe53 100644 --- a/19-lts-upgrade.md +++ b/19-lts-upgrade.md @@ -563,18 +563,18 @@ juju scale-application ro 1 At this point, OSM LTS is operational and ready to use. -## Upgrade of 10.1 LTS to 12 LTS +## Upgrade of 10.1 LTS to 12.0.6 LTS This procedure covers both the upgrade of 10.1 to 12 LTS. There are two installation methods, each with its own set of procedures: * [Kubernetes Installation Option](#kubernetes-installation-to-12) * [Charmed Installation Option](#charmed-installation-to-12) -### Kubernetes Installation to 12 +### Kubernetes Installation to 12.0.6 TBD -### Charmed Installation to 12 +### Charmed Installation to 12.0.6 #### Back up the Databases @@ -638,14 +638,14 @@ microk8s.kubectl cp osm/$mongodb_pod:/data/backup.archive backup.archive #### Upgrade OSM Application ```bash -juju attach-resource -m osm lcm image=opensourcemano/lcm:12 -juju attach-resource -m osm mon image=opensourcemano/mon:12 -juju attach-resource -m osm nbi image=opensourcemano/nbi:12 -juju attach-resource -m osm ng-ui image=opensourcemano/ng-ui:12 -juju attach-resource -m osm pla image=opensourcemano/pla:12 -juju attach-resource -m osm pol image=opensourcemano/pol:12 -juju attach-resource -m osm ro image=opensourcemano/ro:12 -juju attach-resource -m osm keystone keystone-image=opensourcemano/keystone:12 +juju attach-resource -m osm lcm image=opensourcemano/lcm:12.0.6 +juju attach-resource -m osm mon image=opensourcemano/mon:12.0.6 +juju attach-resource -m osm nbi image=opensourcemano/nbi:12.0.6 +juju attach-resource -m osm ng-ui image=opensourcemano/ng-ui:12.0.6 +juju attach-resource -m osm pla image=opensourcemano/pla:12.0.6 +juju attach-resource -m osm pol image=opensourcemano/pol:12.0.6 +juju attach-resource -m osm ro image=opensourcemano/ro:12.0.6 +juju attach-resource -m osm keystone keystone-image=opensourcemano/keystone:12.0.6 ``` At this point, OSM has been upgraded. -- GitLab