CN-UPB / tng-sdk-benchmark

5GTANGO SDK tool for fully automated VNF and network service benchmarking and profiling.
https://5gtango.eu
Apache License 2.0
2 stars 6 forks source link

Deploy a fixed test network in OSM #9

Closed qarawlus closed 5 years ago

qarawlus commented 5 years ago

Deploy a test network in OSM so that we can know the right configuration. The network should consist of the following:

The purpose of this issue is to be familiar with creating a valid and correct OSM topology that we can then later use to create a correct topology using tng-bench that allows the probes to correctly connect to the main VNF or VNF chain and generate correct benchmarking results.

DEADLINE: 13.09.2019 Please finish the issue before the deadline.

qarawlus commented 5 years ago

@Harshita-Puri @bsharma021 If you have questions on OSM login and usage, contact me or @avimehenwal.

qarawlus commented 5 years ago

Also, please update the project board by moving this issue to 'In progress' when you start working on it.

Harshita-Puri commented 5 years ago

A dummy network of "1 VNF 2 Probe" network with "cirros-VM". image

bsharma021 commented 5 years ago

We can see the IP addresses for connection points for VNFs in "OSM GUI - VNF Instances - Show Info in Action Tab". This can also be done programmatically by fetching VNF Info.

qarawlus commented 5 years ago

This seems to be a blocking issue with now a much higher priority as we have discovered more problems than we thought. I assigned myself to this issue so that we can work on it faster and solve issues with Openstack instances not being reached from outside network.

qarawlus commented 5 years ago

Fixed the connection problem with Openstack. I set up a default route rule inside the linux box, and added a masquerade rule to IPTables. I also setup floating IPs correctly, and set up SSH for accessing as a jump server.

Next step is to play with VNFD and NSD configs and see what can and can't be done. @bsharma021 @Harshita-Puri I believe you can now begin modifying the cirros example to test what can be done. The hackfest is using a charm that I cannot correctly understand right now, I must look into it and test why it is not deploying correctly. Working on cirros should work in the meantime.

bsharma021 commented 5 years ago

image

The new network is established with public management access and can be accessed by doing ssh to it.

bsharma021 commented 5 years ago

Any additional interfaces being assigned through OSM can now be activated using cloud-init scripts. The following script can be used to enable a specific interface "ens4" in cirros example.

#cloud-config
password: osm4u
chpasswd: { expire: False }
ssh_pwauth: True
datasource:
    OpenStack:
        metadata_urls: ["http://169.254.169.254"]
        max_wait: -1
        timeout: 10
        retries: 5
        apply_network_config: True

runcmd:
-   [ "dhclient", "ens4"]
bsharma021 commented 5 years ago

The same work can be automated using the following script for enabling all interfaces.

#cloud-config
password: osm4u
chpasswd: { expire: False }
ssh_pwauth: True
datasource:
    OpenStack:
        metadata_urls: ["http://169.254.169.254"]
        max_wait: -1
        timeout: 10
        retries: 5
        apply_network_config: True
write_files:
-   content: |
        #!/bin/bash
        hname=$(hostname)
        cat /etc/hosts | grep $hname >> /dev/null
        if [ $? -ne 0 ];then
        sudo bash -c "echo '127.0.0.1 $hname' >> /etc/hosts"
        fi
        netfile=$(find /etc/network/interfaces.d -name "*.cfg")
        for interface in $(ls -1 /sys/class/net | grep ens) ;do
            cat $netfile | grep $interface >> /dev/null
            if [ $? -ne 0 ];then
                sudo bash -c "echo 'auto $interface' >> ${netfile}"
                sudo bash -c "echo 'iface $interface inet dhcp' >> ${netfile}"
                sudo ifup $interface
            fi
        done
    owner: ubuntu:ubuntu
    permissions: '0644'
    path: /home/ubuntu/script.sh

runcmd:
-   [ "chmod", "u+x", "/home/ubuntu/script.sh"]
-   [ "/home/ubuntu/script.sh" ]