Host Requirements
Hardware
CPU: x86_64 8 cores or more with Virtualization enabled
Memory: 8GB or more system memory
Disk Space: 256GB or more available disk space
Network Interface: 1 GbE NIC
Operating System
Ubuntu 20.04 or later (64-bit)
Hypervisor Software
KVM (Kernel-based Virtual Machine) is the leading open-source virtualisation technology for Linux. It installs natively on all Linux distributions and turns underlying physical servers into hypervisors so that they can host multiple, isolated virtual machines (VMs).
We will be using KVM to serve as the hypervisor for the FTAS VM because KVM being a type-1 hypervisor, it outperforms all type-2 hypervisors, ensuring near-metal performance.
Please refer to the following steps to install it on the host machine
Ensure that the latest Ubuntu packages are installed
sudo apt-get update && sudo apt-get upgrade
Install KVM packages
sudo apt install libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu qemu-kvm
Check if KVM acceleration is ready
kvm-ok
# You should see a message like "KVM acceleration can be used"
sonic@sonic-39:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
sonic@sonic-39:~$
Add user to libvirt group
Verify if the libvirt user group is available using the below command
sudo getent group | grep libvirt
sonic@sonic-39:~$ sudo getent group | grep libvirt
libvirt:x:119:sonic,root
libvirt-qemu:x:64055:libvirt-qemu
libvirt-dnsmasq:x:120:
sonic@sonic-39:~$
If the libvirt group is not available, it can be created using the below command
sudo groupadd --system libvirt
sonic@sonic-39:~$ sudo groupadd --system libvirt
groupadd: group 'libvirt' already exists
sonic@sonic-39:~$
Then add the current user to the group
sudo usermod -a -G libvirt $(whoami)
Set user and group for qemu. Update the qemu config with your user and libvirt group
sudo vi /etc/libvirt/qemu.conf
# Some examples of valid values are:
#
# user = "qemu" # A user named "qemu"
# user = "+0" # Super user (uid=0)
# user = "100" # A user named "100" or a user with uid=100
#
#user = "root"
user = "<your host user>"
# The group for QEMU processes run by the system instance. It can be
# specified in a similar way to the user.
group = "libvirt"
Restart the libvirtd service
sudo systemctl stop libvirtd
sudo systemctl start libvirtd
Check the status of the libvirtd service
sudo systemctl status libvirtd
sonic@sonic-39:~$ sudo systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2023-02-18 10:16:26 UTC; 27s ago
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 68774 (libvirtd)
Tasks: 33 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─54120 /usr/bin/qemu-system-x86_64 -name guest=ftas03,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-8-ftas03/master-key.aes -machine pc-i440fx-1.5,accel
└─68774 /usr/sbin/libvirtd
Feb 18 10:16:26 sonic-39 systemd[1]: Starting Virtualization daemon...
Feb 18 10:16:26 sonic-39 systemd[1]: Started Virtualization daemon.
lines 1-13/13 (END)
If your server has a GUI desktop installed, you may want to install virt-manager. The virt-manager application is a desktop Graphical user interface for managing virtual machines through libvirt
sudo apt-get install virt-manager
Network Configuration
It is recommended that the virtual NIC on the VM should be bridged with the physical NIC on the host machine.
In this sample configuration eno1 is the physical NIC of the host machine, which is typically used for SSH(Management).
#/etc/netplan/00-installer-config.yaml
network:
ethernets:
enp1s0:
dhcp4: no
bridges:
br0:
interfaces: [enp1s0]
dhcp4: yes
mtu: 1500
parameters:
stp: true
forward-delay: 4
dhcp6: no
version: 2
#/etc/netplan/00-installer-config.yaml
network:
ethernets:
enp1s0:
dhcp4: no
bridges:
br0:
interfaces: [enp1s0]
addresses: [172.16.1.100/24]
gateway4: 172.16.1.1
mtu: 1500
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
parameters:
stp: true
forward-delay: 4
dhcp4: no
dhcp6: no
version: 2
Apply the above configuration
sudo netplan apply
This step will reset the SSH connection and reassign the static IP from the physical interface(enp1s0) to the bridge interface(br0).
Last updated