Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Installing the Virtual Route Reflector Image on KVM

date_range 17-Aug-21

Before you install vRR:

  1. Download the vRR software package (vrr-*.tgz) from the Virtual Route Reflector page and uncompress the package in a location accessible to the server.

  2. (For Ubuntu) Prepare the Ubuntu host by disabling APIC virtualization.

    Edit the /etc/modprobe.d/qemu-system-x86.conf file and add enable_apicv=0 to the line containing options kvm_intel.

    content_copy zoom_out_map
    options kvm_intel nested=1 enable_apicv=0
    

    Reboot the host or unload and reload the kernel module.

  3. (For CentOS) Copy the vRR image to the libvirtd directory and rename it with the name of your VM.

    content_copy zoom_out_map
    cp vrr-image-name vrr-vm-filename
    
    Note:

    For Junos Releases 15.1 >= Junos Os Releases < 16.1, use the unified package.

    Convert the vmdk image to qcow2 format using the qemu-img convert -f vmdk -O qcow2 vmdk-filename qcow2-filename command. For example: qemu-img convert -f vmdk -O qcow2 junos-x86-64-15.1R1.9.vmdk junos-x86-64-15.1R1.9.qcow2

    Starting with Junos OS Release 16.1, use the VRR KVM bundle: vrr-bundle-kvm-21.1R1.11.tgz. Only the qcow2 image within the KVM bundle: junos-x86-64-*.img is required to bring up VRR (you don't have to use the metadata.img).

    For example, these commands copy the download image to the vrr-VM01.img file in the libvirtd/images directory:

    content_copy zoom_out_map
    cp jinstall64-vrr-14.2R3.8-domestic.img /var/lib/libvirtd/images/vrr-VM01.img
    cp junos-x86-64-17.3R1.10.qcow2 /var/lib/libvirtd/images/vrr-VM01.img
    

To install vRR, perform these tasks:

Configuring the Linux Bridges

You must set up these Linux bridges for the vRR interfaces to have proper connectivity.

  • em0 interface (for example, vrr-mgmt)

  • em1 interface (for example, vrr-ext)

Note:

The em0 interface can only function as a management interface. You cannot use the em0 interface for routing configurations.

For remote connectivity to the vRR instance, you can add physical interfaces from the host.

The bridges are not persistent across reboots. To make them permanent, you must add them to the appropriate configuration files for your Linux distribution.

To configure the bridges:

  1. Create the bridges.
    content_copy zoom_out_map
    user@node:~$ brctl addbr vrr-mgmt
    user@node:~$ brctl addbr vrr-ext
    

    Verify that the bridges have been created with the brctl show command.

  2. For each bridge, an interface with the same name is created on the system. Make sure these interfaces are in an Admin Up state.
    content_copy zoom_out_map
    user@node:~$ ip link set dev vrr-mgmt up
    user@node:~$ ip link set dev vrr-ext up
    

    Verify that the interfaces are up with the ip link show command.

  3. To provide remote connectivity for the vRR instance, add physical interfaces to these bridges.
    content_copy zoom_out_map
    user@node:~$ brctl addif vrr-mgmt interface-name
    user@node:~$ brctl addif vrr-ext interface-name
    
Note:

KVM installations support virtio driver for the em1 and em2 interfaces.

Launching the vRR VM

The physical interfaces are mapped to the VM interfaces (such as em0) using Linux bridging. Figure 1 illustrates this mapping. You can use an XML template or the virt-install utility to create this interface mapping when you launch the vRR VM.

Figure 1: vRR Interface MappingvRR Interface Mapping

To launch the VRR instance:

  1. You can use the virsh create command or the virt-install utility.
    • Use the virsh create vrr-instance-name.xml command with the XML template file.

      For example: virsh create vrr.xml

      Here is a sample XML template file for vrr.xml.

      content_copy zoom_out_map
      <domain type='kvm' id='10'>
      <!-- Assign VRR VM instance name -->
        <name>sample_vrr</name>
      <!-- Assign Memory required for this VRR VM instance -->
        <memory unit='KiB'>25165824</memory>
        <currentMemory unit='KiB'>25165824</currentMemory>
        <memoryBacking>
          <locked/>
        </memoryBacking>
      <!-- Assign required virtual CPU for VRR VM instance, here 4 vcpu is assigned -->
        <vcpu placement='static' cpuset='0-3'>4</vcpu>
        <cputune>
          <vcpupin vcpu='0' cpuset='0'/>
          <vcpupin vcpu='1' cpuset='1'/>
          <vcpupin vcpu='2' cpuset='2'/>
          <vcpupin vcpu='3' cpuset='3'/>
        </cputune>
        <resource>
          <partition>/machine</partition>
        </resource>
        <sysinfo type='smbios'>
          <bios>
            <entry name='vendor'>Juniper</entry>
          </bios>
          <system>
            <entry name='manufacturer'>Juniper</entry>
            <entry name='product'>VRR</entry>
            <entry name='version'>16.1</entry>
          </system>
        </sysinfo>
        <os>
          <type arch='x86_64' machine='pc-i440fx-1.7'>hvm</type>
          <boot dev='hd'/>
          <smbios mode='sysinfo'/>
        </os>
        <features>
          <acpi/>
          <apic/>
        </features>
      <cpu mode='host-model'>
          <model fallback='allow'/>
          <topology sockets='1' cores='4' threads='1'/>
        </cpu>
        <clock offset='utc'/>
        <devices>
          <emulator>/usr/bin/kvm</emulator>
      <!-- Provide VRR VM instance image location -->
          <disk type='file' device='disk'>
                <driver name='qemu' type='qcow2' cache='writethrough'/>
                <source file='/var/tmp/junos-x86-64-21.1R1.11.img'/>
                <backingStore/>
                <target dev='vda' bus='virtio'/>
                <alias name='virtio-disk0'/>
                <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
            </disk>
          <controller type='pci' index='0' model='pci-root'>
            <alias name='pci.0'/>
          </controller>
      <!-- em0 – management interface with the associated bridge -->
          <interface type='bridge'>
                <source bridge='vrr-mgmt'/>
            <target dev='vnet5'/>
            <model type='virtio'/>
            <alias name='net0'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
          </interface>
      <!-- em1 – external data interface with the associated bridge -->
          <interface type='bridge'>
            <source bridge='vrr-ext'/>
            <target dev='vnet7'/>
            <model type='virtio'/>
            <alias name='net1'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
          </interface>
      <!-- em2 – external data interface with the associated bridge -->
          <interface type='bridge'>
            <source bridge='vrr-ext2'/>
            <target dev='vnet8'/>
            <model type='virtio'/>
            <alias name='net2'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
          </interface>
      <!-- em3 – external data interface with the associated bridge -->
          <interface type='bridge'>
            <source bridge='vrr-ext2'/>
            <target dev='vnet9'/>
            <model type='virtio'/>
            <alias name='net3'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
          </interface>
          <serial type='pty'>
            <source path='/dev/pts/0'/>
            <target port='0'/>
            <alias name='serial0'/>
          </serial>
          <console type='pty' tty='/dev/pts/0'>
            <source path='/dev/pts/0'/>
            <target type='serial' port='0'/>
            <alias name='serial0'/>
          </console>
          <memballoon model='none'>
             <alias name='balloon0'/>
          </memballoon>
        </devices>
        <seclabel type='none' model='none'/>
      </domain>
      
    • (For Junos OS Release 14.1 or 14.2) You can use the virt-install utility.

      content_copy zoom_out_map
      virt-install --name vrr-instance-name \
      --vcpus 1 \
      --ram 8192 \
      --import \
      --disk path=./image-name,format=qcow2,bus=virtio \
      --disk path=./metadata.img,format=qcow2,bus=virtio \
      --serial tcp,host=0.0.0.0:5025,protocol=telnet \
      --network bridge=vrr-mgmt,model=virtio \
      --network bridge=vrr-ext,model=virtio
      

      where:

      --name

      Specifies the name of the vRR instance.

      --disk

      Specifies the path to the image file.

      For example:

      content_copy zoom_out_map
      virt-install --name vrr-142r1 \
      --vcpus 1 \
      --ram 8192 \
      --import \
      --disk path=./junos-x86-64-14.2R1.6.img,format=qcow2,bus=virtio \
      --disk path=./metadata.img,format=qcow2,bus=virtio \
      --serial tcp,host=0.0.0.0:5025,protocol=telnet \
      --network bridge=vrr-mgmt,model=virtio \
      --network bridge=vrr-ext,model=virtio
      
      Note:

      After you have installed and started the vRR instance, you can access the serial console port for the VM using the Telnet protocol. For example: telnet 127.0.0.1 5025

  2. You can connect to the VM console using the virsh console vrr-instance-name command.

    Wait for the system to boot and present the login prompt. You can log in and configure vRR as you would normally do on a router.

    To disconnect from the console, press Ctrl + ].

  3. Verify that your VM is installed as vRR using the show version command.
    Note:

    The model must appear as vrr.

    For example:

    content_copy zoom_out_map
    root> show version
    
    content_copy zoom_out_map
    Model: vrr
  4. Verify that your VM is installed using the show interfaces terse command. The added interfaces appear as em interfaces. For example:
    content_copy zoom_out_map
    root> show interfaces terse
    
    content_copy zoom_out_map
    Interface               Admin Link Proto    Local                 Remote
    ...
    em0                     up    up
    em1                     up    up
    ...
    
footer-navigation