OpenStack SONA Tutorial

This tutorial is a a extended version from official documentation of SONA. I use ubuntu 18.04 system for all of nodes and use devstack to build OpenStack and SONA, I am using Pike version.

You need to configure IP address on management and data network interfaces.

Controller, Compute, and Gateway Nodes

  • Install OpenVSwitch
sudo apt update -y
sudo apt install openvswitch-switch -y
  • Set OVSDB
sudo sed -i '/set ovsdb-server \"$DB_FILE\"/a \        set \"$@\" --remote=ptcp:6640' /usr/share/openvswitch/scripts/ovs-ctl
sudo systemctl restart openvswitch-switch
  • Check OpenVSwitch
sudo ovs-vsctl show

Controller

  • Create user stack
git clone https://opendev.org/openstack-dev/devstack
./devstack/tools/create-stack-user.sh
sudo su stack
cd ~
git clone -b stable/pike https://git.openstack.org/openstack-dev/devstack
  • Clone networking-onos
git clone --branch stable/pike https://github.com/openstack/networking-onos.git
  • Configure networking-onos
nano /opt/stack/networking-onos/etc/conf_onos.ini

# Configuration options for ONOS ML2 Mechanism driver
[onos]
# (StrOpt) ONOS ReST interface URL. This is a mandatory field.
url_path = http://10.222.222.9:8181/onos/openstacknetworking
# (StrOpt) Username for authentication. This is a mandatory field.
username = onos
# (StrOpt) Password for authentication. This is a mandatory field.
password = rocks
  • Clone and configure devstack
git clone -b stable/pike https://git.openstack.org/openstack-dev/devstack
nano devstack/local.conf
[[local|localrc]]
HOST_IP=IP_MANAGEMENT_CONTROLLER
SERVICE_HOST=IP_MANAGEMENT_CONTROLLER
RABBIT_HOST=IP_MANAGEMENT_CONTROLLER
DATABASE_HOST=IP_MANAGEMENT_CONTROLLER
Q_HOST=IP_MANAGEMENT_CONTROLLER
 
ADMIN_PASSWORD=rahasia
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD
 
DATABASE_TYPE=mysql
 
# Log
USE_SCREEN=True
SCREEN_LOGDIR=/opt/stack/logs/screen
LOGFILE=/opt/stack/logs/xstack.sh.log
LOGDAYS=1
# Force config drive
FORCE_CONFIG_DRIVE=True
 
# Networks
Q_ML2_TENANT_NETWORK_TYPE=vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS=onos_ml2
Q_ML2_PLUGIN_TYPE_DRIVERS=flat,vlan,vxlan
ML2_L3_PLUGIN=onos_router
NEUTRON_CREATE_INITIAL_NETWORKS=False
enable_plugin networking-onos https://github.com/openstack/networking-onos.git stable/pike
ONOS_MODE=controller_only
 
# Services
ENABLED_SERVICES=key,nova,n-api,n-cond,n-sch,n-novnc,n-cauth,placement-api,g-api,g-reg,q-svc,horizon,rabbit,mysql
  
# Branches
GLANCE_BRANCH=stable/pike
HORIZON_BRANCH=stable/pike
KEYSTONE_BRANCH=stable/pike
NEUTRON_BRANCH=stable/pike
NOVA_BRANCH=stable/pike
  • Run Devstack
FORCE=yes ./devstack/stack.sh

Compute

  • Create user stack
git clone https://opendev.org/openstack-dev/devstack
./devstack/tools/create-stack-user.sh
sudo su stack
cd ~
git clone -b stable/pike https://git.openstack.org/openstack-dev/devstack
  • Add devstack configuration
nano devstack/local.conf
[[local|localrc]]
HOST_IP=IP_MANAGEMENT_COMPUTE
SERVICE_HOST=IP_MANAGEMENT_CONTROLLER
RABBIT_HOST=IP_MANAGEMENT_CONTROLLER
DATABASE_HOST=IP_MANAGEMENT_CONTROLLER
 
ADMIN_PASSWORD=rahasia
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD
 
DATABASE_TYPE=mysql
 
NOVA_VNC_ENABLED=True
VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
VNCSERVER_LISTEN=$HOST_IP
 
# Force config drive
FORCE_CONFIG_DRIVE=True

# should be qemu if your compute node is a vm
# should be kvm if your compute node is a baremetal
LIBVIRT_TYPE=qemu

# Log
USE_SCREEN=True
SCREEN_LOGDIR=/opt/stack/logs/screen
LOGFILE=/opt/stack/logs/xstack.sh.log
LOGDAYS=1
 
# Services
ENABLED_SERVICES=n-cpu,placement-client,neutron
 
enable_plugin networking-onos https://github.com/openstack/networking-onos.git stable/pike
ONOS_MODE=compute
 
# Branches
NOVA_BRANCH=stable/pike
KEYSTONE_BRANCH=stable/pike
NEUTRON_BRANCH=stable/pike
  • Run Devstack
FORCE=yes ./devstack/stack.sh

ONOS

  • Install Packages
apt update -y
apt install git zip curl unzip python-minimal openjdk-8-jdk -y
  • Create user SDN
sudo adduser sdn --system --group
  • Create folder
sudo mkdir -p /opt && cd /opt
  • Download ONOS packages
sudo wget http://repo1.maven.org/maven2/org/onosproject/onos-releases/1.15.0/onos-1.15.0.tar.gz
sudo tar xzf onos-1.15.0.tar.gz
sudo mv onos-1.15.0 onos
sudo chown -R sdn:sdn onos
  • Setting startup options
sudo -u sdn nano /opt/onos/options
# running onos with user sdn
export ONOS_USER=sdn
 
# default active drivers and openflow
export ONOS_APPS=drivers,openflow-base,openstacknetworking
  • Install services
sudo cp /opt/onos/init/onos.initd /etc/init.d/onos
sudo cp /opt/onos/init/onos.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable onos
  • Start ONOS
sudo systemctl start onos
  • Access CLI
ssh-keygen -t rsa
/opt/onos/bin/onos-user-key $USER ~/.ssh/id_rsa.pub

/opt/onos/bin/onos
  • Create network configuration
nano network-cfg.json
{
    "nodes" : [
        {
            "hostname" : "COMPUTE_HOSTNAME",
            "type" : "COMPUTE",
            "managementIp" : "IP_MANAGEMENT_COMPUTE",
            "dataIp" : "IP_DATA_COMPUTE",
            "integrationBridge" : "of:00000000000000a1"
        },
        {
            "hostname" : "CONTROLLER_HOSTNAME",
            "type" : "CONTROLLER",
            "managementIp" : "IP_MANAGEMENT_CONTROLLER",
            "keystoneConfig" : {
                "endpoint" : "keystone-endpoint-address",
                "authentication" : {
                    "version" : "v2.0",
                    "protocol" : "HTTPS",
                    "project" : "admin",
                    "username" : "admin",
                    "password" : "rahasia",
                    "perspective" : "PUBLIC"
                }
            },
            "neutronConfig": {
                "useMetadataProxy": true,
                "metadataProxySecret": "nova",
                "novaMetadataIp": "IP_MANAGEMENT_CONTROLLER",
                "novaMetadataPort": 8775
            }
        },
        {
            "hostname" : "GATEWAY_HOSTNAME",
            "type" : "GATEWAY",
            "managementIp" : "IP_MANAGEMENT_GATEWAY",
            "dataIp" : "IP_DATA_GATEWAY",
            "integrationBridge" : "of:00000000000000a2",
            "uplinkPort" : "EXTERNAL_INTERFACE_TO_PUBLIC"
         }
     ]
}
  • Send to ONOS
curl --user onos:rocks -X POST -H "Content-Type:application/json" -d "@network-cfg.json" http://IP_MANAGEMENT_ONOS:8181/onos/openstacknode/configure

Gateway

  • Download Docker
wget -qO- https://get.docker.com/ | sudo sh
  • Download SONA Setup
git clone https://github.com/sonaproject/sona-setup.git
cd sona-setup
  • Edit config
nano externalRouterConfig.ini

#floatingCidr is CIDR associated with uplinkPort on Gateway Node
#externalPeerMac difference each gateway
floatingCidr = "NETWORK_EXTERNAL_INTERFACE_TO_PUBLIC/CIDR"
externalPeerMac = "fa:00:00:00:00:01"
  • Run
./createExternalRouter.sh

OpenStack

  • Create public network type flat with interface from devstack (default is public) and network NETWORK_EXTERNAL_INTERFACE_TO_PUBLIC/CIDR.

 

Comments are closed.