SlideShare una empresa de Scribd logo
1 de 24
Virtualization
What is virtualization?
What is virtualization?
●

●

●

mov

Full virtualization

cmp
jmp

Para virtualization

call
push

Partial virtualization

pop
int

RAM

nop

MMU

CPU
What is virtualization?
●

●

●

mov

Full virtualization

cmp
jmp

Para virtualization

call
push

Partial virtualization

pop
int

RAM

nop

MMU

CPU
Find out if your CPU is 
virtualization enabled
For Intel VT-x
$ grep –color vmx /proc/cpuinfo
For AMD V
$ grep –color svm /proc/cpuinfo
flags
: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm
constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf
eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr
pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx lahf_lm
ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
Organization
Host kernel
●

KVM

●
●

Kernel

Kernel

VM

VM

Kernel

Kernel

VM

VM

Kernel

Kernel

VM

VM

KVM
- in the kernel
QEMU - System virtualization
Libvirt - management simplification
KVM Kernel configuration
CONFIG_KVM_GUEST=y

CONFIG_PARAVIRT=y

# CONFIG_KVM_DEBUG_FS is not set

# CONFIG_PARAVIRT_DEBUG is not set

CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y

CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_PARAVIRT_TIME_ACCOUNTING=y
CONFIG_PARAVIRT_CLOCK=y

CONFIG_HAVE_KVM_IRQ_ROUTING=y

CONFIG_VIRT_TO_BUS=y

CONFIG_HAVE_KVM_EVENTFD=y

CONFIG_VIRTIO_BLK=m

CONFIG_KVM_APIC_ARCHITECTURE=y

CONFIG_SCSI_VIRTIO=m

CONFIG_KVM_MMIO=y

CONFIG_VIRTIO_NET=m

CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y

CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_VIRT_DRIVERS=y

CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT CONFIG_VIRTIO=y
=y
# Virtio drivers
CONFIG_KVM=y

CONFIG_VIRTIO_PCI=y

CONFIG_KVM_INTEL=y

CONFIG_VIRTIO_BALLOON=m

# CONFIG_KVM_AMD is not set

CONFIG_VIRTIO_MMIO=m

# CONFIG_KVM_MMU_AUDIT is not set
CONFIG_KVM_DEVICE_ASSIGNMENT=y

CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_VIRTUALIZATION=y
KVM Kernel configuration
Processor type and features ->
Linux guest support -> *
BUS options -> PCI IOV
Device Drivers ->
Block devices -> Virtio block driver
SCSI device support -> SCSI low-level drivers -> virtio-scsi
Network device support -> Virtio network driver
Character devices ->
* HW Random Number Generator
Virtio console
Virtio drivers -> *
Virtualization -> *
Create
● Start
● Talk to QEMU
●
KVM tools

●

virsh

●

virt-manager
KVM information
●

List VMs
–
–

●

virsh list
virsh list – all (including the suspended and stopped)

Node Information
–

virsh nodeinfo – information about the host node

–

virsh dominfo vm_name - information about the VM

–

virsh vcpuinfo vm_name - CPU info about the VM
●

Start
–

●

VM Management :)

virsh start vm_name

Stop
–

- soft shutdown

–
●

virsh shutdown vm_name
virsh destroy vm_name

- power down

Restart
–
–

virsh shutdown vm_name

–

virsh destroy vm_name

–
●

virsh reboot vm_name

virsh start vm_name

- power cycle

Suspend
–

virsh suspend vm_name

- to RAM
Hibernate
●

Save - save the VM state to a file
–
–

●

virsh save vm_name
virsh save-image-define save-file.img

Restore
–

●

virsh restore save-file.img

File location
–

/var/lib/libvirt/qemu/
Network
●

List all defined networks
–

●

Get information for predefined network
–

●

virsh net-info net_name

Activate a network on Host boot
–

●

virsh net-list

virsh net-autostart net_name

Start/Stop/Remove network
–

virsh net-start net_name

–

virsh net-destroy net_name

–

virsh net-undefine net_name
Storage pools
●

List all defined storage pools
–

●

Get information for predefined pool
–

●

virsh pool-info pool_name

Activate a storage pool on Host boot
–

●

virsh pool-list

virsh pool-autostart pool_name

Start/Stop/Remove network
–

virsh pool-start net_name

–

virsh pool-destroy net_name

–

virsh pool-undefine net_name
Storage pools
●

Create a pool
# virsh pool-create pool.xml
# virsh pool-create-as --name pesho 
--type [dir,disk,fs,logical,netfs...] 
--target (depending on the type) 

●

Refresh the files/volume in a pool
# virsh pool-refresh pool_name
Volumes
●

Create
# virsh vol-create volume.xml
# virsh vol-create-as --pool=pool_name 
--name pesho_be 
--capacity (int in Bytes) 
--format [raw,bochs,qcow,qcow2,qed,vmdk]

●

Clone
# virsh vol-clone vol_name new_name --pool pool_name

●

Delete
# virsh vol-delete vol_name --pool pool_name
Snapshots
# virsh snapshot-create-as vm_name snapshot1
"backup1" --disk-only --atomic
# virsh snapshot-list vm_name
# virsh snapshot-info vm_name 
--snapshotname snapshot1
Migration
●

Migration with shared storage
virsh migrate --live Jab2 qemu+ssh://192.168.0.5/system

●

Migration with local storage
# qemu-img info /vm/vm-test.img
image: /vm/jivko-test.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 8.0G

# qemu-img create -f raw /vm/vm-test.img 8G
Formatting '/vm/jivko-test.img', fmt=raw size=8589934592

# virsh migrate --persistent --live --copy-storage-all Jab2
qemu+ssh://192.168.0.5/system
Create a new VM
●

Installation image

●

Command
–

qemu -drive file=ubuntu-lucid.img,if=virtio 
/path/to/kernel/bzImage 

-kernel

-append "console=ttyS0 root=/dev/vda" 
-m 512 -smp 1 -fsdev
local,id=test_dev,path=shared,security_model=none
-enable-kvm
Backups
Configuration
●

Fuck... it's XML based...
/etc/libvirt/qemu/vm_name.xml
/etc/libvirt/qemu/autostart
/etc/libvirt/qemu/networks
/var/lib/libvirt/images
Console & 
Debugging
●

Console
–
–

virsh console vm_name
/usr/bin/virsh -c 
'qemu+ssh://root@IP:22/system' console vm_name

–

●

Install virt-manager and setup connection to the host node,
then connect to the vm with double click :)

Debugging
# qemu -gdb tcp:127.0.0.1:1212 [...]
# gdb vmlinux-of-guest
(gdb) target remote tcp:127.0.0.1:1212
Common issues
●

Sometimes libvirt can't start some VMs
–

check if they have .save files in
●

–

check if there are files with the VM name in
●

–

/var/lib/libvirt/qemu/images
/var/lib/libvirt/qemu/save

If there are any files for that VM in either of these
dirs, remove them and the VM should start

Más contenido relacionado

La actualidad más candente

Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefsMarian Marinov
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroupsKernel TLV
 
Optimizing VM images for OpenStack with KVM/QEMU
Optimizing VM images for OpenStack with KVM/QEMUOptimizing VM images for OpenStack with KVM/QEMU
Optimizing VM images for OpenStack with KVM/QEMUOpenStack Foundation
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
Improving the Performance of the qcow2 Format (KVM Forum 2017)
Improving the Performance of the qcow2 Format (KVM Forum 2017)Improving the Performance of the qcow2 Format (KVM Forum 2017)
Improving the Performance of the qcow2 Format (KVM Forum 2017)Igalia
 
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Anne Nicolas
 
Comparison of foss distributed storage
Comparison of foss distributed storageComparison of foss distributed storage
Comparison of foss distributed storageMarian Marinov
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procKenny (netman)
 
DOXLON November 2016: Facebook Engineering on cgroupv2
DOXLON November 2016: Facebook Engineering on cgroupv2DOXLON November 2016: Facebook Engineering on cgroupv2
DOXLON November 2016: Facebook Engineering on cgroupv2Outlyer
 
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, CitrixXPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, CitrixThe Linux Foundation
 
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiesChris Huybregts
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesHao-Ran Liu
 

La actualidad más candente (20)

Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroups
 
Optimizing VM images for OpenStack with KVM/QEMU
Optimizing VM images for OpenStack with KVM/QEMUOptimizing VM images for OpenStack with KVM/QEMU
Optimizing VM images for OpenStack with KVM/QEMU
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
LSA2 - PostgreSQL
LSA2 - PostgreSQLLSA2 - PostgreSQL
LSA2 - PostgreSQL
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
Improving the Performance of the qcow2 Format (KVM Forum 2017)
Improving the Performance of the qcow2 Format (KVM Forum 2017)Improving the Performance of the qcow2 Format (KVM Forum 2017)
Improving the Performance of the qcow2 Format (KVM Forum 2017)
 
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
 
FUSE Filesystems
FUSE FilesystemsFUSE Filesystems
FUSE Filesystems
 
Comparison of foss distributed storage
Comparison of foss distributed storageComparison of foss distributed storage
Comparison of foss distributed storage
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
 
DOXLON November 2016: Facebook Engineering on cgroupv2
DOXLON November 2016: Facebook Engineering on cgroupv2DOXLON November 2016: Facebook Engineering on cgroupv2
DOXLON November 2016: Facebook Engineering on cgroupv2
 
NetBSDworkshop
NetBSDworkshopNetBSDworkshop
NetBSDworkshop
 
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, CitrixXPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
 
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 

Destacado

Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Novell
 
Virtualization Architecture & KVM
Virtualization Architecture & KVMVirtualization Architecture & KVM
Virtualization Architecture & KVMPradeep Kumar
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Wan Leung Wong
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Managerwalkerchang
 
Qemu & KVM Guide #1 (intro & basic)
Qemu & KVM Guide #1 (intro & basic)Qemu & KVM Guide #1 (intro & basic)
Qemu & KVM Guide #1 (intro & basic)JungIn Jung
 
Mastering kvm virtualization- A complete guide of KVM virtualization
Mastering kvm virtualization- A complete guide of KVM virtualizationMastering kvm virtualization- A complete guide of KVM virtualization
Mastering kvm virtualization- A complete guide of KVM virtualizationHumble Chirammal
 
Redis - BlagoevgradConf 2013
Redis - BlagoevgradConf 2013Redis - BlagoevgradConf 2013
Redis - BlagoevgradConf 2013svilen.ivanov
 
Kvm virtualization platform
Kvm virtualization platformKvm virtualization platform
Kvm virtualization platformAhmad Hafeezi
 
open source virtualization
open source virtualizationopen source virtualization
open source virtualizationKris Buytaert
 
Criação de ambientes em chroot
Criação de ambientes em chrootCriação de ambientes em chroot
Criação de ambientes em chrootRudá Moura
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJim Yeh
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinuxShay Cohen
 
Open Virtualization Format - Detailed
Open Virtualization Format - DetailedOpen Virtualization Format - Detailed
Open Virtualization Format - DetailedMahesh. Rudrachar
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDanny Abukalam
 
Chw00t: Breaking unices’ chroot solutions
Chw00t: Breaking unices’ chroot solutionsChw00t: Breaking unices’ chroot solutions
Chw00t: Breaking unices’ chroot solutionsPositive Hack Days
 
LXD: The hypervisor that isn't
LXD: The hypervisor that isn'tLXD: The hypervisor that isn't
LXD: The hypervisor that isn'ttych0
 

Destacado (20)

Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
Virtualization Architecture & KVM
Virtualization Architecture & KVMVirtualization Architecture & KVM
Virtualization Architecture & KVM
 
LSA2 - 02 chrooting
LSA2 - 02 chrootingLSA2 - 02 chrooting
LSA2 - 02 chrooting
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Manager
 
Qemu & KVM Guide #1 (intro & basic)
Qemu & KVM Guide #1 (intro & basic)Qemu & KVM Guide #1 (intro & basic)
Qemu & KVM Guide #1 (intro & basic)
 
Mastering kvm virtualization- A complete guide of KVM virtualization
Mastering kvm virtualization- A complete guide of KVM virtualizationMastering kvm virtualization- A complete guide of KVM virtualization
Mastering kvm virtualization- A complete guide of KVM virtualization
 
Redis - BlagoevgradConf 2013
Redis - BlagoevgradConf 2013Redis - BlagoevgradConf 2013
Redis - BlagoevgradConf 2013
 
Kvm virtualization platform
Kvm virtualization platformKvm virtualization platform
Kvm virtualization platform
 
virtio
virtiovirtio
virtio
 
Kvm setup
Kvm setupKvm setup
Kvm setup
 
open source virtualization
open source virtualizationopen source virtualization
open source virtualization
 
Criação de ambientes em chroot
Criação de ambientes em chrootCriação de ambientes em chroot
Criação de ambientes em chroot
 
Namespace
NamespaceNamespace
Namespace
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinux
 
Open Virtualization Format - Detailed
Open Virtualization Format - DetailedOpen Virtualization Format - Detailed
Open Virtualization Format - Detailed
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
 
Chw00t: Breaking unices’ chroot solutions
Chw00t: Breaking unices’ chroot solutionsChw00t: Breaking unices’ chroot solutions
Chw00t: Breaking unices’ chroot solutions
 
LXD: The hypervisor that isn't
LXD: The hypervisor that isn'tLXD: The hypervisor that isn't
LXD: The hypervisor that isn't
 

Similar a LSA2 - 01 Virtualization with KVM

Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Ontico
 
Performance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksPerformance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksMarian Marinov
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usagevincentvdk
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernellcplcp1
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems PerformanceBrendan Gregg
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMdata://disrupted®
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawnGábor Nyers
 
Overview of sheepdog
Overview of sheepdogOverview of sheepdog
Overview of sheepdogLiu Yuan
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld
 
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...confluent
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephRongze Zhu
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22Yuya Takei
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisAnne Nicolas
 
Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2While42
 
php & performance
 php & performance php & performance
php & performancesimon8410
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilationmcganesh
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVMAchieving the ultimate performance with KVM
Achieving the ultimate performance with KVMStorPool Storage
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfstroganovboris
 
PHP & Performance
PHP & PerformancePHP & Performance
PHP & Performance毅 吕
 

Similar a LSA2 - 01 Virtualization with KVM (20)

Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.
 
Performance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksPerformance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networks
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
Overview of sheepdog
Overview of sheepdogOverview of sheepdog
Overview of sheepdog
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
 
Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2
 
php & performance
 php & performance php & performance
php & performance
 
Pitr Made Easy
Pitr Made EasyPitr Made Easy
Pitr Made Easy
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilation
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVMAchieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
 
PHP & Performance
PHP & PerformancePHP & Performance
PHP & Performance
 

Más de Marian Marinov

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsMarian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDBMarian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMarian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfMarian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home eraMarian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL serverMarian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKMarian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networksMarian Marinov
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automationMarian Marinov
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingMarian Marinov
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of serversMarian Marinov
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failuresMarian Marinov
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingMarian Marinov
 
How to build your own anycast service
How to build your own anycast serviceHow to build your own anycast service
How to build your own anycast serviceMarian Marinov
 

Más de Marian Marinov (20)

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failures
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
How to build your own anycast service
How to build your own anycast serviceHow to build your own anycast service
How to build your own anycast service
 
Electrical workshop
Electrical workshopElectrical workshop
Electrical workshop
 

Último

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Último (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

LSA2 - 01 Virtualization with KVM

  • 5. Find out if your CPU is  virtualization enabled For Intel VT-x $ grep –color vmx /proc/cpuinfo For AMD V $ grep –color svm /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
  • 6. Organization Host kernel ● KVM ● ● Kernel Kernel VM VM Kernel Kernel VM VM Kernel Kernel VM VM KVM - in the kernel QEMU - System virtualization Libvirt - management simplification
  • 7. KVM Kernel configuration CONFIG_KVM_GUEST=y CONFIG_PARAVIRT=y # CONFIG_KVM_DEBUG_FS is not set # CONFIG_PARAVIRT_DEBUG is not set CONFIG_HAVE_KVM=y CONFIG_HAVE_KVM_IRQCHIP=y CONFIG_PARAVIRT_SPINLOCKS=y CONFIG_PARAVIRT_TIME_ACCOUNTING=y CONFIG_PARAVIRT_CLOCK=y CONFIG_HAVE_KVM_IRQ_ROUTING=y CONFIG_VIRT_TO_BUS=y CONFIG_HAVE_KVM_EVENTFD=y CONFIG_VIRTIO_BLK=m CONFIG_KVM_APIC_ARCHITECTURE=y CONFIG_SCSI_VIRTIO=m CONFIG_KVM_MMIO=y CONFIG_VIRTIO_NET=m CONFIG_KVM_ASYNC_PF=y CONFIG_HAVE_KVM_MSI=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM_VIRTIO=m CONFIG_VIRT_DRIVERS=y CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT CONFIG_VIRTIO=y =y # Virtio drivers CONFIG_KVM=y CONFIG_VIRTIO_PCI=y CONFIG_KVM_INTEL=y CONFIG_VIRTIO_BALLOON=m # CONFIG_KVM_AMD is not set CONFIG_VIRTIO_MMIO=m # CONFIG_KVM_MMU_AUDIT is not set CONFIG_KVM_DEVICE_ASSIGNMENT=y CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y # CONFIG_DEBUG_VIRTUAL is not set CONFIG_VIRTUALIZATION=y
  • 8. KVM Kernel configuration Processor type and features -> Linux guest support -> * BUS options -> PCI IOV Device Drivers -> Block devices -> Virtio block driver SCSI device support -> SCSI low-level drivers -> virtio-scsi Network device support -> Virtio network driver Character devices -> * HW Random Number Generator Virtio console Virtio drivers -> * Virtualization -> *
  • 11. KVM information ● List VMs – – ● virsh list virsh list – all (including the suspended and stopped) Node Information – virsh nodeinfo – information about the host node – virsh dominfo vm_name - information about the VM – virsh vcpuinfo vm_name - CPU info about the VM
  • 12. ● Start – ● VM Management :) virsh start vm_name Stop – - soft shutdown – ● virsh shutdown vm_name virsh destroy vm_name - power down Restart – – virsh shutdown vm_name – virsh destroy vm_name – ● virsh reboot vm_name virsh start vm_name - power cycle Suspend – virsh suspend vm_name - to RAM
  • 13. Hibernate ● Save - save the VM state to a file – – ● virsh save vm_name virsh save-image-define save-file.img Restore – ● virsh restore save-file.img File location – /var/lib/libvirt/qemu/
  • 14. Network ● List all defined networks – ● Get information for predefined network – ● virsh net-info net_name Activate a network on Host boot – ● virsh net-list virsh net-autostart net_name Start/Stop/Remove network – virsh net-start net_name – virsh net-destroy net_name – virsh net-undefine net_name
  • 15. Storage pools ● List all defined storage pools – ● Get information for predefined pool – ● virsh pool-info pool_name Activate a storage pool on Host boot – ● virsh pool-list virsh pool-autostart pool_name Start/Stop/Remove network – virsh pool-start net_name – virsh pool-destroy net_name – virsh pool-undefine net_name
  • 16. Storage pools ● Create a pool # virsh pool-create pool.xml # virsh pool-create-as --name pesho --type [dir,disk,fs,logical,netfs...] --target (depending on the type) ● Refresh the files/volume in a pool # virsh pool-refresh pool_name
  • 17. Volumes ● Create # virsh vol-create volume.xml # virsh vol-create-as --pool=pool_name --name pesho_be --capacity (int in Bytes) --format [raw,bochs,qcow,qcow2,qed,vmdk] ● Clone # virsh vol-clone vol_name new_name --pool pool_name ● Delete # virsh vol-delete vol_name --pool pool_name
  • 18. Snapshots # virsh snapshot-create-as vm_name snapshot1 "backup1" --disk-only --atomic # virsh snapshot-list vm_name # virsh snapshot-info vm_name --snapshotname snapshot1
  • 19. Migration ● Migration with shared storage virsh migrate --live Jab2 qemu+ssh://192.168.0.5/system ● Migration with local storage # qemu-img info /vm/vm-test.img image: /vm/jivko-test.img file format: raw virtual size: 8.0G (8589934592 bytes) disk size: 8.0G # qemu-img create -f raw /vm/vm-test.img 8G Formatting '/vm/jivko-test.img', fmt=raw size=8589934592 # virsh migrate --persistent --live --copy-storage-all Jab2 qemu+ssh://192.168.0.5/system
  • 20. Create a new VM ● Installation image ● Command – qemu -drive file=ubuntu-lucid.img,if=virtio /path/to/kernel/bzImage -kernel -append "console=ttyS0 root=/dev/vda" -m 512 -smp 1 -fsdev local,id=test_dev,path=shared,security_model=none -enable-kvm
  • 22. Configuration ● Fuck... it's XML based... /etc/libvirt/qemu/vm_name.xml /etc/libvirt/qemu/autostart /etc/libvirt/qemu/networks /var/lib/libvirt/images
  • 23. Console &  Debugging ● Console – – virsh console vm_name /usr/bin/virsh -c 'qemu+ssh://root@IP:22/system' console vm_name – ● Install virt-manager and setup connection to the host node, then connect to the vm with double click :) Debugging # qemu -gdb tcp:127.0.0.1:1212 [...] # gdb vmlinux-of-guest (gdb) target remote tcp:127.0.0.1:1212
  • 24. Common issues ● Sometimes libvirt can't start some VMs – check if they have .save files in ● – check if there are files with the VM name in ● – /var/lib/libvirt/qemu/images /var/lib/libvirt/qemu/save If there are any files for that VM in either of these dirs, remove them and the VM should start