Install CSR1000v on KVM and Centos Linux

CSR1000v on KVM installation is covered in Cisco’s documentation using the GUI as well as Openstack and Openstack’s Nova, but there’s not much current information regarding KVM based installs using the CLI.  With a little work, I was able to install the Cloud Services Router on Centos Linux with minimal effort.

I opted to use the Centos 7 Linux distribution (Virtualization Host Minimal Install) for several reasons, but mainly because Red Hat Enterprise Linux (RHEL) is currently the preferred (commercial) distribution for most mission critical deployments.  Centos is the community supported (i.e. “free”) equivalent and the knowledge set is transferable between the two distributions.    The CSR1000v on KVM specific instructions should apply to most Linux variants that use libvirt for KVM management, but things like bridge configuration can vary between Linux distributions.

Centos, KVM, and libvirt Installation

First, make sure your server processor supports Intel’s VT-x or AMD’s equivalent.  Next, install the KVM modules, libvirt for KVM management, and set up a bridge interface on your server.  Plenty has already been written on those subjects, so we’ll jump straight into the CSR1000v install assuming these dependencies are met and the CSR1000v ISO has been downloaded from CCO.

CSR1000v on KVM Installation

I created a new folder off the root directory called “images”, simply to save on typing.  The /images directory is where I’m storing the CSR1000v ISO file as well as the disk image for the CSR1000v.  On a production server, the proper location for the disk images is /var/lib/libvirt/images/.  Directory and file permissions are already set properly at that location.

The following command creates a VM named csr1000v with Cisco’s recommended 4096M of RAM, 8G of disk space, and is connected to the bridge interface br0.

[root@jcpe images]# virt-install -n csr1000v -r 4096 -c csr1000v-universalk9.03.14.01.S.155-1.S1-std.iso -b br0,model=virtio -f csr1000v.img -s 8 --nographics --accelerate --os-variant=rhl7

After hitting enter, the installation will begin and you’ll automatically be connected to the router console.  At the time of this writing, Red Hat Enterprise Linux 7 is the most current release and my preliminary testing showed good results; I haven’t been able to find any official documentation on the “best” os variant to use.  You can see the different OS-variant options by typing osinfo-query os.

WARNING CDROM media does not print to the text console by default, so you likely will not see text install output. You might want to use --location.  See the man page for examples of using --location with CDROM media

Starting install…
Allocating ‘csr1000v.img’ | 8.0 GB 00:00
Creating domain… | 0 B 00:00
Connected to domain csr1000v
Escape character is ^]
Press any key to continue.
Press any key to continue.
Press any key to continue.

GNU GRUB version 0.97 (639K lower / 3144696K upper memory)

-output removed-

Guest installation complete… restarting guest.

Everything will reboot again, eventually presenting you with a familiar screen:

cisco CSR1000V (VXE) processor (revision VXE) with 2152318K/6147K bytes of memory.
Processor board ID 95LAWYUQXNJ
1 Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
3988512K bytes of physical memory.


-output removed-


— System Configuration Dialog —

Would you like to enter the initial configuration dialog? [yes/no]:

Now that you’re in the router, the escape character to return to a Linux prompt is ^] and use the virsh console [VM ID] to get back to the router console.  In this particular case, the VM ID is 19.

[root@jcpe images]# virsh list
Id    Name                           State
19    csr1000v                       running

[root@jcpe images]#

You’ll need to know a few other Linux commands to navigate your new virtual environment:

  • virsh list –all will list all VM’s on the machine (note: two dashes)
  • virsh shutdown will (try to) gracefully shutdown a VM
  • virsh destroy is a virtual power switch to a VM if it can’t be shut down gracefully
  • virsh start will start a VM
  • virsh reboot will reboot your VM
  • virsh undefine will delete your VM from the server.

To add another interface to the router, use the virsh attach-interface command.  In my case, the syntax was:

[root@jcpe images]# virsh attach-interface --domain csr1000v --type bridge --model virtio --config --live --source br0
Interface attached successfully

[root@jcpe images]# virsh domiflist csr1000v

Interface  Type       Source     Model       MAC
vnet0      bridge     br0        virtio     52:54:00:3a:75:60
vnet1      bridge     br0        virtio     52:54:00:b0:0e:cd

Notice that we’ve specified the virtio driver instead using the default rtl8139 driver.  The short answer is: virtio is a high performance driver, however, it doesn’t support jumbo packets over 1518 bytes.  You can read more about tuning and Cisco’s recommended vhost-net driver below.

Increasing Performance on KVM Installations

In closing…

This article explains how to install the Cisco CSR1000v on KVM using the CLI.  Using the concepts outlined in this article, you can virtualize (KVM) and emulate (QEMU) a large variety of operating systems without the expense of dedicated hardware.  I encourage you to experiment with different settings and share your results by commenting below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.