Saturday, March 14, 2020

Nested KVM performance evaluation on Ubuntu 20.04 (Focal Fossa)

Update as of 03/24/2020 00:15 a.m.
   Issue has been fixed. KVM Guest 
   is installing on Q9550 box
End Update

Setup KVM on Ubuntu 20.04

Performance appraisal has been done via attempt to set up Ubuntu 20.04 (L0) as KVM virtualization host installing Qemu && Libvirt per
L1-ManjaroGDM 19.02 Guest is starting up CentOS 8.1 Server domain at Level L2. L1 and L2 guests got their XML profiles updated with <cpu mode='host-passthrough'> in virsh console of parent domains. Following below is the set commands setting up KVM Hypervisor  on Ubuntu 20.04 (beta) on bare metal :-

$ sudo apt -y install qemu-kvm \
    libvirt-daemon bridge-utils \
    virtinst libvirt-daemon-system
$ sudo apt -y install virt-top libguestfs-tools \
   libosinfo-bin  qemu-system virt-manager

$ sudo modprobe vhost_net 
$ lsmod | grep vhost
vhost_net              24576  0
tun                    49152  1 vhost_net
vhost                  49152  1 vhost_net
tap                    28672  1 vhost_net
$ echo vhost_net | sudo tee -a /etc/modules
$ sudo shutdown -r now

Please, be aware that successful install KVM on Ubuntu 20.04 might require in meantime CPU's generation Haswell at least.
Bug is pending at regarding issues with Penryn's (2007) based boxes.

Setup KVM on Mangaro Gnome 19.02 L1 Guest
$ sudo pacman -S qemu virt-manager virt-viewer \
   dnsmasq vde2 bridge-utils openbsd-netcat  
 $ sudo pacman -S ebtables iptables
 $ sudo systemctl enable libvirtd.service
 $ sudo systemctl start libvirtd.service

Tune /etc/libvirt/libvirtd.conf :   unix_sock_group = "libvirt" (line 85)  unix_sock_rw_perms = "0770" (line 102) When done restart libvirtd daemon. Changes been done will suppress  prompt for root password at Virt-Manager startup. They are, actually, optional.

 $ sudo usermod -a -G libvirt $(whoami)
 $ newgrp libvirt
 $ sudo systemctl restart libvirtd.service

Define network openstackvms.xml on the Manjaro Guest
# cat openstackvms.xml
   <forward mode='nat'>
       <port start='1024' end='65535'/>
   <bridge name='virbr1' stp='on' delay='0' />
   <mac address='52:54:00:60:f8:6d'/>
   <ip address='' netmask=''>
  <range start='' end='' />

This network would allow to launch VM on Manjaro Gnome 19.02 guest.
$ sudo virsh --connect qemu:///system net-define \  /home/boris/openstackvms.xml
$ sudo virsh --connect qemu:///system net-start openstackvms
$ sudo virsh --connect qemu:///system  \
net-autostart openstackvms