2 Sunday 2nd Feb 2014, 16:00, H.2215 Ferrer
3 https://fosdem.org/2014/schedule/event/libguestfs/
5 Advanced disk image management with libguestfs
6 libguestfs, virt-builder, virt-sparsify, virt-sysprep
8 ----------------------------------------------------------------------
11 Good afternoon. Today I'm going to talk about libguestfs
12 with is a suite of tools for looking inside and modifying
13 virtual machine disk images.
19 First off, a new tool that we've written to create virtual machines.
21 [ Show the builder.sh script ]
22 [ Run the builder.sh script ]
24 I'll come back to this script at the end of the talk.
28 - output raw, qcow2 and other formats
29 - resize using [virt-resize]
32 - edit configuration files
38 Libguestfs can safely and securely inspect and modify disk
39 images without needing root.
41 Virt-builder doesn't install guests from scratch. Instead it
42 takes clean, cryptographically signed, compressed templates and uses
43 libguestfs to customize them.
47 Preparing the templates
48 -----------------------
50 virt-builder comes with a handful of templates.
52 You can also prepare your own.
54 Over the years we have come up with a good way
55 to prepare and distribute reasonably small templates
65 virt-install runs a regular OS install, using anaconda,
66 debian-installer, etc. You can automate this completely
67 using kickstart or preseed.
69 virt-sysprep unconfigures the guest. Using libguestfs it
70 removes SSH host keys, log files, network configuration,
71 user accounts and so on.
76 virt-sparsify uses libguestfs to make guests sparse a.k.a.
79 It looks for unused space:
83 - in LVM physical volumes
87 Including non-zeroed, but unused blocks.
89 It converts that to sparseness in the host file.
95 Finally xz compresses the template. We like xz for several reasons:
97 - nearly best in class compression
99 - preserves sparseness
101 - compressed files can be random accessed [nbdkit]
103 - virt-builder includes parallel uncompress
110 CirrOS 0.3.1 39 18 11 MB
111 Debian 7 4096 719 142 MB
112 Fedora 20 6144 826 174 MB
113 Ubuntu 13.10 4096 1019 187 MB
116 [At the end of the talk, show the progress of the builder script.]
119 * libguestfs resources and other tools