Welcome: - good morning to folks in the US, good afternoon or evening everywhere else - welcome to the libguestfs webinar - I am your host, Richard Jones - a few administration points to begin with - please save questions to the end - you can also join the IRC channel #libguestfs and post questions at any time - if you're having problems with webex, see: https://rwmj.wordpress.com/2011/11/17/libguestfs-web-seminar-this-friday/ - there is a handout with accompanying slides, see my blog - the session is being recorded - after the session, a recording will be made available; keep an eye on my blog - after the session, all the programs, etc will be made available Part 1: an overview of libguestfs ---------------------------------------------------------------------- 1. Introduction and what it is Libguestfs is a set of tools for viewing, editing and creating virtual machine disk images. That includes: - injecting files into disk images - editing files - creating disk images entirely from scratch - resizing them - adding, moving and deleting partitions and logical volumes - examining disk images to find out what operating systems they contain and what applications are installed - rescuing VMs that don't boot It is also a library, available from C, C++, Perl, Python, Ruby, Java, OCaml and from shell scripts. It is also a FUSE module, that lets you safely mount guest filesystems on the host. Libguestfs can access virtually any disk image: We support all known types of Linux filesystem, such as ext2/3/4, XFS, btrfs, GFS2, etc. We support NTFS and FAT for Windows guests. We also support Mac OS X and BSD filesystems. We fully support LVM, GPT partition tables. qcow2, VirtualBox VDI. We have partial support for VMware VMDK. And much more. Libguestfs can also access and modify the Windows Registry, read the Windows Event log, change Linux configuration files, and read Linux log files. 2. guestfish example - rm /etc/udev/rules.d/70-persistent-net.rules (script - sysprep.sh) - make a disk (script - new-disk.sh) (diagram) - interactive on a disk image guestfish --ro -a new-disk.img -i # type some filesystem commands # show inspection data a more realistic script would edit /etc/fstab, reset ssh host keys (in RHEL 6.3: see virt-sysprep) - show guestmount-ing a disk image 3. python example - get version of firefox installed (for any guest) - takes 12 seconds to run - doing a lot of work in those 12 seconds - using the API directly gives you more control 4. virt-df historical - graphs and trends (show diagram) show cron job show data files libreoffice builder-rhel6.ods cooking.ods 5. inspection - disk images - run virt-filesystems -a on each - run virt-inspector on each virt-inspector disk.img | ../highlight | less -r - xpath queries : app version virt-inspector disk2.img | \ xmlstarlet sel -t -c '//application[name="firefox"]' - xpath queries : icon virt-inspector disk2.img | \ xmlstarlet sel -t -c 'string(//icon)' | base64 -i -d | display - 6. alignment/resize - show alignment problems in WinXP guest virt-alignment-scan -a winxp.img - realign and resize it rm -f resized.img truncate -s 10G resized.img virt-resize winxp.img resized.img --expand /dev/sda1 --alignment 2048 - performance discussion (diagram here) - show new alignment virt-alignment-scan -a resized.img - show it boots qemu-kvm -m 1024 -hda resized.img - note this is a RHEL 6.3 feature Part 2: preview of RHEL 6.3 ---------------------------------------------------------------------- 7. (show diagram) For RHEL 6.0 the focus was on making bug free packages available, but the performance was quite poor. For RHEL 6.1 we concentrated on performance and a few features. RHEL 6.3 is 6-7 months away but there are already preview packages 1.7.17 (1.8) -> 1.14 (about 11 months of upstream development) Major new features include: - new tools (for alignment, sysprep, virt-ls -lR, virt-copy-in/out) - further improvements to Windows support, such as being able to use drive letters from most tools - major API extensions for copying whole devices, cancelling long-running operations, brtfs, event API - improvements to guest inspection: live CDs, logos - fully implemented and supported Ruby and Java bindings - 40-50 bugs fixed - preview packages 8. Questions