OSM Development Stack

One Machine: Charmed OSM and Microstack

Why Charmed OSM?


  • Current. Charmed OSM tracks upstream releases.
  • Simple. Minimize administration and operations with a juju deployed OSM installation. juju deploy osm and juju will handle everything.
  • Flexible and scalable. It can be deployed on any Kubernetes cluster (Microk8s, Charmed Kubernetes, EKS, and GKE). Charmed OSM can be deployed in standalone or high availability mode.
  • Secure. Canonical team uses rocks.canonical.com:5000 registry to spin the docker images used in Charmed OSM, applying security patches to them (also pushed to upstream).

Why Microstack?


  • Openstack in one machine. No need for a big infrastructure to start playing with Openstack.
  • Fast. Have a fully functional Openstack in a few minutes.
  • Made for everyone. No need to understand the depths of Openstack.

Requirements


  • Ubuntu Bionic
  • 4 CPU
  • 16 GB RAM
  • 80G free disk space

Install Charmed OSM


Bootstrap Juju on LXD

sudo snap install juju --classic
juju bootstrap localhost osm-lxd

Install MicroK8s

sudo snap install microk8s --channel 1.14/stable --classic
sudo usermod -a -G microk8s $USER
newgrp microk8s
microk8s.status --wait-ready
microk8s.enable storage dns
sudo snap alias microk8s.kubectl kubectl

Install osmclient snap

sudo snap install osmclient --edge
sudo snap alias osmclient.osm osm
sudo snap connect osmclient:juju-client-observe

osmclient.overlay

Deployment

juju bootstrap microk8s osm-on-k8s
juju add-model osm
juju deploy osm --overlay vca-overlay.yaml

Install Microstack


sudo snap install microstack --classic --channel=edge/rocky
sudo microstack.init --auto

Add Ubuntu image

wget https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
microstack.openstack image create \
                     --public \
                     --disk-format qcow2 \
                     --container-format bare \
                     --file ubuntu-16.04-server-cloudimg-amd64-disk1.img \
                     ubuntu1604

Add Keypair

ssh-keygen -t rsa -N "" -f ~/.ssh/microstack
microstack.openstack keypair create --public-key ~/.ssh/microstack.pub microstack

Check installation


$ juju status
Model  Controller  Cloud/Region        Version  SLA          Timestamp
osm    osm-on-k8s  microk8s/localhost  2.6.8    unsupported  13:34:27Z

App             Version  Status  Scale  Charm           Store       Rev  OS          Address         Notes
grafana-k8s              active      1  grafana-k8s     jujucharms   21  kubernetes  10.152.183.158  
kafka-k8s                active      1  kafka-k8s       jujucharms    9  kubernetes  10.152.183.74   
lcm-k8s                  active      1  lcm-k8s         jujucharms   25  kubernetes  10.152.183.234  
mariadb-k8s              active      1  mariadb-k8s     jujucharms   21  kubernetes  10.152.183.236  
mon-k8s                  active      1  mon-k8s         jujucharms   20  kubernetes  10.152.183.220  
mongodb-k8s              active      1  mongodb-k8s     jujucharms   19  kubernetes  10.152.183.184  
nbi-k8s                  active      1  nbi-k8s         jujucharms   28  kubernetes  10.152.183.164  
pol-k8s                  active      1  pol-k8s         jujucharms   20  kubernetes  10.152.183.77   
prometheus-k8s           active      1  prometheus-k8s  jujucharms   20  kubernetes  10.152.183.6    
ro-k8s                   active      1  ro-k8s          jujucharms   25  kubernetes  10.152.183.111  
ui-k8s                   active      1  ui-k8s          jujucharms   33  kubernetes  10.152.183.129  
zookeeper-k8s            active      1  zookeeper-k8s   jujucharms   28  kubernetes  10.152.183.23   

Unit               Workload  Agent  Address    Ports                       Message
grafana-k8s/0*     active    idle   10.1.1.45  3000/TCP                    ready
kafka-k8s/0*       active    idle   10.1.1.46  9092/TCP                    ready
lcm-k8s/0*         active    idle   10.1.1.51  9999/TCP                    ready
mariadb-k8s/0*     active    idle   10.1.1.38  3306/TCP                    ready
mon-k8s/0*         active    idle   10.1.1.50  8000/TCP                    ready
mongodb-k8s/0*     active    idle   10.1.1.41  27017/TCP                   ready
nbi-k8s/0*         active    idle   10.1.1.49  9999/TCP                    ready
pol-k8s/0*         active    idle   10.1.1.48  80/TCP                      ready
prometheus-k8s/0*  active    idle   10.1.1.43  9090/TCP                    ready
ro-k8s/0*          active    idle   10.1.1.47  9090/TCP                    ready
ui-k8s/0*          active    idle   10.1.1.52  80/TCP                      ready
zookeeper-k8s/0*   active    idle   10.1.1.44  2181/TCP,2888/TCP,3888/TCP  ready

Continue to the following steps only when every component is ready. Export the OSM_HOSTNAME variable and confirm that the platform is operational:

$ export OSM_HOSTNAME=10.152.183.164 

Add microstack as a VIM

osm vim-create --name microstack-site \
    --user admin \
    --password keystone \
    --auth_url http://10.20.20.1:5000/v3 \
    --tenant admin \
    --account_type openstack \
    --config='{security_groups: default,
               keypair: microstack,
               project_name: admin,
               user_domain_name: default,
               region_name: microstack,
               insecure: True,
               availability_zone: nova,
               version: 3}'

osm vim-list # Check if the VIM has been successfully added

Example: Basic Network Service

Download packages

wget http://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
wget http://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz

Upload packages

osm upload-package hackfest_basic_vnf.tar.gz
osm upload-package hackfest_basic_ns.tar.gz

Create a basic Network Service

osm ns-create --ns_name hackfest_basic_ns \
              --nsd_name hackfest_basic-ns \
              --vim_account microstack-site

Checking the status of a Network Service

$ osm ns-list
+-------------------+--------------------------------------+--------------------+---------------+-----------------+
| ns instance name  | id                                   | operational status | config status | detailed status |
+-------------------+--------------------------------------+--------------------+---------------+-----------------+
| hackfest_basic_ns | 0133e3fe-e648-4b3d-8cf6-d55fed8b458d | running            | configured    | done            |
+-------------------+--------------------------------------+--------------------+---------------+-----------------+

$ microstack.openstack server list
+--------------------------------------+-----------------------------------------+--------+---------------------------------+------------+-----------------------+
| ID                                   | Name                                    | Status | Networks                        | Image      | Flavor                |
+--------------------------------------+-----------------------------------------+--------+---------------------------------+------------+-----------------------+
| 13707a28-9644-4148-aadd-46707fbf40a5 | hackfest_basic_ns-1-hackfest_basic-VM-1 | ACTIVE | mgmtnet=192.168.1.12            | ubuntu1604 | hackfest_basic-VM-flv |
+--------------------------------------+-----------------------------------------+--------+---------------------------------+------------+-----------------------+

Hello,
I created a new ubuntu VM on VirtualBox and have started trying the procedure. On microstack.init I get “stack smashing detected” after waiting RabbitMQ to start:
image
Note that I have used the new ubuntu 19.04 and not the 18 one.

With Ctrl-C I get below traceback:

At this point, in my juju status I have:

(too bad that I can’t upload more than 1 picture due to being a new member
 perhaps you should change this restriction to something more logical
 i.e. 5)


Forgot to mention

Great article :slight_smile:

I installed a fresh ubuntu 18.04 (ubuntu-18.04.3-live-server-amd64) and retried.
I got to an error:

after: juju deploy osm --overlay vca-overlay.yaml

I tried many things (mostly trying to troubleshoot dns) but they did not work.
In my last attempt (starting from fresh ubuntu installation) I added the command:

before installing osmclient snap 
 and it worked:

I’m starting to get tired of this bundle. It supposed to make my life easier but I’ve already spent 2 days debugging things.
So, OSM and microk8s have been installed, but microstack fails with errors (at: sudo microstack.init --auto):

and a few lines below:

Below is a huge clipping of my terminal. Again, it is very bad that you have so many new member rules applied
 I can’t post 2nd screenshot and I can’t upload a file (.rtf, .pdf) of my terminal outputs
 This makes sharing my problem and asking for advice very difficult.
Anyway, below is the clipping of the error:

Note that I have tried numerous times on –channel=edge/rocky and once on –channel=edge. Same error. Funny thing is that yesterday, on my other installation I got the same error a few times, but then had an idea and resolved it. But I can’t remember what I did trying around staff. Certain thing is that I deviated from the procedure above. I kept the terminal log until the point of the problem but sadly not the solution. So, in this installation I came to a dead end.

So, if I get no response from you in the next days
 I guess I’m dropping it

Hey @dkaratasos,

Thanks for testing out the new dev stack. Sorry to hear you’ve run into so many troubles with it!

Most of the team has just traveled back from the Hackfest in Patras, so it may take a day or two for them to respond. We’re eager to understand the problems you faced, so we can make the experience better for everyone.

Thanks!

Adam

Thanks for replying. I will wait for the team to come back then :slight_smile: hope they enjoyed their visit in Patras

Hello @dkaratasos ,

Sorry to hear you have had so many problems during the installation. I will go through some of the problems you’ve had.

First of all, I want to make sure you have been using Ubuntu 18.04 (LTS). How much memory and disk do you have on your VM? I would recommend you 16 GB of RAM, and 100 GB of disk.

At the end of the answer, there is a “Following steps” section with the steps I would recommend you to do.

DNS problem

This issue you have attached could be because you are behind a proxy which hasn’t access to api.jujucharms.com.

Also, make sure you are installing the 1.14 version of microk8s. There’s an open bug with the microk8s 1.15 DNS plugin, which will be fixed soon.

Also, I don’t think you need to execute sudo iptables -P FORWARD ACCEPT

Stack smashing detected [UPDATED]

I’ve submitted the bug, and the team is fixing it right now. I believe it’s an issue affecting ubuntu 19, so try using bionic instead.

Following steps

  • Create a fresh VM with the recommended settings.
  • Follow this in order to improve the performance of your VM.
  • Follow the steps until Install Microstack (not included)
  • Do watch -c juju status --color to check the OSM deployment status. Wait until OSM is up.
  • Install microstack

Contact

Feel free to send me an email with your progress.
david.garcia@canonical.com

Hello David,

Let me confirm first that I am using Ubuntu 18.04 LTS as mentioned above on a fresh VM installation on vbox at each attempt. Regarding resources, I gave the VM 16GB memory, ~80GB disk and 4CPUs as recommended.
I keep monitoring the juju status during deployment and on the problem of: “ERROR cannot deploy bundle: cannot add charm “cs:~charmed-osm/grafana-k8s-21”:” the juju status could not give a printout at all. With my workaround on iptables I didn’t see any issue on juju status.

I am not behind a proxy on home computer that I tried installation.

My current problem is Microstack, so I can’t really follow the installation step on your instructions. Enhancements on performance are highly appreciated, but I’m trying to figure out the problem before trying from scratch for a 4th/5th time.

I will use your email to send you a command log from MobaXterm since I can’t upload it here :slight_smile:

Thanks,
Dimitris

Hello @dkaratasos,

Please, attach the output from microk8s.kubectl -n kube-system get pods command.

I want to make sure that the DNS plugin is up and running.

Thanks,
David

I have checked this on one of the terminals
 the DNS was running. I haven’t kept a sceenshot of that but I will next time I’ll start it up. I have send you an email with the main terminal output :slight_smile:
My other terminal was mainly used to check juju status kube-system pods etc, so I didn’t save it afterwards


Hmmm
 strange

I was always doing fresh installations before and haven’t really got a chance before to power off and power on the VM. Today, to get the printout you requested I powered it on again
 but juju status printouts nothing (it is hanged) and get pods gives status unknown. About an hour has passed from powering on.
image
i would swear that they were both ok last time I had it opened. I even tried the microstack init after everything on juju status appeared running.

At any case, the settings of the VM is also shown above
 (I had to combine 3 images into one)

I can also see an error if I use the -A in get pods:

maybe it is relevant


Having an issue installing as well.

sudo snap install juju --classic
sudo snap install osmclient --edge
sudo snap connect osmclient:juju-client-observe

Probelem when I run “snap connect osmclient:juju-client-observe” I get an error that
error: snap “osmclient” has no plug named “juju-client.observe”

Will be glad to know how i can get past this issue.
The rest are fine so far.

Thank you so much,

Michael

Hello Michael

It looks that this post is not completely updated. You can follow the instructions to install Charmed OSM in this link of the ETSI OSM documentation

Please let me know if this works for you.

Best regards,

Guillermo

Hello Guillermo,

I have installed charmed OSM from the above link and Microstack on the same VM. Everything went well and I was able to desploy the test Network Service.

However, I cannot see the OSM parameters on Grafana dashboard. I do not find the ‘osm_mano_automated’ dashboard in Grafana.

Additonal note, when I reboot the VM, some of the units including mon-k8s under juju status show the agent failed. Is there a way to refresh/restart juju charms.

Any help is much appreciated.
Thank you.

Hello Anusha,

Sorry for the late answer.
Regarding the Grafana dashboard, this is a known issue. You can import the dashboard manually. You can find OSM dashboards in devops repository in /installers/docker/grafana folder. The dashboards you need to import are: osm-sample-dashboard.json and osm-system-dashboard.json.

And regarding the status of mon-k8s, it takes some minutes to the pod in order to be available. In case, the issue persists, then try the following commmand that will restart the agent:
microk8s.kubectl -n osm delete pods mon-k8s-operator-0 --force --grace-period 0

I hope this helps.

Hi Anusha,

2 questions:

  1. The link from ETSi installs OSM as well as micro k8s, right?
  2. Can you please share the link you used for installing microstack?

Thanks,
Nishank

Hi Galvino,

Thanks for the response.
I think something went wrong during my charmed osm installation and Grafana is not configured properly. However, I was able to query the metrics via osm_prometheus under ‘Explore’

Regarding the juju status, the above command did not work and I’m yet to find out how to restart terminated components.

Hi Nishank,

  1. Yes. Here is the link : https://osm.etsi.org/docs/user-guide/03-installing-osm.html#charmed-installation
  2. For microstack : https://ubuntu.com/tutorials/microstack-get-started#2-install-microstack

All the best!
Best Regards,
Anusha

Thank you for the links, Anusha.

Have installed OSM via ETSI link.
We do not explicitly need to add microk8s to OSM, like say we add a VIM (openstack), right?

Onto microstack now.

Thanks again,
Nishank