This document describes how to install and set up Cumulus Linux within a Vagrant environment, using VirtualBox as the hypervisor.
Configure the Vagrant Environment
Cumulus VX requires Vagrant version 1.7 or later. The installation steps below use Vagrant version 1.9.4 for the example commands.
To set up the Vagrant environment:
Download and install Vagrant: Vagrant Downloads.
In a terminal, add the Cumulus VX Vagrant box image. Ensure option
Vagrant downloads and installs the latest Cumulus VX VirtualBox image.
Cumulus Networks provides several preconfigured demos to run with Vagrant using Ansible to configure the VMs. To run these demos, download and install Ansible 1.7 or newer.
Configure a Cumulus VX VM with Vagrant
In a terminal, create a folder to contain the Vagrant environment, then change directories into that folder.
Initialize the Vagrant environment so you can provision your VMs. This creates a file called
Vagrantfilewithin the folder you just created.
Configure Vagrant to spin up a Cumulus VX VM. Modify the newly created
Vagrantfileto configure the VMs, then save the file:
Cumulus VX 3.y.z images require at least 512MB to be fully functional. The default Vagrant memory size is 512MB. If performance issues exist, increase the amount of memory by setting the
v.memoryvariable in the
Vagrantfileto 512 or more. You can also adjust the memory size in the VirtualBox UI when the VM is powered off.
vagrant upto start the VM:
After you start a VM, you can log in using the
vagrant ssh command logs in as the preconfigured
vagrant user. A shared file system is automatically mounted inside the VM under the
/vagrant mount point; you can transfer files between the host and Cumulus VX instance from there.
To shut down the VM, use the
For more information on configuring VMs with Vagrant, see docs.vagrantup.com/v2/.
You can explore the various demos available as part of the cldemo-vagrant family of repositories located here: https://github.com/CumulusNetworks/cldemo-vagrant#available-demos.
Additional Configuration Options
Add Switch Port Interfaces to a Cumulus VX VM
By default Vagrant only configures the first network interface (eth0) for its own use. You must configure additional network interfaces, such as the Cumulus Linux switch port interfaces, in the
Vagrantfile. Normally, you configure these interfaces to use a private network. By default, Vagrant provides one preconfigured private network, although you can choose to create additional private networks. You can connect one or more network interfaces to a private network.
The following example creates a Cumulus VX VM where the interfaces swp1 through swp4 are created and connected to the preconfigured private network:
For more information on creating and using private networks, see docs.vagrantup.com/v2/networking/private_network.html and docs.vagrantup.com/v2/virtualbox/networking.html.
Create Multiple Cumulus VX VMs
Vagrant can create and configure multiple VMs with a single command. For example, you can use Vagrant to create multiple Cumulus VX VMs and then connect the network interfaces of those VMs together.
The following example creates two Cumulus VX VMs, leaf1 and leaf2, where the interfaces swp1 through swp4 are connected together via separate private networks:
When you run
vagrant up, both VMs are created. You can log in to each VM and configure the interfaces as you want; the interfaces will pass traffic between themselves as if they are two physical switches connected together by four cables.
At this time, there are some limitations to using Vagrant with Cumulus VX:
- VirtualBox can only support a maximum of 36 network interfaces.
- The first network interface (eth0) is always managed by Vagrant and must be connected to a NAT network.
Cumulus VX for Vagrant has been tested in the following environments:
|Host OS||Vagrant Version(s)||VirtualBox Version(s)||Notes|
|OS X 10.10|
While both VirtualBox and Vagrant are fully supported on Windows hosts, Vagrant provisioning with Ansible is not.