Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add config for swp3

...

  1. Review the Linux version of the host:

    Note

    This guide is validated and verified for Ubuntu Trusty 14.04.5 LTS starting from a clean install.

    Code Block
    languagetext
    local@host:~$ uname -a
    Linux ubuntu-trusty-64 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  2. Run the following commands to install libvirt:

    Code Block
    languagetext
    local@host:~$ sudo add-apt-repository ppa:linuxsimba/libvirt-udp-tunnel 
    local@host:~$ sudo apt-get update -y
    local@host:~$ sudo apt-get install libvirt-bin libvirt-dev qemu-utils qemu
    local@host:~$ sudo /etc/init.d/libvirt-bin restart
    Note

    The linuxsimba/libvirt-udp-tunnel package repository provides an updated libvirtd version that includes enhancements required to launch Cumulus VX. The example below shows the installation output:

    Code Block
    languagetext
    local@host:~/$ sudo apt-get install libvirt-bin libvirt-dev qemu-utils qemu
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    tree is already the newest version.
    git is already the newest version.
    qemu-utils is already the newest version.
    qemu-utils set to manually installed.
    The following packages were automatically installed and are no longer required:
      bsdtar libarchive13 liblzo2-2 libnettle4 linux-headers-4.2.0-34
      linux-headers-4.2.0-34-generic linux-image-4.2.0-34-generic
      linux-image-extra-4.2.0-34-generic ruby-childprocess ruby-erubis ruby-ffi
      ruby-i18n ruby-log4r ruby-net-scp ruby-net-ssh
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      libvirt0 python-paramiko python-support qemu-system qemu-system-arm
      qemu-system-mips qemu-system-misc qemu-system-ppc qemu-system-sparc
      qemu-user sshpass
    Suggested packages:
      radvd lvm2 qemu-user-static samba vde2 openbios-ppc openhackware qemu-slof
    The following NEW packages will be installed:
      htop python-paramiko python-support qemu qemu-system qemu-system-arm
      qemu-system-mips qemu-system-misc qemu-system-ppc qemu-system-sparc
      qemu-user sshpass
    The following packages will be upgraded:
      ansible libvirt-bin libvirt-dev libvirt0
    4 upgraded, 12 newly installed, 0 to remove and 18 not upgraded.
    Need to get 31.1 MB of archives.
    After this operation, 166 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
  3. After the installation process is complete, log out, then log back in to verify the libvirt version.

    Note
    In this guide, libvirt 1.2.16 was verified.
    Code Block
    languagetext
    local@host:~# libvirtd --version
    libvirtd (libvirt) 1.2.16

...

  1. Copy the qcow2 image onto a Linux server four times to create the four VMs, then name them as follows:

    • leaf1.qcow2

    • leaf2.qcow2

    • spine1.qcow2

    • spine2.qcow2

  2. Power on leaf1.qcow2 and configure it as follows:

    Code Block
    languagetext
    sudo /usr/bin/kvm   -curses                             \
                        -name leaf1                       \
                        -pidfile leaf1.pid                \
                        -smp 1                              \
                        -m 256                              \
                        -net nic,vlan=10,macaddr=00:01:00:00:01:00,model=virtio \
                        -net user,vlan=10,net=192.168.0.0/24,hostfwd=tcp::1401-:22 \
                        -netdev socket,udp=127.0.0.1:1602,localaddr=127.0.0.1:1601,id=dev0 \
                        -device virtio-net-pci,mac=00:02:00:00:00:01,addr=6.0,multifunction=on,netdev=dev0,id=swp1 \
                        -netdev socket,udp=127.0.0.1:1606,localaddr=127.0.0.1:1605,id=dev1 \
                        -device virtio-net-pci,mac=00:02:00:00:00:02,addr=6.1,multifunction=off,netdev=dev1,id=swp2 \
                        -netdev socket,udp=127.0.0.1:1610,localaddr=127.0.0.1:1609,id=dev2 \
                        -device virtio-net-pci,mac=00:02:00:00:00:09,addr=6.2,multifunction=off,netdev=dev2,id=swp3 \
                        leaf1.qcow2
  3. Power on leaf2.qcow2 and configure it as follows:

    Code Block
    languagetext
    sudo /usr/bin/kvm   -curses                             \
                        -name leaf2                       \
                        -pidfile leaf2.pid                \
                        -smp 1                              \
                        -m 256                              \
                        -net nic,vlan=10,macaddr=00:01:00:00:02:00,model=virtio \
                        -net user,vlan=10,net=192.168.0.0/24,hostfwd=tcp::1402-:22 \
                        -netdev socket,udp=127.0.0.1:1604,localaddr=127.0.0.1:1603,id=dev0 \
                        -device virtio-net-pci,mac=00:02:00:00:00:03,addr=6.0,multifunction=on,netdev=dev0,id=swp1 \
                        -netdev socket,udp=127.0.0.1:1608,localaddr=127.0.0.1:1607,id=dev1 \
                        -device virtio-net-pci,mac=00:02:00:00:00:04,addr=6.1,multifunction=off,netdev=dev1,id=swp2 \
                        -netdev socket,udp=127.0.0.1:1612,localaddr=127.0.0.1:1611,id=dev2 \
                        -device virtio-net-pci,mac=00:02:00:00:00:10,addr=6.2,multifunction=off,netdev=dev2,id=swp3 \
                        leaf2.qcow2
  4. Power on spine1.qcow2 and configure it as follows:

    Code Block
    languagetext
    sudo /usr/bin/kvm   -curses                             \
                        -name spine1                       \
                        -pidfile spine1.pid                \
                        -smp 1                              \
                        -m 256                              \
                        -net nic,vlan=10,macaddr=00:01:00:00:03:00,model=virtio \
                        -net user,vlan=10,net=192.168.0.0/24,hostfwd=tcp::1403-:22 \
                        -netdev socket,udp=127.0.0.1:1601,localaddr=127.0.0.1:1602,id=dev0 \
                        -device virtio-net-pci,mac=00:02:00:00:00:05,addr=6.0,multifunction=on,netdev=dev0,id=swp1 \
                        -netdev socket,udp=127.0.0.1:1603,localaddr=127.0.0.1:1604,id=dev1 \
                        -device virtio-net-pci,mac=00:02:00:00:00:06,addr=6.1,multifunction=off,netdev=dev1,id=swp2 \
                        -netdev socket,udp=127.0.0.1:1609,localaddr=127.0.0.1:1610,id=dev2 \
                        -device virtio-net-pci,mac=00:02:00:00:00:11,addr=6.2,multifunction=off,netdev=dev2,id=swp3 \
                        spine1.qcow2
  5. Power on spine2 and configure it as follows:

    Code Block
    languagetext
    sudo /usr/bin/kvm   -curses                             \
                        -name spine2                       \
                        -pidfile spine2.pid                \
                        -smp 1                              \
                        -m 256                              \
                        -net nic,vlan=10,macaddr=00:01:00:00:04:00,model=virtio \
                        -net user,vlan=10,net=192.168.0.0/24,hostfwd=tcp::1404-:22 \
                        -netdev socket,udp=127.0.0.1:1605,localaddr=127.0.0.1:1606,id=dev0 \
                        -device virtio-net-pci,mac=00:02:00:00:00:07,addr=6.0,multifunction=on,netdev=dev0,id=swp1 \
                        -netdev socket,udp=127.0.0.1:1607,localaddr=127.0.0.1:1608,id=dev1 \
                        -device virtio-net-pci,mac=00:02:00:00:00:08,addr=6.1,multifunction=off,netdev=dev1,id=swp2 \
                        -netdev socket,udp=127.0.0.1:1611,localaddr=127.0.0.1:1612,id=dev2 \
                        -device virtio-net-pci,mac=00:02:00:00:00:12,addr=6.2,multifunction=off,netdev=dev2,id=swp3 \
                        spine2.qcow2
    Note

    The QEMU/KVM commands used here are minimal. You can add more parameters, such as -enable-kvm, -serial or -monitor, as needed.

    Note
    titleBridging Switch Port Interfaces

    If you intend to bridge the switch ports in the VM, place each switch port in the bridge in its own virtual network on the host. Otherwise, you might see this error:

    Code Block
    languagetext
    br0: received package on swp1 with own address as source address

...