Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Building the Juniper Networks vMX Docker lwAFTR Container


The vMX Docker lwAFTR container includes the packages necessary to launch the vMX images with a configuration file and license key. When building the Docker image, you can do it directly on the target system itself, or build it on another system and then transfer it to the target.

Downloading the vMX and License Key

You need both the Juniper Networks virtual MX Series router (vMX) and a license key, available on the Juniper website to support Juniper vMX lw4o6 VNF. Use vMX KVM version of Junos OS Release 16.1R3 or later. For the license key, you can use a purchased license-key, or use the free 60-day 50-Mbps trial license. Both are available for download here:

Later, you will copy these files to the vmx-docker-lwaftr/tests directory where they will be used when building the Docker image.

Identifying Relevant Resources

If your physical host has more than one CPU socket, you need to ensure that the VNF and network interface card (NIC) are assigned to the same socket. Likewise, to maximize system performance, we recommend that you “pin” the Snabb to the same core used by the NIC (pinning allows Snabb to use an isolated core).

For example, to find a Peripheral Component Interconnect (PCI) address and the corresponding Linux device name for the Snabb process to use, you can type one or more of the following commands:

user@host:/sys/bus/pci/devices# lspci | grep 83:00
user@host:/sys/bus/pci/devices$ ls 0000\:83\:00.0/net/
user@host:/sys/bus/pci/devices$ ls 0000\:83\:00.1/net/
user@host:/sys/bus/pci/devices# ethtool -i p3p2

To identify which cores belong to which socket (that is, the NUMA node), you can type the following commands:

user@host:~$ sudo numactl –H
user@host:/sys/bus/pci/devices/0000:81:00.0$ cat local_cpulist
user@host:~$ lstopo –v

Note that once you put the NIC under Snabb, it will be removed from the control of the Linux kernel. Therefore the NIC will not appear when you run lstopo or ipconfig. Use lspci instead.

Building the Docker Image

The vMX Docker lwAFTR container is based on the official Ubuntu Docker 14.04.5 base container and includes the following elements:

  • Qemu 2.4.1 with reconnect patch downloaded and built from source in qemu/

  • Snabb, downloaded and built from source in snabb/

  • JET Python Client Library

The build process requires a Docker Engine and the make tool, which are available on the build source. The vMX image is loaded from the vMX tar file in the local directory, that is, the folder from where the container is launched. It is not part of the container.

For more detailed build instructions, see the Install Docker Engine on Linux guide.

  1. Clone the build environment on the local server (use –recursive to include the QEMU, Snabb, and other submodules).
    user@host:~$ git clone --recursive -b v1.1.19 Juniper/vmx-docker-lwaftr
  2. Change to the Snabb directory that you just created, clean up unused files, and then run the make command to start building the container and packages.
    user@host:~$ cd vmx-docker-lwaftr
    user@host:~$ cd snabb
    user@host:~$ make clean
    user@host:~$ make
  3. View the container, tagged with the loaded version.
    $ user@host:~/ /vmx-docker-lwaftr$ docker images
  4. Copy the Junos OS vMX installation bundle and the Juniper license file you downloaded to the directory where they will be picked up.
    user@host:~$ cd ~/vmx-docker-lwaftr/tests/
    user@host:~$~/vmx-docker-lwaftr/tests$ cat license-eval.txt
    user@host:~$ cp vmx-bundle-16.1R3.10.tgz ~/vmx-docker-lwaftr/tests/

Launching the vMX Docker lwAFTR Container

Juniper provides several sample executable shell scripts that you can modify to fit your needs. These scripts can be viewed in the vmx-docker-lwaftr/tests$ directory and should be modified to fit your needs.

  • The script shows a simulation for use in Docker virtual networks.

  • The script shows how to connect to a single PCI port.

  • The run-lwaftr3.txt script is an example with 200,000 binding entries.

  • The run-lwaftr5.txt script is an example with two PCI ports.

Modifying the Sample Script

You can use the following example to identify parts of the executable shell script that might need to be modified to fit your environment.

  1. Open one of the sample scripts for editing:
    user@host:~$ cat
  2. Once you have modified the script, rename and save it.
    user@host:~$ cd ~/vmx-docker-lwaftr/tests/
    user@host:~$~/vmx-docker-lwaftr/tests$ cat license-eval.txt
    user@host:~$ cp vmx-bundle-16.1R3.10.tgz ~/vmx-docker-lwaftr/tests/

  3. Run your newly modified script as root user or, in the Docker group, as user .
    user@host:~$ cd ~/vmx-docker-lwaftr/tests
    user@host:~$ chmod +x