3 ----------------------------------------------------------------------
4 Red Hat Enterprise Linux 6 shipped with a new tool, virt-v2v, to
5 convert and move virtual machines from VMware ESX and older Red Hat
6 Enterprise Linux platforms to KVM on Red Hat Enterprise Linux 6 or Red
7 Hat Enterprise Virtualization. It is based on a suite of tools,
8 libguestfs, which look inside disk images and virtual machines,
9 something that no other virtualization vendor offers. Red Hat
10 Enterprise Linux 6.1 will bring many improvements to these tools,
13 * Greatly improved options for storage migration
14 * New VM inspection features
15 * An easy-to-use graphical guest browser
16 * New guestfish commands
18 The latest upstream virt-v2v also includes the ability to convert and
19 move a workload from a physical server.
21 In this session, Matthew Booth and Richard Jones will cover all the
22 capabilities of the virt-v2v tool and libguestfs suite planned for Red
23 Hat Enterprise Linux 6.1, as well as the new upstream P2V
24 functionality. The session will include demonstrations and discussion
25 of the practical aspects of using the tools within your organization.
26 ----------------------------------------------------------------------
29 *** 0: BEFORE THE TALK ***
35 cd $HOME/d/libguestfs-talk-2011/talk
37 sudo virsh edit FedoraSmall
38 sudo lvchange -an /dev/vg_pin/FedoraBig
39 sudo lvremove /dev/vg_pin/FedoraBig
45 time guestfish -a /dev/null run
53 Thanks for coming along to the second virt-v2v and libguestfs
54 talk. At the Summit last year Matt and I gave a
55 preview of virt-v2v and the technology behind it for early
56 adopters. This year I'm happy to say that the technology is
57 mature and ready to go into production and we're going to be
60 - what these tools can do for you and how to get started
61 - a very little bit about how this works under the hood
62 - and we're going to demonstrate how some of the RHEL 6.1 tools work
63 and what's coming down the pipeline for 6.2 and beyond
65 I'll be talking first about libguestfs, and then after 25 minutes Matt
66 will get up and talk about converting Xen and VMWare guests to run on
67 KVM using virt-v2v. At the end we'll stop for questions, and after
68 the talk is over we'll be outside the conference room in case anyone
69 wants to ask any more detailed technical questions.
72 *** 2: Introduction ***
74 If you've never used libguestfs or the virt tools before, here's
77 libguestfs is a library, scripting language and a set of tools
78 that let you look inside virtual machines and make changes to
79 them without even needing to boot them up.
81 Some things you might want to do with this:
83 - monitor your virtual machines for disk usage, security, patches applied
84 - make disk images bigger or smaller
85 - make new VMs from scratch using one of our sister projects
89 The project has been in full time development for over 2 years, we've
90 got a 171 page manual, 313000 lines of code, and there are several
91 major projects that depend upon this software including: virt-v2v (of
92 course) JBoss Boxgrinder, the Aeolus cloud management project, at
93 least one proprietary cloud image deployment service, virt-manager,
94 and 24 different command line tools that come bundled with libguestfs
98 *** 3: What is libguestfs ***
102 The simple idea behind libguestfs is to run the Linux kernel and tools
103 like "mkfs", "LVM" and "fdisk" in a library so that you can make use
104 of it from tools, and your scripts and programs.
106 The idea of reusing the Linux kernel and these tools gives us
107 tremendous power. For example if you had a FreeBSD guest -- and
108 FreeBSD uses its own filesystem and partitioning scheme -- well
109 because that is already supported by the Linux kernel, libguestfs
110 supports that as well. Similarly we support all sorts of Linux
111 guests, Windows guests, and all sorts of containers that Linux
112 supports like ISO for CDs, LVM, qcow2 for KVM guests and much much
115 This unprecedented power means that any guest is immediately supported
116 out of the box by libguestfs, using the mature, well debugged code
117 from the Linux kernel and tools.
119 We present this through a stable API, so future versions of libguestfs
120 won't break your scripts or force you to rewrite code that is already
123 And there are dozens of existing tools built on this API, and I'm
124 going to demonstrate a few of them. You can also write your own
125 scripts and programs against the API.
128 *** 4: Demonstration of guestfish ***
130 How do you use libguestfs. A simple way is to open up any disk
131 image or virtual machine using our shell tool called 'guestfish'
132 (the guest filesystem interactive shell):
134 guestfish -d -i F14x64
136 From here you can examine the filesystem, edit files, upload or
137 download, and plenty more.
139 New in RHEL 6.1, you can also create new filesystems from scratch
140 which can be attached to virtual machines:
144 virt-filesystems --all --long -h -a test1.img
146 To find out more about guestfish or any of the other tools, a good
147 place to start is the manual page:
151 You'll find all the common options comprehensively documented, along
152 with examples of how to use each tool.
156 *** 5: Demonstration of guestfs-browser ***
158 The guest filesystem browser, which is actually not a part of RHEL 6
159 just yet, lets you browse through guest filesystems:
161 > browse into a Windows guest and show registry
164 *** 6: virt-resize ***
166 Another useful tool is virt-resize which lets you offline expand or
167 shrink a virtual machine. This tool can resize partitions, resize
168 filesystem content, and resize logical and physical volumes.
170 Here I'll give a short demonstration using a Fedora guest:
172 # virt-df -h FedoraSmall
173 Filesystem Size Used Available Use%
174 FedoraSmall:/dev/sda1 194M 24M 160M 13%
175 FedoraSmall:/dev/vg_fedorasmall/lv_root
178 This guest has very high disk usage -- nearly 80% -- and only
179 about half a gigabyte of space available. We can look at how
180 the filesystems in this guest are arranged:
182 # virt-filesystems --all --long -h -d FedoraSmall
184 (Show 3 GB disk, 2.6 GB root filesystem)
186 This is an offline process, so the guest must be shut down, and
187 virt-resize makes a copy of the guest. There are other ways you can
190 # lvcreate -L 8G -n FedoraBig vg_pin [5 seconds]
192 Now you can and should look in the virt-resize manual page (man
193 virt-resize) so you can get the command line options right.
197 # virt-resize --expand /dev/sda2 --lv-expand /dev/vg_fedorasmall/lv_root \
198 /dev/vg_pin/FedoraSmall /dev/vg_pin/FedoraBig
202 [It works on Windows too]
204 [Advantages and disadvantages of making a copy]
210 [Login and use df command]
217 *** 7: Demonstration of virt-inspector ***
220 time virt-inspector RHEL60x64 > xml
222 highlight < xml | less -r
224 xpath '//application[name="firefox"]' < xml | highlight
227 *** 8: Demonstration of virt-manager with inspection features ***
229 Click into Windows guest to show list of applications.
234 *** 9: Finish off ***