[WEBSITE] ---------------------------------------------------------------------- Red Hat Enterprise Linux 6 shipped with a new tool, virt-v2v, to convert and move virtual machines from VMware ESX and older Red Hat Enterprise Linux platforms to KVM on Red Hat Enterprise Linux 6 or Red Hat Enterprise Virtualization. It is based on a suite of tools, libguestfs, which look inside disk images and virtual machines, something that no other virtualization vendor offers. Red Hat Enterprise Linux 6.1 will bring many improvements to these tools, including: * Greatly improved options for storage migration * New VM inspection features * An easy-to-use graphical guest browser * New guestfish commands The latest upstream virt-v2v also includes the ability to convert and move a workload from a physical server. In this session, Matthew Booth and Richard Jones will cover all the capabilities of the virt-v2v tool and libguestfs suite planned for Red Hat Enterprise Linux 6.1, as well as the new upstream P2V functionality. The session will include demonstrations and discussion of the practical aspects of using the tools within your organization. ---------------------------------------------------------------------- *** 0: BEFORE THE TALK *** White background Remove desktop icons Hide panel cd $HOME/d/libguestfs-talk-2011/talk sudo virsh edit FedoraSmall sudo lvchange -an /dev/vg_pin/FedoraBig sudo lvremove /dev/vg_pin/FedoraBig rm 400.d/test1.img rm 700.d/xml time guestfish -a /dev/null run techtalk-pse *** 1: Start *** Thanks for coming along to the second virt-v2v and libguestfs talk. At the Summit last year Matt and I gave a preview of virt-v2v and the technology behind it for early adopters. This year I'm happy to say that the technology is mature and ready to go into production and we're going to be talking about: - what these tools can do for you and how to get started - a very little bit about how this works under the hood - and we're going to demonstrate how some of the RHEL 6.1 tools work and what's coming down the pipeline for 6.2 and beyond I'll be talking first about libguestfs, and then after 25 minutes Matt will get up and talk about converting Xen and VMWare guests to run on KVM using virt-v2v. At the end we'll stop for questions, and after the talk is over we'll be outside the conference room in case anyone wants to ask any more detailed technical questions. *** 2: Introduction *** If you've never used libguestfs or the virt tools before, here's a quick introduction. libguestfs is a library, scripting language and a set of tools that let you look inside virtual machines and make changes to them without even needing to boot them up. Some things you might want to do with this: - monitor your virtual machines for disk usage, security, patches applied - make disk images bigger or smaller - make new VMs from scratch using one of our sister projects [200 TOOLS] The project has been in full time development for over 2 years, we've got a 171 page manual, 313000 lines of code, and there are several major projects that depend upon this software including: virt-v2v (of course) JBoss Boxgrinder, the Aeolus cloud management project, at least one proprietary cloud image deployment service, virt-manager, and 24 different command line tools that come bundled with libguestfs itself. *** 3: What is libguestfs *** [300 LIBGUESTFS] The simple idea behind libguestfs is to run the Linux kernel and tools like "mkfs", "LVM" and "fdisk" in a library so that you can make use of it from tools, and your scripts and programs. The idea of reusing the Linux kernel and these tools gives us tremendous power. For example if you had a FreeBSD guest -- and FreeBSD uses its own filesystem and partitioning scheme -- well because that is already supported by the Linux kernel, libguestfs supports that as well. Similarly we support all sorts of Linux guests, Windows guests, and all sorts of containers that Linux supports like ISO for CDs, LVM, qcow2 for KVM guests and much much more. This unprecedented power means that any guest is immediately supported out of the box by libguestfs, using the mature, well debugged code from the Linux kernel and tools. We present this through a stable API, so future versions of libguestfs won't break your scripts or force you to rewrite code that is already working. And there are dozens of existing tools built on this API, and I'm going to demonstrate a few of them. You can also write your own scripts and programs against the API. *** 4: Demonstration of guestfish *** How do you use libguestfs. A simple way is to open up any disk image or virtual machine using our shell tool called 'guestfish' (the guest filesystem interactive shell): guestfish -d -i F14x64 From here you can examine the filesystem, edit files, upload or download, and plenty more. New in RHEL 6.1, you can also create new filesystems from scratch which can be attached to virtual machines: guestfish -N fs virt-filesystems --all --long -h -a test1.img To find out more about guestfish or any of the other tools, a good place to start is the manual page: man guestfish You'll find all the common options comprehensively documented, along with examples of how to use each tool. *** 5: Demonstration of guestfs-browser *** The guest filesystem browser, which is actually not a part of RHEL 6 just yet, lets you browse through guest filesystems: > browse into a Windows guest and show registry *** 6: virt-resize *** Another useful tool is virt-resize which lets you offline expand or shrink a virtual machine. This tool can resize partitions, resize filesystem content, and resize logical and physical volumes. Here I'll give a short demonstration using a Fedora guest: # virt-df -h FedoraSmall Filesystem Size Used Available Use% FedoraSmall:/dev/sda1 194M 24M 160M 13% FedoraSmall:/dev/vg_fedorasmall/lv_root 2.5G 2.0G 528M 79% This guest has very high disk usage -- nearly 80% -- and only about half a gigabyte of space available. We can look at how the filesystems in this guest are arranged: # virt-filesystems --all --long -h -d FedoraSmall (Show 3 GB disk, 2.6 GB root filesystem) This is an offline process, so the guest must be shut down, and virt-resize makes a copy of the guest. There are other ways you can resize a guest. # lvcreate -L 8G -n FedoraBig vg_pin [5 seconds] Now you can and should look in the virt-resize manual page (man virt-resize) so you can get the command line options right. [2 minutes] # virt-resize --expand /dev/sda2 --lv-expand /dev/vg_fedorasmall/lv_root \ /dev/vg_pin/FedoraSmall /dev/vg_pin/FedoraBig [Explain summary] [It works on Windows too] [Advantages and disadvantages of making a copy] [virsh edit] [Boot it] [Login and use df command] [Shut down] *** 7: Demonstration of virt-inspector *** time virt-inspector RHEL60x64 > xml highlight < xml | less -r xpath '//application[name="firefox"]' < xml | highlight *** 8: Demonstration of virt-manager with inspection features *** Click into Windows guest to show list of applications. *** 9: Finish off ***