Virtualization system requirements

PNETLab version 4.2.10 or later is required to install and launch vESR.

Creating a virtual machine

1) PNETLab allows virtual machines to be included in topologies using a template in .yml format and a disk image .qcow2 (the QEMU virtualization system volume image format). Therefore, to launch vESR in PNETLab, a .qcow2 file must be obtained from the .iso file, following the instructions in Installing vESR via QEMU/KVM (the "Creating a virtual machine" and "Installing vESR" sections), or an existing .qcow2 image from the files supplied with vESR can be used. In this case, proceed to step 2.

Create a disk for the subsequent ISO image installation:

host@host:~$ qemu-img create -f qcow2 -o size=500M hda.qcow2

Install the image onto the created disk:

host@host:~$ qemu-system-x86_64 --enable-kvm -cpu host -smp 4 hda.qcow2 -cdrom vesr-installer.iso -boot d -m 3G -net nic -net user

For the PNETLab virtualization system, the name of the disk to be used matters; in the example it is "hda".

The .qcow2 image for import into PNETLab is ready.

2) Prepare the template. Create the vesr.yml file with the following content:

---
type: qemu
description: Eltex vESR
name: vESR
cpulimit: 1
icon: Router.png
cpu: 4
ram: 3072
qemu_nic: e1000
ethernet: 4
eth_format: gi1/0/{1}
console: telnet
shutdown: 1
qemu_arch: x86_64
qemu_version: 2.12.0
qemu_options: -machine type=pc,accel=kvm -serial mon:stdio -no-user-config -nodefaults -rtc base=utc -vga std>
...

The vESR settings must match those specified when installing from iso onto qcow2 (see step 1):

cpu - matches -smp 4
ram - matches -m 3G

The hda.qcow2 volume image and the vesr.yml template are ready.

Importing the template and disk into PNETLab

1) Connect to PNETLab via SSH and create a folder.

The template name is linked to the name of the folder that will contain the prepared image, so it must necessarily start with vesr-, followed by the version of the specific image.

mkdir /opt/unetlab/addons/qemu/vesr-1.37

2) Upload the virtual machine image file from the local computer to the PNETLab file system.

Transfer the files to PNETLab using WinSCP/FileZilla, or using SCP:

scp hda.qcow2 root@198.51.100.2:/opt/unetlab/addons/qemu/vesr-1.37/

3) Select the folder for the .yml template upload. Depending on the processor manufacturer used for server virtualization, the template folder is selected.

On the server, check the processor manufacturer name using the command below:

root@eve-ng:~# lsmod | grep ^kvm
kvm_intel             466944  6
kvm                  1388544  1 kvm_intel

• If the processor is Intel, the template files must be located in "/opt/unetlab/html/templates/intel/"
• If the processor is AMD, the template files must be located in "/opt/unetlab/html/templates/amd/"

4) Upload the vesr.yml template to the PNETLab server.

Using the scp command, upload the template to the following folder:

scp vesr.yml root@198.51.100.2:/opt/unetlab/html/templates/intel/

The example describes creating the template on the host machine and transferring it to the PNETLab server. The template can also be created directly in the required folder within the virtualization system.

5) Fix file read permissions.
To do this, run the script in PNETLab:

root@pnetlab:~# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions

6) Add vESR as a node to the laboratory.
Go to the PNETLab web interface, open the "Node" item in the context menu in the laboratory, and select "Eltex vESR" from the list:

7) Configure vESR. The settings are imported from the vesr.yml template. At this stage, it is enough to verify that everything was transferred correctly and nothing needs to be changed (if the values do not match, change them to those specified in the template):

8) Start the node and determine the Telnet port to which vESR will be connected to. Select the node and click "Start":

If after the completed configuration vESR does not start (the node does not start up), check the virtualization settings for the PNETLab VM.

In the virtual machine settings on the "Processors" tab, enable the "Virtualize Intel VT-x/EPT or AMD-V/RVI" and "Virtualize CPU perfomance counters" options.

If during the node startup the following error appears in the PNETLab console "kvm: 2366: cpu0 disabled perfctr wrmsr: 0x186 data 0x5100c0", run the following command as the root user:

echo "options kvm ignore_msrs=1 report_ignored_msrs=0" > /etc/modprobe.d/kvm.conf

When the mouse cursor is placed over the node, the port at which vESR is accessible is shown:

Thus, subsequent connection to vESR is made via Telnet on port 30001.

Connecting network interfaces

1) To connect a network interface, add a Net network to the laboratory. Connect the objects with a link:

Go to the console to configure the vESR interface:

Configure the IP addressing on vESR and verify IP connectivity.

vesr# configure
vesr(config)# interface gigabitethernet 1/0/1
vesr(config-if-gi)# ip address 198.51.100.2/24
vesr(config-if-gi)# exit
vesr(config)# exit
Warning: you have uncommitted configuration changes.
vesr# commit
Configuration has been successfully applied and saved to flash. Commit timer started, changes will be reverted in 600 seconds.
vesr# confirm
Configuration has been confirmed. Commit timer canceled.
vesr# ping 198.51.100.1
PING 198.51.100.1 (198.51.100.1) 56 bytes of data.
!!!
--- 198.51.100.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.150/0.223/0.313/0.069 ms

vESR now has direct IP connectivity with the host, enabling Telnet and SSH access to vESR, as well as vESR firmware updates, file uploads, and file downloads.