Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is an example of how to run an ONAP  sdnc-image with a minimal setup with SDN-R configuration with docker-compose. With this deployment you are able run the ODLUX gui within the SDNC which is then reachable on http://localhost:8080/odlux/index.html.

Prerequisites

  • vm (4 vCPU/ 4 gig RAM/ 40Gig HDD)
  • ubuntu (e.g. Ubuntu server 20.04.2 LTS)
  • docker
  • docker-compose (v2 recommended)

Deployment

So we have only 2 files in our directory. The docker-compose.yml itself and the .env file for storing all parameters we may like to change.

docker-compose.yml (minimal):

Code Block
version: '3'
services:services:
  sdnc-web:
    image: ${SDNC_WEB_IMAGE}
    container_name: sdnc-web
    ports:
      - 8080:8080
    environment:
      - SDNRHOST=sdnr
    depends_on:
      sdnr:
        condition: service_healthy
    healthcheck:
      test: "curl --silent --fail http://localhost:8080/ready > /dev/null || exit 1"
      interval: 10s
      timeout: 10s
      retries: 45
  sdnr:
    image: ${SDNC_IMAGE}
    container_name: sdnr
    ports:
      - 8181:8181
    environment:
      - A1_ADAPTER_NORTHBOUND=false
      - CCSDK_REPLICAS=0
      - DOMAIN=""
      - ENABLE_OAUTH=false
      - ENABLE_ODL_CLUSTER=false
      - ODL_ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - SDNC_REPLICAS=0
      - SDNRDBURL=http://sdnrdb:9200
      - SDNRDM=false
      - SDNRINIT=true
      - SDNRONLY=true
      - SDNRWT=true
      - SDNR_NETCONF_CALLHOME_ENABLED=true
      - JAVA_OPTS=-Xms256m -Xmx4g
    healthcheck:
      test: [ "CMD", "wget", "-nv", "-t1", "--spider", "http://localhost:8181/ready" ]
      interval: 10s
      timeout: 10s
      retries: 45
    depends_on:
      - sdnrdb
  sdnrdb:
    image: ${SDNRDB_IMAGE}
    container_name: sdnrdb
    environment:
      - discovery.type=single-node 
 

.env file:

Code Block
SDNC_IMAGE=nexus3.onap.org:10001/onap/sdnc-image:latest2.6.1
SDNC_WEB_IMAGE=nexus3.onap.org:10001/onap/sdnc-web-image:2.6.1
ADMIN_PASSWORD=admin
SDNRDB_IMAGE=docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3

The sdnc image version (here latest) you can choose from this list here: https://nexus3.onap.org:10001/v2/onap/sdnc-image/tags/list.

versionONAP release nameodl-base
2.8.XOslopotassium-sr2
2.7.XNew Delhi (no sdnc release)-
2.6.XMontrealargon-sr2
2.5.XLondonchlorine
2.4.XKohnsulfur
2.3.XJakartaphosphorus
2.2.XIstanbulsilicon-SR1
2.1.XHonolulualuminium-SR1/3
2.0.XGuilin

sodium-SR3/4

1.8.XFrankfurt
1.7.XEl Alto

So after you started this deployment with

Code Block
$ docker-compose up -d /docker compose up -d (depends on your docker compose version)

you should be able to access the ODLUX gui via you webbrowser on http://localhost:81818080/odlux/index.html. Login credentials are username "admin" and password the one you have in your .env file, so by default also "admin".


Troubleshooting

Problem: docker container is crashing

check the status of the container

Code Block
$ docker ps -a | grep sdnr

If the status is "up  ..." then you may have to wait a little bit more.

If the status is exited, check the stdout logs of the container

Code Block
$ docker logs sdnr


Problem: ODLUX is not coming up/ 401 Unauthorized response:

...

Code Block
$ curl -v http://localhost:8181/ready
$ curl -v http://localhost:8080/ready

both should return response code 200

Code Block
< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 20 Sep 2021 07:00:29 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Frame-Options: SAMEORIGIN
< 
* Connection #0 to host localhost left intact

If this does not return a 200 something is wrong on the sdnc or sdnc-web side so you have to follow step 2. If it returns 200 and odlux is still not reachable also go to step 2.

Step2: check odl console

Code Block
$ docker exec -ti sdnr bash
bash-5.0$ /opt/opendaylight/bin/client

if this is not accessable go to step 3:

if this is accessable do:

Code Block
$ opendaylight-user@root> bundle:list | grep -iv active

the output should be something like this:

Code Block
START LEVEL 100 , List Threshold: 50
 ID │ State    │ Lvl │ Version                                │ Name
────┼──────────┼─────┼────────────────────────────────────────┼───────────────────────────────────────────────────────
 19 │ Resolved │  80 │ 8.1.2                                  │ ODL :: odlparent :: bcprov-framework-ext, Hosts: 0
 20 │ Resolved │  80 │ 8.1.2                                  │ ODL :: odlparent :: bcpkix-framework-ext, Hosts: 0
111 │ Resolved │  80 │ 4.3.1                                  │ Apache Karaf :: Diagnostic :: Boot

if there is one package on Failure state pls go to step 3. If not go on with

Code Block
$ opendaylight-user@root> bundle:list | grep -i ccsdk

If this list has some services still on GracePeriod, pls wait some more time and try it again (Can take up to two minutes). If this list is empty it looks like no sdnr feature was started. Then you have to check the features config file. 

Code Block
$ opendaylight-user@root> less etc/org.apache.karaf.features.cfg | grep featuresBoot

there you should see something like this:

Code Block
featuresBoot = 3a3f1168-5df1-4fcc-a03f-6253067eaa1a,odl-restconf-all,odl-netconf-topology,odl-mdsal-all,odl-mdsal-apidocs,odl-daexim-all,odl-restconf-nb-rfc8040,sdnr-wt-feature-aggregator-devicemanager-base,sdnr-wt-feature-aggregator-devicemanager
featuresBootAsynchronous=false

If there are no sdnr features inside of this list, please check your environment variables inside of the container. If these are also okay, then you have to check the startODL.sh script for the install_sdnr_wt() function call, because this is then not called. If only odlux features are missing you may have set the SDNRDM env var to true. This is possible, but needs an extended setup which is not part of this guide.


Step 3: Search the log for failure inside of the container

Code Block
$ docker exec -ti sdnr bash
bash-5.0$ less /opt/opendaylight/data/log/karaf.log

Here you may find a resolve error or something similar. If this happens with a non release image (X.X.X-STAGING-xxx) pls try to use a release (X.X.X) first.