Import old talks from 2010 and 2011 (Boston).
[libguestfs-talks.git] / 2011-boston / notes / NOTES.txt
1 [WEBSITE]
2
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,
11 including:
12
13 * Greatly improved options for storage migration
14 * New VM inspection features
15 * An easy-to-use graphical guest browser
16 * New guestfish commands
17
18 The latest upstream virt-v2v also includes the ability to convert and
19 move a workload from a physical server.
20
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 ----------------------------------------------------------------------
27
28
29 *** 0: BEFORE THE TALK ***
30
31 White background
32 Remove desktop icons
33 Hide panel
34
35 cd $HOME/d/libguestfs-talk-2011/talk
36
37 sudo virsh edit FedoraSmall
38 sudo lvchange -an /dev/vg_pin/FedoraBig
39 sudo lvremove /dev/vg_pin/FedoraBig
40
41 rm 400.d/test1.img
42
43 rm 700.d/xml
44
45 time guestfish -a /dev/null run
46
47 techtalk-pse
48
49
50
51 *** 1: Start ***
52
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
58 talking about:
59
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
64
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.
70
71
72 *** 2: Introduction ***
73
74 If you've never used libguestfs or the virt tools before, here's
75 a quick introduction.
76
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.
80
81 Some things you might want to do with this:
82
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
86
87 [200 TOOLS]
88
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
95 itself.
96
97
98 *** 3: What is libguestfs ***
99
100 [300 LIBGUESTFS]
101
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.
105
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
113 more.
114
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.
118
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
121 working.
122
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.
126
127
128 *** 4: Demonstration of guestfish ***
129
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):
133
134   guestfish -d -i F14x64
135
136 From here you can examine the filesystem, edit files, upload or
137 download, and plenty more.
138
139 New in RHEL 6.1, you can also create new filesystems from scratch
140 which can be attached to virtual machines:
141
142   guestfish -N fs
143
144   virt-filesystems --all --long -h -a test1.img
145
146 To find out more about guestfish or any of the other tools, a good
147 place to start is the manual page:
148
149   man guestfish
150
151 You'll find all the common options comprehensively documented, along
152 with examples of how to use each tool.
153
154
155
156 *** 5: Demonstration of guestfs-browser ***
157
158 The guest filesystem browser, which is actually not a part of RHEL 6
159 just yet, lets you browse through guest filesystems:
160
161   > browse into a Windows guest and show registry
162
163
164 *** 6: virt-resize ***
165
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.
169
170 Here I'll give a short demonstration using a Fedora guest:
171
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
176                                             2.5G       2.0G       528M   79%
177
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:
181
182   # virt-filesystems --all --long -h -d FedoraSmall
183
184 (Show 3 GB disk, 2.6 GB root filesystem)
185
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
188 resize a guest.
189
190   # lvcreate -L 8G -n FedoraBig vg_pin          [5 seconds]
191
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.
194
195                                                 [2 minutes]
196
197   # virt-resize --expand /dev/sda2 --lv-expand /dev/vg_fedorasmall/lv_root \
198      /dev/vg_pin/FedoraSmall /dev/vg_pin/FedoraBig
199
200 [Explain summary]
201
202 [It works on Windows too]
203
204 [Advantages and disadvantages of making a copy]
205
206 [virsh edit]
207
208 [Boot it]
209
210 [Login and use df command]
211
212 [Shut down]
213
214
215
216
217 *** 7: Demonstration of virt-inspector ***
218
219
220 time virt-inspector RHEL60x64 > xml
221
222 highlight < xml | less -r
223
224 xpath '//application[name="firefox"]' < xml | highlight
225
226
227 *** 8: Demonstration of virt-manager with inspection features ***
228
229 Click into Windows guest to show list of applications.
230
231
232
233
234 *** 9: Finish off ***
235