Starting with version 10.1.0 of OSM, every even numbered release will receive two years of community support. This document covers the steps needed for upgrading OSM. Depending on the installation method, there are two methods for upgrading OSM to an LTS version.
## Upgrade of Pre-LTS to 10.1.0 LTS
This procedure covers both upgrade from 9.1.5 or 10.0.3 to 10.1.0 LTS. Where necessary, additional steps for 9.1.5 are shown. There are two installation methods, each with its own set of procedures:
#### Restart all OSM Services <a name="k8s-12"></a>
Now that the databases are migrated to the new version, we can restart the services.
```bash
kubectl -n osm scale deployment/grafana --replicas=1
kubectl -n osm scale statefulset/prometheus --replicas=1
kubectl -n osm scale statefulset/kafka --replicas=1
kubectl -n osm scale deployment/keystone --replicas=1
kubectl -n osm scale deployment/lcm --replicas=1
kubectl -n osm scale deployment/mon --replicas=1
kubectl -n osm scale deployment/nbi --replicas=1
kubectl -n osm scale deployment/ng-ui --replicas=1
kubectl -n osm scale deployment/pla --replicas=1
kubectl -n osm scale deployment/pol --replicas=1
kubectl -n osm scale deployment/ro --replicas=1
kubectl -n osm scale statefulset/zookeeper --replicas=1
```
At this point, OSM LTS is operational and ready to use.
### Charmed Installation Option
For Charmed OSM Installation, the procedure is to maintain the database content while redeploying the application using Juju. Rather than adding a series of commands to manually redeploy, we can simply download and run the LTS installer to recreate OSM after removing the non-LTS software.
The following steps will upgrade OSM to the LTS version:
*[Stop all OSM Services](#charm-1)
*[Backup the Databases](#charm-2)
*[Remove Deployed OSM Application](#charm-3)
*[Upgrade Juju](#charm-4)
*[Upgrade MicroK8s](#charm-5)
*[Install OSM 10.1.0 LTS](#charm-6)
*[Stop New OSM Services](#charm-7)
*[Restore the Databases](#charm-8)
*[Perform Database Migration](#charm-9)
*[Restart all OSM Services](#charm-10)
#### Stop all OSM Services <a name="charm-1"></a>
##### Version 9.1.5
```bash
juju scale-application grafana-k8s 0
juju scale-application prometheus-k8s 0
juju scale-application kafka-k8s 0
juju scale-application keystone 0
juju scale-application lcm-k8s 0
juju scale-application mon-k8s 0
juju scale-application nbi 0
juju scale-application ng-ui 0
juju scale-application pla 0
juju scale-application pol-k8s 0
juju scale-application ro-k8s 0
juju scale-application zookeeper-k8s 0
```
##### Version 10.0.3
```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
```
#### Backup the Databases <a name="charm-2"></a>
Once all the units show a scale of 0, proceed to performing the database backup.
#### Restart all OSM Services <a name="charm-10"></a>
Now that the databases are migrated to the new version, we can restart the services.
```bash
juju scale-application lcm 1
juju scale-application mon 1
juju scale-application nbi 1
juju scale-application ng-ui 1
juju scale-application pla 1
juju scale-application pol 1
juju scale-application ro 1
```
At this point, OSM LTS is operational and ready to use.
## Testing Upgrade
### Changing Credentials
We will change some default passwords, and create some additional users to ensure RBAC still works.
```bash
osm user-update admin --password'osm4u'
export OSM_PASSWORD=osm4u
```
```bash
osm project-create --domain-name default test_project_1
```
```bash
osm user-create test_admin_1 --projects admin --project-role-mappings'test_project_1,project_user'--password testadmin --domain-name default
osm user-update test_admin_1 --remove-project-role'admin,project_admin'
osm user-create test_member_1 --projects admin --project-role-mappings'test_project_1,project_user'--password testmember --domain-name default
osm user-update test_member_1 --remove-project-role'admin,project_admin'
```
### Selection of Packages
In order to test that the upgrade does not impact existing operations, we will deploy a series of network services and slices prior to the upgrade and then verify all functionality post upgrade. What follows is a list of packages and tests to run. All packages will come from https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages