SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
                 Look into libvirt
                     Osier Yang  <jyang@redhat.com>
Status
●   First release on Dec 19 2005
●   1.0.0 in two weeks. (Finally)
●   25 maitainers/commiters.
●   200 ~ 300 patches per release
●   Less than 300 APIs
Why libvirt?
●   Long term API/ABI/XML back-compact
●   Portable between various HVs
●   Hides complex interfaces of HV
●   Hides HV's API changes
●   Available on Linux, Solaris, Windows & OS-X
●   Secure access (TLS, SASL, SSH, PolicyKit)
●   Open, LGPLv2+ license
What libvirt manages
●   Domain
●   Virtual network
●   Host network interface
●   Node device
●   Storage pool/volume
●   Network filter
●   Secret
Supported hypervisors
●   QEMU/KVM
●   XEN: XenD, XenStored, XM, libxenlight
●   VMWare: ESX, GSX server, Workstation,
    Player
●   Linux container: LXC, OpenVZ
●   Test, Remote
●   UML, VirtualBox, Hyper-V, Parallels, etc
Virtual network
●   Nat (dnsmasq/Radvd, iptables)
●   Route
●   Isolated
●   Bridge (Open vSwitch, Macvtap)
●   Host network interface passthrough (SR-IOV
    VFs pool)
Host network interface
●   Based on netcf -> augeas
●   Enumerate
●   Management(ethernets, bonds, bridges, vlan
    interfaces)
●   Transaction support – revert/commit config
    changes
●   Report status (libnl, ioctl, sysfs)
Network filter
●   iptables
●   ebtables
●   Ip6tables
●   E.g. allow-incoming-ipv4 no-ip-multicast
Storage
●   pool, volume
●   fs (dir, fs, netfs)
●   scsi
●   Iscsi
●   Disk
●   lvm
●   mpath
●   sheepdog, rbd
Node device
●   Enumerate host devices
●   Backends (udev, HAL)
●   vHBA create/destroy
Secret
●   Encrypt storage
●   Can be used to encrypt a storage volume or
    domain disk
●   Only support qcow disks
Miscellaneous
●   Hooks (Daemon, QEMU, LXC, Migration)
●   Audit
●   Security (Selinux/Apparmor, sVirt)
●   Locking (libsanlock, POSIX fcntl)
●   Zero-conf (Avahi)
●   etc...
How to talk with QEMU
●   Monitor (HMP, QMP)
●   Guest agent monitor
●   Serial/Parrell console
●   Graphic console (vnc/spice)
●   Network
Domain APIs (libvirt.h)
●   Lifecyle (define/undefine, start/destroy,
    suspend/resume), list, lookup.
●   Save, restore, core dump, suspend, resume
●   Migration
●   Snapshot (Internal/External, Disk-only/
    System checkpoint/VM state)
●   Guest resource management (memory,
    network, memory, cpu, NUMA tuning)
Domain APIs (libvirt.h)
●   Host device passthrough
●   Detach/reattach node devices
●   Async events
●   Node resource management (memory)
●   APIs based on guest agent (E.g. S3/S4)
●   Guest block/network I/O statistics
●   ...more...
libvirt architecture
                                        Node
        client


                                                libvirt-qemu

      public API




                                                                     Agent monitor
                                                        qemu-kvm
                                  libvirtd




                                             monitor
                        RPC
       remote
                        $URI


uri = “qemu://$hostname/system"                              Guest
                                                guest
                                                             agent
The stack
 virsh
virsh      bindings       SNMP             AMQP         ......

                         public API

                          libvirtd

 KVM        XEN         ESX          LXC          UML      ......


Network    Storage     Iface     nwfilter     Secret    Nodedev


cgroup      netcf     iptables   ebtables         tc       libnl


 lvm       selinux     sysfs         udev         HAL   devmap


iscsiadm    ioctl     libnuma    numad        sanlock   qemu-img
Stuffs around
●   Language bindings (Python, Perl, Ruby, Jave,
    OCaml, C#, PHP)
●   Libvirt-snmp
●   Libvirt-qpid
●   Libvirt-cim
●   libvirt-glib (libvirt-glib, libvirt-gconf, libvirt-
    gobject)
Stuffs around
●   Virt-manager
●   virt-viewer
●   python-virtinst
●   Libosinfo
●   Libvirt-designer
●   Libvirt-sandbox
●   Gnome Boxes
Stuffs around
●   Virt-manager, virt-viewer
●   python-virtinst
●   Libosinfo
●   Libvirt-designer
●   Libvirt-sandbox
●   Gnome Boxes
●   Eucalyptus, openstack
●   Plugins for collectd, munin, Nagios, Zenoss
libguestfs
●   For accessing and modifying virtual machine
    (VM) disk images
●   View and edit files inside guests
●   Scripting changes to VM
●   Monitoring disk used/free statistics
●   P2V, V2V
●   Performing partial backups
●   Cloning VMs, etc..
How libguestfs works
             Appliance
  client
               qemu



               guestfsd
libguestfs


              Linux kernel




               Device or
               Disk image
virt-v2v
●   Convert VMs on XEN/ESX to RH virt stack
●   Support guests of RHEL, Fedora, Windows
●   Based on libguestfs and libvirt
How virt-v2v works
●   Shutdown guest on source host
●   Use libvirt to get domain XML config
●   Copy storage
●   Convert storage and modify XML
●   Use libvirt to define and start the domain on
    dest host
The conversion - RHEL/FC
●   Remove XEN/ESX specific stuffs (E.g.
    xenpv kernel/drivers, VMWare tools)
●   Install or update kernel, try best to let it
    support virtio
●   Update block and network drivers
Ongoing or TODO
●   Snapshot improvements
●   Storage driver improvements (glusterfs,
    job, inotify)
●   LXC driver improvements
●   Persistent vHBA
●   Migration with NPIV
●   Associate storage with domain
●   Improve device hotplug
Ongoing or TODO
●   Lifecycle events for all objects
●   Role based access control on all public APIs
●   Isolate QEMU process with Linux Container
    namespaces.
●   APIs to expose host/hypervior's capabilities
●   Etc...
http://libvirt.org 
  libvir­list@redhat.com
libvirt­user@redhat.com
      #virt on OFTC 

Más contenido relacionado

La actualidad más candente

How Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackHow Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackNETWAYS
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...Yandex
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshotRajesh Joseph
 
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, Intel
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, IntelXPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, Intel
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, IntelThe Linux Foundation
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Webdevops - Neos Docker
Webdevops - Neos DockerWebdevops - Neos Docker
Webdevops - Neos DockerHans Höchtl
 
Devconf.cz 2016 Linux as a guest on Hyper-V
Devconf.cz 2016 Linux as a guest on Hyper-VDevconf.cz 2016 Linux as a guest on Hyper-V
Devconf.cz 2016 Linux as a guest on Hyper-VVitaly Kuznetsov
 
OpenNebula - OpenNebula and tips for CentOS 7
OpenNebula - OpenNebula and tips for CentOS 7OpenNebula - OpenNebula and tips for CentOS 7
OpenNebula - OpenNebula and tips for CentOS 7OpenNebula Project
 
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...The Linux Foundation
 
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013bsdvirt
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explainedMaarten Smeets
 
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebula Project
 
Linux Virtualization
Linux VirtualizationLinux Virtualization
Linux VirtualizationOpenVZ
 
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Allon Mureinik
 
Fundamental Virtualisasi di openSUSE
Fundamental Virtualisasi di openSUSEFundamental Virtualisasi di openSUSE
Fundamental Virtualisasi di openSUSEutianayuba
 

La actualidad más candente (20)

How Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackHow Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project Feedback
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
 
Vagrant
VagrantVagrant
Vagrant
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshot
 
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, Intel
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, IntelXPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, Intel
XPDS14 - Xen as High-Performance NFV Platform - Jun Nakajima, Intel
 
Quickly Debug VM Failures in OpenStack
Quickly Debug VM Failures in OpenStackQuickly Debug VM Failures in OpenStack
Quickly Debug VM Failures in OpenStack
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Webdevops - Neos Docker
Webdevops - Neos DockerWebdevops - Neos Docker
Webdevops - Neos Docker
 
FreeBSD hosting
FreeBSD hostingFreeBSD hosting
FreeBSD hosting
 
Devconf.cz 2016 Linux as a guest on Hyper-V
Devconf.cz 2016 Linux as a guest on Hyper-VDevconf.cz 2016 Linux as a guest on Hyper-V
Devconf.cz 2016 Linux as a guest on Hyper-V
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
 
OpenNebula - OpenNebula and tips for CentOS 7
OpenNebula - OpenNebula and tips for CentOS 7OpenNebula - OpenNebula and tips for CentOS 7
OpenNebula - OpenNebula and tips for CentOS 7
 
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
 
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013
Extending bhyve beyond FreeBSD guests - EuroBSDCon 2013
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
 
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
 
OpenVZ Linux Containers
OpenVZ Linux ContainersOpenVZ Linux Containers
OpenVZ Linux Containers
 
Linux Virtualization
Linux VirtualizationLinux Virtualization
Linux Virtualization
 
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
 
Fundamental Virtualisasi di openSUSE
Fundamental Virtualisasi di openSUSEFundamental Virtualisasi di openSUSE
Fundamental Virtualisasi di openSUSE
 

Similar a Look Into Libvirt Osier Yang

[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilionAkihiro Suda
 
20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_Akihiro Suda
 
OpenStack Nova Scheduler
OpenStack Nova Scheduler OpenStack Nova Scheduler
OpenStack Nova Scheduler Peeyush Gupta
 
Proxmox Talk - Linux Fest Northwest 2018
Proxmox Talk - Linux Fest Northwest 2018Proxmox Talk - Linux Fest Northwest 2018
Proxmox Talk - Linux Fest Northwest 2018Richard Clark
 
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012Lance Albertson
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0guest72e8c1
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilionAkihiro Suda
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirtplarsen67
 
Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Stephen Gordon
 
Ryu: network operating system
Ryu: network operating systemRyu: network operating system
Ryu: network operating systemIsaku Yamahata
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloudDobrica Pavlinušić
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usagevideos
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfaaajjj4
 
Linux sever building
Linux sever buildingLinux sever building
Linux sever buildingEdmond Yu
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usagevincentvdk
 
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...Gosuke Miyashita
 

Similar a Look Into Libvirt Osier Yang (20)

[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion
 
20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_
 
OpenStack Nova Scheduler
OpenStack Nova Scheduler OpenStack Nova Scheduler
OpenStack Nova Scheduler
 
Proxmox Talk - Linux Fest Northwest 2018
Proxmox Talk - Linux Fest Northwest 2018Proxmox Talk - Linux Fest Northwest 2018
Proxmox Talk - Linux Fest Northwest 2018
 
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
 
RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirt
 
Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)
 
XS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt EnglishXS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt English
 
Ryu: network operating system
Ryu: network operating systemRyu: network operating system
Ryu: network operating system
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
 
Linux sever building
Linux sever buildingLinux sever building
Linux sever building
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
 

Más de OpenCity Community

Más de OpenCity Community (20)

开源讲义.pdf
开源讲义.pdf开源讲义.pdf
开源讲义.pdf
 
物联网操作系统漫谈-GIAC大会.pdf
物联网操作系统漫谈-GIAC大会.pdf物联网操作系统漫谈-GIAC大会.pdf
物联网操作系统漫谈-GIAC大会.pdf
 
2017开源年会-企业开源那些事儿-更新.pdf
2017开源年会-企业开源那些事儿-更新.pdf2017开源年会-企业开源那些事儿-更新.pdf
2017开源年会-企业开源那些事儿-更新.pdf
 
社会化研发
社会化研发社会化研发
社会化研发
 
Containers & CaaS
Containers & CaaSContainers & CaaS
Containers & CaaS
 
OaaS:Open as a Strategy
OaaS:Open as a StrategyOaaS:Open as a Strategy
OaaS:Open as a Strategy
 
Hello openstack 2014
Hello openstack 2014Hello openstack 2014
Hello openstack 2014
 
Docker openstack-2014
Docker openstack-2014Docker openstack-2014
Docker openstack-2014
 
Learn OpenStack from trystack.cn
Learn OpenStack from trystack.cnLearn OpenStack from trystack.cn
Learn OpenStack from trystack.cn
 
OpenStack系列公开课2 -20130508
OpenStack系列公开课2 -20130508OpenStack系列公开课2 -20130508
OpenStack系列公开课2 -20130508
 
OpenStack ecosystem
OpenStack ecosystemOpenStack ecosystem
OpenStack ecosystem
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hoursHow to master OpenStack in 2 hours
How to master OpenStack in 2 hours
 
Learn OpenStack from trystack.cn ——Folsom in practice
Learn OpenStack from trystack.cn  ——Folsom in practiceLearn OpenStack from trystack.cn  ——Folsom in practice
Learn OpenStack from trystack.cn ——Folsom in practice
 
Quantum Networks
Quantum NetworksQuantum Networks
Quantum Networks
 
云计算思考
云计算思考云计算思考
云计算思考
 
Openstorage Openstack
Openstorage OpenstackOpenstorage Openstack
Openstorage Openstack
 
Openstack的研究与实践
Openstack的研究与实践Openstack的研究与实践
Openstack的研究与实践
 
Open Stack Cheng Du Swift Alex Yang
Open Stack Cheng Du Swift Alex YangOpen Stack Cheng Du Swift Alex Yang
Open Stack Cheng Du Swift Alex Yang
 
Nova与虚拟机管理
Nova与虚拟机管理Nova与虚拟机管理
Nova与虚拟机管理
 
Deep Dive Into Quantum
Deep Dive Into QuantumDeep Dive Into Quantum
Deep Dive Into Quantum
 

Look Into Libvirt Osier Yang

  • 2. Status ● First release on Dec 19 2005 ● 1.0.0 in two weeks. (Finally) ● 25 maitainers/commiters. ● 200 ~ 300 patches per release ● Less than 300 APIs
  • 3. Why libvirt? ● Long term API/ABI/XML back-compact ● Portable between various HVs ● Hides complex interfaces of HV ● Hides HV's API changes ● Available on Linux, Solaris, Windows & OS-X ● Secure access (TLS, SASL, SSH, PolicyKit) ● Open, LGPLv2+ license
  • 4. What libvirt manages ● Domain ● Virtual network ● Host network interface ● Node device ● Storage pool/volume ● Network filter ● Secret
  • 5. Supported hypervisors ● QEMU/KVM ● XEN: XenD, XenStored, XM, libxenlight ● VMWare: ESX, GSX server, Workstation, Player ● Linux container: LXC, OpenVZ ● Test, Remote ● UML, VirtualBox, Hyper-V, Parallels, etc
  • 6. Virtual network ● Nat (dnsmasq/Radvd, iptables) ● Route ● Isolated ● Bridge (Open vSwitch, Macvtap) ● Host network interface passthrough (SR-IOV VFs pool)
  • 7. Host network interface ● Based on netcf -> augeas ● Enumerate ● Management(ethernets, bonds, bridges, vlan interfaces) ● Transaction support – revert/commit config changes ● Report status (libnl, ioctl, sysfs)
  • 8. Network filter ● iptables ● ebtables ● Ip6tables ● E.g. allow-incoming-ipv4 no-ip-multicast
  • 9. Storage ● pool, volume ● fs (dir, fs, netfs) ● scsi ● Iscsi ● Disk ● lvm ● mpath ● sheepdog, rbd
  • 10. Node device ● Enumerate host devices ● Backends (udev, HAL) ● vHBA create/destroy
  • 11. Secret ● Encrypt storage ● Can be used to encrypt a storage volume or domain disk ● Only support qcow disks
  • 12. Miscellaneous ● Hooks (Daemon, QEMU, LXC, Migration) ● Audit ● Security (Selinux/Apparmor, sVirt) ● Locking (libsanlock, POSIX fcntl) ● Zero-conf (Avahi) ● etc...
  • 13. How to talk with QEMU ● Monitor (HMP, QMP) ● Guest agent monitor ● Serial/Parrell console ● Graphic console (vnc/spice) ● Network
  • 14. Domain APIs (libvirt.h) ● Lifecyle (define/undefine, start/destroy, suspend/resume), list, lookup. ● Save, restore, core dump, suspend, resume ● Migration ● Snapshot (Internal/External, Disk-only/ System checkpoint/VM state) ● Guest resource management (memory, network, memory, cpu, NUMA tuning)
  • 15. Domain APIs (libvirt.h) ● Host device passthrough ● Detach/reattach node devices ● Async events ● Node resource management (memory) ● APIs based on guest agent (E.g. S3/S4) ● Guest block/network I/O statistics ● ...more...
  • 16. libvirt architecture Node client libvirt-qemu public API Agent monitor qemu-kvm libvirtd monitor RPC remote $URI uri = “qemu://$hostname/system" Guest guest agent
  • 17. The stack virsh virsh bindings SNMP AMQP ...... public API libvirtd KVM XEN ESX LXC UML ...... Network Storage Iface nwfilter Secret Nodedev cgroup netcf iptables ebtables tc libnl lvm selinux sysfs udev HAL devmap iscsiadm ioctl libnuma numad sanlock qemu-img
  • 18. Stuffs around ● Language bindings (Python, Perl, Ruby, Jave, OCaml, C#, PHP) ● Libvirt-snmp ● Libvirt-qpid ● Libvirt-cim ● libvirt-glib (libvirt-glib, libvirt-gconf, libvirt- gobject)
  • 19. Stuffs around ● Virt-manager ● virt-viewer ● python-virtinst ● Libosinfo ● Libvirt-designer ● Libvirt-sandbox ● Gnome Boxes
  • 20. Stuffs around ● Virt-manager, virt-viewer ● python-virtinst ● Libosinfo ● Libvirt-designer ● Libvirt-sandbox ● Gnome Boxes ● Eucalyptus, openstack ● Plugins for collectd, munin, Nagios, Zenoss
  • 21. libguestfs ● For accessing and modifying virtual machine (VM) disk images ● View and edit files inside guests ● Scripting changes to VM ● Monitoring disk used/free statistics ● P2V, V2V ● Performing partial backups ● Cloning VMs, etc..
  • 22. How libguestfs works Appliance client qemu guestfsd libguestfs Linux kernel Device or Disk image
  • 23. virt-v2v ● Convert VMs on XEN/ESX to RH virt stack ● Support guests of RHEL, Fedora, Windows ● Based on libguestfs and libvirt
  • 24. How virt-v2v works ● Shutdown guest on source host ● Use libvirt to get domain XML config ● Copy storage ● Convert storage and modify XML ● Use libvirt to define and start the domain on dest host
  • 25. The conversion - RHEL/FC ● Remove XEN/ESX specific stuffs (E.g. xenpv kernel/drivers, VMWare tools) ● Install or update kernel, try best to let it support virtio ● Update block and network drivers
  • 26. Ongoing or TODO ● Snapshot improvements ● Storage driver improvements (glusterfs, job, inotify) ● LXC driver improvements ● Persistent vHBA ● Migration with NPIV ● Associate storage with domain ● Improve device hotplug
  • 27. Ongoing or TODO ● Lifecycle events for all objects ● Role based access control on all public APIs ● Isolate QEMU process with Linux Container namespaces. ● APIs to expose host/hypervior's capabilities ● Etc...