Cisco Nexus 9300v Vagrant Libvirt Boxes

Cisco Nexus 9300v is supported by the netlab libvirt package command. To build a Nexus 9300v box:

  • Create an empty directory on an Ubuntu machine with libvirt and Vagrant.

  • Download Nexus 9300v disk image (.qcow2 file) into that directory

  • Execute netlab libvirt package nxos virtual-disk-file-name and follow the instructions

Warning

  • The box-building process generates a random device serial number that will be used by all Nexus 9300v devices created from the Vagrant box. As NX-OS uses the device serial number as its DHCP client ID, you might experience problems starting a lab with more than one Nexus 9300v device on newer versions of KVM/libvirt. The workaround-of-last-resort is setting libvirt batch_size to 1.

  • If you’re using a ‌netlab release older than 1.8.2, or if you’re using a Linux distribution other than Ubuntu, please read the box-building caveats first.

Tip

See Cisco Nexus OS Caveats if you want to run NX OS 10.1 or later

Initial Device Configuration

During the box-building process (inspired by this solution) you’ll have to copy-paste the initial device configuration. netlab libvirt config nxos command displays the build recipe:

Creating initial configuration for Cisco Nexus OS 9.3, 10.1 and 10.2
====================================================================

* If faced with annoying power-on auto provisioning (POAP) prompt, answer "skip"
* Login with username 'admin', no password
* Go into enable mode, enter configuration mode
* Copy-paste the following configuration

======================================================
feature bash-shell
!
username admin password admin!
no ip domain-lookup
username vagrant password vagrant role network-admin
!
username vagrant sshkey ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==
!
feature nxapi
feature scp-server
!
line vty
  exec-timeout 0
!
interface mgmt0
  ip address dhcp
  no shutdown
!
======================================================

* Find NXOS image name in bootflash (dir bootflash:)
* Configure boot image with 'boot nxos bootflash:/_imagename_'

WARNING: Without configuring the boot image, the Vagrant box stops at the
"loader >" prompt

When you're done configuring the device:

* Exit configuration mode
* Execute 'copy running startup'
* Disconnect from console (ctrl-] usually works). Do not do anything else
  (like reloading the box).