From 90eba70ab224d8590e8108b65476cc3582a1c9d5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 22 Oct 2019 13:19:01 +0100 Subject: [PATCH] Add notes for a short introduction to NBD. --- 2019-kvm-forum/notes-01-introduction | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 2019-kvm-forum/notes-01-introduction diff --git a/2019-kvm-forum/notes-01-introduction b/2019-kvm-forum/notes-01-introduction new file mode 100644 index 0000000..cf16bfc --- /dev/null +++ b/2019-kvm-forum/notes-01-introduction @@ -0,0 +1,61 @@ +Quick Introduction to NBD +[About 2 mins 30 seconds] + +* Heading: Linux 2.1.55 (1997) +- Diagram showing two machines +- Physical disk attached to one +- Exported to /dev/nbd0 on the other +- NBD_CMD_READ (0) or NBD_CMD_WRITE (1) only + +Network Block Device is a protocol for exporting a disk from +one machine to another over a network. It was added to +Linux 2.1.55 in 1997 and started off very simple with just two commands. + +* Heading: Linux 5 (2019) +- Same diagram annotated with additional commands: +- DISC, FLUSH, TRIM, CACHE, WRITE_ZEROES, BLOCK_STATUS, RESIZE + +In 2019 NBD is quite a bit more complicated, but still +overall a simple protocol. + +* Heading: Exporting a point in time snapshot over NBD +- Diagram showing qemu exporting a point in time snapshot of a live guest +- blockdev-backup device=A target=Target sync=none job-id=job1 +- nbd-server-start addr={"type":"unix","data":{"path":"./nbd-sock"}} +- nbd-server-add device=Target + +Our use of NBD today is quite a bit different from how it was +intended back in 1997. Here are some ways we're using it today. + +As a way to export a point in time snapshot from qemu. + +* Heading: Virt-v2v using nbdkit to read a VDDK disk +- Diagram showing virt-v2v + nbdkit + vddk + VMware + +As a way to read a VDDK disk and convert it to run on KVM. + +* Heading: qemu-nbd as a high performance server +- Diagram showing qemu-nbd used by RHV ImageIO + +As a high performance server, serving qcow2 files for ImageIO. + +* Heading: qemu-img convert from RHV ImageIO to KubeVirt +- Diagram showing nbdkit -> qemu-img convert -> nbdkit + +Copying disk images efficiently between KVM-based management systems. + +* Heading: nbdkit linuxdisk used to boot remote machines +- Diagram showing linuxdisk synthesizing an initramfs/filesystem + +Using it as a replacement for TFTP when PXE-booting machines +over the network. + +* Heading: Making disk images for testing +- Diagram showing an nbdkit shell script plugin + +As a general purpose tool to make disk images for testing. + +You can think of NBD as a universal protocol that you can use +whenever you need to access a virtual machine disk, disk image, +or block device between two processes, whether or not the +processes are running on the same machine. -- 1.8.3.1