<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://osm.etsi.org/wikipub/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tierno</id>
	<title>OSM Public Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://osm.etsi.org/wikipub/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tierno"/>
	<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php/Special:Contributions/Tierno"/>
	<updated>2026-05-06T17:01:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4835</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4835"/>
		<updated>2019-10-03T14:16:13Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* NBI Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===NBI Errors===&lt;br /&gt;
====Cannot login after migration to 6.0.2====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: NBI always return &amp;quot;UNAUTHORIZED&amp;quot; Cannot login neither with UI nor with CLI. CLI shows error &amp;quot;can&#039;t find a default project for this user&amp;quot; or &amp;quot;project admin not allowed for this user&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally after a migration to release 6.0.2 There is a slight incompatibility with users creared from older versions&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Delete user admin and reboot NBI so that a new compatible user is created by running these commands:&lt;br /&gt;
 curl --insecure https://localhost:9999/osm/test/db-clear/users&lt;br /&gt;
 docker service update  osm_nbi --force&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4834</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4834"/>
		<updated>2019-10-03T14:14:55Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* NBI Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===NBI Errors===&lt;br /&gt;
====Cannot login after migration to 6.0.2====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: NBI always return &amp;quot;UNAUTHORIZED&amp;quot; Cannot login neither with UI nor with CLI. CLI shows error &amp;quot;can&#039;t find a default project for this user&amp;quot; or &amp;quot;project admin not allowed for this user&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally after a migration to release 6.0.2 There is a slight incompatibility with users creared from older versions&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Delete user admin and reboot NBI so that a new compatible user is created. Run these commands: &amp;quot;curl --insecure https://localhost:9999/osm/test/db-clear/users&amp;quot;; &amp;quot;docker service update  osm_nbi --force&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4833</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4833"/>
		<updated>2019-10-03T14:13:55Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* NBI Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===NBI Errors===&lt;br /&gt;
====can&#039;t find a default project for this user====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: NBI always return &amp;quot;UNAUTHORIZED&amp;quot; Cannot login neither with UI nor with CLI. CLI shows error &amp;quot;can&#039;t find a default project for this user&amp;quot; or &amp;quot;project admin not allowed for this user&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally after a migration to release 6.0.2 There is a slight incompatibility with users creared from older versions&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Delete user admin and reboot NBI so that a new compatible user is created. Run these commands: &amp;quot;curl --insecure https://localhost:9999/osm/test/db-clear/users&amp;quot;; &amp;quot;docker service update  osm_nbi --force&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4821</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4821"/>
		<updated>2019-10-02T08:43:13Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* can&amp;#039;t find a default project for this user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===NBI Errors===&lt;br /&gt;
====can&#039;t find a default project for this user====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: NBI always return &amp;quot;UNAUTHORIZED&amp;quot; &amp;quot;can&#039;t find a default project for this user&amp;quot; or     &amp;quot;project admin not allowed for this user&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally after a migration to release 6.0.2 There is a slight incompatibility with users creared from older versions&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Delete user admin and reboot NBI so that a new compatible user is created. Run these commands: &amp;quot;curl --insecure https://localhost:9999/osm/test/db-clear/users&amp;quot;; &amp;quot;docker service update  osm_nbi --force&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4815</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4815"/>
		<updated>2019-10-01T09:51:52Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). Current installation uses Docker Swarm by default (there are Kubernetes distributions and an incoming option for installing on Kubernetes). The modules are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kafka&#039;&#039;&#039;: Provides a Kafka bus used for OSM communication. This module relies on &#039;&#039;zookeeper&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;zookeeper&#039;&#039;&#039;: Used by &#039;&#039;kafka&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;nbi&#039;&#039;&#039;: North Bound Interface of OSM. Restful server that follows ETSI SOL005 interface. Relies on &#039;&#039;mongo&#039;&#039; database and &#039;&#039;kafka&#039;&#039; bus. For authentication it can optionally uses &#039;&#039;keystone&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;keystone&#039;&#039;&#039;: Used optionally for NBI authentication and RBAC. It stores the users, projects and role permissions. It relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;lcm&#039;&#039;&#039;: Provides the Live Cycle Management. It uses &#039;&#039;ro&#039;&#039; for resource orchestration and juju for configuration. It relies also on &#039;&#039;mongo&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;ro&#039;&#039;&#039;: Makes the Resource Orchestration, or VIM deployment. Relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;light-ui&#039;&#039;&#039;: Web user interface. It communicates with &#039;&#039;nbi&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mon&#039;&#039;&#039;: Performs OSM monitoring. Relies on &#039;&#039;mongo&#039;&#039; and &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mongo&#039;&#039;&#039;: Common non relational database for OSM modules.&lt;br /&gt;
* &#039;&#039;&#039;mysql&#039;&#039;&#039;: Relational database server used for &#039;&#039;ro&#039;&#039;, &#039;&#039;keystone&#039;&#039;, &#039;&#039;mon&#039;&#039; and &#039;&#039;pol&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;pol&#039;&#039;&#039;: Policy Manager for OSM.&lt;br /&gt;
* &#039;&#039;&#039;prometheus&#039;&#039;&#039;: for monitoring .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition LCM and NBI, shares a common file system  where packages are stored. In current installation it uses a shared docker volume called &#039;&#039;osm_package&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This picture shows the modules with the port that they export, their relationships with the name of env variables that control them. For clarity not all the dependencies are depicted, as kafka, mysql, ... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________                                                              ________&lt;br /&gt;
    |          |                                                            |        |&lt;br /&gt;
    | light-ui |OSM_SERVER               _______                            |keystone|&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |-------------------------&amp;gt; |:5000   |&lt;br /&gt;
    |__________|                        | nbi   |                           |________|&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | mysql |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For debugging it is convenient running the target module directly at host maintaining the rest of dependent modules in containers. In the following sections it is described how to achieve that.&lt;br /&gt;
&lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI by one of:&lt;br /&gt;
* Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
* ... Or update light-ui docker service (not persistent on reboot):&lt;br /&gt;
 docker service update osm_light-ui --force --env-add &amp;quot;OSM_SERVER=172.17.0.1&amp;quot;&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/nbi.env&#039;&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
&lt;br /&gt;
Values are stored at &#039;/etc/osm/docker/lcm.env&#039; but here it is explained how to obtain these values.&lt;br /&gt;
* OSMLCM_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/lcm.env&#039;&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_CACERT: To get this value run the following command in the OSM host:&lt;br /&gt;
** juju controllers --format json | jq -r &#039;.controllers[&amp;quot;osm&amp;quot;][&amp;quot;ca-cert&amp;quot;]&#039;&lt;br /&gt;
* OSMLCM_VCA_PUBKEY: To get this value run the following command in the OSM host:&lt;br /&gt;
** cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;mysql&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;mysql&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: localhost or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4813</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4813"/>
		<updated>2019-09-30T14:23:28Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
==RBAC==&lt;br /&gt;
From Release SIX, operations are authorized via RBAC (Role Base Access Control). Each user and project is assigned with a set of roles, and some of them must grant the intended operation. If administrative query string is used (see next section), role must grant the use of it in addition to the operation.&lt;br /&gt;
&lt;br /&gt;
Role permissions are organized in a hierarchical tree, separated by colon, optionally ending with the http operation. The value of False means not granted, meanwhile with True it is granted. If this permission is missing, the immediate hierarchical permission applies. When there is not hierarchical at all, the defined &amp;quot;default&amp;quot; permission applies, and if &amp;quot;default&amp;quot; is missing, not granted is assumed. See  these examples [https://osm.etsi.org/gitweb/?p=osm/NBI.git;a=blob;f=osm_nbi/roles_to_operations.yml initial roles ]; and  [https://osm.etsi.org/gitweb/?p=osm/NBI.git;a=blob;f=osm_nbi/resources_to_operations.yml role permissions] for the list of rbac permission with their operation. In following sections the rbac permission granting this operation is indicated in bracket.&lt;br /&gt;
&lt;br /&gt;
== Query String ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
=== Administrative Query String===&lt;br /&gt;
&lt;br /&gt;
Some special keys used for administration are:&lt;br /&gt;
* &#039;&#039;&#039;FORCE&#039;&#039;&#039;(=True) (rbac: force). Forces and operation. It disables descriptor checking, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PUBLIC&#039;&#039;&#039;(=True) (rbac: public). Allows getting public descriptor or instances (apart from those belonging to the project used login). For write/update operations, it used for set or unset a descriptor as public&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ADMIN&#039;&#039;&#039;&#039; (rbac: admin). Allows making operations on behalves on a different project/s than the one used for login (=projectA,projectB,...). Also to show all descriptor or instances (just ADMIN). For update operations..&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SET_PROJECT&#039;&#039;&#039;=ProjectA,ProjectB,... (rbac: set_project). Allows adding an existing descriptor or instance to a project portfolio with an update operation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. (rbac: users). Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: users:id).&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. (rbac: projects). A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: projects:id)&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. (rbac: vims). Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: vims:id)&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. (rbac: wims). WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: wims:id)&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. (rbac: sdn_controllers). SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: sdn_controllers:id)&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;. (rbac: pduds)&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;. (rbac: pduds:id)&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;.&lt;br /&gt;
* GET: (rbac: ns_instances:get) Obtains a list of NS&lt;br /&gt;
* POST: (rbac: ns_instances:content:post) (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;. (rbac: ns_instances:id)&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;. (rbac: ns_instances)&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;. (rbac: ns_instances:id)&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;. (rbac: ns_instances:id:instantiate:post)&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;. (rbac: ns_instances:id:terminate:post)&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;. (rbac: ns_instances:id:action:post)&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # Needed for VNFD mapping NSD.constituent-vnfd.member-vnf-index. If missing a NSD is targeting&lt;br /&gt;
vdu_id: str              # Needed if target is a VDU. Maps VNFD.vdu-id&lt;br /&gt;
vdu_count_index: int     # Needed if the VDU has several replicas (count&amp;gt;1)&lt;br /&gt;
primitive: str           # Mandatory. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.name&lt;br /&gt;
primitive_params: dict   # Optional. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.parameter&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;. (rbac: ns_instances:id:scale:post)&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;. (rbac: ns_instances:opps)&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;. (rbac: ns_instances:opps:id)&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;. (rbac: vnf_instances).  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;. (rbac: vnf_instances:id)&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates_content&#039;&#039;&#039;&lt;br /&gt;
* GET: (rbac: slice_templates:get). Obtain list of Network Slice Templates&lt;br /&gt;
* POST (rbac: slice_templates:content:post). : Create a Network Slice Template and upload the content&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates_content/&amp;lt;nstInfoId&amp;gt;&#039;&#039;&#039;&#039;. (rbac: slice_templates:id)&lt;br /&gt;
* GET: Show the detail of Network Slice Template&lt;br /&gt;
* PUT: Update the whole  Network Slice Template&lt;br /&gt;
* DELETE: Remove a Network Slice template. The Network Slice template is removed only if state is NOT_IN_USE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates&#039;&#039;&#039;. (rbac: slice_templates)&lt;br /&gt;
* GET: Obtain  list of Network Slice Templates&lt;br /&gt;
* POST: Create an empty Network Slice Template. A PUT should be done afterwards to upload the package&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;&#039;&#039;&#039;. (rbac: slice_templates:id)&lt;br /&gt;
* GET: Show the detail of Network Slice Template descriptor used by OSM&lt;br /&gt;
* DELETE: Remove a Network Slice Template. The Network Slice template is removed only if state is NOT_IN_USE.&lt;br /&gt;
* PATCH: Update a Network Slice Template field&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/nst_content&#039;&#039;&#039;. (rbac: slice_templates:content)&lt;br /&gt;
* GET: Show the detail of the source Network Slice Template package&lt;br /&gt;
* PUT: Update a Network Slice Template&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/nst&#039;&#039;&#039;. (rbac: slice_templates:id:nst)&lt;br /&gt;
* GET: Show the detail of the source Network Slice Template descriptor&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/artifacts[/&amp;lt;artifactPath&amp;gt;]&#039;&#039;&#039;. (rbac: slice_templates:id:nst_artifact)&lt;br /&gt;
* GET: Obtain Network Slice Templates Artifacts. This is useful for download the Network Slice Templates&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Cicle Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: (rbac: slice_instances:get). Obtain the list of Network Slice Instances&lt;br /&gt;
* POST: (rbac: slice_instances:content:post) (Asynchronous). Creates and Instantiate a Network Slice Instance. It returns the netsliceInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    nstId: name of the Network Slice Template   #mandatory&lt;br /&gt;
    nsiName: name of the Network Slice Instance # mandatory&lt;br /&gt;
    vimAccountId: internal-id   # mandatory&lt;br /&gt;
    ssh_keys: comma separated list of keys to inject to vnfs&lt;br /&gt;
    nsiDescription: description of the Network Slice Instance&lt;br /&gt;
    additionalParamsForNsi: {param: value, ...}&lt;br /&gt;
    netslice-subnet: [ Same content as section #NSLCM_Details /nslcm/v1/ns_instances_content&lt;br /&gt;
    ],&lt;br /&gt;
    netslice-vld: [&lt;br /&gt;
                   name: TEXT, &lt;br /&gt;
                   vim-network-name: TEXT or DICT with the name for each vim account: {vimAccountId: network-name, ...}, &lt;br /&gt;
                   vim-network-id: TEXT or DICT with the id for each vim account {vimAccountId: network-id}, &lt;br /&gt;
                   ip-profile: Profile of the vld&lt;br /&gt;
    ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances_content/&amp;lt;SliceInstanceId&amp;gt;&#039;&#039;&#039;. (rbac: slice_instances:id)&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a Network Slice Instance Record&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances&#039;&#039;&#039;. (rbac: slice_instances)&lt;br /&gt;
* GET: Obtain the list of Network Slice Instances&lt;br /&gt;
* POST: Create the Network Slice Instance but do not instantitate it. It returns the netsliceInstanceId in the response header &#039;Location&#039;. Example of request content: Same content as section  [[#NSILCM_Details|NSILCM Details /nsilcm/v1/netslice_instances_content]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;&#039;&#039;&#039;. (rbac: slice_instances:id)&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance&lt;br /&gt;
* DELETE: Delete the Network Slice Instance Record, if it is not instantiated&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;/instantiate&#039;&#039;&#039;. (rbac: slice_instances:id:instantiate:post)&lt;br /&gt;
* POST: (Asynchronous). Deploys a Network Slice Instance that it is in NOT_INSTANTIATED state. It returns the nsiLcmOpOccId (Operations Occurence Id) in the response header &#039;Location&#039;. Example of request content: Same content as section  [[#NSILCM_Details|NSILCM Details /nsilcm/v1/netslice_instances_content]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;/terminate&#039;&#039;&#039;. (rbac: slice_instances:id:terminate:post)&lt;br /&gt;
* POST: (Asynchronous). Undeploys a Network Slice Instance that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/nsi_lcm_op_occ&#039;&#039;&#039;. (rbac: slice_instances:opps)&lt;br /&gt;
* GET: Obtain the list of Network Slice Instances operations. It may be useful filtering  by a concrete NSI with &#039;?netsliceInstanceId=&amp;lt;netsliceInstanceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/nsi_lcm_op_occ/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;. (rbac: slice_instances:opps:id)&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance operation&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4792</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4792"/>
		<updated>2019-09-18T14:08:11Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* Instantiation Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===NBI Errors===&lt;br /&gt;
====can&#039;t find a default project for this user====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: NBI always return &amp;quot;UNAUTHORIZED&amp;quot; &amp;quot;can&#039;t find a default project for this user&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally after a migration to release 6.0.2 There is a slight incompatibility with users creared from older versions&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Delete user admin and reboot NBI so that a new compatible user is created. Run these commands: &amp;quot;curl --insecure https://localhost:9999/osm/test/db-clear/users&amp;quot;; &amp;quot;docker service update  osm_nbi --force&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4739</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4739"/>
		<updated>2019-09-10T14:12:43Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* Manual recovery of Juju */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
juju_pubkey=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_PUBKEY.*$/OSMLCM_VCA_PUBKEY=&#039;$juju_pubkey&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4704</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4704"/>
		<updated>2019-08-29T13:47:29Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # Needed for VNFD mapping NSD.constituent-vnfd.member-vnf-index. If missing a NSD is targeting&lt;br /&gt;
vdu_id: str              # Needed if target is a VDU. Maps VNFD.vdu-id&lt;br /&gt;
vdu_count_index: int     # Needed if the VDU has several replicas (count&amp;gt;1)&lt;br /&gt;
primitive: str           # Mandatory. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.name&lt;br /&gt;
primitive_params: dict   # Optional. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.parameter&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain list of Network Slice Templates&lt;br /&gt;
* POST: Create a Network Slice Template and upload the content&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates_content/&amp;lt;nstInfoId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show the detail of Network Slice Template&lt;br /&gt;
* PUT: Update the whole  Network Slice Template&lt;br /&gt;
* DELETE: Remove a Network Slice template. The Network Slice template is removed only if state is NOT_IN_USE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain  list of Network Slice Templates&lt;br /&gt;
* POST: Create an empty Network Slice Template. A PUT should be done afterwards to upload the package&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show the detail of Network Slice Template descriptor used by OSM&lt;br /&gt;
* DELETE: Remove a Network Slice Template. The Network Slice template is removed only if state is NOT_IN_USE.&lt;br /&gt;
* PATCH: Update a Network Slice Template field&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/nst_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Show the detail of the source Network Slice Template package&lt;br /&gt;
* PUT: Update a Network Slice Template&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/nst&#039;&#039;&#039;&lt;br /&gt;
* GET: Show the detail of the source Network Slice Template descriptor&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nst/v1/netslice_templates/&amp;lt;nstInfoId&amp;gt;/artifacts[/&amp;lt;artifactPath&amp;gt;]&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain Network Slice Templates Artifacts. This is useful for download the Network Slice Templates&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Cicle Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain the list of Network Slice Instances&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a Network Slice Instance. It returns the netsliceInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    nstId: name of the Network Slice Template   #mandatory&lt;br /&gt;
    nsiName: name of the Network Slice Instance # mandatory&lt;br /&gt;
    vimAccountId: internal-id   # mandatory&lt;br /&gt;
    ssh_keys: comma separated list of keys to inject to vnfs&lt;br /&gt;
    nsiDescription: description of the Network Slice Instance&lt;br /&gt;
    additionalParamsForNsi: {param: value, ...}&lt;br /&gt;
    netslice-subnet: [ Same content as section #NSLCM_Details /nslcm/v1/ns_instances_content&lt;br /&gt;
    ],&lt;br /&gt;
    netslice-vld: [&lt;br /&gt;
                   name: TEXT, &lt;br /&gt;
                   vim-network-name: TEXT or DICT with the name for each vim account: {vimAccountId: network-name, ...}, &lt;br /&gt;
                   vim-network-id: TEXT or DICT with the id for each vim account {vimAccountId: network-id}, &lt;br /&gt;
                   ip-profile: Profile of the vld&lt;br /&gt;
    ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances_content/&amp;lt;SliceInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a Network Slice Instance Record&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain the list of Network Slice Instances&lt;br /&gt;
* POST: Create the Network Slice Instance but do not instantitate it. It returns the netsliceInstanceId in the response header &#039;Location&#039;. Example of request content: Same content as section  [[#NSILCM_Details|NSILCM Details /nsilcm/v1/netslice_instances_content]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance&lt;br /&gt;
* DELETE: Delete the Network Slice Instance Record, if it is not instantiated&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a Network Slice Instance that it is in NOT_INSTANTIATED state. It returns the nsiLcmOpOccId (Operations Occurence Id) in the response header &#039;Location&#039;. Example of request content: Same content as section  [[#NSILCM_Details|NSILCM Details /nsilcm/v1/netslice_instances_content]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/&amp;lt;SliceInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a Network Slice Instance that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/nsi_lcm_op_occ&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtain the list of Network Slice Instances operations. It may be useful filtering  by a concrete NSI with &#039;?netsliceInstanceId=&amp;lt;netsliceInstanceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nsilcm/v1/netslice_instances/nsi_lcm_op_occ/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete Network Slice Instance operation&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4702</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4702"/>
		<updated>2019-08-22T09:35:15Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* File juju_id_rsa.pub not found */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4701</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4701"/>
		<updated>2019-08-22T09:34:18Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* Slow deployment of charms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
=== Add User in Group ===&lt;br /&gt;
Add the non-root user used for installation in &#039;&#039;sudo , lxd, docker&#039;&#039; groups&lt;br /&gt;
&lt;br /&gt;
This will skip below error :-&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Finished installation of juju&lt;br /&gt;
Password:&lt;br /&gt;
&#039;&#039;&#039;sg: failed to crypt password with previous salt: Invalid argument &lt;br /&gt;
ERROR No controllers registered.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
=====TypeError: unsupported operand type(s) for -=: &#039;Retry&#039; and &#039;int&#039;=====&lt;br /&gt;
&lt;br /&gt;
In some cases, a MTU mismatch between the host and docker interfaces will cause this error while running pip. You can check this by running `ifconfig` and comparing the MTU of your host interface and the docker_gwbridge interface.&lt;br /&gt;
&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the MTU value with that of your host interface from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;mtu&amp;quot;: 1458&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
===Instantiation Errors===&lt;br /&gt;
====File juju_id_rsa.pub not found====&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039;: ERROR creating VCA model name &#039;xxxx&#039;: Traceback (most recent call last): File &amp;quot;/usr/lib/python3/dist-packages/osm_lcm/ns.py&amp;quot;, line 822, in instantiate await     ...     [Errno 2] No such file or directory: &#039;/root/.local/share/juju/ssh/juju_id_rsa.pub&#039;&lt;br /&gt;
* &#039;&#039;&#039;CAUSE&#039;&#039;&#039;: Normally a migration from release FIVE do not set properly the env for LCM&lt;br /&gt;
* &#039;&#039;&#039;SOLUTION&#039;&#039;&#039;: Ensure variable &#039;&#039;&#039;OSMLCM_VCA_PUBKEY&#039;&#039;&#039; is properly set at file &#039;&#039;/etc/osm/docker/lcm.env&#039;&#039;. The value must mutch with the output of this command &#039;&#039;cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&#039;&#039;. If not, add or change it. Restart OSM, or just LCM service with &#039;&#039;&#039;docker service update osm_lcm --force --env-add OSMLCM_VCA_PUBKEY=&amp;quot;&amp;lt;value&amp;gt;&amp;quot; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;br /&gt;
&lt;br /&gt;
For each container, logs can be found under:&lt;br /&gt;
 /var/lib/docker/containers/DOCKER_ID/DOCKER_ID-json.log&lt;br /&gt;
&lt;br /&gt;
And the DOCKER_ID can be obtained this way, e.g. for MON&lt;br /&gt;
 docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1 --no-trunc&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4698</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4698"/>
		<updated>2019-08-20T15:25:32Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* NBI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). Current installation uses Docker Swarm by default (there are Kubernetes distributions and an incoming option for installing on Kubernetes). The modules are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kafka&#039;&#039;&#039;: Provides a Kafka bus used for OSM communication. This module relies on &#039;&#039;zookeeper&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;zookeeper&#039;&#039;&#039;: Used by &#039;&#039;kafka&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;nbi&#039;&#039;&#039;: North Bound Interface of OSM. Restful server that follows ETSI SOL005 interface. Relies on &#039;&#039;mongo&#039;&#039; database and &#039;&#039;kafka&#039;&#039; bus. For authentication it can optionally uses &#039;&#039;keystone&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;keystone&#039;&#039;&#039;: Used optionally for NBI authentication and RBAC. It stores the users, projects and role permissions. It relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;lcm&#039;&#039;&#039;: Provides the Live Cycle Management. It uses &#039;&#039;ro&#039;&#039; for resource orchestration and juju for configuration. It relies also on &#039;&#039;mongo&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;ro&#039;&#039;&#039;: Makes the Resource Orchestration, or VIM deployment. Relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;light-ui&#039;&#039;&#039;: Web user interface. It communicates with &#039;&#039;nbi&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mon&#039;&#039;&#039;: Performs OSM monitoring. Relies on &#039;&#039;mongo&#039;&#039; and &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mongo&#039;&#039;&#039;: Common non relational database for OSM modules.&lt;br /&gt;
* &#039;&#039;&#039;mysql&#039;&#039;&#039;: Relational database server used for &#039;&#039;ro&#039;&#039;, &#039;&#039;keystone&#039;&#039;, &#039;&#039;mon&#039;&#039; and &#039;&#039;pol&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;pol&#039;&#039;&#039;: Policy Manager for OSM.&lt;br /&gt;
* &#039;&#039;&#039;prometheus&#039;&#039;&#039;: for monitoring .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition LCM and NBI, shares a common file system  where packages are stored. In current installation it uses a shared docker volume called &#039;&#039;osm_package&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This picture shows the modules with the port that they export, their relationships with the name of env variables that control them. For clarity not all the dependencies are depicted, as kafka, mysql, ... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________                                                              ________&lt;br /&gt;
    |          |                                                            |        |&lt;br /&gt;
    | light-ui |OSM_SERVER               _______                            |keystone|&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |-------------------------&amp;gt; |:5000   |&lt;br /&gt;
    |__________|                        | nbi   |                           |________|&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | mysql |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For debugging it is convenient running the target module directly at host maintaining the rest of dependent modules in containers. In the following sections it is described how to achieve that.&lt;br /&gt;
&lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI by one of:&lt;br /&gt;
* Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
* ... Or update light-ui docker service (not persistent on reboot):&lt;br /&gt;
 docker service update osm_light-ui --force --env-add &amp;quot;OSM_SERVER=172.17.0.1&amp;quot;&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/nbi.env&#039;&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
&lt;br /&gt;
Values are stored at &#039;/etc/osm/docker/lcm.env&#039; but here it is explained how to obtain these values.&lt;br /&gt;
* OSMLCM_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/lcm.env&#039;&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_CACERT: To get this value run the following command in the OSM host:&lt;br /&gt;
** juju controllers --format json | jq -r &#039;.controllers[&amp;quot;osm&amp;quot;][&amp;quot;ca-cert&amp;quot;]&#039;&lt;br /&gt;
* OSMLCM_VCA_PUBKEY: To get this value run the following command in the OSM host:&lt;br /&gt;
** cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4697</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4697"/>
		<updated>2019-08-20T10:34:40Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). Current installation uses Docker Swarm by default (there are Kubernetes distributions and an incoming option for installing on Kubernetes). The modules are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kafka&#039;&#039;&#039;: Provides a Kafka bus used for OSM communication. This module relies on &#039;&#039;zookeeper&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;zookeeper&#039;&#039;&#039;: Used by &#039;&#039;kafka&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;nbi&#039;&#039;&#039;: North Bound Interface of OSM. Restful server that follows ETSI SOL005 interface. Relies on &#039;&#039;mongo&#039;&#039; database and &#039;&#039;kafka&#039;&#039; bus. For authentication it can optionally uses &#039;&#039;keystone&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;keystone&#039;&#039;&#039;: Used optionally for NBI authentication and RBAC. It stores the users, projects and role permissions. It relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;lcm&#039;&#039;&#039;: Provides the Live Cycle Management. It uses &#039;&#039;ro&#039;&#039; for resource orchestration and juju for configuration. It relies also on &#039;&#039;mongo&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;ro&#039;&#039;&#039;: Makes the Resource Orchestration, or VIM deployment. Relies on &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;light-ui&#039;&#039;&#039;: Web user interface. It communicates with &#039;&#039;nbi&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mon&#039;&#039;&#039;: Performs OSM monitoring. Relies on &#039;&#039;mongo&#039;&#039; and &#039;&#039;mysql&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;mongo&#039;&#039;&#039;: Common non relational database for OSM modules.&lt;br /&gt;
* &#039;&#039;&#039;mysql&#039;&#039;&#039;: Relational database server used for &#039;&#039;ro&#039;&#039;, &#039;&#039;keystone&#039;&#039;, &#039;&#039;mon&#039;&#039; and &#039;&#039;pol&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;pol&#039;&#039;&#039;: Policy Manager for OSM.&lt;br /&gt;
* &#039;&#039;&#039;prometheus&#039;&#039;&#039;: for monitoring .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition LCM and NBI, shares a common file system  where packages are stored. In current installation it uses a shared docker volume called &#039;&#039;osm_package&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This picture shows the modules with the port that they export, their relationships with the name of env variables that control them. For clarity not all the dependencies are depicted, as kafka, mysql, ... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________                                                              ________&lt;br /&gt;
    |          |                                                            |        |&lt;br /&gt;
    | light-ui |OSM_SERVER               _______                            |keystone|&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |-------------------------&amp;gt; |:5000   |&lt;br /&gt;
    |__________|                        | nbi   |                           |________|&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | mysql |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For debugging it is convenient running the target module directly at host maintaining the rest of dependent modules in containers. In the following sections it is described how to achieve that.&lt;br /&gt;
&lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI. Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/nbi.env&#039;&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
&lt;br /&gt;
Values are stored at &#039;/etc/osm/docker/lcm.env&#039; but here it is explained how to obtain these values.&lt;br /&gt;
* OSMLCM_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/lcm.env&#039;&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_CACERT: To get this value run the following command in the OSM host:&lt;br /&gt;
** juju controllers --format json | jq -r &#039;.controllers[&amp;quot;osm&amp;quot;][&amp;quot;ca-cert&amp;quot;]&#039;&lt;br /&gt;
* OSMLCM_VCA_PUBKEY: To get this value run the following command in the OSM host:&lt;br /&gt;
** cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4593</id>
		<title>Common issues and troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Common_issues_and_troubleshooting&amp;diff=4593"/>
		<updated>2019-06-18T09:06:33Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Installation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RECOMMENDATION:&#039;&#039;&#039; save a log of your installation:&lt;br /&gt;
 $ ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker===&lt;br /&gt;
====Were all docker images successfully built?====&lt;br /&gt;
&lt;br /&gt;
Although controlled by the installer, you can check that the following images exist:&lt;br /&gt;
&lt;br /&gt;
 $ docker image ls&lt;br /&gt;
 &lt;br /&gt;
 REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE&lt;br /&gt;
 osm/light-ui             latest              1988aa262a97        18 hours ago        710MB&lt;br /&gt;
 osm/lcm                  latest              c9ad59bf96aa        46 hours ago        667MB&lt;br /&gt;
 osm/ro                   latest              812c987fcb16        46 hours ago        791MB&lt;br /&gt;
 osm/nbi                  latest              584b4e0084a7        46 hours ago        497MB&lt;br /&gt;
 osm/pm                   latest              1ad1e4099f52        46 hours ago        462MB&lt;br /&gt;
 osm/mon                  latest              b17efa3412e3        46 hours ago        725MB&lt;br /&gt;
 wurstmeister/kafka       latest              7cfc4e57966c        10 days ago         293MB&lt;br /&gt;
 mysql                    5                   0d16d0a97dd1        2 weeks ago         372MB&lt;br /&gt;
 mongo                    latest              14c497d5c758        3 weeks ago         366MB&lt;br /&gt;
 wurstmeister/zookeeper   latest              351aa00d2fe9        18 months ago       478MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Are all processes/services running?====&lt;br /&gt;
 $ docker stack ps osm |grep -i running&lt;br /&gt;
&lt;br /&gt;
10 docker containers should be running.&lt;br /&gt;
&lt;br /&gt;
All the 10 services should have at least 1 replica: 1/1&lt;br /&gt;
&lt;br /&gt;
 $ docker service ls&lt;br /&gt;
 &lt;br /&gt;
 ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS&lt;br /&gt;
 yuyiqh8ty8pv        osm_kafka           replicated          1/1                 wurstmeister/kafka:latest       *:9092-&amp;gt;9092/tcp&lt;br /&gt;
 y585906h5vy5        osm_lcm             replicated          1/1                 osm/lcm:latest&lt;br /&gt;
 pcdi5vb86nt9        osm_light-ui        replicated          1/1                 osm/light-ui:latest             *:80-&amp;gt;80/tcp&lt;br /&gt;
 i56jhl5k6re4        osm_mon             replicated          1/1                 osm/mon:latest                  *:8662-&amp;gt;8662/tcp&lt;br /&gt;
 p5wyjtne93hp        osm_mongo           replicated          1/1                 mongo:latest&lt;br /&gt;
 iz5uncfdzu23        osm_nbi             replicated          1/1                 osm/nbi:latest                  *:9999-&amp;gt;9999/tcp&lt;br /&gt;
 4ttw2v4z2g57        osm_pm              replicated          1/1                 osm/pm:latest&lt;br /&gt;
 xbg6bclp2anw        osm_ro              replicated          1/1                 osm/ro:latest                   *:9090-&amp;gt;9090/tcp&lt;br /&gt;
 sf7rayfolncu        osm_ro-db           replicated          1/1                 mysql:5&lt;br /&gt;
 5bl73dhj1xl0        osm_zookeeper       replicated          1/1                 wurstmeister/zookeeper:latest&lt;br /&gt;
&lt;br /&gt;
====Docker image failed to build====&lt;br /&gt;
=====Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease=====&lt;br /&gt;
&lt;br /&gt;
In some cases, DNS resolution works on the host but fails when building the Docker container. This is caused when Docker doesn&#039;t automatically determine the DNS server to use.&lt;br /&gt;
&lt;br /&gt;
Check if the following works:&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
If it does not work, you have to configure Docker to use the available DNS.&lt;br /&gt;
 # Get the IP address you’re using for DNS:&lt;br /&gt;
 nmcli dev show | grep &#039;IP4.DNS&#039;&lt;br /&gt;
 # Create a new file, /etc/docker/daemon.json, that contains the following (but replace the DNS IP address with the output from the previous step:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;dns&amp;quot;: [&amp;quot;192.168.24.10&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
 # Restart docker&lt;br /&gt;
 sudo service docker restart&lt;br /&gt;
 # Re-run&lt;br /&gt;
 docker run busybox nslookup archive.ubuntu.com&lt;br /&gt;
 # Now you should be able to re-run the installer and move past the DNS issue.&lt;br /&gt;
&lt;br /&gt;
====Problem deploying stack osm====&lt;br /&gt;
=====network netosm could not be found=====&lt;br /&gt;
&lt;br /&gt;
The error is &#039;&#039;network &amp;quot;netosm&amp;quot; is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It usually happens because a &amp;quot;docker system prune&amp;quot;  is done with the stack stopped. The following script will create it:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  # Create OSM Docker Network ...&lt;br /&gt;
  [ -z &amp;quot;$OSM_STACK_NAME&amp;quot; ] &amp;amp;&amp;amp; OSM_STACK_NAME=osm&lt;br /&gt;
  OSM_NETWORK_NAME=net${OSM_STACK_NAME}&lt;br /&gt;
  echo Creating OSM Docker Network&lt;br /&gt;
  DEFAULT_INTERFACE=$(route -n | awk &#039;$1~/^0.0.0.0/ {print $8}&#039;)&lt;br /&gt;
  DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne &#039;if (/mtu\s(\d+)/) {print $1;}&#039;)&lt;br /&gt;
  echo \# OSM_STACK_NAME = $OSM_STACK_NAME&lt;br /&gt;
  echo \# OSM_NETWORK_NAME = $OSM_NETWORK_NAME&lt;br /&gt;
  echo \# DEFAULT_INTERFACE = $DEFAULT_INTERFACE&lt;br /&gt;
  echo \# DEFAULT_MTU = $DEFAULT_MTU&lt;br /&gt;
  sg docker -c &amp;quot;docker network create --driver=overlay --attachable \&lt;br /&gt;
                 --opt com.docker.network.driver.mtu=${DEFAULT_MTU} \&lt;br /&gt;
                 ${OSM_NETWORK_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Juju===&lt;br /&gt;
====Bootstrap hangs====&lt;br /&gt;
&lt;br /&gt;
If the Juju bootstrap takes a long time, stuck at this status...&lt;br /&gt;
&lt;br /&gt;
 Installing Juju agent on bootstrap instance&lt;br /&gt;
 Fetching Juju GUI 2.14.0&lt;br /&gt;
 Waiting for address&lt;br /&gt;
 Attempting to connect to 10.71.22.78:22&lt;br /&gt;
 Connected to 10.71.22.78&lt;br /&gt;
 Running machine configuration script...&lt;br /&gt;
&lt;br /&gt;
...it usually indicates that the LXD container with the Juju controller is having trouble connecting to the internet.&lt;br /&gt;
&lt;br /&gt;
Get the name of the LXD container. It will begin with &#039;juju-&#039; and end with &#039;-0&#039;.&lt;br /&gt;
&lt;br /&gt;
 lxc list&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 |      NAME       |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
 | juju-0383f2-0   | RUNNING | 10.195.8.57 (eth0)  |      | PERSISTENT |           |&lt;br /&gt;
 +-----------------+---------+---------------------+------+------------+-----------+&lt;br /&gt;
&lt;br /&gt;
Next, tail the output of cloud-init to see where the bootstrap is stuck.&lt;br /&gt;
&lt;br /&gt;
 lxc exec juju-0383f2-0 -- tail -f /var/log/cloud-init-output.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Is Juju running?====&lt;br /&gt;
&lt;br /&gt;
If running, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 $ juju status&lt;br /&gt;
 &lt;br /&gt;
 Model    Controller  Cloud/Region         Version  SLA&lt;br /&gt;
 default  osm         localhost/localhost  2.3.7    unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ERROR controller osm already exists====&lt;br /&gt;
&lt;br /&gt;
Did OSM installation fail during juju installation with an error like &amp;quot;ERROR controller osm already exists&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
 ...&lt;br /&gt;
 ERROR controller &amp;quot;osm&amp;quot; already exists&lt;br /&gt;
 ERROR try was stopped&lt;br /&gt;
 &lt;br /&gt;
 ### Jum Agu 24 15:19:33 WIB 2018 install_juju: FATAL error: Juju installation failed&lt;br /&gt;
 BACKTRACE:&lt;br /&gt;
 ### FATAL /usr/share/osm-devops/jenkins/common/logging 39&lt;br /&gt;
 ### install_juju /usr/share/osm-devops/installers/full_install_osm.sh 564&lt;br /&gt;
 ### install_lightweight /usr/share/osm-devops/installers/full_install_osm.sh 741&lt;br /&gt;
 ### main /usr/share/osm-devops/installers/full_install_osm.sh 1033&lt;br /&gt;
&lt;br /&gt;
Try to destroy the Juju controller and run the installation again:&lt;br /&gt;
 $ juju destroy-controller osm --destroy-all-models -y&lt;br /&gt;
 $ ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
If it does not work, you can destroy Juju container and run the installation again&lt;br /&gt;
 #Destroy the Juju container&lt;br /&gt;
 lxc stop juju-*&lt;br /&gt;
 lxc delete juju-*&lt;br /&gt;
 #Unregister the controller since we’ve manually freed the resources associated with it&lt;br /&gt;
 juju unregister -y osm&lt;br /&gt;
 #Verify that there are no controllers&lt;br /&gt;
 juju list-controllers&lt;br /&gt;
 #Run the installation again&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
===LXD===&lt;br /&gt;
====ERROR profile default: /etc/default/lxd-bridge has IPv6 enabled====&lt;br /&gt;
&lt;br /&gt;
Make sure that you follow the instructions in the Quickstart.&lt;br /&gt;
&lt;br /&gt;
When asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements, Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When dialog messages related to LXD configuration are shown, please answer in the following way:&lt;br /&gt;
&lt;br /&gt;
* Do you want to configure the LXD bridge? Yes&lt;br /&gt;
* Do you want to setup an IPv4 subnet? Yes&lt;br /&gt;
* &amp;lt;&amp;lt; Default values apply for next questions &amp;gt;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Do you want to setup an IPv6 subnet? No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===VIMs===&lt;br /&gt;
&lt;br /&gt;
====Is the VIM URL reachable and operational?====&lt;br /&gt;
&lt;br /&gt;
When there are problems to access the VIM URL, an error message similar to the following is shown after attempts to instantiate network services:&lt;br /&gt;
&lt;br /&gt;
 Error: &amp;quot;VIM Exception vimmconnConnectionException ConnectFailure: Unable to establish connection to &amp;lt;URL&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* In order to debug potential issues with the connection, in the case of an OpenStack VIM, you can install the OpenStack client in the OSM VM and run some basic tests. I.e.:&lt;br /&gt;
 $ # Install the OpenStack client&lt;br /&gt;
 $ sudo apt-get install python-openstackclient&lt;br /&gt;
 $ # Load your OpenStack credentials. For instance, if your credentials are saved in a file named &#039;myVIM-openrc.sh&#039;, you can load them with:&lt;br /&gt;
 $ source myVIM-openrc.sh&lt;br /&gt;
 $ # Test if the VIM API is operational with a simple command. For instance:&lt;br /&gt;
 $ openstack image list&lt;br /&gt;
&lt;br /&gt;
If the openstack client works, then make sure that you can reach the VIM from the RO docker:&lt;br /&gt;
 $ docker exec -it osm_ro.1.xxxxx bash&lt;br /&gt;
 $ curl &amp;lt;URL_CONTROLLER&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In some cases, the errors come from the fact that the VIM was added to OSM using names in the URL that are not Fully Qualified Domain Names (FQDN).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When adding a VIM to OSM, you must use always FQDN or the IP addresses. It must be noted that “controller” or similar names are not proper FQDN (the suffix should be added). Non-FQDN names might be understood by docker’s dnsmasq as a docker container name to be resolved, which is not the case. In addition, all the VIM endpoints should also be FQDN or IP addresses, thus guaranteeing that all subsequent API calls can reach the appropriate endpoint.&lt;br /&gt;
&lt;br /&gt;
Think of an NFV infrastructure with tens of VIMs, first you will have to use different names for each controller (controller1, controller2, etc.), then you will have to add to every machine trying to interact with the different VIMs, not only OSM, all those entries in the /etc/hosts file. This is bad practice.&lt;br /&gt;
&lt;br /&gt;
However, it is useful to have a mean to work with lab environments using non-FQDN names. Three options here. Probably you are looking for the third one, but we recommend the first one:&lt;br /&gt;
* Option 1. Change the admin URL and/or public URL of the endpoints to use an IP address or an FQDN. You might find this interesting if you want to bring your Openstack setup to production.&lt;br /&gt;
* Option 2. Modify /etc/hosts in the docker RO container. This is not persistent after reboots or restarts of the osm docker stack.&lt;br /&gt;
* Option 3. Modify /etc/osm/docker/docker-compose.yaml in the host, adding extra_hosts in the ro section with the entries that you want to add to /etc/hosts in the RO docker:&lt;br /&gt;
 ro:&lt;br /&gt;
   extra_hosts:&lt;br /&gt;
     controller: 1.2.3.4&lt;br /&gt;
Then restart the stack:&lt;br /&gt;
 docker stack rm osm&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
This is persistent after reboots and restarts of the osm docker stack.&lt;br /&gt;
&lt;br /&gt;
====Authentication====&lt;br /&gt;
&#039;&#039;&#039;What should I check if the VIM authentication is failing?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Typically, you will get the following error messsage:&lt;br /&gt;
&lt;br /&gt;
Error: &amp;quot;VIM Exception vimconnUnexpectedResponse Unauthorized: The request you have made requieres authentication. (HTTP 401)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your OpenStack URL is based on HTTPS, OSM will check by default the authenticity of your VIM using the appropriate public certificate. The recommended way to solve this is by modifying /etc/osm/docker/docker-compose.yaml in the host, sharing the host file (e.g. /home/ubuntu/cafile.crt) by adding a volume to the ro section as follows:&lt;br /&gt;
  ro:&lt;br /&gt;
    ...&lt;br /&gt;
    volumes:&lt;br /&gt;
      - /home/ubuntu/cafile.crt:/etc/osm/cafile.crt&lt;br /&gt;
Then, when creating the VIM, you should use the config option &amp;quot;ca_cert&amp;quot; as follows:&lt;br /&gt;
 $ # Create the VIM with all the usual options, and add the config option to specify the certificate&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{ca_cert: /etc/osm/cafile.crt}&#039;&lt;br /&gt;
&lt;br /&gt;
For casual testing, when adding the VIM account to OSM, you can use &#039;insecure: True&#039; (without quotes) as part of the VIM config parameters:&lt;br /&gt;
 $ osm vim-create VIM-NAME ... --config &#039;{insecure: True}&#039;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Is the VIM management network reachable from OSM (e.g. via ssh, port 22)?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest check would consist on deploying a VM attached to the management network and trying to access it via e.g. ssh from the OSM host.&lt;br /&gt;
&lt;br /&gt;
For instance, in the case of an OpenStack VIM you could try something like this:&lt;br /&gt;
 $ openstack server create --image ubuntu --flavor m1.small --nic mgmtnet test&lt;br /&gt;
&lt;br /&gt;
If this does not work, typically it is due to one of these issues:&lt;br /&gt;
* Security group policy in your VIM is blocking your traffic (contact your admin to fix it)&lt;br /&gt;
* IP address space in the management network is not routable from outside (or in the reverse direction, for the ACKs).&lt;br /&gt;
&lt;br /&gt;
==Operational issues==&lt;br /&gt;
&lt;br /&gt;
===Running out of disk space===&lt;br /&gt;
If you are upgrading frequently your OSM installation, you might face that your disk is running out of space. The reason is that the previous dockers and docker images might be consuming some disk space. Running the following two commands should be enough to clear your docker setup:&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
&lt;br /&gt;
If you are still experiencing issues with disk space, logs in one of the dockers could be the cause of your issue. Check the containers that are consuming more space (typically kafka-exporter) &lt;br /&gt;
 du -sk /var/lib/docker/containers/* |sort -n&lt;br /&gt;
 docker ps |grep &amp;lt;CONTAINER_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove the stack and redeploy it again after doing a prune:&lt;br /&gt;
 docker stack rm osm_metrics&lt;br /&gt;
 docker system prune&lt;br /&gt;
 docker image prune&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/osm_metrics/docker-compose.yml osm_metrics&lt;br /&gt;
&lt;br /&gt;
===VCA (juju)===&lt;br /&gt;
====Status is not coherent with running NS====&lt;br /&gt;
&lt;br /&gt;
In extraordinary situations, the output of &amp;quot;juju status&amp;quot; could show pending units that should have been removed when deleting a NS. In those situations, you can clean up VCA by following the procedure below:&lt;br /&gt;
 juju status&lt;br /&gt;
 juju remove-application &amp;lt;application&amp;gt;&lt;br /&gt;
 juju resolved &amp;lt;unit&amp;gt; --no-retry        # You&#039;ll likely have to run it several times, as it will probably have an error in the next queued hook.Once the last hook is marked resolved, the charm will continue its removal&lt;br /&gt;
&lt;br /&gt;
The following page also shows [https://docs.jujucharms.com/2.1/en/charms-destroy how to remove different Juju objects]&lt;br /&gt;
&lt;br /&gt;
====Dump Juju Logs ====&lt;br /&gt;
&lt;br /&gt;
To dump the Juju debug-logs, run this command:&lt;br /&gt;
 juju debug-log --replay --no-tail &amp;gt; juju-debug.log&lt;br /&gt;
&lt;br /&gt;
====Manual recovery of Juju====&lt;br /&gt;
&lt;br /&gt;
If juju gets in a corrupt state and you cannot run `juju status` or contact the juju controller, you might need to remove manually the controller and register again, making OSM aware of the new controller.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Stop and delete all juju containers, then unregister the controller&lt;br /&gt;
lxc list&lt;br /&gt;
lxc stop juju-*          #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
lxc delete juju-*        #replace &amp;quot;*&amp;quot; by the right values&lt;br /&gt;
juju unregister -y osm&lt;br /&gt;
&lt;br /&gt;
# Create the controller again &lt;br /&gt;
sg lxd -c &amp;quot;juju bootstrap --bootstrap-series=xenial localhost osm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get controller IP and update it in relevant OSM env files&lt;br /&gt;
controller_ip=$(juju show-controller osm|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_HOST.*$/OSMMON_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_HOST.*$/OSMLCM_VCA_HOST=&#039;$controller_ip&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
 &lt;br /&gt;
#Get juju password and feed it to OSM env files&lt;br /&gt;
function parse_juju_password {&lt;br /&gt;
   password_file=&amp;quot;${HOME}/.local/share/juju/accounts.yaml&amp;quot;&lt;br /&gt;
   local controller_name=$1&lt;br /&gt;
   local s=&#039;[[:space:]]*&#039; w=&#039;[a-zA-Z0-9_-]*&#039; fs=$(echo @|tr @ &#039;\034&#039;)&lt;br /&gt;
   sed -ne &amp;quot;s|^\($s\):|\1|&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s[\&amp;quot;&#039;]\(.*\)[\&amp;quot;&#039;]$s\$|\1$fs\2$fs\3|p&amp;quot; \&lt;br /&gt;
        -e &amp;quot;s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p&amp;quot; $password_file |&lt;br /&gt;
   awk -F$fs -v controller=$controller_name &#039;{&lt;br /&gt;
      indent = length($1)/2;&lt;br /&gt;
      vname[indent] = $2;&lt;br /&gt;
      for (i in vname) {if (i &amp;gt; indent) {delete vname[i]}}&lt;br /&gt;
      if (length($3) &amp;gt; 0) {&lt;br /&gt;
         vn=&amp;quot;&amp;quot;; for (i=0; i&amp;lt;indent; i++) {vn=(vn)(vname[i])(&amp;quot;_&amp;quot;)}&lt;br /&gt;
         if (match(vn,controller) &amp;amp;&amp;amp; match($2,&amp;quot;password&amp;quot;)) {&lt;br /&gt;
             printf(&amp;quot;%s&amp;quot;,$3);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&#039;&lt;br /&gt;
}&lt;br /&gt;
juju_password=$(parse_juju_password osm)&lt;br /&gt;
sudo sed -i &#039;s/^OSMMON_VCA_SECRET.*$/OSMMON_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/mon.env&lt;br /&gt;
sudo sed -i &#039;s/^OSMLCM_VCA_SECRET.*$/OSMLCM_VCA_SECRET=&#039;$juju_password&#039;/&#039; /etc/osm/docker/lcm.env&lt;br /&gt;
&lt;br /&gt;
#Restart OSM stack&lt;br /&gt;
docker stack rm osm&lt;br /&gt;
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slow deployment of charms====&lt;br /&gt;
&lt;br /&gt;
You can make deplyment of charms quicker by:&lt;br /&gt;
* Upgrading your LXD installation to use ZFS: [[LXD configuration for OSM Release FIVE]]&lt;br /&gt;
** After LXD re-installation, you might need to reinstall the juju controller: [[Common_issues_and_troubleshooting#Manual_recovery_of_Juju|Reinstall Juju controller]]&lt;br /&gt;
* Preventing Juju from running apt-get update &amp;amp;&amp;amp; apt-get upgrade when starting a machine: [[Advanced_Charm_Development#Disable_OS_upgrades|Disable OS upgrades in charms]]&lt;br /&gt;
* Building periodically a custom image that will be used as base image for all the charms: [[Advanced_Charm_Development#Build_a_custom_cloud_image|Custom base image for charms]]&lt;br /&gt;
&lt;br /&gt;
==Checking the logs==&lt;br /&gt;
&lt;br /&gt;
You can check the logs of any container with the following commands:&lt;br /&gt;
&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mon&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_pol&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_lcm&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_nbi&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_light-ui&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_ro-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_mongo&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_kafka&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_zookeeper&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone.1&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_keystone-db&amp;quot; -n 1)&lt;br /&gt;
 docker logs $(docker ps -aqf &amp;quot;name=osm_prometheus&amp;quot; -n 1)&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4577</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4577"/>
		<updated>2019-06-03T17:31:00Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # Needed for VNFD mapping NSD.constituent-vnfd.member-vnf-index. If missing a NSD is targeting&lt;br /&gt;
primitive: str           # mandatory. Maps VNFD.vnf-configuration.config-primitive.name (or NSD.ns-configuration)&lt;br /&gt;
primitive_params: dict   # optional. Maps VNFD.vnf-configuration.config-primitive.parameter  (or NSD.ns-configuration)&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4571</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4571"/>
		<updated>2019-05-28T08:26:13Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI. Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/nbi.env&#039;&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
&lt;br /&gt;
Values are stored at &#039;/etc/osm/docker/lcm.env&#039; but here it is explained how to obtain these values.&lt;br /&gt;
* OSMLCM_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/lcm.env&#039;&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_CACERT: To get this value run the following command in the OSM host:&lt;br /&gt;
** juju controllers --format json | jq -r &#039;.controllers[&amp;quot;osm&amp;quot;][&amp;quot;ca-cert&amp;quot;]&#039;&lt;br /&gt;
* OSMLCM_VCA_PUBKEY: To get this value run the following command in the OSM host:&lt;br /&gt;
** cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4547</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4547"/>
		<updated>2019-05-22T13:25:45Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI. Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/nbi.env&#039;&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_DATABASE_COMMONKEY: must be the same value used by NBI. Get it with &#039;cat /etc/osm/docker/lcm.env&#039;&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4457</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4457"/>
		<updated>2019-04-16T11:31:23Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it. It returns the nsInstanceId in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nsName: name            # mandatory&lt;br /&gt;
nsdId: nsd-internal-id  # mandatory&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
additionalParamsForNs:  {param1: value1, param2: value2}&lt;br /&gt;
additionalParamsForVnf: [member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {param1: value1, param2: value2}]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;. Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vimAccountId: internal-id   # mandatory&lt;br /&gt;
wimAccountId: False/True/internal-id&lt;br /&gt;
ssh_keys: [ssh-key-pub1, ssh-key-pub2, ]&lt;br /&gt;
vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vimAccountId: vim-uuid, internal-vld: [], vdu: [] } ]&lt;br /&gt;
vld: [ {name: vld-name, ip-profile: {}, vnfd-connection-point-ref: [{}] }]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # mandatory. Maps NSD  constituent-vnfd.member-vnf-index&lt;br /&gt;
primitive: str           # mandatory. Maps VNFD.vnf-configuration.config-primitive.name&lt;br /&gt;
primitive_params: dict   # optional. Maps VNFD.vnf-configuration.config-primitive.parameter&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=OSM_instantiation_parameters&amp;diff=4440</id>
		<title>OSM instantiation parameters</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=OSM_instantiation_parameters&amp;diff=4440"/>
		<updated>2019-04-11T10:18:45Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When creating a NS instance, it is possible to pass instantiation parameters to OSM using the &amp;quot;--config&amp;quot; option of the client or the &amp;quot;config&amp;quot; parameter of the UI. In this section we will illustrate through some of the existing examples how to specify those parameters using OSM client:&lt;br /&gt;
&lt;br /&gt;
===Specify a VIM network name for a NS VLD===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;vldnet&#039; is the name of the network in the NS descriptor and &#039;netVIM1&#039; is the VIM network that you want to use:&lt;br /&gt;
 --config &#039;{vld: [ {name: vldnet, vim-network-name: netVIM1} ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf1 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vld: [ {name: mgmtnet, vim-network-name: mgmt} ] }&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify a VIM network name for an internal VLD of a VNF===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor and  &#039;netVIM1&#039; is the VIM network that you want to use:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, vim-network-name: netVIM1} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1  --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, vim-network-name: mgmt} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP profile information and IP for a NS VLD===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;datanet&#039; is the name of the network in the NS descriptor, ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/nsd.html# NS data model] ), and vnfd-connection-point-ref is the reference to the connection point:&lt;br /&gt;
 --config &#039;{vld: [ {name: datanet, ip-profile: {...}, vnfd-connection-point-ref: {...} } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vld: [ {name: datanet, ip-profile: {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}],dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}, vnfd-connection-point-ref: [ {member-vnf-index-ref: &amp;quot;1&amp;quot;, vnfd-connection-point-ref: vnf-data, ip-address: &amp;quot;192.168.100.17&amp;quot;}]}]}&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP profile information for an internal VLD of a VNF===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor and ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] ):&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {...} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile:  {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] ,dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}}]}]} &#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP address and/or MAC address for an interface===&lt;br /&gt;
&lt;br /&gt;
====Specify IP address for an interface====&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor ,ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] ), &#039;id1&#039; is the internal-connection-point id and &#039;a.b.c.d&#039; is the IP that you have to specify for this scenario:&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {...}, internal-connection-point: [{id-ref: id1, ip-address: &amp;quot;a.b.c.d&amp;quot;}] ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
  osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account ost4 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] ,dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}, internal-connection-point: [{id-ref: mgmtVM-internal, ip-address: &amp;quot;192.168.100.3&amp;quot;}]}]}]}&#039;&lt;br /&gt;
&lt;br /&gt;
====Specify MAC address for an interface====&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;id1&#039; is the id of VDU in the VNF descriptor and &#039;interf1&#039; is the name of the interface to which you want to add the MAC address:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: id1, interface: [{name: interf1, mac-address: &amp;quot;aa:bb:cc:dd:ee:ff&amp;quot; }]} ] } ] } &#039;&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: hackfest1VM, interface: [{name: vdu-eth0, mac-address: &amp;quot;52:33:44:55:66:21&amp;quot;}]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
====Specify IP address and MAC address for an interface====&lt;br /&gt;
In the following scenario, we will bring together the two previous cases &lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest2-ns --vim_account ost4 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal , ip-profile: {ip-version: ipv4, subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] , dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true} }, internal-connection-point: [ {id-ref: mgmtVM-internal, ip-address: &amp;quot;192.168.100.3&amp;quot;} ] }, ], vdu: [ {id: mgmtVM, interface: [{name: mgmtVM-eth0, mac-address: &amp;quot;52:33:44:55:66:21&amp;quot;}]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
===Force floating IP address for an interface===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;id1&#039; is the name of the VDU in the VNF descriptor and &#039;interf1&#039; is the name of the interface:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: id1, interface: [{name: interf1, floating-ip-required: True }]} ] } ] } &#039;&lt;br /&gt;
	&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu:[ {id: mgmtVM, interface: [{name: mgmtVM-eth0, floating-ip-required: True }]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
Make sure &#039;vim-network-name&#039; in NS Descriptor has access to the outside to be able to use the parameter &#039;floating-ip-required&#039;.&lt;br /&gt;
&lt;br /&gt;
===Multi-site deployments (specifying different VIM accounts for different VNFs)===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1 and 2&#039; are the member vnf index of the constituent vnfs in the NS descriptor, &#039;vim1 and vim2&#039; are the names of vim accounts and  &#039;netVIM1 and netVIM2&#039; are the VIM networks that you want to use:&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vim_account: vim1}, {member-vnf-index: &amp;quot;2&amp;quot;, vim_account: vim2} ], vld: [ {name: datanet, vim-network-name: {vim1: netVIM1, vim2: netVIM2} } ] }&#039;&lt;br /&gt;
  # NOTE: From release SIX (current muster) add &#039;wim_account: False&#039; (inside --config) to avoid wim network connectivity if you have not a WIM in your system&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vim_account: openstack1}, {member-vnf-index: &amp;quot;2&amp;quot;, vim_account: openstack3} ], vld: [ {name: mgmtnet, vim-network-name: {openstack1: mgmt, openstack3: mgmt} } ] }&#039; &lt;br /&gt;
&lt;br /&gt;
===Specifying a volume ID for a VNF volume===&lt;br /&gt;
 &lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;VM1&#039; is the name of the VDU, &#039;Storage1&#039; is the volume name in VNF descriptor and &#039;05301095-d7ee-41dd-b520-e8ca08d18a55&#039; is the volume id:&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: VM1, volume: [ {name: Storage1, vim-volume-id: 05301095-d7ee-41dd-b520-e8ca08d18a55} ] } ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
With the previous hackfest example, according [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] you will add in VNF Descriptor:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
     volumes:&lt;br /&gt;
      - name: Storage1&lt;br /&gt;
        size: &#039;Size of the volume&#039;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name h1 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: hackfest1VM, volume: [ {name: Storage1, vim-volume-id: 8ab156fd-0f8e-4e01-b434-a0fce63ce1cf} ] } ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding additonal parameters===&lt;br /&gt;
 &lt;br /&gt;
From release SIX (current master) additional user parameters can be added, and they land at vdu:cloud-init (Jinja2 format) and/or vnf-configuration primitives (enclosed by &amp;lt;&amp;gt;). Here is an example of VNF descriptor that uses two parameters called &amp;quot;touch_filename&amp;quot; and &amp;quot;touch_filename2&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vnfd:&lt;br /&gt;
    ...&lt;br /&gt;
    vnf-configuration:&lt;br /&gt;
        config-primitive:&lt;br /&gt;
        -   name: touch&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   data-type: STRING&lt;br /&gt;
                default-value: &amp;lt;touch_filename2&amp;gt;&lt;br /&gt;
                name: filename&lt;br /&gt;
        initial-config-primitive:&lt;br /&gt;
        -   name: config&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   name: ssh-hostname&lt;br /&gt;
                value: &amp;lt;rw_mgmt_ip&amp;gt;  # this paramater is internal&lt;br /&gt;
            -   name: ssh-username&lt;br /&gt;
                value: ubuntu&lt;br /&gt;
            -   name: ssh-password&lt;br /&gt;
                value: osm4u&lt;br /&gt;
            seq: &#039;1&#039;&lt;br /&gt;
        -   name: touch&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   name: filename&lt;br /&gt;
                value: &amp;lt;touch_filename&amp;gt;&lt;br /&gt;
            seq: &#039;2&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And they can be provided with:&lt;br /&gt;
 --config &#039;{additionalParamsForVnf: [{member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {touch_filename: your-value,  touch_filename2: your-value2}}]}&#039;&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=OSM_instantiation_parameters&amp;diff=4439</id>
		<title>OSM instantiation parameters</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=OSM_instantiation_parameters&amp;diff=4439"/>
		<updated>2019-04-10T17:09:01Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When creating a NS instance, it is possible to pass instantiation parameters to OSM using the &amp;quot;--config&amp;quot; option of the client or the &amp;quot;config&amp;quot; parameter of the UI. In this section we will illustrate through some of the existing examples how to specify those parameters using OSM client:&lt;br /&gt;
&lt;br /&gt;
===Specify a VIM network name for a NS VLD===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;vldnet&#039; is the name of the network in the NS descriptor and &#039;netVIM1&#039; is the VIM network that you want to use:&lt;br /&gt;
 --config &#039;{vld: [ {name: vldnet, vim-network-name: netVIM1} ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf1 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vld: [ {name: mgmtnet, vim-network-name: mgmt} ] }&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify a VIM network name for an internal VLD of a VNF===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor and  &#039;netVIM1&#039; is the VIM network that you want to use:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, vim-network-name: netVIM1} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1  --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, vim-network-name: mgmt} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP profile information and IP for a NS VLD===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;datanet&#039; is the name of the network in the NS descriptor, ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/nsd.html# NS data model] ), and vnfd-connection-point-ref is the reference to the connection point:&lt;br /&gt;
 --config &#039;{vld: [ {name: datanet, ip-profile: {...}, vnfd-connection-point-ref: {...} } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vld: [ {name: datanet, ip-profile: {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}],dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}, vnfd-connection-point-ref: [ {member-vnf-index-ref: &amp;quot;1&amp;quot;, vnfd-connection-point-ref: vnf-data, ip-address: &amp;quot;192.168.100.17&amp;quot;}]}]}&#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP profile information for an internal VLD of a VNF===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor and ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] ):&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {...} ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile:  {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] ,dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}}]}]} &#039;&lt;br /&gt;
&lt;br /&gt;
===Specify IP address and/or MAC address for an interface===&lt;br /&gt;
&lt;br /&gt;
====Specify IP address for an interface====&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;internal&#039; is the name of internal-vld in the VNF descriptor ,ip-profile you have to fill the associated parameters with the data model ( [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] ), &#039;id1&#039; is the internal-connection-point id and &#039;a.b.c.d&#039; is the IP that you have to specify for this scenario:&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {...}, internal-connection-point: [{id-ref: id1, ip-address: &amp;quot;a.b.c.d&amp;quot;}] ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
  osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account ost4 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal, ip-profile: {ip-version: ipv4 ,subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] ,dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true}}, internal-connection-point: [{id-ref: mgmtVM-internal, ip-address: &amp;quot;192.168.100.3&amp;quot;}]}]}]}&#039;&lt;br /&gt;
&lt;br /&gt;
====Specify MAC address for an interface====&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1&#039; is the member vnf index of the constituent vnf in the NS descriptor, &#039;id1&#039; is the id of VDU in the VNF descriptor and &#039;interf1&#039; is the name of the interface to which you want to add the MAC address:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: id1, interface: [{name: interf1, mac-address: &amp;quot;aa:bb:cc:dd:ee:ff&amp;quot; }]} ] } ] } &#039;&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: hackfest1VM, interface: [{name: vdu-eth0, mac-address: &amp;quot;52:33:44:55:66:21&amp;quot;}]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
====Specify IP address and MAC address for an interface====&lt;br /&gt;
In the following scenario, we will bring together the two previous cases &lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest2-ns --vim_account ost4 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, internal-vld: [ {name: internal , ip-profile: {ip-version: ipv4, subnet-address: &amp;quot;192.168.100.0/24&amp;quot;, gateway-address: &amp;quot;0.0.0.0&amp;quot;, dns-server: [{address: &amp;quot;8.8.8.8&amp;quot;}] , dhcp-params: {count: 100, start-address: &amp;quot;192.168.100.20&amp;quot;, enabled: true} }, internal-connection-point: [ {id-ref: mgmtVM-internal, ip-address: &amp;quot;192.168.100.3&amp;quot;} ] }, ], vdu: [ {id: mgmtVM, interface: [{name: mgmtVM-eth0, mac-address: &amp;quot;52:33:44:55:66:21&amp;quot;}]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
===Force floating IP address for an interface===&lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;id1&#039; is the name of the VDU in the VNF descriptor and &#039;interf1&#039; is the name of the interface:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: id1, interface: [{name: interf1, floating-ip-required: True }]} ] } ] } &#039;&lt;br /&gt;
	&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf2 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu:[ {id: mgmtVM, interface: [{name: mgmtVM-eth0, floating-ip-required: True }]} ] } ] } &#039;&lt;br /&gt;
&lt;br /&gt;
Make sure &#039;vim-network-name&#039; in NS Descriptor has access to the outside to be able to use the parameter &#039;floating-ip-required&#039;.&lt;br /&gt;
&lt;br /&gt;
===Multi-site deployments (specifying different VIM accounts for different VNFs)===&lt;br /&gt;
In this scenario, the mapping can be specified in the following way, where &#039;1 and 2&#039; are the member vnf index of the constituent vnfs in the NS descriptor, &#039;vim1 and vim2&#039; are the names of vim accounts and  &#039;netVIM1 and netVIM2&#039; are the VIM networks that you want to use:&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vim_account: vim1}, {member-vnf-index: &amp;quot;2&amp;quot;, vim_account: vim2} ], vld: [ {name: datanet, vim-network-name: {vim1: netVIM1, vim2: netVIM2} } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_vnfd.tar.gz hackfest2-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_2_nsd.tar.gz hackfest2-ns]; images:[https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%203%20-%20Modeling%20multi-VDU%20VNF%20v2.pdf modeling multi-VDU VNF]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
 osm ns-create --ns_name hf12 --nsd_name hackfest2-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vim_account: openstack1}, {member-vnf-index: &amp;quot;2&amp;quot;, vim_account: openstack3} ], vld: [ {name: mgmtnet, vim-network-name: {openstack1: mgmt, openstack3: mgmt} } ] }&#039; &lt;br /&gt;
&lt;br /&gt;
===Specifying a volume ID for a VNF volume===&lt;br /&gt;
 &lt;br /&gt;
In a generic way, the mapping can be specified in the following way, where &#039;VM1&#039; is the name of the VDU, &#039;Storage1&#039; is the volume name in VNF descriptor and &#039;05301095-d7ee-41dd-b520-e8ca08d18a55&#039; is the volume id:&lt;br /&gt;
&lt;br /&gt;
 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: VM1, volume: [ {name: Storage1, vim-volume-id: 05301095-d7ee-41dd-b520-e8ca08d18a55} ] } ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
You can try it using one of the examples of the hackfest (&#039;&#039;&#039;descriptors: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_vnfd.tar.gz hackfest1-vnf], [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_1_nsd.tar.gz hackfest1-ns]; images: [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/US1604.qcow2 ubuntu1604], presentation: [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180626%20OSM%20Hackfest%20-%20Session%202%20-%20Creating%20a%20basic%20VNF%20and%20NS.pdf creating a basic VNF and NS]&#039;&#039;&#039;) in the following way:&lt;br /&gt;
&lt;br /&gt;
With the previous hackfest example, according [http://osm-download.etsi.org/ftp/osm-doc/vnfd.html VNF data model] you will add in VNF Descriptor:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
     volumes:&lt;br /&gt;
      - name: Storage1&lt;br /&gt;
        size: &#039;Size of the volume&#039;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 osm ns-create --ns_name h1 --nsd_name hackfest1-ns --vim_account openstack1 --config &#039;{vnf: [ {member-vnf-index: &amp;quot;1&amp;quot;, vdu: [ {id: hackfest1VM, volume: [ {name: Storage1, vim-volume-id: 8ab156fd-0f8e-4e01-b434-a0fce63ce1cf} ] } ] } ] }&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding additonal parameters===&lt;br /&gt;
 &lt;br /&gt;
From release SIX (current master) additional user parameters can be added, and they land at vdu:cloud-init (Jinja2 format) and/or vnf-configuration primitives (enclosed by &amp;lt;&amp;gt;). Here is an example of VNF descriptor that uses two parameters called &amp;quot;touch_filename&amp;quot; and &amp;quot;touch_filename2&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vnfd:&lt;br /&gt;
    ...&lt;br /&gt;
    vnf-configuration:&lt;br /&gt;
        config-primitive:&lt;br /&gt;
        -   name: touch&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   data-type: STRING&lt;br /&gt;
                default-value: &amp;lt;touch_filename2&amp;gt;&lt;br /&gt;
                name: filename&lt;br /&gt;
        initial-config-primitive:&lt;br /&gt;
        -   name: config&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   name: ssh-hostname&lt;br /&gt;
                value: &amp;lt;rw_mgmt_ip&amp;gt;  # this paramater is internal&lt;br /&gt;
            -   name: ssh-username&lt;br /&gt;
                value: ubuntu&lt;br /&gt;
            -   name: ssh-password&lt;br /&gt;
                value: osm4u&lt;br /&gt;
            seq: &#039;1&#039;&lt;br /&gt;
        -   name: touch&lt;br /&gt;
            parameter:&lt;br /&gt;
            -   name: filename&lt;br /&gt;
                value: &amp;lt;touch_filename&amp;gt;&lt;br /&gt;
            seq: &#039;2&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And they can be provided with:&lt;br /&gt;
 --config &#039;{additionalParamsForVnf: [{member-vnf-index: &amp;quot;1&amp;quot;, additionalParams: {touch_filename: your-value,  touch_filename2: your-value2}}]}&#039;&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Workflow_with_OSM_tools&amp;diff=4435</id>
		<title>Workflow with OSM tools</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Workflow_with_OSM_tools&amp;diff=4435"/>
		<updated>2019-04-10T11:26:42Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Login to OSM portal =&lt;br /&gt;
# Go to OSM portal: https://osm.etsi.org/&lt;br /&gt;
# Login using your username and password&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
* If you are &#039;&#039;&#039;[[Participate|contributing on behalf of your company]]&#039;&#039;&#039;, you should login with your &#039;&#039;&#039;ETSI Online Account (EOL)&#039;&#039;&#039;. &lt;br /&gt;
** If your company is not yet an &#039;&#039;&#039;[https://portal.etsi.org/TBSiteMap/OSM/ListofOSMMembers.aspx OSM Member or Participant]&#039;&#039;&#039;, you can check here &#039;&#039;&#039;[https://osm.etsi.org/welcome/#join how to join OSM as an organization]&#039;&#039;&#039;&lt;br /&gt;
** If your company has &#039;&#039;&#039;already joined OSM but you do not have an EOL account&#039;&#039;&#039; yet, you can &#039;&#039;&#039;[http://webapp.etsi.org/createaccount/ request an EOL account]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
* If you are an &#039;&#039;&#039;individual contributor&#039;&#039;&#039;, you can &#039;&#039;&#039;[https://osm.etsi.org/index2.php?page=page_register.php create your OSM account online]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you need any help, contact us at [mailto:OSMsupport@etsi.org OSMsupport@etsi.org]&lt;br /&gt;
&lt;br /&gt;
= Report a bug on Bugzilla =&lt;br /&gt;
# Go to the OSM Portal and click on &#039;&#039;&#039;Bugzilla&#039;&#039;&#039; menu on the portal menu bar. Or simply go to [https://osm.etsi.org/bugzilla OSM Bugzilla]&lt;br /&gt;
# Click on &amp;quot;new&amp;quot; on Bugzilla menu bar.&lt;br /&gt;
# Choose the product, e.g. &amp;quot;OSM&amp;quot;.&lt;br /&gt;
# Complete the bug form. If you know, choose the component, e.g. UI, SO, RO, Documentation/Wiki, etc.&lt;br /&gt;
# Enter the bug summary, description, attachement, etc.&lt;br /&gt;
# Click on the &amp;quot;Submit Bug&amp;quot; button to confirm.&lt;br /&gt;
# A bug id is generated (e.g. Bug 6 -Small Error)&lt;br /&gt;
&lt;br /&gt;
= Clone your project =&lt;br /&gt;
# Clone a &#039;&#039;&#039;git&#039;&#039;&#039; repository, for example: &amp;lt;pre&amp;gt; git clone https://osm.etsi.org/gerrit/osm/RO.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Enter your username&lt;br /&gt;
# Enter you password&lt;br /&gt;
# It is mandatory to install the Gerrit commit-msg hook for the cloned repository in order to automatically insert a Change-Id tag in commit messages. You can install it by entering the following command for RO repository &amp;lt;pre&amp;gt; curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg &amp;lt;/pre&amp;gt; You then need to make the hook executable &amp;lt;pre&amp;gt; chmod u+x RO/.git/hooks/commit-msg &amp;lt;/pre&amp;gt;  More information about the Gerrit commit-msg hook can be found here https://git.eclipse.org/r/Documentation/cmd-hook-commit-msg.html&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &lt;br /&gt;
* You can find all the project repository URLs on &#039;&#039;&#039;[https://osm.etsi.org/gitweb/ Gitweb]&#039;&#039;&#039; or on &#039;&#039;&#039;[https://osm.etsi.org/gerrit/ Gerrit]&#039;&#039;&#039;&lt;br /&gt;
** On Gitweb&lt;br /&gt;
**# Click on &#039;&#039;&#039;Gitweb&#039;&#039;&#039; menu on the portal menu bar.&lt;br /&gt;
**# Select a product to see the available cloning URLs&lt;br /&gt;
** On Gerrit&lt;br /&gt;
**# Click on &#039;&#039;&#039;Gerrit&#039;&#039;&#039; menu on the portal menu bar.&lt;br /&gt;
**# Click on &amp;quot;Projects&amp;quot; menu on the Gerrit menu bar.&lt;br /&gt;
**# Click on &amp;quot;List&amp;quot; menu.&lt;br /&gt;
**# Select a product to see the available cloning URLs.&lt;br /&gt;
&lt;br /&gt;
= Configure your Git environment =&lt;br /&gt;
# Configure your git username globally: &amp;lt;pre&amp;gt; git config --global user.name &amp;lt;username&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Configure your git email address:  &amp;lt;pre&amp;gt; git config --global user.email &amp;lt;email&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your git configuration:  &amp;lt;pre&amp;gt; git config --list &amp;lt;/pre&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;Note: Your email address will be visible on commits to Git. &lt;br /&gt;
 If you&#039;d like to keep your email address private, you can mask your email as follows:&lt;br /&gt;
 if your email is &amp;lt;name@company.com&amp;gt; you can set user.email to &amp;lt;hidden@company.com&amp;gt;&lt;br /&gt;
 This allows other users to identify you as a contributor (with your user name) and&lt;br /&gt;
 Git Stats to keep track of your company&#039;s contributions (with the email domain)&lt;br /&gt;
&lt;br /&gt;
In case you are using git in the same computer for other open source projects, you can restrict your git variables to the local folder: &amp;lt;pre&amp;gt;git config --local user.name &amp;lt;username&amp;gt;&lt;br /&gt;
git config --local user.email &amp;lt;email&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= License Headers = &lt;br /&gt;
Newly contributed Source Code should be licensed under the [https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 license]. A [https://osm.etsi.org/gitweb/?p=osm/LCM.git;a=blob_plain;f=LICENSE;hb=HEAD LICENSE] file shall exist at he root of the repository and all source files should have the following LICENSE header:&lt;br /&gt;
&lt;br /&gt;
 # Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 # you may not use this file except in compliance with the License.&lt;br /&gt;
 # You may obtain a copy of the License at&lt;br /&gt;
 #&lt;br /&gt;
 #    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 #&lt;br /&gt;
 # Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 # distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or&lt;br /&gt;
 # implied.&lt;br /&gt;
 # See the License for the specific language governing permissions and&lt;br /&gt;
 # limitations under the License.&lt;br /&gt;
&lt;br /&gt;
= Commit changes to your local project =&lt;br /&gt;
# Go to the &amp;quot;RO&amp;quot; folder &amp;lt;pre&amp;gt;cd osm/RO&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Make some changes on the source (e.g. add a line to the &amp;quot;example-file&amp;quot;)&lt;br /&gt;
# Stage the change. &amp;lt;pre&amp;gt; git add example-file &amp;lt;/pre&amp;gt; &lt;br /&gt;
# Commit the change to your local repository. You can add a bug id in your commit message to link the bug to your contribution  &amp;lt;pre&amp;gt; git commit -s -m &amp;quot;Bug 2 fixed!!&amp;quot;  &amp;lt;/pre&amp;gt; &lt;br /&gt;
# You can see your commit message and update it, if needed, using the following command: &amp;lt;pre&amp;gt;git commit --amend &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Developer&#039;s Certificate of Origin== &lt;br /&gt;
* The &amp;quot;-s&amp;quot; parameter enables to Sign the contribution. It adds the following line at the end of your commit message: &lt;br /&gt;
&amp;lt;pre&amp;gt;   Signed-off-by: Random J Developer &amp;lt;random@developer.example.org&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as a open-source patch. The rules are pretty simple: signing a contribution means that you can certify the below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        Developer&#039;s Certificate of Origin 1.1&lt;br /&gt;
&lt;br /&gt;
        By making a contribution to this project, I certify that:&lt;br /&gt;
&lt;br /&gt;
        (a) The contribution was created in whole or in part by me and I&lt;br /&gt;
            have the right to submit it under the open source license&lt;br /&gt;
            indicated in the file; or&lt;br /&gt;
&lt;br /&gt;
        (b) The contribution is based upon previous work that, to the best&lt;br /&gt;
            of my knowledge, is covered under an appropriate open source&lt;br /&gt;
            license and I have the right under that license to submit that&lt;br /&gt;
            work with modifications, whether created in whole or in part&lt;br /&gt;
            by me, under the same open source license (unless I am&lt;br /&gt;
            permitted to submit under a different license), as indicated&lt;br /&gt;
            in the file; or&lt;br /&gt;
&lt;br /&gt;
        (c) The contribution was provided directly to me by some other&lt;br /&gt;
            person who certified (a), (b) or (c) and I have not modified&lt;br /&gt;
            it.&lt;br /&gt;
&lt;br /&gt;
        (d) I understand and agree that this project and the contribution&lt;br /&gt;
            are public and that a record of the contribution (including all&lt;br /&gt;
            personal information I submit with it, including my sign-off) is&lt;br /&gt;
            maintained indefinitely and may be redistributed consistent with&lt;br /&gt;
            this project or the open source license(s) involved.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Push your contribution to Gerrit =&lt;br /&gt;
== Push your contribution to Gerrit using git push ==&lt;br /&gt;
1. To avoid merge conflicts, it is recommended to do a pull with rebase before pushing your contribution in order to merge latest changes made by other users.&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: you can force git to use always the --rebase option with:&lt;br /&gt;
 git config --local pull.rebase true&lt;br /&gt;
&lt;br /&gt;
2. Push your commits to &#039;&#039;&#039;Gerrit&#039;&#039;&#039; for Code Review using the following command:&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
 #use &#039;v1.0&#039; instead of &#039;master&#039; for contributing to v1.0 branch&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: you can also configure git to push always to the desired branch.&lt;br /&gt;
 git config --local remote.origin.push HEAD:refs/for/master&lt;br /&gt;
 git config --local remote.origin.push HEAD:refs/for/v1.0&lt;br /&gt;
&lt;br /&gt;
3. Enter your username.&lt;br /&gt;
&lt;br /&gt;
4. Enter your password.&lt;br /&gt;
&lt;br /&gt;
5. You can review your contribution on &#039;&#039;&#039;Gerrit&#039;&#039;&#039; web interface&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The following actions are execution automatically after pushing any contribution to Gerrit: &lt;br /&gt;
** &#039;&#039;&#039;Gerrit&#039;&#039;&#039; reports the new contribution state to the corresponding bug in &#039;&#039;&#039;Bugzilla&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Gerrit&#039;&#039;&#039; notifies &#039;&#039;&#039;Jenkins&#039;&#039;&#039; to build the new contribution.&lt;br /&gt;
&lt;br /&gt;
== Push your contribution to Gerrit using git review ==&lt;br /&gt;
Instead of using &amp;quot;git push&amp;quot;, you could use &amp;quot;git review&amp;quot;. Follow this guide ([[Using git-review to push and review changes]]) to install and configure git-review. You will also have to set the SSH URL for your remote and copy the commit-msg hook.&lt;br /&gt;
* To avoid merge conflicts, it is recommended to do a pull with rebase before pushing your contribution.&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
* Then, send your contribution to gerrit:&lt;br /&gt;
 git review -c&lt;br /&gt;
&lt;br /&gt;
= Gerrit Notifications =&lt;br /&gt;
Gerrit sends email notifications to:&lt;br /&gt;
*Owner of the change&lt;br /&gt;
*Reviewers of the change&lt;br /&gt;
*Project watchers &lt;br /&gt;
&lt;br /&gt;
Each user can configure his own watched projects and branches in the &amp;quot;settings/watched project&amp;quot; menu. Email notifications can be sent for New Changes, New Patch Sets, All Comments, Submitted Changes and  Abandoned Changes.&lt;br /&gt;
&lt;br /&gt;
Link: [https://osm.etsi.org/gerrit/#/settings/projects https://osm.etsi.org/gerrit/#/settings/projects] (you can navigate there from the Gerrit console by clicking on the arrow by your login on the top right corner)&lt;br /&gt;
&lt;br /&gt;
= Continuous Integration =&lt;br /&gt;
# &#039;&#039;&#039;Jenkins&#039;&#039;&#039; builds, tests the new contribution, and reports the result on its web interface.&lt;br /&gt;
# &#039;&#039;&#039;Jenkins&#039;&#039;&#039; votes on the contribution using &#039;&#039;&#039;“Code-Verif”&#039;&#039;&#039; (-1, +1) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Code Review =&lt;br /&gt;
# Other &#039;&#039;&#039;contributors&#039;&#039;&#039; and &#039;&#039;&#039;MDG Committers&#039;&#039;&#039; can comment the new contribution and vote using &#039;&#039;&#039;“Code-Review”&#039;&#039;&#039; (-1, 0, +1) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
# The &#039;&#039;&#039;MDG Leader&#039;&#039;&#039; can comment the new contribution and votes using &#039;&#039;&#039;“Code-Review”&#039;&#039;&#039; (-2, -1, 0, +1, +2) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Amending a contribution in Gerrit =&lt;br /&gt;
Before amending, make sure that you have the commit-msg hook installed in your local repo. For instance, if your user is &amp;quot;user&amp;quot; and the repo is the &amp;quot;devops&amp;quot; repo, the command to install the commit-msg hook would be:&lt;br /&gt;
 $ scp -p -P 29418 user@osm.etsi.org:hooks/commit-msg devops/.git/hooks/&lt;br /&gt;
&lt;br /&gt;
In that way, all patches will use the same Change Id, thus guaranteeing that they will be associated to the same change.&lt;br /&gt;
&lt;br /&gt;
NOTE: If you don&#039;t setup your environment as above, and would like to update a gerrit review with your new/updated code, you MUST have the Change-Id (of the existing gerrit review) inside the commit message. If the commit update does not contain the Change-Id, the commit will will end up creating a new gerrit review, and your subsequent gerrit review will need to be abandoned (not ideal).&lt;br /&gt;
&lt;br /&gt;
== Amending your last change/commit pushed to Gerrit ==&lt;br /&gt;
1. Get the latest changes from the repo and rebase your changes on top&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
2. Fix the code and any conflicts that might have appeared after pulling the code.&lt;br /&gt;
&lt;br /&gt;
3. Add all updated files to the index.&lt;br /&gt;
 git add &amp;lt;file&amp;gt; &lt;br /&gt;
&lt;br /&gt;
4. Amend your commit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
 git commit --amend&lt;br /&gt;
&lt;br /&gt;
5. Submit your change back to the repository. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending one of your changes which has dependencies on subsequent changes==&lt;br /&gt;
This procedure will only work if you are the only person working on a set of commits and you don&#039;t expect others to push commits and rebase them to be dependent on yours.&lt;br /&gt;
&lt;br /&gt;
1. Run &#039;git status&#039; on the branch to know how many commits you are ahead of origin. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git status&lt;br /&gt;
 On branch master&lt;br /&gt;
 Your branch is ahead of &#039;origin/master&#039; by 3 commits.&lt;br /&gt;
&lt;br /&gt;
2. Do an interactive rebase over the last X commits and specify which commit you want to amend by changing the command of the commit from &amp;quot;pick&amp;quot; to &amp;quot;edit&amp;quot;. Use &amp;quot;drop&amp;quot; to abandon. Re-order the lines to put commits on a different order. &lt;br /&gt;
 git rebase -i HEAD~3&lt;br /&gt;
  edit 0ab17ad Change in file1&lt;br /&gt;
  pick 4995f46 Second change&lt;br /&gt;
  pick baa85bf Third change&lt;br /&gt;
&lt;br /&gt;
3. Fix the code in the commit, add the files, amend the commit, and continue rebasing:&lt;br /&gt;
 vi file1.txt            #Fix the code&lt;br /&gt;
 git add file1.txt&lt;br /&gt;
 git commit --amend&lt;br /&gt;
 git rebase --continue&lt;br /&gt;
&lt;br /&gt;
4. In case of conflicts with subsequent commits, you will have to solve them, and continue rebasing&lt;br /&gt;
 vi file1.txt            #Fix the conflict&lt;br /&gt;
 git add file1.txt       #Add the files to the staging area; no commit is required.&lt;br /&gt;
 git rebase --continue&lt;br /&gt;
&lt;br /&gt;
5. Repeat step 4 as many times as required, until rebase finishes. You can cancel the whole operation at any moment with &amp;quot;git rebase --abort&amp;quot;&lt;br /&gt;
&lt;br /&gt;
6. Rebase your contribution before pushing&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
7. Push your changes to gerrit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending a change of another author using git ==&lt;br /&gt;
When amending code from a different author, reviewer and original author should be coordinated in order to make sure that changes made by the reviewer are not reverted by the original author later. For that reason, it is recommended to avoid using the local copy of the branch. Instead, it is recommended to create a new local branch to work on every specific change, following the procedure below:&lt;br /&gt;
&lt;br /&gt;
1. Get the last code from the repository.&lt;br /&gt;
 git fetch origin&lt;br /&gt;
&lt;br /&gt;
2. Create a new branch to work on the code from the remote branch. You can use the review number and patchset as name. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git checkout -b &amp;lt;review-number&amp;gt;-&amp;lt;patchset&amp;gt; origin/master&lt;br /&gt;
&lt;br /&gt;
3. Pull the patch on the created branch. (To find the command to execute you can open the corresponding change page on Gerrit UI, click on download menu, then copy the &amp;quot;pull&amp;quot; command.)&lt;br /&gt;
 git pull &amp;lt;url&amp;gt; &amp;lt;ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Fix the code.&lt;br /&gt;
&lt;br /&gt;
5. Add all updated files to the index.&lt;br /&gt;
 git add &amp;lt;file&amp;gt; &lt;br /&gt;
&lt;br /&gt;
6. Amend the commit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
 git commit --amend&lt;br /&gt;
&lt;br /&gt;
7. Rebase your contribution before pushing&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
8. Submit your change back to the repository. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending a change of another author using git-review ==&lt;br /&gt;
1. Follow the instructions in &#039;&#039;&#039;[[Using git-review to push and review changes|this link]]&#039;&#039;&#039; to install and configure git-review.&lt;br /&gt;
&lt;br /&gt;
2. Download the change with git-review&lt;br /&gt;
 $ git review -d 1280&lt;br /&gt;
 Downloading refs/changes/80/1280/1 from gerrit&lt;br /&gt;
 Switched to branch &amp;quot;review/garciadeblas/1280&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will download the change, put it in a branch called review/AUTHOR/change (if the change has no tag, the sequence number will be used instead), and switch to that branch.&lt;br /&gt;
&lt;br /&gt;
3. After that, you can amend the downloaded change to improve it. Finally, push it again:&lt;br /&gt;
 $ git add                         # add the changes&lt;br /&gt;
 $ git commit --amend              # do not touch the Change-Id. The Change-Id is the way for gerrit to keep track what belongs to what development stream as a new patch set.&lt;br /&gt;
 $ git commit --amend --author     # if you want to mark the changes as yours.&lt;br /&gt;
 $ git review -c -R                # The -R is important, since it tells git-review to not rebase your change against master.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
&lt;br /&gt;
4. Delete the branch once you have finished:&lt;br /&gt;
 $ git branch -D review/garciadeblas/1280&lt;br /&gt;
&lt;br /&gt;
= Merging the contribution =&lt;br /&gt;
# The &#039;&#039;&#039;MDG Leader&#039;&#039;&#039; can &amp;quot;Submit&amp;quot; the change only if +1 &#039;&#039;&#039;&amp;quot;Code-Verif&amp;quot;&#039;&#039;&#039; (from &#039;&#039;&#039;Jenkins&#039;&#039;&#039;) and at least one +2 &#039;&#039;&#039;&amp;quot;Code-Review&amp;quot;&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Gerrit&#039;&#039;&#039; reports the result of the code review to the corresponding bug in &#039;&#039;&#039;Bugzilla&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Fixing the author name / email =&lt;br /&gt;
* Did you commit your changes with a wrong user name? Don&#039;t panic, see how [https://www.everythingcli.org/git-like-a-pro-rewrite-author-history/ this can be fixed]&lt;br /&gt;
&lt;br /&gt;
= OSM CI/CD =&lt;br /&gt;
[[File:OSM_CI-CD_workflow.png|700px|OSM CI/CD Workflow]]&lt;br /&gt;
&lt;br /&gt;
[https://osm.etsi.org/wikipub/images/1/16/OSM_CI-CD_pipeline.pdf Learn more]&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4434</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4434"/>
		<updated>2019-04-09T11:15:57Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # mandatory. Maps NSD  constituent-vnfd.member-vnf-index&lt;br /&gt;
primitive: str           # mandatory. Maps VNFD.vnf-configuration.config-primitive.name&lt;br /&gt;
primitive_params: dict   # optional. Maps VNFD.vnf-configuration.config-primitive.parameter&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4425</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4425"/>
		<updated>2019-03-28T13:28:16Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content to executing a primitive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
member_vnf_index: str    # mandatory. Maps NSD  constituent-vnfd.member-vnf-index&lt;br /&gt;
primitive: str           # mandatory. Maps VNFD.vnf-configuration.config-primitive.name&lt;br /&gt;
params: dict             # optional. Maps VNFD.vnf-configuration.config-primitive.parameter&lt;br /&gt;
   param: value&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4424</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4424"/>
		<updated>2019-03-27T18:41:06Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory only if http header does not contain Authorization. &#039;project&#039; can be provided, if not, first project of available for this user is assigned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo_for_RO_Module&amp;diff=4405</id>
		<title>Developer HowTo for RO Module</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo_for_RO_Module&amp;diff=4405"/>
		<updated>2019-03-22T10:29:13Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Getting Started==&lt;br /&gt;
The RO Module of OSM is implemented by openmano. The recommended Linux distribution for development is Ubuntu 16.04 LTS Server. PyCharm is a nice and easy to use tool for development and debugging.&lt;br /&gt;
&lt;br /&gt;
The step [[Release_1_Installation]] installs all OSM modules in containers. However, for development, a virtual machine may be more suitable. To install the openmano module you can run a script that installs the required packages, clone the project from &#039;&#039;git clones https://osm.etsi.org/gerrit/osm/RO&#039;&#039; and configures openmano client and other utility scripts at path&lt;br /&gt;
 wget -O install-openmano.sh &amp;quot;https://osm.etsi.org/gitweb/?p=osm/RO.git;a=blob_plain;f=scripts/install-openmano.sh&amp;quot;&lt;br /&gt;
 chmod +x install-openmano.sh&lt;br /&gt;
 sudo ./install-openmano.sh -q --develop   #-h for help&lt;br /&gt;
&lt;br /&gt;
See also and follow [[Workflow_with_OSM_tools#Clone_your_project]]&lt;br /&gt;
&lt;br /&gt;
New code features must be incorporated to master:&lt;br /&gt;
 git checkout master&lt;br /&gt;
Generate a &amp;quot;.gitignore&amp;quot;, you can use the &#039;&#039;.gitignore-common&#039;&#039; example that skips PyCharm and Eclipse files&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
 #edit to include your local files to ignore&lt;br /&gt;
Prepare your git environment to push with a proper user/email, push to gerrit. See and configure:&lt;br /&gt;
&amp;lt;p&amp;gt;[[Workflow_with_OSM_tools#Configure_your_Git_environment]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[[Workflow_with_OSM_tools#Commit_changes_to_your_local_project]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[[ Workflow_with_OSM_tools#Push_your_contribution_to_Gerrit]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Programming Language==&lt;br /&gt;
The RO module uses Python2. However Python3 conventions for a future migration must be used as far as possible. For example:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! BAD Python2&lt;br /&gt;
! OK  Python2 compatible with python3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;format test string %s number %d&amp;quot; % (st, num)&lt;br /&gt;
| &amp;quot;format test string {} number {}&amp;quot;.format(st, num)&lt;br /&gt;
|-&lt;br /&gt;
| print a, b, c&lt;br /&gt;
| print(a,b,c)&lt;br /&gt;
|-&lt;br /&gt;
| except Exception, e&lt;br /&gt;
| except Exception as e&lt;br /&gt;
|-&lt;br /&gt;
| if type(x) == X:&lt;br /&gt;
| if isinstance(x,X):&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
In addition, &#039;&#039;&#039;DO NOT USE libraries not compatible with python3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Descriptors can be YAML (prefered because more readable and allow comments) or JSON&lt;br /&gt;
&lt;br /&gt;
==Code Style==&lt;br /&gt;
Please follow PEP8 style guide for all the Python code. Lines up to 120 length&lt;br /&gt;
&lt;br /&gt;
===Logging===&lt;br /&gt;
Use the appropriate logging levels when logging the messages. An example is shown below:&lt;br /&gt;
    self.logger.debug(&amp;quot;Changing state to %s&amp;quot;, next_state)&lt;br /&gt;
&lt;br /&gt;
Logging levels (general and per module) are specified at &#039;&#039;&#039;openmanod.cfg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Try to use few useful logs, not verbose, that brings useful information. For example, in case of fail getting a server, the complete URL should be provided.&lt;br /&gt;
&lt;br /&gt;
Avoid several logs together&lt;br /&gt;
&lt;br /&gt;
  WRONG:&lt;br /&gt;
  self.looger.debug(&amp;quot;Entering in method A&amp;quot;)&lt;br /&gt;
  self.logger.debug(&amp;quot;Contacting server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  RIGHT:&lt;br /&gt;
  self.logger.debug(&amp;quot;method A, contacting server %s&amp;quot;, url)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the traceback is needed(call stack that generate the exception) , use the &amp;quot;exc_info=True&amp;quot; parameter&lt;br /&gt;
  self.logger.error(&amp;quot;Exception %s when ...&amp;quot;, exception, exc_info=True)&lt;br /&gt;
&lt;br /&gt;
===Exceptions===&lt;br /&gt;
Code must be wrote in a way that functions and methods raise an exception when something goes wrong, instead of returning a negative or false value.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  WRONG&lt;br /&gt;
    def get_ip_address():&lt;br /&gt;
        ...&lt;br /&gt;
        if fail:&lt;br /&gt;
            return False, &amp;quot;Fail because xxx&amp;quot;&lt;br /&gt;
        return True, ip&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
    result, ip = get_ip_address()&lt;br /&gt;
    if not result:&lt;br /&gt;
        return False, &amp;quot;Cannot get ip address...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  RIGHT&lt;br /&gt;
    def get_ip_address():&lt;br /&gt;
        ...&lt;br /&gt;
        if fail:&lt;br /&gt;
            raise customException(&amp;quot;Fail because ...&amp;quot;)&lt;br /&gt;
        return ip&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
    try:&lt;br /&gt;
        ip = get_ip_address()&lt;br /&gt;
        ...&lt;br /&gt;
    except customException as e:&lt;br /&gt;
        raise customException2(str(e))&lt;br /&gt;
&lt;br /&gt;
==Directory Organization==&lt;br /&gt;
The code organized into the following high level directories: &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/&#039;&#039;&#039; contains the entry server file &#039;&#039;openmanod&#039;&#039; and client &#039;&#039;openmano&#039;&#039; code &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/osm_ro&#039;&#039;&#039; contains the RO server code files &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/test&#039;&#039;&#039; contains scripts and code for testing &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/database_utils&#039;&#039;&#039; contains scripts for database creation, dumping and migration &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/scripts&#039;&#039;&#039; general scripts, as installation, execution, reporting &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/scenarios&#039;&#039;&#039; examples and templates of network scnario descriptors &amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;/vnfs&#039;&#039;&#039; examples and templates of VNF descriptors &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RO Architecture==&lt;br /&gt;
[[File:OpenmanoArchitecture.png|400px]]&lt;br /&gt;
&lt;br /&gt;
===RO Server modules===&lt;br /&gt;
The RO module contains the following modules&lt;br /&gt;
* &#039;&#039;&#039;openmanod&#039;&#039;&#039; is the main program. It reads the configuration file (openmanod.cfg) and execute the httpserver and wait for the end&lt;br /&gt;
* &#039;&#039;&#039;httpserver.py&#039;&#039;&#039; is a thread that implements the northbound API interface, uses python bottle module. Calls main engine methods to perform the tasks&lt;br /&gt;
* &#039;&#039;&#039;nfvo.py&#039;&#039;&#039; is the main engine, implementing all the methods for the creation, deletion and management of vnfs, scenarios and instances. Operations against a VIM are asynchornous. ACTIONs to be done are stored at database before returning ok to the client&lt;br /&gt;
* &#039;&#039;&#039;nfvo_db.py&#039;&#039;&#039; is the module in charge of database operations. Uses base &#039;&#039;&#039;db_base.py&#039;&#039;&#039;. Database is managed with MySQLdb python library&lt;br /&gt;
* &#039;&#039;&#039;openmano_schemas.py&#039;&#039;&#039; is a dictionary schemas used to validate API request and response content using jsonschema library&lt;br /&gt;
* &#039;&#039;&#039;vim_thread.py&#039;&#039;&#039; There is a thread per VIM and credentials. It performs basic tasks of creating/deleting VM, networks, flavors, etc. In addition it refreshes the VM and network status. It calls vimconn.py methods &lt;br /&gt;
* &#039;&#039;&#039;vimconn.py&#039;&#039;&#039; is the base class for the VIM plugin. It contains the definition of the methods to be implemented. The inherited &#039;&#039;&#039;vimconn_openstack.py&#039;&#039;&#039;, &#039;&#039;&#039;vimconn_openvim.py&#039;&#039;&#039;, &#039;&#039;&#039;vimconn_vmware&#039;&#039;&#039; and &#039;&#039;&#039;vimconn_aws&#039;&#039;&#039; implements the operations against the concrete VIM type. OpenStack plugin uses the python-*client libraries, meanwhile Openvim plugin uses direct http requests.&lt;br /&gt;
* &#039;&#039;&#039;console_proxy_thread.py&#039;&#039;&#039; is a thread that implements a TCP/IP proxy for the console access to a VIM&lt;br /&gt;
&lt;br /&gt;
===RO Client modules===&lt;br /&gt;
Other modules not part of the server are:&lt;br /&gt;
* &#039;&#039;&#039;openmano&#039;&#039;&#039; is a CLI client&lt;br /&gt;
* &#039;&#039;&#039;openmanoclient.py&#039;&#039;&#039; is a client python library for managing openmano server&lt;br /&gt;
&lt;br /&gt;
===ACTIONS and TASKS===&lt;br /&gt;
ACTIONS are a a group of tasks performed against a a concrete instance-scenarios (NS record). The creation and deletion of the instance-scenario itself is an action. As it is asynchonous, NBI returns an &amp;quot;Action_id&amp;quot; that can be used to check the status. For each action, nfvo.py generates individual tasks for the related VIMs. Tasks are both stored at database and sent to the related vim_thread.py. A task has a concrete relation with a VIM, e.g. create/delete a VM, a network, ... look for a flavor, network, ...&lt;br /&gt;
&lt;br /&gt;
===Database content===&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
==Database changes==&lt;br /&gt;
Database schema can be changed if needed. It is recomended to use a graphical tool (e.g. Heidy) to change database and change it back and copy the SQL commands. Make these steps:&lt;br /&gt;
&lt;br /&gt;
1. openmanod: increment __version__, version_date and database_version&lt;br /&gt;
&lt;br /&gt;
2. database_utils/migrate_mano_db.sh. See the three &amp;quot;TODO&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2a. Increment LAST_DB_VERSION&lt;br /&gt;
&lt;br /&gt;
2b. Annotate a comment to have a track of versions: [ $OPENMANO_VER_NUM -ge 50XX ] &amp;amp;&amp;amp; DB_VERSION=XX  #0.5.XX =&amp;gt;  XX&lt;br /&gt;
&lt;br /&gt;
2c. Generate new methods; function upgrade_to_XX() and function downgrade_from_XX. Insert here the sql commands. Last sql command over schema_version is quite important to detect the database version.&lt;br /&gt;
&lt;br /&gt;
Test several upgrades/downgrades to version 20 with &amp;quot;migrate_mano_db.sh&amp;quot; and &amp;quot;migrate_mano_db.sh 20&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Package dependency osm-im==&lt;br /&gt;
It is under IM repository. It contains the OSM models. Used models at RO are under &amp;lt;IM&amp;gt;/models/yang/vnfd.yang and &amp;lt;IM&amp;gt;/models/yang/nsd.yang. More modules will be incorporated in the future.&lt;br /&gt;
&lt;br /&gt;
When IM is maked, pyangbind generates python source files imported at RO. They are used to validate and load a yaml/json VNFD and NSD catalog descriptor.&lt;br /&gt;
&lt;br /&gt;
Method pybindJSONDecoder.load_ietf_json from pyangbind is used to parse and load the descriptor. A structure of nested YANG classes are generated and used at &amp;lt;RO&amp;gt;/osm_ro/nfvo.py methods new_vnfd_v3 and new_nsd_v3. RO supports backward compatibility with old format descriptors. NBI (osm_ro/httpserver.py) uses .../v3/... at URL to diferenciate between old and new descriptors. CLI (openmano) detects automatically if the descriptor is in old format or in OSM format to send the request to the server using the old URL or the new &amp;quot;v3&amp;quot; URL&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
The OSM binary installation install this package. In case of needed you can install/update it manually by:&lt;br /&gt;
&lt;br /&gt;
  apt-get update&lt;br /&gt;
  apt-get install make git python python-pip tox debhelper python-bitarray python-lxml&lt;br /&gt;
  pip install --upgrade pip&lt;br /&gt;
  # If not inside a container. Use &amp;quot;sudo -HE&amp;quot; to get root privileges for pip installation&lt;br /&gt;
  pip install pyangbind stdeb&lt;br /&gt;
  git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
  make -C IM clean all&lt;br /&gt;
  dpkg -i IM/deb_dist/python-pyang_*.deb&lt;br /&gt;
  dpkg -i IM/deb_dist/python-pyangbind_*.deb&lt;br /&gt;
  dpkg -i IM/deb_dist/python-osm-im_*.deb&lt;br /&gt;
  # Use this line to check if it is installed and where  &lt;br /&gt;
  python -c &#039;import osm_im; print osm_im.__path__[0]&#039;&lt;br /&gt;
&lt;br /&gt;
==Package dependency lib-osm-openvim==&lt;br /&gt;
&lt;br /&gt;
It is under openvim repository. RO uses a library for the SDN assist that is in charge of performing the underlay dataplane connectivity using an openflow controller. osm-openvim and lib-osm-openvim are diffent, though they share same pieces of code. lib-osm-openvim uses a different database name (mano_vim_db) so that openvim can be installed in the same virtual machine or container (openvim uses vim_db database name) &lt;br /&gt;
&lt;br /&gt;
TODO complete where RO uses it&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
The OSM binary installation install this package. In case of needed you can install/update it manually by:&lt;br /&gt;
&lt;br /&gt;
  apt-get update&lt;br /&gt;
  apt-get install make git python tox libmysqlclient-dev&lt;br /&gt;
  git clone https://osm.etsi.org/gerrit/osm/openvim&lt;br /&gt;
  git -C openvim checkout 005a9dc  # this is temporal, because last version contains error at Makefile&lt;br /&gt;
  make -C openvim lite&lt;br /&gt;
  # Use this line to check if it is installed and where  &lt;br /&gt;
  python -c &#039;import lib_osm_openvim; print lib_osm_openvim.__path__[0]&#039;&lt;br /&gt;
  # Install database of ovim library&lt;br /&gt;
  OSMLIBOVIM_PATH=`python -c &#039;import lib_osm_openvim; print lib_osm_openvim.__path__[0]&#039;`&lt;br /&gt;
  # -U and -P are the admin database user/password. Normally &amp;quot;-U root&amp;quot; without password &amp;quot;executed as root&amp;quot;&lt;br /&gt;
  ${OSMLIBOVIM_PATH}/database_utils/install-db-server.sh -U root [-P passwd] -u mano -p manopw -d mano_vim_db --updatedb&lt;br /&gt;
&lt;br /&gt;
==CLI client==&lt;br /&gt;
&lt;br /&gt;
The RO code contains a python CLI (openmano) that allows friently command execution. This CLI client can run on a separate machine where openmano server is running. &amp;quot;openmano config&amp;quot; indicates where the server is (by default localhost)&lt;br /&gt;
&lt;br /&gt;
==Northbound Interface==&lt;br /&gt;
&lt;br /&gt;
The RO uses a REST API with YAML/JSON content. The primitives are explained [[RO Northbound Interface|here]]&lt;br /&gt;
&lt;br /&gt;
==Running Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Launching RO===&lt;br /&gt;
Openmano can run as systemd service. (Can be installed with &#039;&#039;&#039;./scripts/install-openmano-service.sh -f RO&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Or can be run inside a screen (the prefered method for developpers). The script to easily launch/remove is &#039;&#039;&#039;./scripts/service-openmano.sh&#039;&#039;&#039;. Execute with -h to see options&lt;br /&gt;
&lt;br /&gt;
Note that the general OSM install script, installs openmano inside a container and code run at folder /opt/openmano (instead of $HOME/openmano)&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
Many of openmano operations rely on an external VIM. Without external infraestructure it is recomended to use openvim in &amp;quot;test&amp;quot; (fake) mode. Install it in the same machine where openmano is located with [[OpenVIM_installation_(Release_One)#Installation]]&lt;br /&gt;
&lt;br /&gt;
Run &#039;&#039;./test/basictest&#039;&#039; for a initial test. Type -h to see options. For testing using openvim just run &amp;lt;pre&amp;gt; . ./test/basictest.sh --force --screen --init-openvim &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Creating a new VIM plugin==&lt;br /&gt;
&lt;br /&gt;
Choose a name, eg. XXX&lt;br /&gt;
&lt;br /&gt;
Create a new python module vimconn_XXX.py derived from vimconn.py class. Implement the relevant functions. You have several connectors already created to be used as example as openstack and openvim. Openstack connector uses the python openstack client libraries, meanwhile openvim connector uses direct http requests.&lt;br /&gt;
&lt;br /&gt;
DO NOT change the method names, parameters or parameter content. ROuse the same methods for all the VIMs and they cannot be changed to accomodate VIM specifics. VIM specifics must be solved inside the connector.&lt;br /&gt;
&lt;br /&gt;
The new module can need specific configuration for the VIM that it is passed as a dictionary in the &#039;&#039;config&#039;&#039; variable at constructor. For example, in the case of openstack, &#039;&#039;config&#039;&#039; variable is used for: enabling/disabling port_security_enable, specifying the name of the physical network used for dataplane, regions, etc. The &#039;&#039;config&#039;&#039; variable is the right place to specify those needed parameters not provided by ROat the methods that form part of the VIM configuration. See [[Openstack configuration (Release FIVE)#Add openstack toOSM]] and [[Configuring AWS for OSM Release TWO#Add AWS to OSM]] for examples &lt;br /&gt;
&lt;br /&gt;
For integration with the main project, it is needed to add the new vitype to dictionary &amp;quot;vim_module&amp;quot; at file &amp;quot;osm_ro/vim_thread.py&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    openmano tenant-create osm  # if not already done&lt;br /&gt;
    export OPENMANO_TENANT=osm&lt;br /&gt;
    openmano datacenter-create &amp;lt;vim-name&amp;gt; &amp;lt;access-URL&amp;gt;  --type=XXX --config &amp;lt;specific config&amp;gt;&lt;br /&gt;
    # if fails the cause can be a library you need not installed or an error upon importing. Try tho import it in a python client&lt;br /&gt;
    # example of &amp;lt;specific config&amp;gt; text: &amp;quot;{dataplane_physical_net: physnet_sriov, port_security_enabled: False}&amp;quot;&lt;br /&gt;
    openmano datacenter-attach &amp;lt;vim-name&amp;gt; --vim-tenant-name=&amp;lt;tenant-to-use-by-openmano&amp;gt; --user=&amp;lt;tenant-user&amp;gt; --password=&amp;lt;tenant-password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test it using the &#039;&#039;&#039;test/test_RO.py&#039;&#039;&#039; file:&lt;br /&gt;
    # Create manually an image &amp;lt;image&amp;gt; and a management network &amp;lt;net-mgmt&amp;gt; at your VIM&lt;br /&gt;
    ./test/test_RO.py deploy --help&lt;br /&gt;
    # e.g. ./test/test_RO.py deploy -n &amp;lt;net-mgmt&amp;gt; -t osm -i &amp;lt;image&amp;gt; -d &amp;lt;vim-name&amp;gt; --timeout=30 --test simple_linux,simple_multi_vnfc,simple_2_vnf&lt;br /&gt;
    ./test/test_RO.py vimconn --help&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4353</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4353"/>
		<updated>2019-03-05T11:02:50Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages IM, common:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 # pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Additionally you may want that docker &#039;light-ui&#039; uses your local copy of NBI. Edit again file &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;light-ui&#039; section the required IP address from docker to the VM:&lt;br /&gt;
&lt;br /&gt;
 OSM_SERVER: &amp;lt;172.17.0.1&amp;gt;    # nbi&lt;br /&gt;
 # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
Clone and install needed NBI packages &lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4316</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4316"/>
		<updated>2019-02-28T12:48:24Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* 7 Expose needed ports of docker services */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;. Note: for kafka sometimes this is not enough and other modules has errrors connecting to kafka controller. If this is the case modify docker-compose adding kafka bus and relaunch service&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4315</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4315"/>
		<updated>2019-02-28T12:46:20Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* NBI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 cd ../../..&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 # sudo apt-get install python3-keystoneclient&lt;br /&gt;
 # pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4314</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4314"/>
		<updated>2019-02-28T12:38:03Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* LCM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; and &#039;&#039;&#039;kafka&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4313</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4313"/>
		<updated>2019-02-28T12:31:58Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* 7 Expose needed ports of docker services */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
... And , &#039;&#039;kafka&#039;&#039;&#039; (service osm_kafka) needed for LCM, NBI uses ports &amp;quot;9092:9092&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4312</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4312"/>
		<updated>2019-02-28T12:30:41Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* LCM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM packages if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
Cone and install LCM depencencies&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file. See [[Developer_HowTo#5 Configure it to interact with other modules]]&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4311</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4311"/>
		<updated>2019-02-28T12:14:12Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* LCM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules if not done:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4310</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4310"/>
		<updated>2019-02-28T12:07:29Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* 6 Install needed packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
Install them with &lt;br /&gt;
 pip3 install -e common --user  # needed for LCM, NBI&lt;br /&gt;
 pip3 install -e N2VC --user  # needed for LCM&lt;br /&gt;
 pip3 install -e IM --user  # needed for NBI&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp RO/.gitignore-common RO/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4309</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4309"/>
		<updated>2019-02-27T14:55:23Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory if http header does not contain Authorization, &#039;project&#039; cab be provided, if not, first project of available for this user is assgned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
** Example of content: &#039;{scaleType: SCALE_VNF, scaleVnfData: {scaleVnfType: SCALE_OUT, scaleByStepData: {member-vnf-index: &amp;lt;nsd:constituent-vnfd:member-vnf-index&amp;gt;, scaling-group-descriptor: &amp;lt;vnfd:scaling-group-descriptor:name&amp;gt;} } }&#039;   # Use SCALE_IN instead of SCALE OUT depending of desired type. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=OSM_Release_FIVE&amp;diff=4308</id>
		<title>OSM Release FIVE</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=OSM_Release_FIVE&amp;diff=4308"/>
		<updated>2019-02-27T13:24:32Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:6hackdate.png|350px|right|top|link=https://osm.etsi.org/wikipub/index.php/6th_OSM_Hackfest]]  &lt;br /&gt;
&lt;br /&gt;
Open Source MANO (OSM) is an ETSI-hosted open source community delivering a production-quality MANO stack for NFV, capable of consuming openly published information models, available to everyone, suitable for all VNFs, operationally significant and VIM-independent. OSM is aligned to NFV ISG information models while providing first-hand feedback based on its implementation experience.&lt;br /&gt;
&lt;br /&gt;
Release FIVE brings a number of improvements over previous releases. For the full list of new features, please refer to the Rel FIVE White Paper or the [[OSM Release FIVE Documentation]]. For a comprehensive overview of OSM functionalities, you can also refer to the release notes of former releases ([https://osm.etsi.org/images/OSM-Whitepaper-TechContent-ReleaseONE-FINAL.pdf ONE], [https://osm.etsi.org/images/OSM-Whitepaper-TechContent-ReleaseTWO-FINAL.pdf TWO], [https://osm.etsi.org/images/OSM-Whitepaper-TechContent-ReleaseTHREE-FINAL.pdf THREE],&lt;br /&gt;
[https://osm.etsi.org/images/OSM-Whitepaper-TechContent-ReleaseFOUR-FINAL.pdf FOUR]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OSM in Practice&#039;&#039;&#039;&lt;br /&gt;
{{#evu:https://www.youtube.com/watch?v=kCFxPV67Adw&lt;br /&gt;
|alignment=left&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Assumptions about interaction with VIMs and VNFs=&lt;br /&gt;
The following figure illustrates OSM interaction with VIMs and VNFs:&lt;br /&gt;
* OSM talks to the VIM for the deployment of VNFs and VLs connecting them&lt;br /&gt;
* OSM talks to the VNFs deployed in a VIM to run day-0, day-1 and day-2 configuration primitives.&lt;br /&gt;
&lt;br /&gt;
[[File:Osmtopology.png|600px|OSM Release 4]]&lt;br /&gt;
&lt;br /&gt;
In order for OSM to work, it is assumed that:&lt;br /&gt;
* Each VIM has an API endpoint reachable from OSM&lt;br /&gt;
* Each VIM has a so called management network which provides IP address to VNFs&lt;br /&gt;
* That management network is reachable from OSM&lt;br /&gt;
&lt;br /&gt;
=Install OSM Release FIVE=&lt;br /&gt;
&lt;br /&gt;
This release expands the cloud-native, &#039;&#039;dockerized&#039;&#039; OSM installation with the kafka bus for asynchronous communications, a lighter orchestrator with Network Services and Slicing capabilities, performance/fault/policy management features, a SOL005-aligned NBI, an enhanced GUI with a service composer, and OSM client leveraging the unified and improved REST API that the NBI exposes.&lt;br /&gt;
&lt;br /&gt;
== Default installation procedure ==&lt;br /&gt;
&lt;br /&gt;
All you need to run OSM Release FIVE is a single server or VM with the following requirements:&lt;br /&gt;
* MINIMUM: 2 CPUs, 4 GB RAM, 20GB disk and a single interface with Internet access&lt;br /&gt;
* RECOMMENDED: 2 CPUs, 8 GB RAM, 40GB disk and a single interface with Internet access&lt;br /&gt;
* Ubuntu16.04 (64-bit variant required) as base image (http://releases.ubuntu.com/16.04/)&lt;br /&gt;
&lt;br /&gt;
Once you have prepared the host with the previous requirements, all you need to do is:&lt;br /&gt;
 wget https://osm-download.etsi.org/ftp/osm-5.0-five/install_osm.sh&lt;br /&gt;
 chmod +x install_osm.sh&lt;br /&gt;
 ./install_osm.sh&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TIP:&#039;&#039;&#039; In order to facilitate potential trobleshooting later, it is recommended to save the full log of your installation process:&lt;br /&gt;
 wget https://osm-download.etsi.org/ftp/osm-5.0-five/install_osm.sh&lt;br /&gt;
 chmod +x install_osm.sh&lt;br /&gt;
 ./install_osm.sh 2&amp;gt;&amp;amp;1 | tee osm_install_log.txt&lt;br /&gt;
&lt;br /&gt;
You will be asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements. Please answer &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Then, some dialog messages related to LXD configuration will be shown. This is what you have to answer:&lt;br /&gt;
* Do you want to configure the LXD bridge? &#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
* Do you want to setup an IPv4 subnet? &#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&amp;lt;&amp;lt; &#039;&#039;&#039;Default values&#039;&#039;&#039; apply for next questions &amp;gt;&amp;gt;&#039;&#039;&lt;br /&gt;
* Do you want to setup an IPv6 subnet? &#039;&#039;&#039;No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want to run docker commands, you will also need to either reload the shell or run the following command to add your user to the &#039;docker&#039; group:&lt;br /&gt;
 newgrp docker&lt;br /&gt;
&lt;br /&gt;
===Installation including optional components===&lt;br /&gt;
&lt;br /&gt;
You can include optional components in your installation by adding the following flags:&lt;br /&gt;
* &#039;&#039;&#039;VIM Emulator:&#039;&#039;&#039; --vimemu (more information [[VIM emulator|here]])&lt;br /&gt;
* &#039;&#039;&#039;Performance Management additional stack (Grafana only):&#039;&#039;&#039; --pm_stack (more information [[OSM Performance Management|here]])&lt;br /&gt;
* &#039;&#039;&#039;Fault Management features with ELK:&#039;&#039;&#039; --elk_stack (more information [[OSM Fault Management|here]])&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ./install_osm.sh --elk_stack --pm_stack --vimemu&lt;br /&gt;
&lt;br /&gt;
===Other installation options===&lt;br /&gt;
* You can also run OSM using a pre-built [https://app.vagrantup.com/osm/boxes/releasefive vagrant] image: [[How_to_run_OSM_on_Vagrant]]&lt;br /&gt;
* For other special installation options, please refer to the [[OSM_Release_FIVE_Documentation#Alternative_installation_methods | release documentation]].&lt;br /&gt;
&lt;br /&gt;
==Checking your installation==&lt;br /&gt;
&lt;br /&gt;
After some time, you will get a fresh OSM Release FIVE installation with its latest, pre-built docker images which are built daily. You can access to the UI in the following URL (user:admin, password: admin):  http://1.2.3.4, replacing 1.2.3.4 with the IP address of your host. &lt;br /&gt;
&lt;br /&gt;
[[File:Osm_lwb_ui_login.png|600px|OSM home]]&lt;br /&gt;
&lt;br /&gt;
[[File:Osm_lwb_ui.png|600px|OSM Release FIVE installation result]]&lt;br /&gt;
&lt;br /&gt;
As a result of the installation, thirteen docker containers are created in the host (without considering optional stacks).  You can check they are running by issuing the following commands:&lt;br /&gt;
 docker stack ps osm |grep -i running&lt;br /&gt;
 docker service ls&lt;br /&gt;
&lt;br /&gt;
[[File:Osm_containers_rel5.png|600px|OSM Docker containers]]&lt;br /&gt;
&lt;br /&gt;
At any time, you can quickly relaunch your deployment by using the pre-built docker images, like this:&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60 # The sleep is for making sure the stack removal finishes before redeploying&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
To check the logs of any container:&lt;br /&gt;
 docker service logs osm_lcm         # for LCM&lt;br /&gt;
&lt;br /&gt;
OSM client, a python-based CLI for OSM, will be available as well in the host machine.&lt;br /&gt;
Via the OSM client, you can manage descriptors, NS and VIM complete lifecycle.&lt;br /&gt;
&lt;br /&gt;
=Adding VIM accounts=&lt;br /&gt;
Before proceeding, make sure that you have a site with a VIM configured to run with OSM. Different kinds of VIMs are currently supported by OSM:&lt;br /&gt;
*&#039;&#039;&#039;OpenVIM.&#039;&#039;&#039; Check the following link to know how to install and use openvim for OSM: [[OpenVIM installation | OpenVIM installation]]. Openvim must run in &#039;normal&#039; mode (not test or fake) to have real virtual machines reachable from OSM.&lt;br /&gt;
*&#039;&#039;&#039;OpenStack.&#039;&#039;&#039; Check the following link to learn how to configure OpenStack to be used by OSM: [[Openstack_configuration | Openstack configuration]]&lt;br /&gt;
*&#039;&#039;&#039;VMware vCloud Director.&#039;&#039;&#039; Check the following link to learn how to configure VMware VCD to be used by OSM: [[Configuring_VMware_vCloud_Director | Configuring VMware vCloud Director]]&lt;br /&gt;
*&#039;&#039;&#039;Amazon Web Services (AWS).&#039;&#039;&#039; Check the following link to learn how to configure AWS (EC2 and Virtual Private Cloud) to be used by OSM: [[Configuring_AWS | Configuring AWS for OSM]]&lt;br /&gt;
OSM can manage external SDN controllers to perform the dataplane underlay network connectivity on behalf of the VIM. See [[EPA and SDN assist]]&lt;br /&gt;
&lt;br /&gt;
==Adding VIMs through OSM client==&lt;br /&gt;
===OpenVIM site===&lt;br /&gt;
Execute the following command, using the appropriate parameters (e.g. site name: &amp;quot;openvim-site&amp;quot;, IP address: 10.10.10.10, VIM tenant: &amp;quot;osm&amp;quot;)&lt;br /&gt;
 osm vim-create --name openvim-site --auth_url http://10.10.10.10:9080/openvim --account_type openvim \&lt;br /&gt;
    --description &amp;quot;Openvim site&amp;quot; --tenant osm --user dummy --password dummy&lt;br /&gt;
&lt;br /&gt;
===Openstack site===&lt;br /&gt;
Execute the following command, using the appropriate parameters (e.g. site name: &amp;quot;openstack-site&amp;quot;, IP address: 10.10.10.11, VIM tenant: &amp;quot;admin&amp;quot;, user: &amp;quot;admin&amp;quot;, password: &amp;quot;userpwd&amp;quot;)&lt;br /&gt;
 osm vim-create --name openstack-site --user admin --password userpwd \&lt;br /&gt;
     --auth_url http://10.10.10.11:5000/v2.0 --tenant admin --account_type openstack&lt;br /&gt;
&lt;br /&gt;
For advanced options, please refer to the [[Openstack_configuration#Add_openstack_to_OSM | OpenStack Setup Guide]].&lt;br /&gt;
&lt;br /&gt;
===VMware vCloud Director site===&lt;br /&gt;
*Execute the following command, using the appropriate parameters (e.g. site name: &amp;quot;vmware-site&amp;quot;, IP address: 10.10.10.12, VIM tenant: &amp;quot;vmware-tenant&amp;quot;, user: &amp;quot;osm&amp;quot;, password: &amp;quot;osm4u&amp;quot;, admin user: &amp;quot;admin&amp;quot;, admin password: &amp;quot;adminpwd&amp;quot;, organization: &amp;quot;orgVDC&amp;quot;)&lt;br /&gt;
 osm vim-create --name vmware-site --user osm --password osm4u --auth_url https://10.10.10.12 \&lt;br /&gt;
     --tenant vmware-tenant  --account_type vmware \&lt;br /&gt;
     --config &#039;{admin_username: user, admin_password: passwd, orgname: organization, nsx_manager: &amp;quot;http://10.10.10.12&amp;quot;,&lt;br /&gt;
     nsx_user: user, nsx_password: userpwd,&amp;quot;vcenter_port&amp;quot;: port, &amp;quot;vcenter_user&amp;quot;:user, &amp;quot;vcenter_password&amp;quot;:password,&lt;br /&gt;
     &amp;quot;vcenter_ip&amp;quot;: 10.10.10.14}&#039;&lt;br /&gt;
&lt;br /&gt;
For advanced options, please refer to the [[Configuring_VMware_vCloud_Director#Add_vCloud_using_OSM_Client | vCloud Director Setup Guide]].&lt;br /&gt;
&lt;br /&gt;
===VMware Integrated Openstack (VIO) site===&lt;br /&gt;
Execute the following command, using the appropriate parameters (e.g. site name: &amp;quot;openstack-site-vio4&amp;quot;, IP address: 10.10.10.12, VIM tenant: &amp;quot;admin&amp;quot;, user: &amp;quot;admin&amp;quot;, password: &amp;quot;passwd&amp;quot;)&lt;br /&gt;
 osm vim-create --name VIO --user admin --password passwd --auth_url https://10.10.10.12:5000/v3 --tenant admin \&lt;br /&gt;
     --account_type openstack --config &#039;{use_floating_ip: True, insecure: true, vim_type: VIO, APIversion: v3.3,&lt;br /&gt;
     dataplane_physical_net: dvs-46, &amp;quot;use_internal_endpoint&amp;quot;:true,&amp;quot;dataplane_net_vlan_range&amp;quot;:[&amp;quot;31-35&amp;quot;,&amp;quot;37-39&amp;quot;]}&#039;&lt;br /&gt;
&lt;br /&gt;
With respect to Openstack, the additional configuration for VIO is the following:&lt;br /&gt;
* &#039;&#039;&#039;vim_type&#039;&#039;&#039;: Set to &amp;quot;VIO&amp;quot; to use VMware Integrated openstack as VIM &lt;br /&gt;
* &#039;&#039;&#039;use_internal_endpoint&#039;&#039;&#039;: When true it allows use of private API endpoints&lt;br /&gt;
* &#039;&#039;&#039;dataplane_physical_net&#039;&#039;&#039;: The configured network_vlan_ranges at neutron for the SRIOV (binding direct) and passthrough (binding direct-physical) networks, e.g. &#039;physnet_sriov&#039; in the above configuration. In case of VMware Integrated Openstack (VIO) provide moref ID of distributed virtual switch, e.g &#039;dvs-46&#039; in above configuration.&lt;br /&gt;
* &#039;&#039;&#039;dataplane_net_vlan_range&#039;&#039;&#039;: In case of VMware Integrated Openstack (VIO) provide vlan ranges for the SRIOV (binding direct) networks in format [&#039;start_ID - end_ID&#039;]&lt;br /&gt;
&lt;br /&gt;
For common options, you may refer to the general [[Openstack_configuration#Add_openstack_to_OSM | OpenStack Setup Guide]].&lt;br /&gt;
&lt;br /&gt;
===Amazon Web Services (AWS) site===&lt;br /&gt;
*Execute the following command, using the appropriate parameters (e.g. site name: &amp;quot;aws-site&amp;quot;, VIM tenant: &amp;quot;admin&amp;quot;, user: &amp;quot;XXX&amp;quot;, password: &amp;quot;YYY&amp;quot;)&lt;br /&gt;
 osm vim-create --name aws-site --user XXX --password YYY --auth_url https://aws.amazon.com --tenant admin \&lt;br /&gt;
     --account_type aws --config &#039;{region_name: eu-central-1, flavor_info: {t2.nano: {cpus: 1, disk: 100, ram: 512},&lt;br /&gt;
     t2.micro: {cpus: 1, disk: 100, ram: 1024}, t2.small: {cpus: 1, disk: 100, ram: 2048},&lt;br /&gt;
     m1.small: {cpus: 1, disk: 160, ram: 1741}}}&#039;&lt;br /&gt;
&lt;br /&gt;
For advanced options, please refer to the [[Configuring_AWS#Add_AWS_to_OSM | AWS Setup Guide]].&lt;br /&gt;
&lt;br /&gt;
==Adding VIMs through GUI==&lt;br /&gt;
Just access the &#039;&#039;VIM Accounts&#039;&#039; tab, click the &#039;&#039;New VIM&#039;&#039; button and fill the parameters accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Osmvim.png|600px|AddingVIMUI]]&lt;br /&gt;
&lt;br /&gt;
=Deploying your first Network Service=&lt;br /&gt;
In this example we will deploy the following Network Service, consisting of two simple VNFs based on CirrOS connected by a simple VLD.&lt;br /&gt;
&lt;br /&gt;
[[File:cirros_2vnf_ns.png|500px|NS with 2 CirrOS VNF]]&lt;br /&gt;
&lt;br /&gt;
Before going on, download the required VNF and NS packages from this URL: https://osm-download.etsi.org/ftp/osm-3.0-three/examples/cirros_2vnf_ns/&lt;br /&gt;
&lt;br /&gt;
==Onboarding a VNF==&lt;br /&gt;
&lt;br /&gt;
The onboarding of a VNF in OSM involves adding the corresponding VNF package to the system. This process also assumes, as a pre-condition, that the corresponding VM images are available in the VIM(s) where it will be instantiated.&lt;br /&gt;
&lt;br /&gt;
===Uploading VM image(s) to the VIM(s)===&lt;br /&gt;
In this example, only a vanilla CirrOS 0.3.4 image is need. It can be obtained from the following link: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img&lt;br /&gt;
&lt;br /&gt;
If not available, it would be required to upload the image into the VIM. Instructions differ from one VIM to another:&lt;br /&gt;
*In Openstack:&lt;br /&gt;
 openstack image create --file=&amp;quot;./cirros-0.3.4-x86_64-disk.img&amp;quot; --container-format=bare --disk-format=qcow2 cirros034&lt;br /&gt;
*In OpenVIM:&lt;br /&gt;
 #copy your image to the NFS shared folder (e.g. /mnt/openvim-nfs)&lt;br /&gt;
 cp ./cirros-0.3.4-x86_64-disk.img /mnt/openvim-nfs/&lt;br /&gt;
 openvim image-create --name cirros034 --path /mnt/openvim-nfs/cirros-0.3.4-x86_64-disk.img&lt;br /&gt;
&lt;br /&gt;
===VNF package onboarding===&lt;br /&gt;
&lt;br /&gt;
*From the UI:&lt;br /&gt;
**Go to Projects --&amp;gt; Admin --&amp;gt; VNF Packages (&#039;&#039;Open List&#039;&#039;)&lt;br /&gt;
**Click on the Onboard VNFD button&lt;br /&gt;
**Drag and drop the VNF package file cirros_vnf.tar.gz in the importing area.&lt;br /&gt;
[[File:vnfd_onboard_r4.png|600px|Onboarding a VNF]]&lt;br /&gt;
*From OSM client:&lt;br /&gt;
 osm vnfd-create cirros_vnf.tar.gz&lt;br /&gt;
 osm vnfd-list&lt;br /&gt;
&lt;br /&gt;
==Onboarding a NS==&lt;br /&gt;
*From the UI:&lt;br /&gt;
**Go to Projects --&amp;gt; Admin --&amp;gt; NS Packages (&#039;&#039;Open List&#039;&#039;)&lt;br /&gt;
**Click on the Onboard NSD button&lt;br /&gt;
**Drag and drop the NS package file cirros_2vnf_ns.tar.gz in the importing area.&lt;br /&gt;
[[File:nsd_onboard_r4.png|600px|Onboarding a NS]]&lt;br /&gt;
*From OSM client:&lt;br /&gt;
 osm nsd-create cirros_2vnf_ns.tar.gz&lt;br /&gt;
 osm nsd-list&lt;br /&gt;
&lt;br /&gt;
==Instantiating the NS==&lt;br /&gt;
*From the UI:&lt;br /&gt;
**Go to Projects --&amp;gt; Admin --&amp;gt; NS Packages (&#039;&#039;Open List&#039;&#039;)&lt;br /&gt;
**Next the NS descriptor to be instantiated, click on Launch&lt;br /&gt;
[[File:nsd_list.png|600px|Instantiating a NS (step 1)]] &lt;br /&gt;
**Fill the form, adding at least a name and selecting the VIM&lt;br /&gt;
[[File:new_ns.png|600px|Instantiating a NS (step 2)]] &lt;br /&gt;
* From OSM client:&lt;br /&gt;
 osm ns-create --nsd_name cirros_2vnf_ns --ns_name &amp;lt;ns-instance-name&amp;gt; --vim_account &amp;lt;data-center-name&amp;gt;&lt;br /&gt;
 osm ns-list&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instantiation parameters can be specified using both CLI and UI. There are some examples collected in this wiki page: [[OSM instantiation parameters]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Using old descriptors from Release TWO==&lt;br /&gt;
&lt;br /&gt;
Beware that old Release TWO descriptors cannot be directly used by OSM Release FIVE.&lt;br /&gt;
&lt;br /&gt;
You should use this &#039;&#039;&#039;[[Creating your own VNF package#Migrating old descriptors to release FIVE|conversion tool]]&#039;&#039;&#039; to convert them to Release FIVE format and &#039;&#039;&#039;[[Creating your own VNF package|create the corresponding package]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s next?=&lt;br /&gt;
&lt;br /&gt;
If you want to learn more, you can refer to the rest of &#039;&#039;&#039;[[OSM_Release_FIVE_Documentation | OSM documentation]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4306</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4306"/>
		<updated>2019-02-27T07:53:46Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory if http header does not contain Authorization, &#039;project&#039; cab be provided, if not, first project of available for this user is assgned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
*** Change password: &#039;{password: &amp;lt;new_pass&amp;gt;}&#039;&lt;br /&gt;
*** Change the list of available projects to a new one: &#039;{projects: [P1, P2, ...]}&#039; &lt;br /&gt;
*** Remove a project &#039;P&#039; from user if exist: {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}&#039;  &lt;br /&gt;
*** Add a project &#039;P&#039; to user if not already exist:  &#039;{projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
*** Set &#039;P&#039; to be project by default, (adding it if not exist): &#039;{projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}}&#039;&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4305</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4305"/>
		<updated>2019-02-27T07:28:24Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a concrete project. Each request must contain it in the http header Authorization&lt;br /&gt;
* GET: List the valid granted tokens obtained by this user&lt;br /&gt;
* POST: Obtain a token. The &#039;username&#039; and &#039;password&#039; is mandatory if http header does not contain Authorization, &#039;project&#039; cab be provided, if not, first project of available for this user is assgned. For changing project, a new token must be obtained.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content:  &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, projects: [P1, P2, ...]}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition:&lt;br /&gt;
 {password: &amp;lt;new_pass&amp;gt;}  # changes password&lt;br /&gt;
 {projects: [P1, P2, ...]  # Change the list of available projects to a new one&lt;br /&gt;
 {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null}}    # Remove a project &#039;P&#039; from user if exist:  &lt;br /&gt;
 {projects: {&amp;quot;$+&#039;P&#039;&amp;quot;: &amp;quot;P&amp;quot;}}  # Add a project &#039;P&#039; to user if not already exist: &lt;br /&gt;
 {projects: {&amp;quot;$&#039;P&#039;&amp;quot;: null, &amp;quot;$+[0]&amp;quot;: &amp;quot;P&amp;quot;}} # Set &#039;P&#039; to be project by default, (adding it if not exist)&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new project.&lt;br /&gt;
** Example of request content: &#039;{name: &amp;lt;P-name&amp;gt;, admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition to change admin status: &#039;{admin: &amp;lt;True/False&amp;gt;}&#039;&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=OSM_Release_FIVE_Documentation&amp;diff=4304</id>
		<title>OSM Release FIVE Documentation</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=OSM_Release_FIVE_Documentation&amp;diff=4304"/>
		<updated>2019-02-27T07:05:33Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:6hackdate.png|320px|right|top|link=https://osm.etsi.org/wikipub/index.php/6th_OSM_Hackfest]]  &lt;br /&gt;
&lt;br /&gt;
== Release FIVE Quickstart ==&lt;br /&gt;
* In order to get started quickly and get familiar with the most common operations, you can refer to the [[OSM_Release_FIVE | Release FIVE Quickstart page]].&lt;br /&gt;
&lt;br /&gt;
== VNF and NS examples ==&lt;br /&gt;
* [[Examples from OSM Hackfests]]&lt;br /&gt;
&lt;br /&gt;
== Onboarding your own VNF and NS ==&lt;br /&gt;
* [[Creating_your_own_VNF_package | Create your own VNF package]] &lt;br /&gt;
* [[Creating_your_own_VNF_charm_(Release_THREE) | Creating your own VNF charm]]&lt;br /&gt;
** Some [[Example_VNF_Charms | examples of VNF Charms]] &lt;br /&gt;
** [[VNF_Primitives | Default VNF Primitives]] &lt;br /&gt;
* [[OSM_Information_Model | OSM Information Model]]&lt;br /&gt;
* [[Reference_VNF_and_NS_Descriptors | Information to create VNF and NS Descriptors]]&lt;br /&gt;
* [[OSM_Release_FOUR#Using_old_descriptors_from_Release_TWO | How to onboard old Release TWO descriptors]]&lt;br /&gt;
&lt;br /&gt;
== Specific installation methods ==&lt;br /&gt;
* [[How_to_run_OSM_on_Vagrant | How to run OSM on Vagrant]]&lt;br /&gt;
* [[How to upgrade the OSM Platform]]&lt;br /&gt;
* [[How to install OSM client | How to install OSM client separately]]&lt;br /&gt;
* [[Advanced OSM installation procedures]]&lt;br /&gt;
* [[How to install OSM in Amazon EC2 | How to install OSM in Amazon EC2]]&lt;br /&gt;
&lt;br /&gt;
== EPA and SDN Assist ==&lt;br /&gt;
* [[EPA_and_SDN_assist | How-to guide]]&lt;br /&gt;
* [[Openstack_configuration_(Release_FOUR)#Configure_Openstack_for_full_EPA_support_in_OSM | OpenStack configuration for EPA and SDN Assist]]&lt;br /&gt;
&lt;br /&gt;
== Reference material and self training ==&lt;br /&gt;
* [[OSM client]]:&lt;br /&gt;
** [[OSM_client#Installation | Installation]]&lt;br /&gt;
** [[OSM Client commands]]&lt;br /&gt;
** [[Enable autocompletion in OSM Client]]&lt;br /&gt;
* [[OSM instantiation parameters]]&lt;br /&gt;
* Using Monitoring and Autoscaling capabilities:&lt;br /&gt;
** [[OSM_Performance_Management | OSM Performance Management]]&lt;br /&gt;
** [[OSM_Fault_Management | OSM Fault Management]]&lt;br /&gt;
** [[OSM_Autoscaling | OSM Autoscaling]]&lt;br /&gt;
* 4th OSM Hackfest - full training material:&lt;br /&gt;
** [[4th_OSM_Hackfest#Agenda | Table of contents]]&lt;br /&gt;
** [https://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/presentations/ Documentation]&lt;br /&gt;
** [https://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/packages/ NS and VNF Packages] and [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/ VM images]&lt;br /&gt;
* [[NBI_API_Description| Descriptrion of the OSM North Bound Interface REST API]]&lt;br /&gt;
* [[VIM_emulator | How to use the VIM emulator]]&lt;br /&gt;
* [[OSM_E2E_tests | Tests to validate VIM capabilities]]&lt;br /&gt;
* [[OSM_workshops_and_events | OSM Workshops videos]]&lt;br /&gt;
* [[OSM_Technical_Videos | Other technical videos and demos]]&lt;br /&gt;
* [https://osm.etsi.org/images/OSM-Whitepaper-TechContent-ReleaseFOUR-FINAL.pdf Release FOUR White Paper]&lt;br /&gt;
* [https://osm.etsi.org/images/OSM_White_Paper_Experience_implementing_NFV_specs_final.pdf OSM&#039;s End User Advisory Group White Paper]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* [[How to know the version of your current OSM installation]]&lt;br /&gt;
* [[Common issues and troubleshooting]]&lt;br /&gt;
* Have you detected any bug? Check [[How_to_report_issues_(Release_THREE) | this guide]] to see how to report issues.&lt;br /&gt;
&lt;br /&gt;
== OSM Scope, Features and Integration Guidelines ==&lt;br /&gt;
&lt;br /&gt;
* [[OSM Scope, Functionality, Operation and Integration Guidelines]]&lt;br /&gt;
* [[Release notes and whitepapers]]&lt;br /&gt;
&lt;br /&gt;
== How to contribute ==&lt;br /&gt;
* [https://osm.etsi.org/about/how-to-join Joining the OSM community]&lt;br /&gt;
* Developer guides:&lt;br /&gt;
** [[Workflow_with_OSM_tools | Workflow with OSM tools (git, gerrit, bugzilla, etc.) (MUST READ for developers)]]&lt;br /&gt;
** [[Developer HowTo | Developer how-to (MUST READ for developers)]]&lt;br /&gt;
** [[Developer_HowTo_for_RO_Module | Developer how-to for RO]]&lt;br /&gt;
**[[How_to_upgrade_the_OSM_Platform#Upgrading_a_specific_component_to_use_your_own_cloned_repo_.28e.g._for_developing_purposes.29 | How to work with your own cloned repo for a specific component]]&lt;br /&gt;
* [https://opensourcemano.slack.com/ OSM Slack Workplace]&lt;br /&gt;
* Upcoming Hackfests and events:&lt;br /&gt;
** [[5th_OSM_Hackfest|5th OSM Hackfest - Barcelona]] - 4-8 Feb 2019&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4264</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4264"/>
		<updated>2019-02-21T10:01:30Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a project&lt;br /&gt;
* GET: Get tokens&lt;br /&gt;
* POST: Obtain a token. The username, password and optional project is needed. If project is not suplyed it asign first project of available for this user.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition: TODO&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new projects.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition: TODO&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: (Asynchronous). Creates and Instantiate a NS. It returns the nsInstanceId in the response header &#039;Location&#039;&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances_content/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: (Asynchronous) Terminates (or undeploy) and deletes (if termination is done successfully) a NS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains a list of NS&lt;br /&gt;
* POST: Creates a NS, but do not instantitate it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains details of a NS&lt;br /&gt;
* DELETE: Deletes a NS. It fails if NS is in &#039;INSTANTIATED&#039; state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/instantiate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Deploys a NS that it is in NOT_INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/terminate&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Undeploys a NS that it is in INSTANTIATED state. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/action&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a Day-2 operation over the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/&amp;lt;nsInstanceId&amp;gt;/scale&#039;&#039;&#039;&lt;br /&gt;
* POST: (Asynchronous). Performs a manual scale OUT/IN over one of the VNFs of the NS. It returns the nsLcmOpOccId (Operationts Occurence Id) in the response header &#039;Location&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs&#039;&#039;&#039;&lt;br /&gt;
* GET: Obtains the list of Operations occurrences. It may be useful filtering  by a concrete NS with &#039;?nsInstanceId=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/ns_instances/nsi_lcm_op_occs/&amp;lt;nsiLcmOpOccId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of an Operations occurrences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1/vnf_instances&#039;&#039;&#039;  (also vnfrs for compatibility):&lt;br /&gt;
* GET: Obtains the list of VNF. It may be useful filtering by a concrete NS with &#039;?nsr-id-ref=&amp;lt;nsInstaceId&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/nslcm/v1//vnf_instances/&amp;lt;vnfInstanceId&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Show details of a concrete VNF&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4241</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4241"/>
		<updated>2019-02-14T12:18:46Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a project&lt;br /&gt;
* GET: Get tokens&lt;br /&gt;
* POST: Obtain a token. The username, password and optional project is needed. If project is not suplyed it asign first project of available for this user.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition: TODO&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new projects.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition: TODO&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit. This is catalogue of physical elements present at some vim_account/s. Deployment of a PNFD/HNFD implies using one of this pdu from the catalogue. Matching from PNFD/HNFD to PDU is done by &#039;pdu.type&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor&#039;&#039;&#039;&lt;br /&gt;
* GET: List PDUs. Use query string for filtering.&lt;br /&gt;
* POST: Create a new PDU.&lt;br /&gt;
** Example of request content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: descriptive name              # mandatory&lt;br /&gt;
type: str                           # mandatory. maps VNFD.vdu.pdu-type&lt;br /&gt;
description: str&lt;br /&gt;
vim_accounts: [vim-account-id, ...] # mandatory&lt;br /&gt;
interfaces:                         # mandatory&lt;br /&gt;
-   name: str                       # mandatory. Maps VNFD.vdu.interfaces.name&lt;br /&gt;
    mgmt: boolean                   # mandatory. Indicates if is the management one&lt;br /&gt;
    ip-address: ip                  # mandatory&lt;br /&gt;
    vim-network-id: xxx                 &lt;br /&gt;
    vim-network-name: xxx                &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/pdu/v1/pdu_descriptor/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show PDU details&lt;br /&gt;
* PUT: overwrite this PDU&lt;br /&gt;
* PATCH: edit this PDU&lt;br /&gt;
* DELETE: remove the PDU&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor. This includes also Physical and Hybrid Network Funcitons Descriptors (PNFD/HNFD). (At VDU level, it is indicated if it is physical with the &#039;pdu-type&#039; information element).&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4240</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4240"/>
		<updated>2019-02-12T09:51:28Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Transaction-Id&#039;&#039;&#039;: &#039;&amp;lt;id&amp;gt;&#039;. When uploaded by chunk, the id returned by first chunk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a project&lt;br /&gt;
* GET: Get tokens&lt;br /&gt;
* POST: Obtain a token. The username, password and optional project is needed. If project is not suplyed it asign first project of available for this user.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition: TODO&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new projects.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition: TODO&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4239</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4239"/>
		<updated>2019-02-11T16:16:48Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods summary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a project&lt;br /&gt;
* GET: Get tokens&lt;br /&gt;
* POST: Obtain a token. The username, password and optional project is needed. If project is not suplyed it asign first project of available for this user.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition: TODO&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new projects.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition: TODO&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4237</id>
		<title>NBI API Description</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=NBI_API_Description&amp;diff=4237"/>
		<updated>2019-02-11T11:19:21Z</updated>

		<summary type="html">&lt;p&gt;Tierno: Created page with &amp;quot;__TOC__  == Introduction == OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.  By default it serves https (auto-signed...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
OSM North Bound Interface is a REST-full following ETSI SOL005 standard. It admits both YAML/JSON formats.&lt;br /&gt;
&lt;br /&gt;
By default it serves https (auto-signed certificate) on port 9999. Bearer authentication (with token) is used. Basic authentication or no authentication is also possible changing &#039;nbi.cfg&#039; file.&lt;br /&gt;
&lt;br /&gt;
For developping porpouses it admits web browser navigation using a basic http format.&lt;br /&gt;
&lt;br /&gt;
== Request headers ==&lt;br /&gt;
&#039;&#039;&#039;Accept&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; in most of the cases. Use &#039;text/html&#039; for web navigation. Use &#039;text/plain&#039;,&#039;application/zip&#039; for descriptor artifacts showing. This header field shall be present if the response is expected to have a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; for most of the cases. For packages uploading use &#039;application/gzip&#039;,&#039;application/zip&#039;,&#039;application/x-gzip&#039;,&#039;application/binary&#039;. For descriptor artifacts it can be used &#039;text/plain&#039;. This header field shall be present if the request has a non-empty message body.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Authorization&#039;&#039;&#039;: &#039;Bearer &amp;lt;token_id&amp;gt;&#039;. The authorization token for the request. It is mandatory except when a token is requested.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Range&#039;&#039;&#039;: &#039;&amp;lt;first byte&amp;gt;-&amp;lt;last byte&amp;gt;0/&amp;lt;total&amp;gt;&#039;. It allows uploading a descriptor by chunks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-File-MD5&#039;&#039;&#039;: &#039;&amp;lt;md5&amp;gt;&#039;. MD5 of uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content-Filename&#039;&#039;&#039;: &#039;&amp;lt;filename&amp;gt;&#039;. Filename of the uploaded package.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Query-String-Format&#039;&#039;&#039;: &#039;&amp;lt;yaml&amp;gt;&#039;. Parses query string values using yaml format.&lt;br /&gt;
&lt;br /&gt;
== Response headers ==&lt;br /&gt;
&#039;&#039;&#039;Content-Type&#039;&#039;&#039;: &#039;application/json&#039;,&#039;application/yaml&#039; is the more normal. &#039;text/html&#039; when web navigation. &#039;application/gzip&#039;,&#039;text/plain&#039; for descriptor artifacts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Location&#039;&#039;&#039;: &#039;/&amp;lt;main_topic&amp;gt;/v1/&amp;lt;topic&amp;gt;/&amp;lt;id&amp;gt;&#039;. Always that something is created, this header is present containing URL to this element.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WWW-Authenticate&#039;&#039;&#039;: &#039;Bearer realm=&amp;quot;{}&amp;quot;&#039;. When Authentication error is obtained.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Retry-After&#039;&#039;&#039;: &#039;&amp;lt;time&amp;gt;&#039;. (Future releases)&lt;br /&gt;
&lt;br /&gt;
== Query string ==&lt;br /&gt;
&lt;br /&gt;
Query string has the format: &#039;?key=value&amp;amp;key2=value2&amp;amp;...&#039;.&lt;br /&gt;
&lt;br /&gt;
Some special keys are:&lt;br /&gt;
* &#039;&#039;&#039;FORMAT=True&#039;&#039;&#039; Forces and operation. It disables descriptor checkings, dependency cheking. For delete, it allows deleting things that cannot done in normal operation because dependency. But beware that forcing deletion will not deletes created things at VIM level.&lt;br /&gt;
&lt;br /&gt;
For GET method it allows filtering with this format, follows SOL005 section 4.3.2:&lt;br /&gt;
 query string := ?&amp;lt;simpleFilterExpr&amp;gt;[&amp;quot;&amp;amp;&amp;quot;&amp;lt;simpleFilterExpr&amp;gt;]*&lt;br /&gt;
 simpleFilterExpr := &amp;lt;attrName&amp;gt;[&amp;quot;.&amp;quot;&amp;lt;attrName&amp;gt;]*[&amp;quot;.&amp;quot;&amp;lt;op&amp;gt;]&amp;quot;=&amp;quot;&amp;lt;value&amp;gt;[&amp;quot;,&amp;quot;&amp;lt;value&amp;gt;]*&lt;br /&gt;
 op := &amp;quot;eq&amp;quot; | &amp;quot;neq&amp;quot; (or &amp;quot;ne&amp;quot;) | &amp;quot;gt&amp;quot; | &amp;quot;lt&amp;quot; | &amp;quot;gte&amp;quot; | &amp;quot;lte&amp;quot; | &amp;quot;cont&amp;quot; | &amp;quot;ncont&amp;quot;&lt;br /&gt;
    equal (by default), not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains&lt;br /&gt;
 attrName := string. For filtering inside array, use the index element of the array, or add ANYINDEX to apply the filtering over the same array element&lt;br /&gt;
&lt;br /&gt;
For PUT/POST/PATCH It allows override e.g. package content, with the values of this query string&lt;br /&gt;
&lt;br /&gt;
== URL and Methods sumary == &lt;br /&gt;
&lt;br /&gt;
North Bound Interface  (O: OSM specific; X,5: SOL005 not OSM implemented yet; O5: OSM and SOL005)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
URL: /osm                                                       GET     POST    PUT     DELETE  PATCH&lt;br /&gt;
        /nsd/v1&lt;br /&gt;
            /ns_descriptors_content                             O       O&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /ns_descriptors                                     O5      O5&lt;br /&gt;
                /&amp;lt;nsdInfoId&amp;gt;                                    O5                      O5      5&lt;br /&gt;
                    /nsd_content                                O5              O5&lt;br /&gt;
                    /nsd                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
            /pnf_descriptors                                    5       5&lt;br /&gt;
                /&amp;lt;pnfdInfoId&amp;gt;                                   5                       5       5&lt;br /&gt;
                    /pnfd_content                               5               5&lt;br /&gt;
&lt;br /&gt;
        /vnfpkgm/v1&lt;br /&gt;
            /vnf_packages_content                               O       O&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O                       O&lt;br /&gt;
            /vnf_packages                                       O5      O5&lt;br /&gt;
                /&amp;lt;vnfPkgId&amp;gt;                                     O5                      O5      5&lt;br /&gt;
                    /package_content                            O5               O5&lt;br /&gt;
                        /upload_from_uri                                X&lt;br /&gt;
                    /vnfd                                       O5&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O5&lt;br /&gt;
&lt;br /&gt;
        /nslcm/v1&lt;br /&gt;
            /ns_instances_content                               O       O&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O                       O&lt;br /&gt;
            /ns_instances                                       5       5&lt;br /&gt;
                /&amp;lt;nsInstanceId&amp;gt;                                 O5                      O5&lt;br /&gt;
                    instantiate                                         O5&lt;br /&gt;
                    terminate                                           O5&lt;br /&gt;
                    action                                              O&lt;br /&gt;
                    scale                                               O5&lt;br /&gt;
                    heal                                                5&lt;br /&gt;
            /ns_lcm_op_occs                                     5       5&lt;br /&gt;
                /&amp;lt;nsLcmOpOccId&amp;gt;                                 5                       5       5&lt;br /&gt;
                    TO BE COMPLETED                             5               5&lt;br /&gt;
            /vnf_instances  (also vnfrs for compatibility)      O&lt;br /&gt;
                /&amp;lt;vnfInstanceId&amp;gt;                                O&lt;br /&gt;
&lt;br /&gt;
        /pdu/v1&lt;br /&gt;
            /pdu_descriptor                                     O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
&lt;br /&gt;
        /admin/v1&lt;br /&gt;
            /tokens                                             O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /users                                              O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O               O       O       O&lt;br /&gt;
            /projects                                           O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O&lt;br /&gt;
            /vim_accounts  (also vims for compatibility)        O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /wim_accounts                                       O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
            /sdns                                               O       O&lt;br /&gt;
                /&amp;lt;id&amp;gt;                                           O                       O       O&lt;br /&gt;
&lt;br /&gt;
        /nst/v1                                                 O       O&lt;br /&gt;
            /netslice_templates_content                         O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O       O       O       O&lt;br /&gt;
            /netslice_templates                                 O       O&lt;br /&gt;
                /&amp;lt;nstInfoId&amp;gt;                                    O                       O       O&lt;br /&gt;
                    /nst_content                                O               O&lt;br /&gt;
                    /nst                                        O&lt;br /&gt;
                    /artifacts[/&amp;lt;artifactPath&amp;gt;]                 O&lt;br /&gt;
&lt;br /&gt;
        /nsilcm/v1&lt;br /&gt;
            /netslice_instances_content                         O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
            /netslice_instances                                 O       O&lt;br /&gt;
                /&amp;lt;SliceInstanceId&amp;gt;                              O                       O&lt;br /&gt;
                    instantiate                                         O&lt;br /&gt;
                    terminate                                           O&lt;br /&gt;
                    action                                              O&lt;br /&gt;
            /nsi_lcm_op_occs                                    O       O&lt;br /&gt;
                /&amp;lt;nsiLcmOpOccId&amp;gt;                                O                       O       O&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Administrative Content Details ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens&#039;&#039;&#039;. Token is a temporal authorization for a user in a project&lt;br /&gt;
* GET: Get tokens&lt;br /&gt;
* POST: Obtain a token. The username, password and optional project is needed. If project is not suplyed it asign first project of available for this user.&lt;br /&gt;
** Example of request content: &#039;{username: &amp;lt;user&amp;gt;, password: &amp;lt;pass&amp;gt;, project_id: &amp;lt;project&amp;gt;}&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/tokens/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: show token details&lt;br /&gt;
* DELETE: revoque token. Logout&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users&#039;&#039;&#039;. Users may operate in several projects&lt;br /&gt;
* GET: Get users&lt;br /&gt;
* POST: Add a new user.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/users/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get user details&lt;br /&gt;
* PUT/PATCH: Edit user.&lt;br /&gt;
** Example of user edition: TODO&lt;br /&gt;
* DELETE: Removes user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects&#039;&#039;&#039;. A project contains its own separate space&lt;br /&gt;
* GET: Get projects&lt;br /&gt;
* POST: Add a new projects.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/projects/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get project details&lt;br /&gt;
* PUT/PATCH: Edit project.&lt;br /&gt;
** Example of project edition: TODO&lt;br /&gt;
* DELETE: Removes project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts&#039;&#039;&#039;. Vim account is the deployment target&lt;br /&gt;
* GET: Get vim_accounts&lt;br /&gt;
* POST: Add a new vim_accounts.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/vim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get vim_account details&lt;br /&gt;
* PUT/PATCH: Edit vim_account.&lt;br /&gt;
** Example of vim_account edition: TODO&lt;br /&gt;
* DELETE: Removes vim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts&#039;&#039;&#039;. WIM are WAN Infrastructure Managers, that is in charge of inter VIM connectivity managemnt&lt;br /&gt;
* GET: Get wim_accounts&lt;br /&gt;
* POST: Add a new wim_account.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/wim_accounts/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get wim_account details&lt;br /&gt;
* PUT/PATCH: Edit wim_account.&lt;br /&gt;
** Example of wim_account edition: TODO&lt;br /&gt;
* DELETE: Removes wim_account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns&#039;&#039;&#039;. SDN controllers in charge of VIM underlayed connectivity&lt;br /&gt;
* GET: Get sdns&lt;br /&gt;
* POST: Add a new sdn.&lt;br /&gt;
** Example of request content: TODO&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/admin/v1/sdns/&amp;lt;id&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* GET: Get sdn details&lt;br /&gt;
* PUT/PATCH: Edit sdn.&lt;br /&gt;
** Example of sdn edition: TODO&lt;br /&gt;
* DELETE: Removes sdn.&lt;br /&gt;
&lt;br /&gt;
== PDU Details ==&lt;br /&gt;
Physical Data Unit&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== VNFD Details ==&lt;br /&gt;
Virtual Network Function Descriptor&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSD Details ==&lt;br /&gt;
Network Services Descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSLCM Details ==&lt;br /&gt;
Network Services Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NST Details ==&lt;br /&gt;
NetSlice Template descriptor &lt;br /&gt;
&lt;br /&gt;
TBC&lt;br /&gt;
&lt;br /&gt;
== NSILCM Details ==&lt;br /&gt;
NetSlice Instance Life Ciclo Management&lt;br /&gt;
&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4048</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4048"/>
		<updated>2018-12-18T11:40:11Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
=== 7 Expose needed ports of docker services===&lt;br /&gt;
&lt;br /&gt;
To expose &#039;&#039;&#039;mongo&#039;&#039;&#039; database (service osm_mongo), needed for NBI, LCM, MON:&lt;br /&gt;
 docker service update osm_mongo --publish-add 27017:27017&lt;br /&gt;
 #NOTE: Not sure if this is persistent upon reboot&lt;br /&gt;
 # check exposed ports by:&lt;br /&gt;
 docker service list&lt;br /&gt;
&lt;br /&gt;
Alternativelly you can modify the docker osm stack by editing file &#039;/etc/osm/docker/docker-compose.yaml&#039;, adding/uncommenting the exposed ports; and restart the stack:&lt;br /&gt;
 sudo vi /etc/osm/docker/docker-compose.yaml&lt;br /&gt;
 # add/uncomment at section mongo:&lt;br /&gt;
 #    ports:&lt;br /&gt;
 #    - &amp;quot;27017:27017&amp;quot;&lt;br /&gt;
 docker stack rm osm &amp;amp;&amp;amp; sleep 60&lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
 # make again the service scale to 0 of step 1 in this section&lt;br /&gt;
&lt;br /&gt;
Similarly, &#039;&#039;&#039;ro-db&#039;&#039;&#039; (service osm_ro-db) needed for RO, uses ports &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMNBI_STATIC_DIR: &amp;lt;Absolute path of NBI&amp;gt;/osm_nbi/html_public&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O ./ietf-yang-types.yang&lt;br /&gt;
 wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O ./ietf-inet-types.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
Change docker service &#039;&#039;&#039;mongo&#039;&#039;&#039; to expose ports. See [[Developer_HowTo#7 Expose needed ports of docker services]]&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4041</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=4041"/>
		<updated>2018-12-14T14:25:53Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nst.py nst.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Workflow_with_OSM_tools&amp;diff=3872</id>
		<title>Workflow with OSM tools</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Workflow_with_OSM_tools&amp;diff=3872"/>
		<updated>2018-11-23T11:16:10Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Login to OSM portal =&lt;br /&gt;
# Go to OSM portal: https://osm.etsi.org/&lt;br /&gt;
# Login using your username and password&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
* If you are &#039;&#039;&#039;[[Participate|contributing on behalf of your company]]&#039;&#039;&#039;, you should login with your &#039;&#039;&#039;ETSI Online Account (EOL)&#039;&#039;&#039;. &lt;br /&gt;
** If your company is not yet an &#039;&#039;&#039;[https://portal.etsi.org/TBSiteMap/OSM/ListofOSMMembers.aspx OSM Member or Participant]&#039;&#039;&#039;, you can check here &#039;&#039;&#039;[https://osm.etsi.org/welcome/#join how to join OSM as an organization]&#039;&#039;&#039;&lt;br /&gt;
** If your company has &#039;&#039;&#039;already joined OSM but you do not have an EOL account&#039;&#039;&#039; yet, you can &#039;&#039;&#039;[http://webapp.etsi.org/createaccount/ request an EOL account]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
* If you are an &#039;&#039;&#039;individual contributor&#039;&#039;&#039;, you can &#039;&#039;&#039;[https://osm.etsi.org/index2.php?page=page_register.php create your OSM account online]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you need any help, contact us at [mailto:OSMsupport@etsi.org OSMsupport@etsi.org]&lt;br /&gt;
&lt;br /&gt;
= Report a bug on Bugzilla =&lt;br /&gt;
# Go to the OSM Portal and click on &#039;&#039;&#039;Bugzilla&#039;&#039;&#039; menu on the portal menu bar. Or simply go to [https://osm.etsi.org/bugzilla OSM Bugzilla]&lt;br /&gt;
# Click on &amp;quot;new&amp;quot; on Bugzilla menu bar.&lt;br /&gt;
# Choose the product, e.g. &amp;quot;OSM&amp;quot;.&lt;br /&gt;
# Complete the bug form. If you know, choose the component, e.g. UI, SO, RO, Documentation/Wiki, etc.&lt;br /&gt;
# Enter the bug summary, description, attachement, etc.&lt;br /&gt;
# Click on the &amp;quot;Submit Bug&amp;quot; button to confirm.&lt;br /&gt;
# A bug id is generated (e.g. Bug 6 -Small Error)&lt;br /&gt;
&lt;br /&gt;
= Clone your project =&lt;br /&gt;
# Clone a &#039;&#039;&#039;git&#039;&#039;&#039; repository, for example: &amp;lt;pre&amp;gt; git clone https://osm.etsi.org/gerrit/osm/RO.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Enter your username&lt;br /&gt;
# Enter you password&lt;br /&gt;
# It is madatory to install the Gerrit commit-msg hook for the cloned repository in order to automatically insert a Change-Id tag in commit messages. You can install it by entering the following command for RO repository &amp;lt;pre&amp;gt; curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg &amp;lt;/pre&amp;gt; You then need to make the hook executable &amp;lt;pre&amp;gt; chmod u+x RO/.git/hooks/commit-msg &amp;lt;/pre&amp;gt;  More information about the Gerrit commit-msg hook can be found here https://git.eclipse.org/r/Documentation/cmd-hook-commit-msg.html&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &lt;br /&gt;
* You can find all the project repository URLs on &#039;&#039;&#039;[https://osm.etsi.org/gitweb/ Gitweb]&#039;&#039;&#039; or on &#039;&#039;&#039;[https://osm.etsi.org/gerrit/ Gerrit]&#039;&#039;&#039;&lt;br /&gt;
** On Gitweb&lt;br /&gt;
**# Click on &#039;&#039;&#039;Gitweb&#039;&#039;&#039; menu on the portal menu bar.&lt;br /&gt;
**# Select a product to see the available cloning URLs&lt;br /&gt;
** On Gerrit&lt;br /&gt;
**# Click on &#039;&#039;&#039;Gerrit&#039;&#039;&#039; menu on the portal menu bar.&lt;br /&gt;
**# Click on &amp;quot;Projects&amp;quot; menu on the Gerrit menu bar.&lt;br /&gt;
**# Click on &amp;quot;List&amp;quot; menu.&lt;br /&gt;
**# Select a product to see the available cloning URLs.&lt;br /&gt;
&lt;br /&gt;
= Configure your Git environment =&lt;br /&gt;
# Configure your git username globally: &amp;lt;pre&amp;gt; git config --global user.name &amp;lt;username&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Configure your git email address:  &amp;lt;pre&amp;gt; git config --global user.email &amp;lt;email&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your git configuration:  &amp;lt;pre&amp;gt; git config --list &amp;lt;/pre&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;Note: Your email address will be visible on commits to Git. &lt;br /&gt;
 If you&#039;d like to keep your email address private, you can mask your email as follows:&lt;br /&gt;
 if your email is &amp;lt;name@company.com&amp;gt; you can set user.email to &amp;lt;hidden@company.com&amp;gt;&lt;br /&gt;
 This allows other users to identify you as a contributor (with your user name) and&lt;br /&gt;
 Git Stats to keep track of your company&#039;s contributions (with the email domain)&lt;br /&gt;
&lt;br /&gt;
In case you are using git in the same computer for other open source projects, you can restrict your git variables to the local folder: &amp;lt;pre&amp;gt;git config --local user.name &amp;lt;username&amp;gt;&lt;br /&gt;
git config --local user.email &amp;lt;email&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= License Headers = &lt;br /&gt;
Newly contributed Source Code should be licensed under the [https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 license]. A [https://osm.etsi.org/gitweb/?p=osm/LCM.git;a=blob_plain;f=LICENSE;hb=HEAD LICENSE] file shall exist at he root of the repository and all source files should have the following LICENSE header:&lt;br /&gt;
&lt;br /&gt;
 # Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 # you may not use this file except in compliance with the License.&lt;br /&gt;
 # You may obtain a copy of the License at&lt;br /&gt;
 #&lt;br /&gt;
 #    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 #&lt;br /&gt;
 # Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 # distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or&lt;br /&gt;
 # implied.&lt;br /&gt;
 # See the License for the specific language governing permissions and&lt;br /&gt;
 # limitations under the License.&lt;br /&gt;
&lt;br /&gt;
= Commit changes to your local project =&lt;br /&gt;
# Go to the &amp;quot;RO&amp;quot; folder &amp;lt;pre&amp;gt;cd osm/RO&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Make some changes on the source (e.g. add a line to the &amp;quot;example-file&amp;quot;)&lt;br /&gt;
# Stage the change. &amp;lt;pre&amp;gt; git add example-file &amp;lt;/pre&amp;gt; &lt;br /&gt;
# Commit the change to your local repository. You can add a bug id in your commit message to link the bug to your contribution  &amp;lt;pre&amp;gt; git commit -s -m &amp;quot;Bug 2 fixed!!&amp;quot;  &amp;lt;/pre&amp;gt; &lt;br /&gt;
# You can see your commit message and update it, if needed, using the following command: &amp;lt;pre&amp;gt;git commit --amend &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Developer&#039;s Certificate of Origin== &lt;br /&gt;
* The &amp;quot;-s&amp;quot; parameter enables to Sign the contribution. It adds the following line at the end of your commit message: &lt;br /&gt;
&amp;lt;pre&amp;gt;   Signed-off-by: Random J Developer &amp;lt;random@developer.example.org&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as a open-source patch. The rules are pretty simple: signing a contribution means that you can certify the below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        Developer&#039;s Certificate of Origin 1.1&lt;br /&gt;
&lt;br /&gt;
        By making a contribution to this project, I certify that:&lt;br /&gt;
&lt;br /&gt;
        (a) The contribution was created in whole or in part by me and I&lt;br /&gt;
            have the right to submit it under the open source license&lt;br /&gt;
            indicated in the file; or&lt;br /&gt;
&lt;br /&gt;
        (b) The contribution is based upon previous work that, to the best&lt;br /&gt;
            of my knowledge, is covered under an appropriate open source&lt;br /&gt;
            license and I have the right under that license to submit that&lt;br /&gt;
            work with modifications, whether created in whole or in part&lt;br /&gt;
            by me, under the same open source license (unless I am&lt;br /&gt;
            permitted to submit under a different license), as indicated&lt;br /&gt;
            in the file; or&lt;br /&gt;
&lt;br /&gt;
        (c) The contribution was provided directly to me by some other&lt;br /&gt;
            person who certified (a), (b) or (c) and I have not modified&lt;br /&gt;
            it.&lt;br /&gt;
&lt;br /&gt;
        (d) I understand and agree that this project and the contribution&lt;br /&gt;
            are public and that a record of the contribution (including all&lt;br /&gt;
            personal information I submit with it, including my sign-off) is&lt;br /&gt;
            maintained indefinitely and may be redistributed consistent with&lt;br /&gt;
            this project or the open source license(s) involved.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Push your contribution to Gerrit =&lt;br /&gt;
== Push your contribution to Gerrit using git push ==&lt;br /&gt;
1. To avoid merge conflicts, it is recommended to do a pull with rebase before pushing your contribution in order to merge latest changes made by other users.&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: you can force git to use always the --rebase option with:&lt;br /&gt;
 git config --local pull.rebase true&lt;br /&gt;
&lt;br /&gt;
2. Push your commits to &#039;&#039;&#039;Gerrit&#039;&#039;&#039; for Code Review using the following command:&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
 #use &#039;v1.0&#039; instead of &#039;master&#039; for contributing to v1.0 branch&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: you can also configure git to push always to the desired branch.&lt;br /&gt;
 git config --local remote.origin.push HEAD:refs/for/master&lt;br /&gt;
 git config --local remote.origin.push HEAD:refs/for/v1.0&lt;br /&gt;
&lt;br /&gt;
3. Enter your username.&lt;br /&gt;
&lt;br /&gt;
4. Enter your password.&lt;br /&gt;
&lt;br /&gt;
5. You can review your contribution on &#039;&#039;&#039;Gerrit&#039;&#039;&#039; web interface&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The following actions are execution automatically after pushing any contribution to Gerrit: &lt;br /&gt;
** &#039;&#039;&#039;Gerrit&#039;&#039;&#039; reports the new contribution state to the corresponding bug in &#039;&#039;&#039;Bugzilla&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Gerrit&#039;&#039;&#039; notifies &#039;&#039;&#039;Jenkins&#039;&#039;&#039; to build the new contribution.&lt;br /&gt;
&lt;br /&gt;
== Push your contribution to Gerrit using git review ==&lt;br /&gt;
Instead of using &amp;quot;git push&amp;quot;, you could use &amp;quot;git review&amp;quot;. Follow this guide ([[Using git-review to push and review changes]]) to install and configure git-review. You will also have to set the SSH URL for your remote and copy the commit-msg hook.&lt;br /&gt;
* To avoid merge conflicts, it is recommended to do a pull with rebase before pushing your contribution.&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
* Then, send your contribution to gerrit:&lt;br /&gt;
 git review -c&lt;br /&gt;
&lt;br /&gt;
= Gerrit Notifications =&lt;br /&gt;
Gerrit sends email notifications to:&lt;br /&gt;
*Owner of the change&lt;br /&gt;
*Reviewers of the change&lt;br /&gt;
*Project watchers &lt;br /&gt;
&lt;br /&gt;
Each user can configure his own watched projects and branches in the &amp;quot;settings/watched project&amp;quot; menu. Email notifications can be sent for New Changes, New Patch Sets, All Comments, Submitted Changes and  Abandoned Changes.&lt;br /&gt;
&lt;br /&gt;
Link: [https://osm.etsi.org/gerrit/#/settings/projects https://osm.etsi.org/gerrit/#/settings/projects] (you can navigate there from the Gerrit console by clicking on the arrow by your login on the top right corner)&lt;br /&gt;
&lt;br /&gt;
= Continuous Integration =&lt;br /&gt;
# &#039;&#039;&#039;Jenkins&#039;&#039;&#039; builds, tests the new contribution, and reports the result on its web interface.&lt;br /&gt;
# &#039;&#039;&#039;Jenkins&#039;&#039;&#039; votes on the contribution using &#039;&#039;&#039;“Code-Verif”&#039;&#039;&#039; (-1, +1) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Code Review =&lt;br /&gt;
# Other &#039;&#039;&#039;contributors&#039;&#039;&#039; and &#039;&#039;&#039;MDG Committers&#039;&#039;&#039; can comment the new contribution and vote using &#039;&#039;&#039;“Code-Review”&#039;&#039;&#039; (-1, 0, +1) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
# The &#039;&#039;&#039;MDG Leader&#039;&#039;&#039; can comment the new contribution and votes using &#039;&#039;&#039;“Code-Review”&#039;&#039;&#039; (-2, -1, 0, +1, +2) on &#039;&#039;&#039;Gerrit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Amending a contribution in Gerrit =&lt;br /&gt;
Before amending, make sure that you have the commit-msg hook installed in your local repo. For instance, if your user is &amp;quot;user&amp;quot; and the repo is the &amp;quot;devops&amp;quot; repo, the command to install the commit-msg hook would be:&lt;br /&gt;
 $ scp -p -P 29418 user@osm.etsi.org:hooks/commit-msg devops/.git/hooks/&lt;br /&gt;
&lt;br /&gt;
In that way, all patches will use the same Change Id, thus guaranteeing that they will be associated to the same change.&lt;br /&gt;
&lt;br /&gt;
NOTE: If you don&#039;t setup your environment as above, and would like to update a gerrit review with your new/updated code, you MUST have the Change-Id (of the existing gerrit review) inside the commit message. If the commit update does not contain the Change-Id, the commit will will end up creating a new gerrit review, and your subsequent gerrit review will need to be abandoned (not ideal).&lt;br /&gt;
&lt;br /&gt;
== Amending your last change/commit pushed to Gerrit ==&lt;br /&gt;
1. Get the latest changes from the repo and rebase your changes on top&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
2. Fix the code and any conflicts that might have appeared after pulling the code.&lt;br /&gt;
&lt;br /&gt;
3. Add all updated files to the index.&lt;br /&gt;
 git add &amp;lt;file&amp;gt; &lt;br /&gt;
&lt;br /&gt;
4. Amend your commit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
 git commit --amend&lt;br /&gt;
&lt;br /&gt;
5. Submit your change back to the repository. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending one of your changes which has dependencies on subsequent changes==&lt;br /&gt;
This procedure will only work if you are the only person working on a set of commits and you don&#039;t expect others to push commits and rebase them to be dependent on yours.&lt;br /&gt;
&lt;br /&gt;
1. Run &#039;git status&#039; on the branch to know how many commits you are ahead of origin. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git status&lt;br /&gt;
 On branch master&lt;br /&gt;
 Your branch is ahead of &#039;origin/master&#039; by 3 commits.&lt;br /&gt;
&lt;br /&gt;
2. Do an interactive rebase over the last X commits and specify which commit you want to amend by changing the command of the commit from &amp;quot;pick&amp;quot; to &amp;quot;edit&amp;quot;.&lt;br /&gt;
 git rebase -i HEAD~3&lt;br /&gt;
  edit 0ab17ad Change in file1&lt;br /&gt;
  pick 4995f46 Second change&lt;br /&gt;
  pick baa85bf Third change&lt;br /&gt;
&lt;br /&gt;
3. Fix the code in the commit, add the files, amend the commit, and continue rebasing:&lt;br /&gt;
 vi file1.txt            #Fix the code&lt;br /&gt;
 git add file1.txt&lt;br /&gt;
 git commit --amend&lt;br /&gt;
 git rebase --continue&lt;br /&gt;
&lt;br /&gt;
4. In case of conflicts with subsequent commits, you will have to solve them, and continue rebasing&lt;br /&gt;
 vi file1.txt            #Fix the conflict&lt;br /&gt;
 git add file1.txt       #Add the files to the staging area; no commit is required.&lt;br /&gt;
 git rebase --continue&lt;br /&gt;
&lt;br /&gt;
5. Repeat step 4 as many times as required, until rebase finishes.&lt;br /&gt;
&lt;br /&gt;
6. Rebase your contribution before pushing&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
7. Push your changes to gerrit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending a change of another author using git ==&lt;br /&gt;
When amending code from a different author, reviewer and original author should be coordinated in order to make sure that changes made by the reviewer are not reverted by the original author later. For that reason, it is recommended to avoid using the local copy of the branch. Instead, it is recommended to create a new local branch to work on every specific change, following the procedure below:&lt;br /&gt;
&lt;br /&gt;
1. Get the last code from the repository.&lt;br /&gt;
 git fetch origin&lt;br /&gt;
&lt;br /&gt;
2. Create a new branch to work on the code from the remote branch. You can use the review number and patchset as name. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git checkout -b &amp;lt;review-number&amp;gt;-&amp;lt;patchset&amp;gt; origin/master&lt;br /&gt;
&lt;br /&gt;
3. Pull the patch on the created branch. (To find the command to execute you can open the corresponding change page on Gerrit UI, click on download menu, then copy the &amp;quot;pull&amp;quot; command.)&lt;br /&gt;
 git pull &amp;lt;url&amp;gt; &amp;lt;ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Fix the code.&lt;br /&gt;
&lt;br /&gt;
5. Add all updated files to the index.&lt;br /&gt;
 git add &amp;lt;file&amp;gt; &lt;br /&gt;
&lt;br /&gt;
6. Amend the commit. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
 git commit --amend&lt;br /&gt;
&lt;br /&gt;
7. Rebase your contribution before pushing&lt;br /&gt;
 git pull --rebase&lt;br /&gt;
&lt;br /&gt;
8. Submit your change back to the repository. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: use the appropriate branch instead of master, if you are working on a different branch.&lt;br /&gt;
 git push origin HEAD:refs/for/master&lt;br /&gt;
&lt;br /&gt;
== Amending a change of another author using git-review ==&lt;br /&gt;
1. Follow the instructions in &#039;&#039;&#039;[[Using git-review to push and review changes|this link]]&#039;&#039;&#039; to install and configure git-review.&lt;br /&gt;
&lt;br /&gt;
2. Download the change with git-review&lt;br /&gt;
 $ git review -d 1280&lt;br /&gt;
 Downloading refs/changes/80/1280/1 from gerrit&lt;br /&gt;
 Switched to branch &amp;quot;review/garciadeblas/1280&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will download the change, put it in a branch called review/AUTHOR/change (if the change has no tag, the sequence number will be used instead), and switch to that branch.&lt;br /&gt;
&lt;br /&gt;
3. After that, you can amend the downloaded change to improve it. Finally, push it again:&lt;br /&gt;
 $ git add                         # add the changes&lt;br /&gt;
 $ git commit --amend              # do not touch the Change-Id. The Change-Id is the way for gerrit to keep track what belongs to what development stream as a new patch set.&lt;br /&gt;
 $ git commit --amend --author     # if you want to mark the changes as yours.&lt;br /&gt;
 $ git review -c -R                # The -R is important, since it tells git-review to not rebase your change against master.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Don&#039;t use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact.&lt;br /&gt;
&lt;br /&gt;
4. Delete the branch once you have finished:&lt;br /&gt;
 $ git branch -D review/garciadeblas/1280&lt;br /&gt;
&lt;br /&gt;
= Merging the contribution =&lt;br /&gt;
# The &#039;&#039;&#039;MDG Leader&#039;&#039;&#039; can &amp;quot;Submit&amp;quot; the change only if +1 &#039;&#039;&#039;&amp;quot;Code-Verif&amp;quot;&#039;&#039;&#039; (from &#039;&#039;&#039;Jenkins&#039;&#039;&#039;) and at least one +2 &#039;&#039;&#039;&amp;quot;Code-Review&amp;quot;&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Gerrit&#039;&#039;&#039; reports the result of the code review to the corresponding bug in &#039;&#039;&#039;Bugzilla&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Fixing the author name / email =&lt;br /&gt;
* Did you commit your changes with a wrong user name? Don&#039;t panic, see how [https://www.everythingcli.org/git-like-a-pro-rewrite-author-history/ this can be fixed]&lt;br /&gt;
&lt;br /&gt;
= OSM CI/CD =&lt;br /&gt;
[[File:OSM_CI-CD_workflow.png|700px|OSM CI/CD Workflow]]&lt;br /&gt;
&lt;br /&gt;
[https://osm.etsi.org/wikipub/images/1/16/OSM_CI-CD_pipeline.pdf Learn more]&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3778</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3778"/>
		<updated>2018-10-29T13:16:24Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
 sudo apt-get install python3-keystoneclient&lt;br /&gt;
 pip3 install cherrypy==18.0.0 pyyaml==3.* keystoneauth1&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # osm_im:&lt;br /&gt;
 # Install Information Model vnfd.py and nsd.py files for pyangbind validation at e.g. parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 mkdir IM/osm_im&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/vnfd.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../osm_im/nsd.py nsd.yang&lt;br /&gt;
 pip3 install -e IM&lt;br /&gt;
&lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
* OSMLCM_GLOBAL_LOGLEVEL: DEBUG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install needed OSM modules:&lt;br /&gt;
 # N2VC:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 # osm_common:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
 pip3 install aiokafka==0.4.*  pymongo==3.7.* pycrypto pyyaml==3.*&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;br /&gt;
* RO_LOG_LEVEL: DEBUG&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Openstack_configuration_(Release_THREE)&amp;diff=3669</id>
		<title>Openstack configuration (Release THREE)</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Openstack_configuration_(Release_THREE)&amp;diff=3669"/>
		<updated>2018-09-25T11:21:00Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=Configure openstack for OSM (basic)=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Guarantee that Openstack API endpoints are reachable from OSM (particularly from RO container)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Create a management network, with DHCP enabled, reachable from OSM (particularly from VCA container)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to create a management network, with DHCP enabled, and guarantee that this management network is reachable from OSM. The network is used by the VCA (Juju) for configuring the VNFs once they are running. It is recommended to create a provider network, isolated from Openstack. For instance, in order to create a provider network using physical interface em1 and VLAN 500 and with CIDR 10.208.0.0/24, you should run the following commands:&lt;br /&gt;
 neutron net-create mgmt --provider:network_type=vlan --provider:physical_network=physnet_em1 --provider:segmentation_id=500 --shared&lt;br /&gt;
 neutron subnet-create --name subnet-mgmt mgmt 10.208.0.0/24 --allocation-pool start=10.208.0.2,end=10.208.0.254&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Create a valid tenant/user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to create a tenant/user with rights to create/delete flavors. The easiest way is to create a user and assign it the role &amp;quot;admin&amp;quot;. Another option is to change the general flavor management policies at file &#039;&#039;/etc/nova/policy.json&#039;&#039; to allow flavor creation per user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Upload images&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
OSM will create the needed images into openstack at deployment time, but the process takes a long time and the provided path at VNFD must be accesible by OSM. For this reason, it is recommended to upload the images of the VNFs manually at openstack, using the following command:&lt;br /&gt;
&lt;br /&gt;
 openstack image create --file=&amp;quot;./cirros-0.3.4-x86_64-disk.img&amp;quot; --container-format=bare --disk-format=qcow2 --public cirros034&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Modify default security group or create a new one&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default openstack apply the &amp;quot;default&amp;quot; security group that blocks any incoming traffic to the VM. However ssh access might be needed by VCA. You must modify the default security group to allow TCP port 22, or create a new security group and configure RO to use this security group when datacenter is addeed (see [[Openstack_configuration_(Release_TWO)#Add_openstack_to_OSM|Add openstack to OSM]] )&lt;br /&gt;
&lt;br /&gt;
=Configure Openstack for full EPA support in OSM =&lt;br /&gt;
&lt;br /&gt;
Besides the instructions above for any Openstack, you should do extra configuration to configure Openstack for running VNFs which use SRIOV interfaces.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT consider this as the final configuration guide for Openstack with EPA. Please check Openstack docs and Openstack downstream distros&#039; docs to get a further understanding and the up-to-date required configuration.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: The configuration shown below works with Openstack Newton, and it might not work with later versions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The compute nodes need to have a whitelist for the interfaces with SRIOV and passthrough enabled, and those interface need to be associated to a physical network label e.g. “physnet”. This can be done in the file /etc/nova/nova.conf :&lt;br /&gt;
 pci_passthrough_whitelist=[{&amp;quot;devname&amp;quot;: &amp;quot;p3p1&amp;quot;, &amp;quot;physical_network&amp;quot;: &amp;quot;physnet&amp;quot;}, {&amp;quot;devname&amp;quot;: &amp;quot;p3p2&amp;quot;, &amp;quot;physical_network&amp;quot;: &amp;quot;physnet&amp;quot;}]&lt;br /&gt;
&lt;br /&gt;
* The neutron controller needs to be updated to add “sriovnicswitch” to the mechanism_drivers. This can be done in the file “/etc/neutron/plugins/ml2/ml2_conf.ini” &lt;br /&gt;
 mechanism_drivers =openvswitch,sriovnicswitch&lt;br /&gt;
&lt;br /&gt;
* The neutron controller needs to be updated to set the vlans to be used for the defined physical network label. This can be done in the file “/etc/neutron/plugins/ml2/ml2_conf.ini”. For instance, to set the vlans from 2000 to 3000:&lt;br /&gt;
 network_vlan_ranges =physnet:2000:3000&lt;br /&gt;
&lt;br /&gt;
* The neutron controller needs to be updated to allow the supported NIC vendor’s product ID. This can be done in the file “/etc/neutron/plugins/ml2/ml2_conf.ini” to &lt;br /&gt;
 [ml2_sriov]&lt;br /&gt;
 supported_pci_vendor_devs = 8086:10ed&lt;br /&gt;
&lt;br /&gt;
* The nova controller needs to be updated to allow proper scheduling of SR-IOV and Passthrough devices, by adding the PciPassthroughFilter filter to the list of filters. This can be done in the file “/etc/nova/nova.conf”:&lt;br /&gt;
 scheduler_available_filters=nova.scheduler.filters.all_filters&lt;br /&gt;
 scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,CoreFilter, PciPassthroughFilter&lt;br /&gt;
&lt;br /&gt;
The previous configuration has been collected from the links below. Please check them to get more details:&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html-single/network_functions_virtualization_product_guide/&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html-single/network_functions_virtualization_planning_guide/&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html-single/network_functions_virtualization_configuration_guide/&lt;br /&gt;
* https://docs.openstack.org/newton/networking-guide/config-sriov.html&lt;br /&gt;
&lt;br /&gt;
=Add openstack to OSM=&lt;br /&gt;
&lt;br /&gt;
There is a parameter called &#039;&#039;&#039;--config&#039;&#039;&#039; used to supply general configuration options. This paremeter can be used when creating the datacenter using the OSM client or when adding the datacenter directly to the RO (both at datacenter creation and datacenter attachment to openmano tenant -the latter prevails-).&lt;br /&gt;
&lt;br /&gt;
The following configuration can be added:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;security_groups&#039;&#039;&#039;:    To be used for the deployment&lt;br /&gt;
* &#039;&#039;&#039;availability_zone&#039;&#039;&#039;:  To be used for the deployment. It can be:&lt;br /&gt;
** a single availability zone (all deployments will land in that zone), e.g. &#039;availability_zone: controller&#039;&lt;br /&gt;
** several availability zones, which enables affinity and anti-affinity deployments, e.g. &#039;availability_zone: [zone1, zone2]&#039;&lt;br /&gt;
* &#039;&#039;&#039;region_name&#039;&#039;&#039;:        The region where the VM must be deployed.&lt;br /&gt;
* &#039;&#039;&#039;insecure&#039;&#039;&#039;:           (By default false). When true it allows authorization over a non trusted certificate over https&lt;br /&gt;
* &#039;&#039;&#039;use_existing_flavors&#039;&#039;&#039;:         (By default false). Set to &amp;quot;True&amp;quot; to use the closer flavor with enough resources instead of creating a new flavor with the exact requirements. This option does not work for EPA (cpu pinning, huge pages, ...) where openmano still tries to create a flavor with the needed extra expects. Use this options when you do not have admin credentials (Available from future v2.0.2 version)&lt;br /&gt;
* &#039;&#039;&#039;vim_type&#039;&#039;&#039;:            Set to &amp;quot;VIO&amp;quot; to use VMware Integrated openstack as VIM&lt;br /&gt;
* &#039;&#039;&#039;use_internal_endpoint&#039;&#039;&#039;: Set to True to force using internal endpoints&lt;br /&gt;
For openstack API v3. (It is needed to provide domain variables)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;APIversion&#039;&#039;&#039;:         (By default it used v3 if the keystone auth-url ends with &amp;quot;v3&amp;quot;). Set to &amp;quot;v3.3&amp;quot; or &amp;quot;3&amp;quot; to use this openstack API version&lt;br /&gt;
* &#039;&#039;&#039;project_domain_id&#039;&#039;&#039;, &#039;&#039;&#039;project_domain_name&#039;&#039;&#039;:   If non of them are provided &amp;quot;default&amp;quot; is used for project_domain_id&lt;br /&gt;
* &#039;&#039;&#039;user_domain_id&#039;&#039;&#039;, &#039;&#039;&#039;user_domain_name&#039;&#039;&#039;:   If non of them are provided &amp;quot;default&amp;quot; is used for user_domain_id&lt;br /&gt;
&lt;br /&gt;
ADVANCED configuration:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;keypair&#039;&#039;&#039;:            To be added in addition to the keypair allocated on the VNF descriptor. Provide the name of an openstack keypair&lt;br /&gt;
* &#039;&#039;&#039;dataplane_physical_net&#039;&#039;&#039;: The physical network label used in Openstack both to identify SRIOV and passthrough interfaces (nova configuration) and also to specify the VLAN ranges used by SR-IOV interfaces (neutron configuration). In case of VMware Integrated Openstack (VIO) provide moref ID of distributed virtual switch.&lt;br /&gt;
* &#039;&#039;&#039;use_floating_ip&#039;&#039;&#039;:    (By default false). If boolean True (note: not string &#039;True&#039;) a management interface of a VNFD is automatically assigned a floating_ip -if possible-. If a string is suplied instead of a boolean, it indicates the network/floating ip pool to use. The prefered method is to use a provider network&lt;br /&gt;
* &#039;&#039;&#039;dataplane_net_vlan_range&#039;&#039;&#039;: In case of VMware Integrated Openstack (VIO) provide vlan ranges for the SRIOV (binding direct) networks in format [&#039;start_ID - end_ID&#039;]&lt;br /&gt;
* &#039;&#039;&#039;microversion&#039;&#039;&#039;:      This is an Openstack-only parameter that allows to specify a specific microversion to be used in nova. When using &#039;microversion: 2.32&#039;, it enables the use of Virtual Device Role Tagging, which allows to identify each VM interface with a tag (the tag will be the name of the interface in the VNFD) and convey that information to the VM as metadata. This implementation approach is due to the warning message in https://developer.openstack.org/api-guide/compute/microversions.html where it is stated that microversion backwards compatibility is not guaranteed and clients should always require a specific microversion. This functionality was introduced would not work with Openstack versions previous to Newton.&lt;br /&gt;
&lt;br /&gt;
The content of config is a yaml format text. The recomendation is to use a comma separated list between curly brackets {} and quotes. For instance, the following config is used to add a VMware Integrated Openstack where floating IP addresses will be assigned to VNF mgmt interfaces, all deployments must land in the availability_zone &amp;quot;controller&amp;quot;, and the vlan ranges for the SRIOV networks will be 1-5 and 7-10:&lt;br /&gt;
 --config=&#039;{use_floating_ip: True, availability_zone: zone1, dataplane_net_vlan_range: [&amp;quot;1-5&amp;quot; , &amp;quot;7-10&amp;quot;]}}&#039;&lt;br /&gt;
&lt;br /&gt;
==Using the OSM client==&lt;br /&gt;
 osm vim-create --name openstack-site --user admin --password userpwd --auth_url http://10.10.10.11:5000/v2.0 --tenant admin --account_type openstack --config=&#039;{security_groups: default, keypair: mykey}&#039;&lt;br /&gt;
&lt;br /&gt;
==Adding directly in the RO==&lt;br /&gt;
 openmano datacenter-create openstack-site http://10.10.10.11:5000/v2.0 --type openstack --description &amp;quot;OpenStack site&amp;quot; --config=&#039;{security_groups: default, keypair: mykey}&#039; &lt;br /&gt;
 openmano datacenter-attach openstack-site --user=admin --password=userpwd --vim-tenant-name=admin --config=&#039;{availability_zone: one}&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: In case of adding the datacenter to the RO, after doing it, go to the GUI:&lt;br /&gt;
 ACCOUNTS &amp;gt; OSMOPENMANO &amp;gt; Click &#039;REFRESH STATUS&#039; button&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3583</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3583"/>
		<updated>2018-08-31T11:47:09Z</updated>

		<summary type="html">&lt;p&gt;Tierno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo NBI/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x NBI/.git/hooks/commit-msg&lt;br /&gt;
 cp NBI/.gitignore-common NBI/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
Create the vnfd_catalog.py and nsd_catalog.py files at NBI/osm_nbi folder from the yang OSM Information Model:&lt;br /&gt;
 # At parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone  https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../../NBI/osm_nbi/vnfd_catalog.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../../NBI/osm_nbi/nsd_catalog.py nsd.yang&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OSM modules:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 # configure gerrit commit-msg hook&lt;br /&gt;
 curl -Lo LCM/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x LCM/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OSM modules:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
	<entry>
		<id>https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3582</id>
		<title>Developer HowTo</title>
		<link rel="alternate" type="text/html" href="https://osm.etsi.org/wikipub/index.php?title=Developer_HowTo&amp;diff=3582"/>
		<updated>2018-08-31T11:40:28Z</updated>

		<summary type="html">&lt;p&gt;Tierno: /* RO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this entry is to provide a guide for developers to set up their environment, in order to ease the development with the different OSM modules.&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Modules run in separate docker containers (except juju controller that uses a lxd container). For debugging it is convinient running the target module directly at host maintaining the rest of dependent modules in containers.&lt;br /&gt;
&lt;br /&gt;
These are the modules with the port that they export, their relationships with the name of env variables that control them. For clarity the kafka dependency of lcm, nbi, mon and pm is not depicted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     __________&lt;br /&gt;
    |          | &lt;br /&gt;
    | light-ui |OSM_SERVER               _______&lt;br /&gt;
    | :80      |----------------------&amp;gt; |       |&lt;br /&gt;
    |__________|                        | nbi   |&lt;br /&gt;
                     OSMNBI_STORAGE_PATH| :9999 |OSMNBI_DATABASE_HOST        _______ &lt;br /&gt;
    .............. &amp;lt;--------------------|_______|-------------------------&amp;gt; |       |&lt;br /&gt;
    . volume:    .                                                          |       |&lt;br /&gt;
    . osm_osm_   .                                                          | mongo |&lt;br /&gt;
    . packages   .   OSMLCM_STORAGE_PATH _______ OSMLCM_DATABASE_HOST       | :27017|&lt;br /&gt;
    .............. &amp;lt;--------------------|       |-------------------------&amp;gt; |_______|&lt;br /&gt;
                                        | lcm   |&lt;br /&gt;
    **************       OSMLCM_VCA_HOST|       |OSMLCM_RO_HOST&lt;br /&gt;
    * lxd: juju  * &amp;lt;--------------------|_______|--------------|&lt;br /&gt;
    * controller *                                             |&lt;br /&gt;
    **************                       _______               |             _______&lt;br /&gt;
                                        |       | &amp;lt;-------------            |       |&lt;br /&gt;
                                        | ro    |                           | ro-db |  &lt;br /&gt;
                                        | :9090 |RO_DB_HOST                 | :3306 |&lt;br /&gt;
                                        |_______|-------------------------&amp;gt; |_______|&lt;br /&gt;
&lt;br /&gt;
     _______     _______                 _______                             _________&lt;br /&gt;
    |       |   |       |               |       |                           |         |&lt;br /&gt;
    | mon   |   | pm    |               | kafka |KAFKA_ZOOKEEPER_CONNECT    |zookeeper|  &lt;br /&gt;
    | :8662 |   |       |               | :9092 |-------------------------&amp;gt; | :2181   |       &lt;br /&gt;
    |_______|   |_______|               |_______|                           |_________|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==General steps==&lt;br /&gt;
===  1 Shutdown the container you want to debug===&lt;br /&gt;
&lt;br /&gt;
First thing, you need to stop the module you want to debug. As OSM uses a docker service do not manually stop the container because it will be automatically relaunched again. Scale it to 0 for stopping and to 1 for running again. &lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
&lt;br /&gt;
=== 2 Clone the module===&lt;br /&gt;
&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
&lt;br /&gt;
=== 3 Install the module===&lt;br /&gt;
&lt;br /&gt;
Inside the folder where the module is cloned type the following command:&lt;br /&gt;
&lt;br /&gt;
 pip3 install -e .  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: pip3 can be installed with &#039;sudo apt-get install python3-pip&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: it is recomended pip3 version 9.0.3. Check version with &#039;pip3 --version&#039; and fix it if needed with &#039;pip3 install pip==9.0.3&#039;&lt;br /&gt;
&lt;br /&gt;
=== 4 Setup the IDE===&lt;br /&gt;
&lt;br /&gt;
For this tutorial we will use PyCharm as IDE. First thing, we will set &amp;quot;Python3&amp;quot; as default python interpreter:&lt;br /&gt;
&lt;br /&gt;
[[File:PythonInterpreter.jpg|500px|top]]&lt;br /&gt;
&lt;br /&gt;
Next we will configure a new debug environment. For that we will go to the &amp;quot;Run&amp;quot; tab &amp;quot;Edit configurations&amp;quot;. In the new window that appears we will need to configure the script and the environment parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:PyCharmConfiguration.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== 5 Configure it to interact with other modules===&lt;br /&gt;
&lt;br /&gt;
You need to feed the IP addresses of the modules it is going to communicate to. For that, you can use your &amp;quot;/etc/hosts&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in the same server where the rest of the modules are located, use &amp;quot;127.0.0.1&amp;quot; (localhost) as the IP address of those modules. For instance, in the following example we have added mongo, ro and kafka to the line containing &amp;quot;127.0.0.1&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 127.0.0.1 localhost mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
In case the module under development is running in a different server from the rest of modules, you will need to provide the IP address of that server. For instance, in the following example we have added a new line with the name resolution for mongo ro and kafka to IP address &amp;quot;a.b.c.d&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 a.b.c.d mongo ro kafka nbi ro-db&lt;br /&gt;
&lt;br /&gt;
=== 6 Install needed packages===&lt;br /&gt;
&lt;br /&gt;
Is it possible that you will need to install some additional packages in your server. If needed use the commands &amp;quot;pip3 install&amp;quot; or &amp;quot;apt-get install&amp;quot; for that.&lt;br /&gt;
&lt;br /&gt;
Some modules imports another modules from OSM. The modules needed are:&lt;br /&gt;
 n2vc: git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 common: git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 IM: git clone https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
&lt;br /&gt;
==NBI==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_nbi=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/NBI&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e NBI  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/NBI/osm_nbi/nbi.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMNBI_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant write permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes; sudo chmod -R o+w /var/lib/docker/volumes/osm_osm_packages/_data&#039; &lt;br /&gt;
* OSMNBI_DATABASE_HOST: Mongo IP in case host &#039;mongo&#039; is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
Create the vnfd_catalog.py and nsd_catalog.py files at NBI/osm_nbi folder from the yang OSM Information Model:&lt;br /&gt;
 # At parent folder where NBI is cloned&lt;br /&gt;
 pip3 install pyang&lt;br /&gt;
 git clone https://github.com/robshakir/pyangbind&lt;br /&gt;
 pip3 install -e pyangbind&lt;br /&gt;
 git clone  https://osm.etsi.org/gerrit/osm/IM&lt;br /&gt;
 cd IM/models/yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../../NBI/osm_nbi/vnfd_catalog.py vnfd.yang&lt;br /&gt;
 pyang --plugindir ../../../pyangbind/pyangbind/plugin -f pybind -o ../../../NBI/osm_nbi/nsd_catalog.py nsd.yang&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OSM modules:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
==LCM==&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_lcm=0&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/LCM&lt;br /&gt;
 cp LCM/.gitignore-common LCM/.gitignore&lt;br /&gt;
 pip3 install -e LCM  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python3&lt;br /&gt;
Script: $INSTALLATION_FOLDER/LCM/osm_lcm/lcm.py&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* OSMLCM_STORAGE_PATH: Path of the docker volume for filestorage. Both LCM and NBI must share the same path. You can either:&lt;br /&gt;
** Create a folder and debug both NBI and LCM at the same time (needed if you develop in a different server than OSM); or&lt;br /&gt;
** Use the docker volume. Discover local path (Mountpoint) with &#039;docker volume inspect osm_osm_packages&#039; and grant read permissions to pycharm on it with (path can be different at your envioron) &#039;sudo chmod o+rx /var/lib/docker /var/lib/docker/volumes&#039; &lt;br /&gt;
* OSMLCM_DATABASE_HOST: Mongo IP in case &#039;mongo&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_RO_HOST: RO IP in case &#039;ro&#039; host it is not at &amp;quot;/etc/hosts&amp;quot; file&lt;br /&gt;
* OSMLCM_VCA_SECRET: To get this value run the following command in the OSM host:&lt;br /&gt;
** grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk &#039;{print $2}&#039;&lt;br /&gt;
* OSMLCM_VCA_HOST: Will be different depending on where your develop environment is running:&lt;br /&gt;
** In case you run it in the same server as OSM use the following command to get the IP (&amp;lt;VCA_IP&amp;gt;):&lt;br /&gt;
*** juju show-controller|grep api-endpoints|awk -F\&#039; &#039;{print $2}&#039;|awk -F\: &#039;{print $1}&#039;&lt;br /&gt;
** In case you use a different server than OSM use the IP address of OSM host (&amp;lt;OSM_IP&amp;gt;). But in addition you need to redirect inside the OSM host, the port 17070 to the VCA container by one of:&lt;br /&gt;
*** Configure the following ip-table rule in OSM host (not persistent on reboot):&lt;br /&gt;
**** sudo iptables -t nat -A PREROUTING -p tcp -d &amp;lt;OSM_IP&amp;gt; --dport 17070 -j DNAT --to &amp;lt;VCA_IP&amp;gt;:17070&lt;br /&gt;
*** or creates a ssh tunnel inside OSM host (just temporal until session is closed):&lt;br /&gt;
**** ssh -L 0.0.0.0:17070:&amp;lt;VCA_IP&amp;gt;:17070 root@&amp;lt;VCA_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OSM modules:&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/N2VC&lt;br /&gt;
 pip3 install -e N2VC  # try with --user if get permission errors&lt;br /&gt;
 &lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/common&lt;br /&gt;
 pip3 install -e common  # try with --user if get permission errors&lt;br /&gt;
&lt;br /&gt;
==RO==&lt;br /&gt;
&lt;br /&gt;
DRAFT: not tested&lt;br /&gt;
&lt;br /&gt;
It is needed to edit the docker service in order to expose the database port for the &#039;ro-db&#039; container. Edit file &#039;/etc/osm/docker/docker-compose.yaml&#039; (recomended to make a backup copy), and uncomment at &#039;ro-db&#039; section the following two lines:&lt;br /&gt;
    ports:&lt;br /&gt;
      - &amp;quot;3306:3306&amp;quot;&lt;br /&gt;
Additionally you may want that docker &#039;lcm&#039; uses your local copy of RO. Edit again file  &#039;/etc/osm/docker/docker-compose.yaml&#039;, and set at &#039;lcm&#039; section the required IP address from docker to the VM:&lt;br /&gt;
      OSMLCM_RO_HOST: &amp;lt;172.17.0.1&amp;gt;    # ro&lt;br /&gt;
      # Get the needed address at your setup by &#039;ip a | grep docker0&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, relaunch service:&lt;br /&gt;
 docker stack rm osm &lt;br /&gt;
 docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm&lt;br /&gt;
&lt;br /&gt;
Remove docker service, clone code:&lt;br /&gt;
&lt;br /&gt;
 docker service scale osm_ro=0&lt;br /&gt;
 # clone and configure gerrit commit-msg hook&lt;br /&gt;
 git clone https://osm.etsi.org/gerrit/osm/RO&lt;br /&gt;
 curl -Lo RO/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg&lt;br /&gt;
 chmod u+x RO/.git/hooks/commit-msg&lt;br /&gt;
&lt;br /&gt;
Install needed packages using its own installation script. Though it is not recomended, you can skip the &#039;--no-db&#039; option for installing a local database alternativelly to use the database at &#039;ro-db&#039; container:&lt;br /&gt;
 sudo ./RO/scripts/install-openmano.sh --no-db --noclone --develop&lt;br /&gt;
&lt;br /&gt;
Python interpreter: Python2&lt;br /&gt;
Script: $INSTALLATION_FOLDER/RO/openmanod&lt;br /&gt;
&lt;br /&gt;
Environment variables:&lt;br /&gt;
* RO_DB_HOST, RO_DB_OVIM_HOST: ro or &amp;lt;OSM_IP&amp;gt; depending if running on the same server or not. Not needed if alternativelly you use a local database copy.&lt;/div&gt;</summary>
		<author><name>Tierno</name></author>
	</entry>
</feed>