• By Charmed Distribution of OSM | bundle
Channel Revision Published Runs on
latest/stable 249 23 Mar 2023
latest/beta 440 01 Jun 2023
latest/edge 120 14 Sep 2022
13.0/stable 311 13 Apr 2023
13.0/candidate 203 09 Dec 2022
13.0/beta 455 Today
12.0/stable 225 15 Dec 2022
12.0/beta 454 Today
11.0/stable 81 22 Aug 2022
11.0/edge 71 22 Feb 2022
10.0/stable 99 07 Sep 2022
10.0/candidate 76 11 Mar 2022
10.0/edge 72 23 Feb 2022
juju deploy osm
Show information



This tutorial provides a walkthrough of Charmed OSM deployment and onboarding of virtual and cloud-native network functions. You will install Charmed OSM and after that you will use it to deploy and configure a CNF in a K8s cluster.

Charmed OSM is an upstream OSM (Open Source MANO (Management and Orchestration)) deployment that is based on Juju charms. By using charm operators for OSM deployments telcos can benefit from a model-driven declarative approach and simplified operations.

What you’ll need

If you are using Windows or Mac OS, install multipass first to launch an Ubuntu VM.

To complete this tutorial you need a fresh Ubuntu 20.04 VM with the following requirements:

  • Ubuntu 20.04 LTS Operating System
  • 16 GB of RAM
  • 4 CPUs
  • 80 GB of free storage space

Deploy Charmed OSM

In this tutorial, the installation of the Charmed OSM Release 12 is illustrated. OSM has an upstream installer in ETSI repository which needs to be downloaded. Pass the --charmed option with the installer to enable the charmed installation of OSM.

wget https://osm-download.etsi.org/ftp/osm-12.0-twelve/install_osm.sh
chmod +x install_osm.sh
./install_osm.sh --charmed

The installation process takes around 10/15 minutes depending on your connection. When it finishes you will see something similar to this output:

Your installation is now complete, follow these steps for configuring the osmclient:

1. Create the OSM_HOSTNAME environment variable with the NBI IP

export OSM_HOSTNAME=nbi.
export OSM_PASSWORD=674cea0bd2c43265c2f4c5de32dd98c3

2. Add the previous commands to your .bashrc for other Shell sessions

echo "export OSM_HOSTNAME=nbi." >> ~/.bashrc
echo "export OSM_PASSWORD=674cea0bd2c43265c2f4c5de32dd98c3" >> ~/.bashrc

3. Login OSM GUI by using admin password: 674cea0bd2c43265c2f4c5de32dd98c3

Track end end: https://osm.etsi.org/InstallLog.php?&installation_id=1664351299-NLbpOIt3Vf4iNE8H&local_ts=1664351722&event=end&operation=end&value=&comment=&tags=
Track end installation_type: https://osm.etsi.org/InstallLog.php?&installation_id=1664351299-NLbpOIt3Vf4iNE8H&local_ts=1664351722&event=end&operation=installation_type&value=Charmed&comment=&tags=


Now, to complete the installation, we will follow the instructions in points 1 and 2 of the installer output. We can copy and paste the commands directly:

export OSM_HOSTNAME=nbi.
export OSM_PASSWORD=674cea0bd2c43265c2f4c5de32dd98c3

echo "export OSM_HOSTNAME=nbi." >> ~/.bashrc
echo "export OSM_PASSWORD=674cea0bd2c43265c2f4c5de32dd98c3" >> ~/.bashrc

That’s it, you are done !!

Once the installation is complete, you will have the OSM ready and you can start onboarding the VNFs.

Onboarding KNFs

OSM allows us to deploy workload on K8s clusters, but for development purposes, you can use a MicroK8scluster. The following steps will configure OSM to use the same MicroK8s where Charmed OSM is installed and deploy a basic network service to exercise the environment created.

Setting up a MicroK8s cluster in OSM

OSM needs a VIM (Virtual Infrastracture Manager) to be linked to a Kubernetes cluster. The VIM manages the infraestructure to deploy virtual machines. In this case we will deploy only containerized workloads, so the first thing we will do, will be to add a fake VIM to it:

osm vim-create --name dummyvim --user u --password p --tenant p --account_type dummy --auth_url http://localhost/dummy

Now, we need the credentials of the Kubernetes cluster. The standard installation of Charmed OSM uses microk8s, so in order to get the credentials of the microk8s cluster we execute:

microk8s.config > microk8s-kubeconfig.yaml


If you have just installed Charmed OSM, could be the case that you need to logout and login again in the console in order to use the microk8s command.

And then to attach our microk8s to deploy CNFs:

osm k8scluster-add microk8s --creds microk8s-kubeconfig.yaml --vim dummyvim --k8s-nets '{k8s_net1: null}' --version "v1.25" --description="Isolated K8s cluster"

You can check the status of the K8scluster with the following command:

$ osm k8scluster-list

| Name                 | Id                      | VIM        | Operational State | Op. state details |
| microk8s             | f879ba44-017-4377-a...  | dummyvim   | ENABLED           | Helm: ENABLED     |
|                      |                         |            |                   | Juju: ENABLED     |

If you see that the general operational state is ENABLED and the operational state of Helm and Juju are also ENABLED then your K8s cluster is ready to be used.

In case you need more information about the K8s cluster:

$ osm k8scluster-show microk8s

Upload the CNF packages to Charmed OSM

First we will clone the osm-packages repo. In this repo, we can find different examples of VNFs and CNFs that can be deployed with OSM.

git clone --recursive https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages

We are going to upload the squid proxy package. Squid is a web server application which provides proxy and cache services for protocols like HTTP or FTP. These are the commands to upload squid proxy packages to OSM:

cd osm-packages

osm nfpkg-create squid_metrics_cnf
osm nspkg-create squid_metrics_cnf_ns

You can see that the packages have been successfully uploaded if the squid_cnf vnf package and the squid_cnf_ns network service package are listed when you type the following commands:

$ osm vnfd-list
| nfpkg name   | id                                   | desc type |
| squid_cnf    | c1763aa7-209b-45df-9403-63f34eb9ebde | sol006    |

$ osm nsd-list
| nsd name     | id                                   |
| squid_cnf_ns | d99eb544-0415-46cc-a6ef-b78d9c83778d |

Deploy the Network Service

Now that we have all the packages uploaded to OSM, we are going to instantiate the squid proxy using this command:

osm ns-create --ns_name squid --nsd_name squid_cnf_ns --vim_account dummyvim

After a few minutes the CNF should be already instantiated:

$ osm ns-list
| ns instance name | id                                   | date                | ns state | current operation | error details |
| squid            | ed9e8e52-f96f-4a33-ae2c-198ce944d1fd | 2022-02-07T12:51:07 | READY    | IDLE (None)       | N/A           |
To get the history of all operations over a NS, run "osm ns-op-list NS_ID"
For more details on the current operation, run "osm ns-op-show OPERATION_ID"

You can see that the ns state has changed from BUILDING to READY, and the current operation has changed from INSTANTIATING to IDLE.

To get the history of all operations over a NS, run osm ns-op-list NS_ID.

For more details on the current operation, run osm ns-op-show OPERATION_ID.

Testing the CNF and day-2 actions

Test the squid proxy

The squid proxy by default does not allow internet traffic, so if you try to access any web page through squid, the proxy will deny it.

We need the IP address of our squid that we will use to go through the proxy to Internet. We can get the IP executing the following commands:

# Get squid VNF ID
$ VNF_ID=`osm vnf-list --ns squid | grep squid_cnf | awk '{print $2}'`

# Get squid ClusterIP
$ sudo snap install yq
$ SQUID_IP=`osm vnf-show $VNF_ID --literal | yq e '.kdur[0].services[] | select(.name == "squid") | .cluster_ip'`
$ echo $SQUID_IP

Then, we will use this IP as a proxy to browse a web page:

$ HTTPS_PROXY=$SQUID_IP:3128 curl https://www.canonical.com -I

HTTP/1.1 403 Forbidden
Server: squid/3.5.27
curl: (56) Received HTTP code 403 from proxy after CONNECT

We will receive an HTTP 403 - FORBIDDEN response.

Allow a url to pass through the proxy

So, we saw that our squid proxy will forbid us to navigate to Internet. Now, we want to change its configuration in order to be able to go to canonical.com. For that we will use the following OSM’s day-2 action:

osm ns-action squid --vnf_name squid_cnf \
                        --kdu_name squid-metrics-kdu \
                        --action_name add-url \
                        --params '{application-name: squid, url: canonical.com}' \

To check if the operation was successful, use osm ns-op-list:

| id                                   | operation   | action_name | status    | date    | detail     |
| ba7cd1ed-38a8-4afd-bbab-750b8491cdcb | instantiate | N/A         | COMPLETED | 2021... | -          |
| 5c1fbef0-7075-4f35-8385-752772858b4b | action      | add-url     | COMPLETED | 2021... | -          |          

So then, if we try again (the squid can take a couple of minutes until it is updated with the new configuration) we will see that we can navigate to canonical.com:

$ HTTPS_PROXY=$SQUID_IP:3128 curl https://www.canonical.com -I

HTTP/1.1 200 Connection established
HTTP/2 301 

OSM allowed us to manage the squid proxy CNF and change its settings to be able to browse canonical.com.

That’s all folks!

Congratulations! You have made it!

In this tutorial, you have learned how to deploy Charmed OSM on top of MicroK8s, onboard a sample KNF workload through Charmed OSM and configure the workload by the use of day-2 actions. You can now use your newly learned skills to accelerate your transition to NFV with OSM.

Where to go from here?

Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated 29 days ago. Help improve this document in the forum.