Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Library

Precondition

  • Server flavor : 2 VCPU, 8 GB of RAM, 32 GB of HDD
  • Server OS : Fedora 27/28

PnP PNF simulator installation

  • Using bash script:Put the following bash script on the server and run it :

    #!/bin/bash
    
    set_versions () {
        DOCKER_VERSION=17.12.1.ce-1.fc27
        DOCKER_COMPOSE_VERSION=1.22.0
    }
    
    
    enable_root_ssh () {
        sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
        sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
        service sshd restart
        echo -e "arthur\narthur" | passwd root
    }
    
    update_os () {
        dnf -y install fedora-upgrade
    }
    
    docker_install_configure () {
        dnf -y remove docker \
                      docker-client \
                      docker-client-latest \
                      docker-common \
                      docker-latest \
                      docker-latest-logrotate \
                      docker-logrotate \
                      docker-selinux \
                      docker-engine-selinux \
                      docker-engine
        dnf -y install dnf-plugins-core
        dnf config-manager \
         --add-repo \
         https://download.docker.com/linux/fedora/docker-ce.repo
        dnf -y install docker-ce-$DOCKER_VERSION
        systemctl start docker
        mkdir -p /etc/systemd/system/docker.service.d/
        cat > /etc/systemd/system/docker.service.d/override.confg<< EOF
    [Service]
    Environment="http_proxy=http://10.144.1.10:8080/"
    Environment="https_proxy=http://10.144.1.10:8080/"
    Environment="no_proxy=10.157.167.132,127.0.0.1,localhost,.noklab.net,.int.net.nokia.com,.ext.net.nokia.com,.int.nokia.com,.nsn-rdnet.com,.nsn-net.net,.inside.nokiasiemensnetworks.com,.access.nokiasiemensnetworks.com,.nsn-intra.net,.inside.nsn.com,.access.nsn.com"
    EOF
        systemctl daemon-reload
        systemctl restart docker
        docker login -u docker -p docker nexus3.onap.org:10003
    }
    docker_compose_install () {
        curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
        chmod +x /usr/local/bin/docker-compose
    }
    pnf_sim_file_checkout () {
        mkdir ~/sim/
        mkdir ~/sim/config
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/config.json;hb=HEAD" -O config.json
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/netconf.env;hb=HEAD" -O netconf.env
        mkdir ~/sim/json_schema
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/input_validator.json;hb=HEAD" -O input_validator.json
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/output_validator.json;hb=HEAD" -O output_validator.json
        mkdir ~/sim/netconf
        cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.data.xml;hb=HEAD" -O pnf-simulator.data.xml
        cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.yang;hb=HEAD" -O pnf-simulator.yang
        cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/docker-compose.yml;hb=HEAD" -O docker-compose.yml
        cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/simulator.sh;hb=HEAD" -O simulator.sh
        chmod 654 ~/sim/simulator.sh
    }
    
    start_simulator (){
       ~/sim/simulator.sh start
    }
    
    set_versions
    enable_root_ssh
    update_os
    docker_install_configure
    docker_compose_install
    pnf_sim_file_checkout
    start_simulator
  • Using heat template:

    Heat template used  to deploy PnP PNF simulator on open stack can be found in:
    https://gerrit.onap.org/r/gitweb?p=integration.git;a=tree;f=test/mocks/pnfsimulator/deployment;hb=HEAD
    Deployment requires to fill define following parameters:
    • flavor_name
    • Image name - use fesdora/centos/redhat base image with dnf support
    • Key pair name
    • Public network name or ID
    • Private network name or ID
    • Private subnetwork name or ID
    • Proxy (optional parameter, format http://10.10.10.10:8080/, default is empty string)

  • Verify that all docker containers are up :

    [root@pnf-sim ~]# docker ps -a
    CONTAINER ID        IMAGE                                             COMMAND                  CREATED             STATUS                          PORTS                  NAMES
    bf0e6872738a        nexus3.onap.org:10003/onap/pnf-simulator:latest   "/bin/sh -c 'java -c…"   11 minutes ago      Restarting (1) 47 seconds ago                          pnf-simulator
    05f16489d3ca        sysrepo/sysrepo-netopeer2:latest                  "/usr/bin/supervisor…"   14 minutes ago      Up 14 minutes                   0.0.0.0:830->830/tcp   netopeer
    f1e73511a75e        atmoz/sftp:alpine                                 "/entrypoint sftp-us…"   14 minutes ago      Up 14 minutes                   0.0.0.0:2222->22/tcp   sftp-server
    
    

PnP PNF simulator usage

  • PNF registration events configuration

    In order to configure events that will be send to OANP user need to configure config.json file.
    Path to the file ~/sim/config/config.json

    onfig.json
    {
      "simulatorParams": {
        "vesServerUrl": "http://<VES-HOST>:<VES-PORT>/eventListener/v7",
        "testDuration": "10",
        "messageInterval": "1"
      },
      "messageParams": {
        "pnf_serialNumber": "6061ZW3",
        "pnf_vendorName": "Nokia",
        "pnf_oamV4IpAddress": "val3",
        "pnf_oamV6IpAddress": "val4",
        "pnf_unitFamily": "BBU",
        "pnf_modelNumber": "val6",
        "pnf_softwareVersion": "val7",
        "pnf_unitType": "val8",
        "eventName": "pnfRegistration_Nokia_5gDu",
        "nfNamingCode": "gNB",
        "nfcNamingCode": "oam",
        "sourceName": "NOK6061ZW3",
        "sourceId": "val13",
        "reportingEntityName": "NOK6061ZW3"
      }
    }
    

    User need to fill:

    • vesServerUrl

      • <VES-HOST> - IP of any Kubernetes host

      • <VES-PORT> - port under which VES service is visible outside Kuberentes cluster

    • messageInterval - interval with which messages are send to ONAP

    • testDuration - amount of registration requests

    • sourceName - use correlationId value used during service instantiation

    • pnfOamIpv4Address - put there some IPv4 address

    • pnfOamIpv6Address - put there some IPv6 address

  • Starting  PNF registration events simulation

    In order to send messages from simulator to VES collector run command  ~/sim/simulator.sh run-simulator
  • Stopping  PNF registration events simulation

    In order to send messages from simulator to VES collector run command  ~/sim/simulator.sh stop-simulator


  • No labels