Add notes for a short introduction to NBD.
[libguestfs-talks.git] / 2019-kvm-forum / notes-01-introduction
1 Quick Introduction to NBD
2 [About 2 mins 30 seconds]
3
4 * Heading: Linux 2.1.55 (1997)
5 - Diagram showing two machines
6 - Physical disk attached to one
7 - Exported to /dev/nbd0 on the other
8 - NBD_CMD_READ (0) or NBD_CMD_WRITE (1) only
9
10 Network Block Device is a protocol for exporting a disk from
11 one machine to another over a network.  It was added to
12 Linux 2.1.55 in 1997 and started off very simple with just two commands.
13
14 * Heading: Linux 5 (2019)
15 - Same diagram annotated with additional commands:
16 - DISC, FLUSH, TRIM, CACHE, WRITE_ZEROES, BLOCK_STATUS, RESIZE
17
18 In 2019 NBD is quite a bit more complicated, but still
19 overall a simple protocol.
20
21 * Heading: Exporting a point in time snapshot over NBD
22 - Diagram showing qemu exporting a point in time snapshot of a live guest
23 - blockdev-backup device=A target=Target sync=none job-id=job1
24 - nbd-server-start addr={"type":"unix","data":{"path":"./nbd-sock"}}
25 - nbd-server-add device=Target
26
27 Our use of NBD today is quite a bit different from how it was
28 intended back in 1997.  Here are some ways we're using it today.
29
30 As a way to export a point in time snapshot from qemu.
31
32 * Heading: Virt-v2v using nbdkit to read a VDDK disk
33 - Diagram showing virt-v2v + nbdkit + vddk + VMware
34
35 As a way to read a VDDK disk and convert it to run on KVM.
36
37 * Heading: qemu-nbd as a high performance server
38 - Diagram showing qemu-nbd used by RHV ImageIO
39
40 As a high performance server, serving qcow2 files for ImageIO.
41
42 * Heading: qemu-img convert from RHV ImageIO to KubeVirt
43 - Diagram showing nbdkit -> qemu-img convert -> nbdkit
44
45 Copying disk images efficiently between KVM-based management systems.
46
47 * Heading: nbdkit linuxdisk used to boot remote machines
48 - Diagram showing linuxdisk synthesizing an initramfs/filesystem
49
50 Using it as a replacement for TFTP when PXE-booting machines
51 over the network.
52
53 * Heading: Making disk images for testing
54 - Diagram showing an nbdkit shell script plugin
55
56 As a general purpose tool to make disk images for testing.
57
58 You can think of NBD as a universal protocol that you can use
59 whenever you need to access a virtual machine disk, disk image,
60 or block device between two processes, whether or not the
61 processes are running on the same machine.