Deploy and Manage vJunosEvolved on KVM
SUMMARY Read this topic to understand how to deploy and manage the vJunosEvolved instance after you install it on KVM.
This topic describes:
-
How to bring up vJunosEvolved on the KVM servers using libvirt.
-
How to choose the amount of CPU and memory, set up the required bridges for connectivity, and configure the serial port.
-
How to use relevant XML file sections for the configurations and selections listed earlier for deployment.
Note:Download the sample XML file and the vJunosEvolved image from the Juniper website.
Set Up the vJunosEvolved Deployment on the Host Server
This topic describes how to set up the vJunosEvolved deployment on the host server.
This topic highlights only a few sections of the XML file that is used to deploy vJunosEvolved through libvirt.
The entire XML file vJunosEvolved.xml is available for download along with the VM image and associated documentation on the lab download page.
Install the packages mentioned in the minimum software requirements section, if they are not already installed. See Minimum Hardware Requirements for vJunosEvolved.
-
Create a Linux bridges for each WAN interface and configure them as
up.
For example, et-0/0/0, et-0/0/1, and so on, of vJunosEvolved that you plan to use.
# ip link add et000 type bridge
# ip link set et000 up
# ip link add et001 type bridge
# ip link set et001 up
-
Make a live disk copy of the provided QCOW2 vJunosEvolved image.
# cd /root
# cp vJunosEvolved-<release>.qcow2 vJunosEvolved-<release>-live.qcow2
# chmod u+w vjunosEvolved-<release>-live.qcow2
Make a distinct copy for each vJunosEvolved that you plan to deploy. Making a live copy ensures that you do not make any permanent changes on the original image. The live image must also be writable by the userid deploying vJunosEvolved—typically the root user.
-
Specify the number of cores provided to vJunosEvolved by modifying the
following stanza. For the default memory of 8GB required by vJunosEvolved,
use the following code snippet:
<cpu> match="exact" mode="host-model"> <topology cores="4" sockets="1" threads="1"/><model fallback="allow">qemu64</model> <feature name="svm" policy="disable"/> </cpu>
Note:A sample vJunosEvolved.xml file is also available with the posted vJunosEvolved image. This document refers to key snippets from that sample file to illustrate the stanzas the you need to edit in the XML file.
Use the sample vJunosEvolved.xml snippet files that are available with the posted vJunosEvolved image to prevent errors.
The following codeblock provides an example CPU XML snippet, where the default number of cores required is 4, which is sufficient for most applications. You can increase the number of cores added, by modifying the below stanza.
You can increase the memory if needed. It also shows the name of the specific vJunosEvolved being spawned, which is vJunosEvo in this case.<domain xmlns:ns0="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm"> <name>vJunosEvo</name> <memory unit="KiB">8388608</memory> <currentMemory unit="KiB">8388608</currentMemory> <vcpu placement="static">4</vcpu>
-
Modify the name and location of your vJunosEvolved image.
Note:
For libvirt and QEMU-KVM, each vJunosEvolved VM on the host needs to be provided with its own uniquely named QCOW2 image.
Use the following XML snippet to specify the name and location for your vJunosEvolved image:
<disk device="disk" type="file"> <driver cache="writeback" name="qemu" type="qcow2"/> <source file="/root/vJunosEvolved-live.qcow2"/> <target dev="vda" bus="virtio"/> </disk>
-
Create the configuration disk image.
# ./make-config.sh <juniper.conf> <config.qcow2>
The vJunosEvolved accepts an initial configuration by connecting a second disk to the VM instance that contains the configuration. Use the provided script make-config.sh to create the disk image.
The XML file references this configuration drive as shown below:
<disk device="disk" type="file"> <driver cache="writeback" name="qemu" type="qcow2"/> <source file="/root/config.qcow2"/> <target dev="vdb" bus=”virtio”/> </disk>
Note:If you do not prefer initial configuration, then remove the above stanza from the XML file.
-
Set up the management Ethernet port.
This step allows you to connect to the VM’s “re0:mgmt-0” that is the management port from outside the host server on which vJunosEvolved resides.
You need to have a routable IP address configured for re0:mgmt-0, either through a DHCP server or using standard CLI configuration.
<interface type='direct'> <source dev='eth0' mode='bridge'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface>
The “eth0” in the stanza above refers to the host server interface which provides connectivity to the external world and should match the name of this interface on your host server.
If you are not using Dynamic Host Configuration Protocol (DHCP), then, after the vJunosEvolved is up and running, telnet to it's console and configure the IP address for “re0:mgmt-0” using CLI configuration as shown below:
Note:The configurations in this step are examples or sample configuration snippets. You might have to set up a static route configuration as well.
# set interfaces re0:mgmt-0 unit 0 family inet address 10.92.249.111/23
# set routing-options static route 0.0.0.0/0 next-hop 10.92.249.254
Enable SSH to the RE management port.
# set system services ssh root-login allow
-
Create a Linux bridge for each of the ports you specify in the XML
file.
The port names are specified in the following codeblock.
The convention for vJunosEvolved is to use et00x. In the following example, et000 and et001 map to the Junos Evolved et-0/0/0 and et-0/0/1 interfaces respectively.
<interface> <interface type="bridge"> <source bridge="et000"/> <model type="virtio"/> <mtu size='9600'/> <alias name="net1"/> <address bus="0x00" domain="0x0000" function="0x0" slot="0x08" type="pci"/> </interface> <interface type="bridge"> <source bridge="et001"/> <model type="virtio"/> <mtu size='9600'/> <alias name="net2"/> <address bus="0x00" domain="0x0000" function="0x0" slot="0x09" type="pci"/> </interface>
-
Provide a unique serial console port number for each vJunosEvolved on your
host server.
In this sample sinppet "8610" is chosen.
</interface> <serial type="tcp"> <source host="127.0.0.1" mode="bind" service="8610"/> <protocol type="telnet"/> <target port="0"/> <alias name="serial0"/> </serial>
-
Create channelized or non-channelized interfaces.
The “channelized=yes” in the command line arg provides an option to create channelized WAN interfaces. If nothing mentioned or value of “no” mentioned, then non-channelized interfaces are initialized at COSIM.
<ns0:commandline> <ns0:arg value="-smbios"/> <ns0:arg value="type=0,vendor=Bochs,version=Bochs"/> <ns0:arg value="-smbios"/> <ns0:arg value="type=3,manufacturer=Bochs"/> <ns0:arg value="-smbios"/> <ns0:arg value="type=1,manufacturer=Bochs,product=Bochs,serial=chassis_no=0:slot=0:type=1:assembly_id=0x0D20:platform=251:master=0: channelized=yes "/> </ns0:commandline>
-
Create vJunosEvolved VM using the vJunosEvolved.xml file.
# virsh create vJunosEvolved.xml
This creates the first vJunosEvolved VM. The subsequent VMs can be vJunosEvolved2,vJunosEvolved3 and so on.
Domain vJunosEvolved created from vJunosEvolved.xml
Verify the vJunosEvolved VM
This topic describes how to verify whether vJunosEvolved is up and running.
-
Verify if the vJunosEvolved is up and running.
Note:
The XML file for download is “vJunosEvolved.xml”. If you are creating more than one instance, then the domain and XML and live disk files names must be unique.
But for a single instance it looks like this:
# virsh list Id Name State ---------------------------- 74 vJunosEvolved running
-
Connect to the serial console of the Routing Engine VM.
You can find the port to connect to from the XML file.
Note:The telnet port number needs to be unique for each vJunosEvolved VM residing on the host server.
# telnet localhost 8610 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. root@:~ #
-
Verify whether the ET interfaces that you had specified in your XML file
are up.
show interfaces terse
For example if "et000" and "et001" were specified in your XML file, then the et-0/0/0 and et-0/0/1 interfaces should be in "up" state. Other interfaces also shows up, but those interfaces can’t pass traffic.
root> show interfaces terse Interface Admin Link Proto Local Remote et-0/0/0 up up et-0/0/0.16386 up up multiservice pfh-0/0/0 up up pfh-0/0/0.16383 up up inet et-0/0/1 up up et-0/0/1.16386 up up multiservice [snip]
-
Verify whether a VNET interface under each corresponding "et" bridge is
configured.
Use the
brctl
command on the host server once vJunosEvolved is started. This command shows a vnet interface under each corresponding "et" bridge:# brctl show et000 bridge name bridge id STP enabled interfaces et000 8000.fe54001a0d69 no vnet13 # brctl show et001 bridge name bridge id STP enabled interfaces et001 8000.fe540077af98 no vnet14