needed by the operating system but also isn't zeroes.
-Meta-data
+Disk metadata
----------------------------------------------------------------------
DIAGRAM:
Benchmark A
----------------------------------------------------------------------
-Now you might think this is all a bit obscure, but how does it apply
-to copying disk images. In this first benchmark, I've compared
-copying a disk in several different ways to see which is fastest. All
-of the copying happens between two idle machines, over a slow network.
+Now you might think this is all a bit obscure, but is it any good?
+In this first benchmark, I've compared copying a disk in several
+different ways to see which is fastest. All of the copying happens
+between two idle machines, over a slow network.
The full methodology is in the background notes that accompany this
talk, which I'll link at the end.
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
+Complete virt-v2v pipelines
----------------------------------------------------------------------
DIAGRAM:
- very efficient and no large temporary copies
+ - virt-v2v may be on a separate machine
+
- rate filter
- 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
----------------------------------------------------------------------