From: Richard W.M. Jones Date: Mon, 27 Jan 2014 15:27:14 +0000 (+0000) Subject: Add 2014 FOSDEM talk. X-Git-Url: http://git.annexia.org/?p=libguestfs-talks.git;a=commitdiff_plain;h=5f4193eacd87ca2856d94aedc394c759f722c083;ds=sidebyside Add 2014 FOSDEM talk. --- diff --git a/2014-fosdem/builder.sh b/2014-fosdem/builder.sh new file mode 100755 index 0000000..d767e15 --- /dev/null +++ b/2014-fosdem/builder.sh @@ -0,0 +1,24 @@ +#!/bin/bash - + +VIRT_BUILDER_SOURCE=file://$HOME/d/libguestfs/builder/website/index.asc +export VIRT_BUILDER_SOURCE + +guests=( $(virt-builder -l | awk '{print $1}') ) +formats=( raw qcow2 ) +count=0 + +while true; do + guest=${guests[$(($RANDOM % ${#guests[*]}))]} + format=${formats[$(($RANDOM % ${#formats[*]}))]} + + ((count++)); echo -e "\n*** Building guest # $count\n" + + virt-builder $guest --output $guest.img \ + --format $format \ + --no-sync \ + --hostname test$count.example.com \ + --timezone Europe/Brussels \ + --write '/etc/motd:Welcome to FOSDEM 2014' + + rm $guest.img; # Save space! +done diff --git a/2014-fosdem/cheese0.svg b/2014-fosdem/cheese0.svg new file mode 100644 index 0000000..ba11e84 --- /dev/null +++ b/2014-fosdem/cheese0.svg @@ -0,0 +1,69 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/2014-fosdem/cheese1.svg b/2014-fosdem/cheese1.svg new file mode 100644 index 0000000..bee4b77 --- /dev/null +++ b/2014-fosdem/cheese1.svg @@ -0,0 +1,79 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/2014-fosdem/notes.txt b/2014-fosdem/notes.txt new file mode 100644 index 0000000..f746e83 --- /dev/null +++ b/2014-fosdem/notes.txt @@ -0,0 +1,119 @@ +FOSDEM lightning talk +Sunday 2nd Feb 2014, 16:00, H.2215 Ferrer +https://fosdem.org/2014/schedule/event/libguestfs/ + +Advanced disk image management with libguestfs +libguestfs, virt-builder, virt-sparsify, virt-sysprep + +---------------------------------------------------------------------- + + +Good afternoon. Today I'm going to talk about libguestfs +with is a suite of tools for looking inside and modifying +virtual machine disk images. + + +virt-builder +------------ + +First off, a new tool that we've written to create virtual machines. + +[ Show the builder.sh script ] +[ Run the builder.sh script ] + +I'll come back to this script at the end of the talk. + +virt-builder can: + + - output raw, qcow2 and other formats + - resize using [virt-resize] + - write a random seed + - set a hostname + - edit configuration files + - install packages + - run custom scripts + * at build time + * or at first boot + +Libguestfs can safely and securely inspect and modify disk +images without needing root. + +Virt-builder doesn't install guests from scratch. Instead it +takes clean, cryptographically signed, compressed templates and uses +libguestfs to customize them. + + + +Preparing the templates +----------------------- + +virt-builder comes with a handful of templates. + +You can also prepare your own. + +Over the years we have come up with a good way +to prepare and distribute reasonably small templates + + virt-install (or Oz) + v + virt-sysprep + v + virt-sparsify + v + xz + +virt-install runs a regular OS install, using anaconda, +debian-installer, etc. You can automate this completely +using kickstart or preseed. + +virt-sysprep unconfigures the guest. Using libguestfs it +removes SSH host keys, log files, network configuration, +user accounts and so on. + +virt-sparsify +------------- + +virt-sparsify uses libguestfs to make guests sparse a.k.a. +thin-provisioned. + +It looks for unused space: + + - in filesystems + + - in LVM physical volumes + + - swap partitions + +Including non-zeroed, but unused blocks. + +It converts that to sparseness in the host file. + + +xz +-- + +Finally xz compresses the template. We like xz for several reasons: + + - nearly best in class compression + + - preserves sparseness + + - compressed files can be random accessed [nbdkit] + + - virt-builder includes parallel uncompress + + +Results +------- + + disk apparent final +CirrOS 0.3.1 39 18 11 MB +Debian 7 4096 719 142 MB +Fedora 20 6144 826 174 MB +Ubuntu 13.10 4096 1019 187 MB + + +[At the end of the talk, show the progress of the builder script.] + + +* libguestfs resources and other tools diff --git a/2014-fosdem/rjones-libguestfs-2014-fosdem.odp b/2014-fosdem/rjones-libguestfs-2014-fosdem.odp new file mode 100644 index 0000000..6f84ef9 Binary files /dev/null and b/2014-fosdem/rjones-libguestfs-2014-fosdem.odp differ