3 nbdkit-pause-filter - pause NBD requests
7 nbdkit --filter=pause PLUGIN [PLUGIN-ARGS...] pause-control=SOCKET
11 C<nbdkit-pause-filter> is a filter for L<nbdkit(1)> which can
12 temporarily stop NBD requests from being handled by nbdkit, and later
13 resume them. This filter can be used if you need to take a snapshot
14 of the underlying storage.
18 The C<pause-control> parameter is the name of a Unix domain socket
19 which the filter listens for commands on.
21 To pause NBD request processing you send character C<'p'> to the
22 socket. Any NBD requests received afterwards will hang until you
25 To resume processing you send character C<'r'> to the socket.
27 So you can know when pausing/resuming has taken effect, the filter
28 echos back the character over the socket in uppercase (ie. either
29 C<'P'> or C<'R'>). When pausing, the C<'P'> response is not sent
30 until all outstanding NBD requests (received before the pause) have
31 been completed. This usually means the plugin is idle, although be
32 aware that it is possible for plugins to create background threads and
33 do work that the filter cannot "see".
35 Any unknown commands are ignored. The filter responds with C<'X'>.
39 Pick a large file, disk image or ISO, serve it over NBD, and start
42 nbdkit -U - --filter=pause --filter=rate \
43 file BIG_FILE.ISO rate=10M pause-control=sock \
44 --run 'qemu-img convert -p $nbd /var/tmp/out'
46 To cause the copy to appear to hang, do:
58 =item B<pause-control=>SOCKET
60 The Unix domain socket for controlling the filter.
61 See L</Control socket> above.
67 If you are connecting a kernel client, virtual machine or similar to
68 nbdkit then only short pauses are tolerated, and you will soon get
69 timeout errors. The timeouts are not generated by nbdkit, but by the
72 The pause filter does not flush requests to disk, although this is a
73 possible future enhancement.
75 A virtual machine with multiple disks connected through multiple
76 nbdkit instances cannot get a consistent snapshot using this filter,
77 since even if you send the pause commands to all instances at the same
78 time they will be processed at slightly different times (and this can
79 matter if a virtual machine is doing something like RAID across the
80 disks). This is not something that can be solved at the level of
81 individual devices, the only way to solve this is at the hypervisor
88 =item F<$filterdir/nbdkit-pause-filter.so>
92 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
98 C<nbdkit-pause-filter> first appeared in nbdkit 1.22.
104 L<nbdkit-delay-filter(1)>,
105 L<nbdkit-rate-filter(1)>,
114 Copyright (C) 2020 Red Hat Inc.