Extending Openstack Shaker for VNF performance testing (Blog — 1)

Basic idea of how to use shaker
  • 2 Machines — 20.04 Ubuntu OS
  • Devstack stable/victoria
  • One controller+compute and the other only compute node
  • 1 Controller+Compute — 8vcpus, 16GB RAM
  • 1 Compute — 2vcpus, 4GB RAM

Prerequisites

  • Pre-installed openstack setup. Here are sample local.conf files that was used in this case.
  • Ubuntu image — uploaded to glance — select the image appropriate to your requirements(https://cloud-images.ubuntu.com/) — in the test case bionic-server-cloudimg-amd64.img is used

Shaker Setup

Once openstack setup is up and configured with required glance image, next step is to install shaker and build shaker image.

Shaker installation and configuration

Installing shaker using python pip

Building Shaker base image

Shaker image can be build either using shaker image builder tool or diskimage-builder tool. Here is how to use the former

Shaker flavor creation

The shaker VMs primary and minion require a defined shaker flavor in openstack setup, here is the command to create one.

Testcase Topology Setup

Now that the pre-requisites and shaker setup is complete, we can now proceed with the creation of openstack resources for our test case.

Network Configuration

First we need to create the networks required for our use case. We would require 3 networks to test our use case,

  • One Management network — used for cloud-init configuration by shaker and for other configuration purposes
  • East network — used for connection between test_primary VM to the router(Ubuntu VM)
  • West network — connection between test_minion VM to the router(Ubuntu VM)
Topology of the VNF testcases executed using Shaker
Network details in openstack
Network topology in openstack

Neutron Network Port Configuration

In openstack to enable other subnet address packets through the neutron network ports, we would need to enable allowed_address_pairs on those particular ports. In our case since the Ubuntu VM acts like a router forwarding packets from one subnet to other subnet, the neutron ports attached to the VM should have allowed_address_pairs configuration enable. So for this reason we create those neutron ports prior and enable the allowed address pairs configuration. Later when launching the VM, we will use these ports.

Virtual Machine Configuration

Next step is to launch the Ubuntu VM and perform the required configuration.

Hypervisor view in the openstack setup
### test.sh script
#!/bin/bash
sudo dhclient ens4
sudo dhclient ens5
sudo ifconfig ens4 up
sudo ifconfig ens5 up
echo 1 > /proc/sys/net/ipv4/ip_forward
  • test.sh — user data script can be found in the github repo, it brings up the interfaces and enable forwarding on the ubuntu VM
  • east_router_port_id — port id of the east_router port created above
  • west_router_port_id — port id of the west_router port created above
  • image ubuntu — Ubuntu image name or id already uploaded to glance
Ubuntu VM in openstack setup
Ping test to check the VM status

Shaker Test case execution

Now that we have the Ubuntu VM in place, we will proceed with the creation of the minion and primary VMs through Shaker and connect them to the Ubuntu VM, so that the traffic test performed using shaker marks the network performance of the Ubuntu VM in an openstack setup.

heat_template_version: 2013-05-23description:
This Heat template creates a pair of networks plugged into the same router.
Primary instances and minion instances are connected into different networks.
parameters:
net_id:
type: string
description: Network Id of management server
default: "e12265ed-68a0-45c8-8652-fd41b2594f57"
image:
type: string
description: Name of image to use for servers
flavor:
type: string
description: Flavor to use for servers
external_net:
type: string
description: ID or name of external network for which floating IP addresses will be allocated
server_endpoint:
type: string
description: Server endpoint address
dns_nameservers:
type: comma_delimited_list
description: DNS nameservers for the subnets
east_private_net:
type: string
description: NetId of east network
default: "4bdc7b4e-e1d9-4a36-9dc6-0dc3260b2313"
east_private_subnet:
type: string
description: SubnetId of east network
default: "cfa98799-f769-4965-861e-0eec405bc849"
east_ip_address:
type: string
description: Ipaddress for east network
default: "30.0.0.25"
west_private_net:
type: string
description: NetId of west network
default: "7f5f0429-7453-49b7-86cf-4f013fddbae4"
west_private_subnet:
type: string
description: SubnetId of west network
default: "33736de5-ccd9-4903-b6f0-0b272e66eda3"
west_ip_address:
type: string
description: Ipaddress for west network
default: "40.0.0.25"
resources:
server_security_group:
type: OS::Neutron::SecurityGroup
properties:
rules: [
{remote_ip_prefix: 0.0.0.0/0,
protocol: tcp,
port_range_min: 1,
port_range_max: 65535},
{remote_ip_prefix: 0.0.0.0/0,
protocol: udp,
port_range_min: 1,
port_range_max: 65535},
{remote_ip_prefix: 0.0.0.0/0,
protocol: icmp}]
east_agent_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: east_private_net }
fixed_ips:
- subnet_id: { get_param: east_private_subnet }
ip_address: { get_param: east_ip_address }
security_groups: [{ get_resource: server_security_group }]
west_agent_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: west_private_net }
fixed_ips:
- subnet_id: { get_param: west_private_subnet }
ip_address: { get_param: west_ip_address }
security_groups: [{ get_resource: server_security_group }]
test_primary_0:
type: OS::Nova::Server
properties:
name: test_primary_0
image: { get_param: image }
flavor: { get_param: flavor }
key_name: test
networks:
- network: { get_param: net_id }
- port: { get_resource: east_agent_port }
user_data_format: RAW
user_data:
str_replace:
template: |
#!/bin/sh
sudo dhclient ens4
sudo ip r d default via 30.0.0.1
sudo ip r a 40.0.0.0/24 via 30.0.0.10 dev ens4
screen -dmS shaker-agent-screen shaker-agent --server-endpoint=$SERVER_ENDPOINT --agent-id=$AGENT_ID --agent-socket-recv-timeout 10 --agent-socket-send-timeout 10
params:
"$SERVER_ENDPOINT": { get_param: server_endpoint }
"$AGENT_ID": "test_primary_0"
test_minion_0:
type: OS::Nova::Server
properties:
name: test_minion_0
image: { get_param: image }
flavor: { get_param: flavor }
key_name: test
networks:
- network: { get_param: net_id }
- port: { get_resource: west_agent_port }
user_data_format: RAW
user_data:
str_replace:
template: |
#!/bin/sh
sudo dhclient ens4
sudo ip r d default via 40.0.0.1
sudo ip r a 30.0.0.0/24 via 40.0.0.10 dev ens4
screen -dmS shaker-agent-screen shaker-agent --server-endpoint=$SERVER_ENDPOINT --agent-id=$AGENT_ID --agent-socket-recv-timeout 10 --agent-socket-send-timeout 10
params:
"$SERVER_ENDPOINT": { get_param: server_endpoint }
"$AGENT_ID": "test_minion_0"
outputs:
test_primary_0:
value: { get_attr: [ test_primary_0, instance_name ] }
test_minion_0:
value: { get_attr: [ test_minion_0, instance_name ] }
test_primary_0_ip:
value: { get_attr: [ test_primary_0, networks, east, 0 ] }
test_minion_0_ip:
value: { get_attr: [ test_minion_0, networks, west, 0 ] }
### ubuntu_test.yaml
title: OpenStack VNF test
description:
In this scenario Shaker launches pairs of instances. Instances are
connected to one of 2 tenant networks, which plugged into the router VNF.
The traffic goes from one network to the other (L3 east-west).
deployment:
template: ubuntu_test.hot
accommodation: [pair, best_effort]
execution:
progression: quadratic
tests:
-
title: Download
class: flent
method: tcp_download
-
title: Upload
class: flent
method: tcp_upload
-
title: Bi-directional
class: flent
method: tcp_bidirectional
VM details launched on same hypervisor
Graph Topology view
Topology view when shaker is running testcases
Shaker report for ubuntu VM
Shaker bidirectional output

Conclusion

We have observed how shaker can be extended to test the network performance of simple ubuntu VM which can be extended to any VNF. Using shaker also gives us the flexibility to test the VNF under different network performance measuring tools like iperf, flent, netperf, iperf3 or any custom tool using shell support.

References

  1. https://docs.openstack.org/victoria/
  2. https://pyshaker.readthedocs.io/en/latest/index.html
  3. https://docs.openstack.org/performance-docs/latest/test_plans/tenant_networking/shaker.html

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sirishagopigiri

Sirishagopigiri

11 Followers

Engineer by profession. Chef by passion (applicable only for some dishes :-P). Trying to become a blogger.