Slides 6000 (modifications).
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 12 Feb 2021 15:09:24 +0000 (15:09 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 12 Feb 2021 15:30:37 +0000 (15:30 +0000)
2021-pipelines/6000-modifications.html [new file with mode: 0644]
2021-pipelines/6100-simpler-modifications.html [new file with mode: 0644]
2021-pipelines/6200-simpler-modifications.term [new file with mode: 0755]
2021-pipelines/notes.txt

diff --git a/2021-pipelines/6000-modifications.html b/2021-pipelines/6000-modifications.html
new file mode 100644 (file)
index 0000000..3f1ad63
--- /dev/null
@@ -0,0 +1,22 @@
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+<script src="code.js" type="text/javascript"></script>
+
+<h1>Modifying disk images in flight</h1>
+
+<p>
+virt-v2v can ...
+</p>
+
+<ul>
+<li> install virtio drivers
+<li> remove VMware tools
+<li> modify the bootloader
+<li> rebuild the initramfs
+<li> change device names in /etc files
+<li> change the Windows registry
+</ul>
+
+<p>
+(and much more)
+</p>
diff --git a/2021-pipelines/6100-simpler-modifications.html b/2021-pipelines/6100-simpler-modifications.html
new file mode 100644 (file)
index 0000000..08e809e
--- /dev/null
@@ -0,0 +1,22 @@
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+<script src="code.js" type="text/javascript"></script>
+
+<h1>Simpler example of modification</h1>
+
+<pre>
+┌─────────────┐http┌────────────┐    ┌────────────┐
+│ cloud image │───▶│ xz filter  │───▶│ nbdkit     │
+└─────────────┘    └────────────┘    └────────────┘
+
+                                           ◀─── virt-sparsify --in-place
+
+                                        ◀─── <b>virt-customize</b>
+                                             to deactivate cloud-init
+
+                                     ◀─── <b>virt-customize</b>
+                                          to modify /etc/motd
+                                                            ┌───────────┐
+                                 ───▶ qemu-img convert ────▶│ local.img │
+                                                            └───────────┘
+</pre>
diff --git a/2021-pipelines/6200-simpler-modifications.term b/2021-pipelines/6200-simpler-modifications.term
new file mode 100755 (executable)
index 0000000..a6fd7a4
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash -
+
+source functions
+
+# Title.
+export title="Modifying a disk image in flight"
+
+# History.
+remember 'nbdkit curl https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz --filter=xz'
+remember 'qemu-img create -f qcow2 -F raw -b nbd://localhost snapshot.qcow2'
+remember 'virt-sparsify --inplace snapshot.qcow2'
+remember 'virt-customize -a snapshot.qcow2 --run-command "systemctl disable cloud-init" --write /etc/motd:HELLO_WORLD'
+remember 'ls -lh snapshot.qcow2'
+remember 'qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img -p'
+remember 'virt-cat -a local.img /etc/motd'
+
+terminal
index 1a51db9..8941a30 100644 (file)
@@ -311,14 +311,28 @@ I'm not going to talk about this in great detail because it's a very
 complex topic.  Instead I will show you a simple demonstration of a
 similar technique.
 
-  qemu-img create -f qcow2 -b ssh://kool/mnt/scratch/pipes/fedora-33.img snapshot.qcow2
+DIAGRAM:
+
+  (Screenshot from https://alt.fedoraproject.org/cloud/)
+
+  HTTPS
+  -----> nbdkit-curl-plugin --> xz filter --> qcow2 snapshot
+     <-- sparsify
+     <-- deactivate cloud-init
+     <-- write a file
+     --> qemu-img convert
+
+DEMO:
+
+  nbdkit curl https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz --filter=xz
+  qemu-img create -f qcow2 -b nbd://localhost -F raw snapshot.qcow2
   virt-sparsify --inplace snapshot.qcow2
-  guestfish -a snapshot.qcow2 -i write /etc/motd 'HEY, IT WORKED!'
-  ls -lh snapshot.qcow2
+  virt-customize -a snapshot.qcow2 \
+                 --run-command 'systemctl disable cloud-init' \
+                 --write /hello:HELLO
+  ls -lsh snapshot.qcow2
   qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img -p
-  virt-cat -a local.img /etc/motd
-
-(Show this as a demo.  Show original untouched)
+  guestfish --ro -a local.img -i ll /
 
 
 Complete virt-v2v paths
@@ -354,32 +368,6 @@ Discuss:
  - many other tricks used
 
 
-Streaming and modifying a compressed image
-----------------------------------------------------------------------
-
-DIAGRAM:
-
-  (Screenshot from https://alt.fedoraproject.org/cloud/)
-
-  HTTPS
-  -----> nbdkit-curl-plugin --> xz filter --> qcow2 snapshot
-     <-- sparsify
-     <-- deactivate cloud-init
-     <-- write a file
-     --> qemu-img convert
-
-DEMO:
-
-  nbdkit curl https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz --filter=xz
-  qemu-img create -f qcow2 -b nbd://localhost -F raw snapshot.qcow2
-  virt-sparsify --inplace snapshot.qcow2
-  virt-customize -a snapshot.qcow2 \
-                 --run-command 'systemctl disable cloud-init' \
-                 --write /hello:HELLO
-  ls -lsh snapshot.qcow2
-  qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img -p
-  guestfish --ro -a local.img -i ll /
-
 
 Conclusions
 ----------------------------------------------------------------------