look into libvirt osier yang

Download Look Into Libvirt Osier Yang

Post on 12-May-2015




0 download

Embed Size (px)


China OpenStack User Group


  • 1.LookintolibvirtOsierYang

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 HVs 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-IOVVFs pool) 7. Host network interface Based on netcf -> augeas Enumerate Management(ethernets, bonds, bridges, vlaninterfaces) Transaction support revert/commit configchanges 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 ordomain 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 architectureNodeclientlibvirt-qemupublic API Agent monitorqemu-kvmlibvirtd monitorRPC remote$URIuri = qemu://$hostname/system"Guestguest agent 17. The stack virshvirshbindings SNMP AMQP ...... public APIlibvirtd KVMXEN ESXLXCUML......NetworkStorage Iface nwfilter SecretNodedevcgroupnetcf iptables ebtables tc libnl lvm selinux sysfs udev HAL devmapiscsiadmioctl libnumanumadsanlock 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 Applianceclient qemu guestfsdlibguestfsLinux 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 ondest 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 itsupport 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 Containernamespaces. APIs to expose host/hyperviors capabilities Etc... 28. http://libvirt.orglibvirlist@redhat.comlibvirtuser@redhat.com#virtonOFTC