AGW Deployment on Ubuntu - caprivm/virtualization GitHub Wiki
caprivm ([email protected])
This page explains all the steps required to deploy the AGW in a Ubuntu 20.04 VM and register it to the orchestrator. In addition, It explains how to register the AGW with the Orchestrator in detail. The hardware it was tested on is:
Feature | Value |
---|---|
OS Used | Ubuntu 20.04 LTS |
Image base | focal-server-cloudimg-amd64.img |
vCPU | 4 |
RAM (GB) | 8 |
Disk (GB) | 60 |
Home user | ubuntu |
Magma Tag | v1.6 |
The contents of the page are:
- Description
- Prerequisites
- Execute the Preinstall Checking
- Create the Configuration Files for AGW Installation
- Perform the AGW Installation
- Execute a Post-Installation Script
- Show Services Status
- How to restart the magma services?
- How to install AGW from
.deb
packages? - Add two
default via
for the S1 and SGi interfaces - Troubleshooting
Before starting this guide, you should have installed the following tools. You can check the adjacent links if you haven't already:
Prerequisites for installing Magma:
- The
eth0
should be the interface with internet and the machine should have theping
towww.google.com
allow. If this is not the case, we need to change the code to make a ping which can be reachable from the machine. - It is recommended that the VM have three network interfaces. The first (eth0) acts as SGi and the second (eth1) serves as S1 and the third (eth2) is for VM management.
- Make sure in your
/etc/hosts
file you have set the VMhostname
to 127.0.0.1 domain. - It must reach the internet through
eth0
. You can tryping -c4 -I eth0 www.google.com
In this case, consider the next environment variables before continue the procedure inside of your variables environment like .bashrc
:
export MAGMA_ROOT=~/magma_v1.6
export MAGMA_TAG=v1.6
The following variables must be loaded at the beginning of each script. It is important that you do so.
# For AGW scripts
export MAGMA_USER="magma"
export AGW_INSTALL_CONFIG_LINK="/etc/systemd/system/multi-user.target.wants/export agw_installation.service"
export AGW_INSTALL_CONFIG="/lib/systemd/system/agw_installation.service"
export AGW_SCRIPT_PATH="/root/agw_install_ubuntu.sh"
export DEPLOY_PATH="/home/$MAGMA_USER/magma/lte/gateway/deploy"
export SUCCESS_MESSAGE="ok"
export WHOAMI=$(whoami)
export MAGMA_VERSION="${MAGMA_VERSION:-v1.6}"
export CLOUD_INSTALL="cloud"
export GIT_URL="${GIT_URL:-https://github.com/magma/magma.git}"
export INTERFACE_DIR="/etc/network/interfaces.d"
This script considers changing the network configuration according to the needs of Magma. This script differs from the original repository script in that it renames the target interface for eth0
(in ubuntu .img images it is ens160
) and assigns the IPs of both eth0
and eth1
via DHCP:
0-agw-install.sh
#!/bin/bash
# Copyright 2021 The Magma Authors.
set -x
addr1="$1"
gw_addr="$2"
# MAGMA VARIABLES
MAGMA_USER="magma"
AGW_INSTALL_CONFIG_LINK="/etc/systemd/system/multi-user.target.wants/agw_installation.service"
AGW_INSTALL_CONFIG="/lib/systemd/system/agw_installation.service"
AGW_SCRIPT_PATH="/root/agw_install_ubuntu.sh"
DEPLOY_PATH="/home/$MAGMA_USER/magma/lte/gateway/deploy"
SUCCESS_MESSAGE="ok"
NEED_REBOOT=0
WHOAMI=$(whoami)
MAGMA_VERSION="${MAGMA_VERSION:-v1.6}"
CLOUD_INSTALL="cloud"
GIT_URL="${GIT_URL:-https://github.com/magma/magma.git}"
INTERFACE_DIR="/etc/network/interfaces.d"
# SCRIPT
echo "Need to check if both interfaces are named eth0 and eth1"
INTERFACES=$(ip -br a)
if [[ $1 != "$CLOUD_INSTALL" ]] && ( [[ ! $INTERFACES == *'eth0'* ]] || [[ ! $INTERFACES == *'eth1'* ]] || ! grep -q 'GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"' /etc/default/grub); then
# changing intefaces name
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"/g' /etc/default/grub
sed -i 's/ens160/eth0/g' /etc/netplan/50-cloud-init.yaml # <--- MODIFIED
# changing interface name
grub-mkconfig -o /boot/grub/grub.cfg
# name server config
ln -sf /var/run/systemd/resolve/resolv.conf /etc/resolv.conf
sed -i 's/#DNS=/DNS=8.8.8.8 208.67.222.222/' /etc/systemd/resolved.conf
service systemd-resolved restart
# interface config
apt install -y ifupdown net-tools ipcalc
mkdir -p "$INTERFACE_DIR"
echo "source-directory $INTERFACE_DIR" > /etc/network/interfaces
if [ -z "$addr1" ] || [ -z "$gw_addr" ]
then
# DHCP allocated interface IP
echo "auto eth0
iface eth0 inet dhcp" > "$INTERFACE_DIR"/eth0 # <--- MODIFIED
else
# Statically allocated interface IP
if ipcalc -c "$addr1" | grep INVALID
then
echo "Interface ip is not valid IP"
exit 1
fi
if ipcalc -c "$gw_addr" | grep INVALID
then
echo "Upstream Router ip is not valid IP"
exit 1
fi
addr=$(ipcalc -n "$addr1" | grep Address | awk '{print $2}')
netmask=$(ipcalc -n "$addr1" | grep Netmask | awk '{print $2}')
gw_addr=$(ipcalc -n "$gw_addr"| grep Address | awk '{print $2}')
echo "auto eth0
iface eth0 inet dhcp" > "$INTERFACE_DIR"/eth0 # <--- MODIFIED
fi
# configuring eth1
echo "auto eth1
iface eth1 inet dhcp" > "$INTERFACE_DIR"/eth1 # <--- MODIFIED
# get rid of netplan
systemctl unmask networking
systemctl enable networking
apt-get --assume-yes purge nplan netplan.i
# Setting REBOOT flag to 1 because we need to reload new interface and network services.
# NEED_REBOOT=1 # <--- MODIFIED
else
echo "Interfaces name are correct, let's check if network and DNS are up"
while ! nslookup google.com; do
echo "DNS not reachable"
sleep 1
done
while ! ping -c 1 -W 1 -I eth0 8.8.8.8; do
echo "Network not ready yet"
sleep 1
done
fi
To run the script you can do it by:
bash 0-agw-install.sh
If everything is fine, execute a reboot of the machine:
sudo reboot
This segment of the script allows you to configure the variables and/or files necessary for the AGW installation. This script only differs from the original script in that reboot is commented to do it manually if no error occurs.
1-agw-install.sh
#!/bin/bash
# Copyright 2021 The Magma Authors.
set -x
# MAGMA VARIABLES
MAGMA_USER="magma"
AGW_INSTALL_CONFIG_LINK="/etc/systemd/system/multi-user.target.wants/agw_installation.service"
AGW_INSTALL_CONFIG="/lib/systemd/system/agw_installation.service"
AGW_SCRIPT_PATH="/root/agw_install_ubuntu.sh"
DEPLOY_PATH="/home/$MAGMA_USER/magma/lte/gateway/deploy"
SUCCESS_MESSAGE="ok"
NEED_REBOOT=1
WHOAMI=$(whoami)
MAGMA_VERSION="${MAGMA_VERSION:-v1.6}"
CLOUD_INSTALL="cloud"
GIT_URL="${GIT_URL:-https://github.com/magma/magma.git}"
INTERFACE_DIR="/etc/network/interfaces.d"
# SCRIPT
echo "Making sure $MAGMA_USER user is sudoers"
if ! grep -q "$MAGMA_USER ALL=(ALL) NOPASSWD:ALL" /etc/sudoers; then
apt install -y sudo
adduser --disabled-password --gecos "" $MAGMA_USER
adduser $MAGMA_USER sudo
echo "$MAGMA_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
fi
if [ $NEED_REBOOT = 1 ]; then
echo "Will reboot in a few seconds, loading a boot script in order to install magma"
if [ ! -f "$AGW_SCRIPT_PATH" ]; then
cp "$(realpath $0)" "${AGW_SCRIPT_PATH}"
fi
cat <<EOF > $AGW_INSTALL_CONFIG
[Unit]
Description=AGW Installation
After=network-online.target
Wants=network-online.target
[Service]
Environment=MAGMA_VERSION=${MAGMA_VERSION}
Environment=GIT_URL=${GIT_URL}
Environment=REPO_PROTO=${REPO_PROTO}
Environment=REPO_HOST=${REPO_HOST}
Environment=REPO_DIST=${REPO_DIST}
Environment=REPO_COMPONENT=${REPO_COMPONENT}
Environment=REPO_KEY=${REPO_KEY}
Environment=REPO_KEY_FINGERPRINT=${REPO_KEY_FINGERPRINT}
Environment=SKIP_PRECHECK=${SUCCESS_MESSAGE}
Type=oneshot
ExecStart=/bin/bash ${AGW_SCRIPT_PATH}
TimeoutStartSec=3800
TimeoutSec=3600
User=root
Group=root
[Install]
WantedBy=multi-user.target
EOF
chmod 644 $AGW_INSTALL_CONFIG
ln -sf $AGW_INSTALL_CONFIG $AGW_INSTALL_CONFIG_LINK
# reboot # <--- MODIFIED
fi
To run the script you can do it by:
bash 1-agw-install.sh
If everything is fine, perform a reboot of the VM:
sudo reboot
This script allows to install the AGW using mainly ansible
. This script differs from the original script in that it prevents automatic reboot of the VM.
2-agw-install.sh
#!/bin/bash
# Copyright 2021 The Magma Authors.
set -x
# MAGMA VARIABLES
MAGMA_USER="magma"
AGW_INSTALL_CONFIG_LINK="/etc/systemd/system/multi-user.target.wants/agw_installation.service"
AGW_INSTALL_CONFIG="/lib/systemd/system/agw_installation.service"
AGW_SCRIPT_PATH="/root/agw_install_ubuntu.sh"
DEPLOY_PATH="/home/$MAGMA_USER/magma/lte/gateway/deploy"
SUCCESS_MESSAGE="ok"
NEED_REBOOT=1
WHOAMI=$(whoami)
MAGMA_VERSION="${MAGMA_VERSION:-v1.6}"
CLOUD_INSTALL="cloud"
GIT_URL="${GIT_URL:-https://github.com/magma/magma.git}"
INTERFACE_DIR="/etc/network/interfaces.d"
# SCRIPT
echo "Checking if magma has been installed"
MAGMA_INSTALLED=$(apt-cache show magma > /dev/null 2>&1 echo "$SUCCESS_MESSAGE")
if [ "$MAGMA_INSTALLED" != "$SUCCESS_MESSAGE" ]; then
echo "Magma not installed, processing installation"
apt-get -y install curl make virtualenv zip rsync git software-properties-common python3-pip python-dev apt-transport-https
alias python=python3
pip3 install ansible
git clone "${GIT_URL}" /home/$MAGMA_USER/magma
cd /home/$MAGMA_USER/magma || exit
git checkout "$MAGMA_VERSION"
echo "Generating localhost hostfile for Ansible"
echo "[magma_deploy]
127.0.0.1 ansible_connection=local" > $DEPLOY_PATH/agw_hosts
# install magma and its dependencies including OVS.
su - $MAGMA_USER -c "ansible-playbook -e \"MAGMA_ROOT='/home/$MAGMA_USER/magma' OUTPUT_DIR='/tmp'\" -i $DEPLOY_PATH/agw_hosts $DEPLOY_PATH/magma_deploy.yml"
echo "Cleanup temp files"
cd /root || exit
rm -rf $AGW_INSTALL_CONFIG
rm -rf /home/$MAGMA_USER/build
rm -rf /home/$MAGMA_USER/magma
echo "AGW installation is done, Run agw_post_install_ubuntu.sh install script after reboot to finish installation"
wget https://raw.githubusercontent.com/magma/magma/"$MAGMA_VERSION"/lte/gateway/deploy/agw_post_install_ubuntu.sh -P /root/
# reboot # <--- MODIFIED
else
echo "Magma already installed, skipping.."
fi
To run the script you can do it by:
bash 2-agw-install.sh
If everything is fine, perform a reboot of the VM:
sudo reboot
This script is identical to the original in the repository, so you can run it without changes.
agw_post_install_ubuntu.sh
#!/bin/bash
#Copyright 2021 The Magma Authors.
#
#This source code is licensed under the BSD-style license found in the
#LICENSE file in the root directory of this source tree.
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an AS IS BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# Setting up env variable, user and project path
ERROR=""
INFO=""
SUCCESS_MESSAGE="ok"
addError() {
ERROR="$ERROR\n$1 to fix it: $2"
}
addInfo() {
INFO="$INFO $1 \n"
}
if ! grep -q 'Ubuntu' /etc/issue; then
addError "Ubuntu is not installed" "Restart installation following agw_install.sh, agw has to run on Debian"
exit
fi
service magma@* stop
ifdown gtp_br0
ifdown uplink_br0
service openvswitch-switch restart
ifup gtp_br0
ifup uplink_br0
apt-get update > /dev/null
addInfo "$(apt list -qq --upgradable 2> /dev/null)"
if ! grep -q "$MAGMA_USER ALL=(ALL) NOPASSWD:ALL" /etc/sudoers; then
addError "Restart installation following agw_install_ubuntu.sh, magma has to be sudoer"
fi
interfaces=("eth1" "eth0" "gtp_br0" "uplink_br0")
for interface in "${interfaces[@]}"; do
OPERSTATE_LOCATION="/sys/class/net/$interface/operstate"
if test -f "$OPERSTATE_LOCATION"; then
OPERSTATE=$(cat "$OPERSTATE_LOCATION")
if [[ $OPERSTATE == 'down' ]]; then
addError "$interface is not configured" "Try to ifup $interface"
fi
else
addError "$interface is not configured" "Check that /etc/network/interfaces.d/$interface has been set up"
fi
done
PING_RESULT=$(ping -c 1 -I eth0 8.8.8.8 > /dev/null 2>&1 && echo "$SUCCESS_MESSAGE")
if [ "$PING_RESULT" != "$SUCCESS_MESSAGE" ]; then
addError "eth0 is connected to the internet" "Make sure the hardware has been properly plugged in (eth0 to internet)"
fi
service magma@magmad start
sleep 60
allServices=("control_proxy" "directoryd" "dnsd" "enodebd" "magmad" "mme" "mobilityd" "pipelined" "policydb" "redis" "sessiond" "state" "subscriberdb")
for service in "${allServices[@]}"; do
if ! systemctl is-active --quiet "magma@$service"; then
addError "$service is not running" "Please check our faq"
fi
done
nonMagmadServices=("sctpd")
for service in "${nonMagmadServices[@]}"; do
if ! systemctl is-active --quiet "$service"; then
addError "$service is not running" "Please check our faq"
fi
done
packages=("magma" "magma-cpp-redis" "magma-libfluid" "libopenvswitch" "openvswitch-datapath-dkms" "openvswitch-common" "openvswitch-switch")
for package in "${packages[@]}"; do
PACKAGE_INSTALLED=$(dpkg-query -W -f='${Status}' "$package" > /dev/null 2>&1 && echo "$SUCCESS_MESSAGE")
if [ "$PACKAGE_INSTALLED" != "$SUCCESS_MESSAGE" ]; then
addError "$package hasn't been installed" "Rerun the agw_install.sh"
fi
done
if [ -z "$ERROR" ]; then
echo "Installation went smoothly, please let us know what went wrong/good on github"
else
echo "There was a few errors during installation"
printf "%s" "$ERROR"
fi
if [ -n "$INFO" ]; then
echo "INFO:"
printf "%s" "$INFO"
fi
echo "- Check for Root Certificate"
CA=/var/opt/magma/tmp/certs/rootCA.pem
if [ -d "/var/opt/magma/tmp/certs/" ]; then
if [ -f "$CA" ]; then
echo "$CA exists"
fi
else
echo "Verify Root CA in /var/opt/magma/tmp/certs/"
echo "Access Gateway configurations failed"
fi
echo "- Check for Control Proxy"
CP=/var/opt/magma/configs/control_proxy.yml
if [ -d "/var/opt/magma/configs/" ]; then
if [ -f "$CP" ]; then
echo "$CP exists"
echo "- Check control proxy content"
cp_content=("cloud_address" "cloud_port" "bootstrap_address" "bootstrap_port" "rootca_cert" "fluentd_address" "fluentd_port")
for content in "${cp_content[@]}"; do
if ! grep -q "$content" $CP; then
echo "Missing $content in control proxy"
fi
done
else
echo "Control proxy file missing. Check magma installation docs"
fi
else
echo "Check Control Proxy Configs in /var/opt/magma/configs/"
echo "Access Gateway configurations failed"
fi
echo "- Verifying Cloud check-in"
CLOUD=$(journalctl -n20 -u magma@magmad | grep -e 'Checkin Successful' -e 'Got heartBeat from cloud')
if [ "$CLOUD" ]; then
echo "Cloud Check Success"
else
echo "Cloud Check Failed"
echo "Check control proxy content in $CP"
fi
To run the script you can do it by:
bash agw_post_install_ubuntu.sh
No need to restart the VM. It is possible that in the execution of this script, some errors shown because the AGW is not yet connected to the orchestrator.
To view the status of the services, you can run the following command:
sudo service magma@* status
The services that running Magma are:
- control_proxy
- directoryd
- dnsd
- enodebd
- magmad
- mme
- mobilityd
- pipelined
- policydb
- redis
- sessiond
- state
- subscriberdb
The correct way to restart Magma services is by executing the following commands:
sudo service magma@* stop
sudo service magma@magmad restart
You can see the status again:
sudo service magma@* status
If you want to restart S1 communication with the eNB, run the following commands:
sudo service magma@* stop
sudo service sctpd stop
sudo service magma@magmad restart
NOTE: Some errors like HTTPv2 503 in status may appear due to missing connection to the orchestrator. Some of them prints messages like
Streaming from the cloud failed!
. See the next section for connect your AGW with the orchestrator.
Another option to install AGW is to use .deb
packages. For this, follow this documentation. Prerequisites:
- Install Virtualbox and Vagrant as suggested here.
- Install Python as suggested in this link.
Remove before the vagrant box installed:
cd $MAGMA_ROOT/lte/gateway
# First desroy the machine
vagrant global-status
# Remove the box
vagrant halt magma # Shutdown the machine
vagrant destroy magma # Delete the machine
vagrant box remove magmacore/magma_dev # Remove the vbox image from vagrant repo
vagrant up magma --provision # Provision again the machine with updates or changes
Deploy the magma into the vagrant box:
cd $MAGMA_ROOT/lte/gateway/
fab test package:vcs=git && fab copy_packages
When the command finishes running, the packages will be created in the /tmp
folder along with other files:
ls -1 /tmp
# Output:
# magma_version
# packages.tar.gz
# packages.txt
The packages.tar.gz
file contains the .deb
packages that will be used for the installation. The magma_version
contains the information about the tag/commit used for generate the packages:
cat /tmp/magma_version
# Example of output:
# 1.7.0-1625779552-d6169104
In this case, the tag is 1.7.0
and the commit is d6169104
. Finally, the packages.txt
file lists all packages and them versions:
cat /tmp/packages.txt
# Example of output:
# magma-sctpd 1.7.0-1625779552-d6169104 magma-sctpd_1.7.0-1625779552-d6169104_amd64.deb
# python3-eventlet 0.30.2 python3-eventlet_0.30.2_all.deb
# python3-lxml 4.6.3 python3-lxml_4.6.3_amd64.deb
# python3-pyroute2 0.5.14 python3-pyroute2_0.5.14_all.deb
# td-agent-bit 1.7.8 td-agent-bit_1.7.8_amd64.deb
# magma 1.7.0-1625779552-d6169104 magma_1.7.0-1625779552-d6169104_amd64.deb
# python3-json-pointer 0.1.2 python3-json-pointer_0.1.2_all.deb
# python3-prometheus-client 0.3.1 python3-prometheus-client_0.3.1_all.deb
# python3-urllib3 1.25.3 python3-urllib3_1.25.3_all.deb
# python3-aiohttp 3.6.2 python3-aiohttp_3.6.2_amd64.deb
# python3-jsonschema 3.1.0 python3-jsonschema_3.1.0_all.deb
# python3-protobuf 3.14.0 python3-protobuf_3.14.0_all.deb
# python3-webcolors 1.11.1 python3-webcolors_1.11.1_all.deb
Before installing the packages, create a backup copy of the AGW configuration files.
NOTE: Using this type of installation by
.deb
packages rewrites the previous configuration, so it may generate conflicts in the deployment of the.deb
package.
# Make a backup copy of the Magma configuration files
mkdir ~/magma-configs-backup && cd ~/magma-configs-backup
mkdir -p etc/magma && sudo cp -R /etc/magma/* etc/magma/.
mkdir -p var/opt/magma/configs && sudo cp /var/opt/magma/configs/* var/opt/magma/configs/.
Take the .tar.gz
file and pass it to the VM where you want to install Magma. Unzip it and then install the packages:
mkdir -p ~/magma-configs-backup/magma-packages
tar -zxvf packages.tar.gz -C ~/magma-configs-backup/magma-packages/
# Verify the magma packages installed before
sudo apt list --installed | grep magma
# Uninstall old packages of magma
sudo apt-get remove --purge magma magma-sctpd
sudo apt list --installed | grep magma
# Install new packages
cd ~/magma-configs-backup/magma-packages
sudo apt -f install ./magma-sctpd_1.7.0-1625779552-d6169104_amd64.deb
sudo apt -f install ./magma_1.7.0-1625779552-d6169104_amd64.deb
NOTE: If during installation you are asked to overwrite settings, accept this option and overwrite the old settings.
In this installation example, only the magma-sctpd
and magma
packages are considered. The other packages will be required only if the dependency does not exist in the VM. After this you can restart the services and validate the status:
sudo service magma@* stop
sudo service sctpd stop
sudo service magma@magmad restart
sudo service magma@* status
The configuration of the magmad.yml
, mme.yml
, pipelind.yml
and spgw.yml
files are based on need. In addition, the configuration of the network interfaces for the S1 and SGi are needed. It is necessary to ensure the function of the MME by validating that the content of the /etc/magma/mme.yml
file had a content similar to this.
If the S1 and SGi interfaces are on different networks, you may want to add two default vias so that both interfaces are visible to the other hosts on its network. To do this, the file is used /etc/iproute2/rt_tables
:
# Execute the next command as root
sudo -i
# Add the routing tables for each interface
echo "1 sgi_interface" >> /etc/iproute2/rt_tables
echo "2 s1_interface" >> /etc/iproute2/rt_tables
# Add the rules for each table
ip rule add from <sgi_interface_IP>/32 dev eth0 table sgi_interface
ip rule add from <s1_interface_IP>/32 dev eth1 table s1_interface
ip route add default via <sgi_interface_gateway> dev eth0 table sgi_interface
ip route add default via <s1_interface_gateway> dev eth1 table s1_interface
If you want to know the gateway of each interface you can run ip r
.
This section provides some known bugs in the tool that have been covered before.
When the ansible-playbook
is in ovs_deploy : Installing magma.
task, it's possible that the CLI shows the next error.
If yes, for solving this problem execute apt --fix-broken install -y
in root
user and next, execute sudo dpkg -i --force-overwrite <filename>
which <filename>
refers to the name of .deb
package that the --fix-broken install
command report as an error (execute the command for each packet with error). For instance, when run this commands, CLI shows the next broken packages:
Then, for fixing these packages run first sudo dpkg -i --force-overwrite /var/cache/apt/archives/oai-nettle_2.5-1_amd64.deb
, next execute again apt --fix-broken install -y
(yes for all questions if any is made during upgrade). Then execute sudo dpkg -i --force-overwrite /var/cache/apt/archives/oai-gnutls_3.1.23-1_amd64.deb
for the other package and run again apt --fix-broken install -y
. Note that the commands are executed in any order that packages broken was reported.
If necessary and you use v1.3.2 tag, before run again the ovs_deploy
, edit the file /home/magma/magma/lte/gateway/deploy/roles/ovs_deploy/tasks/main.yml
adding a line in the task Installing magma with force: yes
in the apt
options as shows the next figure:
- name: Installing magma.
become: yes
apt:
name: "{{ packages }}"
force: yes
vars:
packages:
- 'magma'
With these changes, try again to deploy ovs_deploy
. Wait for deploy and the expected result is in the next figure:
It is possible that the system has not installed properly the packet of python aioeventlet
this can be checked sending the executable python file of the Pipeline process in a terminal as a non background process. If the error shows something related to this packet is because the Magma process has not install this package inside of the root directory, which is the one who runs the background processes in GNU/Linux Debian.
Go to root and install this module using the next command
sudo su -
# In root user:
pip3 install aioeventlet
Based on: https://github.com/magma/magma/issues/7978
You also need to have OVS version 2.14.3-9
if a Kernel Panic occurs. If you have an old version of OVS you can upgrade by adding the following row to the file /etc/apt/sources.list.d/magma.list
:
deb https://artifactory.magmacore.org/artifactory/debian-test focal-ci main
Next, upgrade the OVS version using:
sudo apt update
ovs-kmod-upgrade.sh
To validate the upgrade use:
apt policy openvswitch-datapath-dkms
# Output example:
# openvswitch-datapath-dkms:
# Installed: 2.14.3-9
# Candidate: 2.14.3-9
# Version table:
# *** 2.14.3-9 500
# 500 https://artifactory.magmacore.org/artifactory/debian-test focal-ci/main amd64 Packages
# 100 /var/lib/dpkg/status
# 2.14.3-8 500
# 500 https://artifactory.magmacore.org/artifactory/debian-test focal-ci/main amd64 Packages
# 2.14.3-7 500
# 500 https://artifactory.magmacore.org/artifactory/debian-test focal-ci/main amd64 Packages
dmesg | grep vSwitch
# Output example:
# [15386.401576] openvswitch: Open vSwitch switching datapath 2.14.3: p1
The last thing that runs is:
sudo service magma@* stop
sudo service sctpd stop # <--- Restart the S1 link
sudo service magma@magmad restart
And that is!
It is possible that, when you are running the Magma post-install script: bash agw_post_install_ubuntu.sh
, it will not allow execution due to an error that says it cannot find the file /etc/postfix/main.cf
. To fix it, run the following commands:
sudo cp /etc/postfix/main.cf.proto /etc/postfix/main.cf
And run the script again.