The solution described in this chapter requires four components:
- libvirt provides an abstraction language to define and launch VMs, but is normally used just to launch single VMs. It uses XML to represent and define the VM.
- KVM works exclusively with QEMU and performs hardware acceleration for x86 VMs with Intel and AMD CPUs. KVM and QEMU are hypervisors that emulate the VMs; the pair is often called KVM/QEMU or just KVM.
- QEMU is a machine emulator that can allow the host machine to emulate the CPU architecture of the guest machine. Because QEMU does not provide hardware acceleration, it works well with KVM.
- Vagrant is an orchestration tool that makes it easier to manage groups of VMs by interconnecting them programmatically. Vagrant helps to tie all the components together and provides a user-friendly language to launch suites of VMs. Vagrant allows multiple Cumulus VX VMs to be interconnected to simulate a network. Vagrant also allows Cumulus VX VMs to be interconnected with other VMs (such as Ubuntu or CentOS) to emulate real world networks.
The following sections describe how to install
libvirt, KVM/QEMU, and Vagrant on a Linux server.
Check the Linux version of the host. This guide is validated and verified for Ubuntu 16.04 LTS starting from a clean install:
After verifying the version, install
QEMU. The following commands install the necessary components to get
QEMUoperational.Click here if running Ubuntu 14.04...
The version of
libvirtwhich ships in Ubuntu 14.04 is too old to be used in many of the simulations built by Cumulus.
libvirt-udp-tunnelpackage repository provides an updated
libvirtdversion that provides enhancements required to launch Cumulus VX. The example below shows how to add the repository:
This repository contains a version of
libvirtthat has the necessary patches to support the construction of UDP tunnels, which are used for the point-to-point links in a VM simulation.
This version of
libvirtneeds to have a default storage pool created using the process below.
After the installation completes, log out, then log in and verify the
libvirtversions 1.2.20 or higher have native support for the UDP tunnels, which are used for the point-to-point links in VM simulation.
Add your user to the
libvirtdgroup (if not already present) so your user can perform
To apply the new group to your existing user, log out and in again.
Confirm that your Linux kernel and BIOS settings permit the use of KVM hardware acceleration.
After completing these steps,
libvirt and KVM/QEMU are installed. The Linux server is now ready to run VMs.
You must install Vagrant after you install
libvirt. Vagrant might not properly detect the necessary files if it is installed before
libvirt. Cumulus VX requires version 1.7 or later. Version 2.0.2 or later is recommended.
Install Vagrant from the
debpackage. Cumulus Networks cannot guarantee the functionality of any version of Vagrant. In this guide, Vagrant version 2.0.2 is used.
Install Vagrant using
Verify the Vagrant version:
Install the necessary plugins for Vagrant:
Vagrant plugin installation is unique to each user; make sure to install plugins as the user who will run the simulations.
Install the CumulusCommunity/cumulus-vx box image:
Vagrant box image installation is unique to each user; make sure to install images as the user who will run the simulations.
Test that everything is working:
To show all running KVM/
libvirtdomain is running. To stop this machine, you can run
vagrant halt. To destroy the machine, you can run
After completing these steps, Vagrant is now set up.
Create the Vagrantfile and Launch KVM Instances
- If you plan on simulating Cumulus VX 2.5.x read this note...
Make sure your Vagrantfiles do not attempt to set the hostname of the VM as that is not supported for older versions of Cumulus VX. If you see a
device.vm.nameline as in the following example, remove it:
After the repo is cloned, change to its directory:
Copy the Vagrantfile-KVM into place.
Check the status of the VMs to see that none of them have been created yet:
All Vagrant commands performed against a simulation such as
vagrant destroymust be issued from the directory that contains the Vagrantfile.
Bring up all the images using
After following all the steps above, the VMs are created and accessible. Issue the following command to access the out-of-band management server VM:
Experiment with your simulation.
- Explore the various demos available as part of the cldemo-vagrant family of repositories located here: https://github.com/CumulusNetworks/cldemo-vagrant#available-demos
Destroy the simulation when finished.