Thomas Uphill

thomas@narrabilis.com

Outline

  • Virtualization
  • History/Description/Organisation
  • tools
    • qemu/libvirt/virsh/virt-manager
  • networking
  • migration
  • cloud
    • ovirt/opennebula/ganeti
  • cluster

Virtualization

physical machine

History

  • Israeli startup Qumranet 2005-2008
    • Moshe Bar - XenSource (Xen) 2003
    • Rami Tamir, Benny Schnaider - Ravello Systems
  • RedHat 2008
    • Avi Kivity
    • Marcelo Tosatti
  • LGPL, GPL

Description

full virtualization

paravirtualization - net/block/video

physical machine

pci

ethernet

block

kernel

kvm

virtio

virtio_pci

virtio_net

virtio_blk

virtio_ring

Organisation

  • kvm.ko
  • kvm-intel.ko
  • kvm-amd.ko

(powerpc arm)

  • modified qemu - wiki.qemu.org
    • x86 powerpc s390
  • SEABIOS

processor extensions in specific module, main virtualization in kvm.ko

modified qemu which interfaces with kvm instead of rewriting calls itself (it is an emulator)

uses SEABIOS

Organisation

kernel

physical machine

pci

ethernet

block

kvm.ko

virtio

virtio_pci

virtio_net

virtio_blk

virtio_ring

kvm-intel.ko

qemu

syscall

SEABIOS

qemu

modified qemu uses kvm as hardware

long command lines

/usr/libexec/qemu-kvm -S -M rhel6.3.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name springdale -uuid aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/springdale.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/dev/springdale_vg/springdale_lv,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:93:17:f4,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:4 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

libvirt

virtualization api

hypervisor agnostic

supports:

      • kvm
      • xen
      • vmware
      • virtualbox

provision, create, modify, monitor, control, migrate and stop domains

libvirt xml

<domain type='kvm' id='2'>

<name>domainname</name>

<uuid>something-unique</uuid>

<memory unit='KiB'>1048576</memory>

<currentMemory unit='KiB'>1048576</currentMemory>

<vcpu placement='static'>1</vcpu>

<os>

<type arch='x86_64' machine='rhel6.3.0'>hvm</type>

<boot dev='hd'/>

</os>

<features>

<acpi/><apic/><pae/>

</features>

<clock offset='utc'/>

<devices>

<emulator>/usr/libexec/qemu-kvm</emulator>

<name>domainname</name>

<uuid>something-unique</uuid>

<memory unit='KiB'>1048576</memory>

<currentMemory unit='KiB'>1048576</currentMemory>

<vcpu placement='static'>1</vcpu>

<type arch='x86_64' machine='rhel6.3.0'>hvm</type>

<acpi/><apic/><pae/>

<clock offset='utc'/>

<devices>

<emulator>/usr/libexec/qemu-kvm</emulator>

virsh

  • cli interface for libvirt
  • load from xml
  • dump to xml
  • edit xml
  • start/stop/restart domains

virt-manager

networking

  • nat - dnsmasq
  • bridge
  • physical device

nat uses dnsmasq

networking -bridge

bridge

vireth0

vireth1

vireth2

vireth3

vireth4

eth0

domain0

domain1

domain2

domain3

domain4

production way to go

virsh/libvirt demo

virsh first:

list domains

dumpxml of the vms

help

then virsh, go to details on the vm, show how to add a drive, or a resource

show about adding usb devices and pci

migration

shared storage

    • same path
    • multipath

qemu same location

    • same syntax/version

network

    • same device/bridge name
    • gratuitous ping

migration

libvirt migration:

    • ssh keys
    • X.509 certificates
    • listen tcp
    • virsh or virt-manager or api

migration - example

kvmdemo iscsi share

kvmdemo-nfs

kvm0

kvm1

NFS export

/shared

NFS mount

/shared

iscsi target

/dev/shared

iscsi initiator

/dev/shared

bridge kvm

bridge kvm

kvmdemo

kvmdemo

migration - demo

cloud

several options

manage migration of vms

manage storage pools

manage networking (bridges)

ovirt

www.ovirt.org

Fedora centric

ovirt-engine

http://localhost:8080 https://localhost:8443

opennebula

opennebula.org

hypervisor agnostic

supports vmware

ganeti

code.google.com/p/ganeti

google solution

xen or kvm

lvm files drbd

RHEV

RedHat Solution

  • HA Cluster
  • GFS

Questions/Comments?

thomas@narrabilis.com

ramblings.narrabilis.com

cluster

Red Hat High Availability

Fedora Cluster Suite

ricci/luci cman dlm fenced - old

corosync/pacemaker - new

shared storage

heartbeat

/etc/cluster/cluster.conf

cluster.conf

xml format

<cluster name="lopsa" config_version="2">
<clusternodes>
<clusternode name="node0.example.com" nodeid="1">
<fence>
</fence>
</clusternode>
<clusternode name="node1.example.com" nodeid="2">
<fence>
</fence>
</clusternode>
<clusternode name="node2.example.com" nodeid="3">
<fence>
</fence>
</clusternode>
</clusternodes>
<fencedevices>
</fencedevices>
<rm>
</rm>
</cluster>

cluster.conf

resources

<vm name="kvm-test" domain="all" path="/cluster/kvm/kvm-test"/>

clusvcadm

clustat

kvm - Google Slides