Update Red Hat Copyright Notices
[nbdkit.git] / filters / pause / nbdkit-pause-filter.pod
blob1bc083ddcb2e27737f8e26111468af52852d548e
1 =head1 NAME
3 nbdkit-pause-filter - pause NBD requests
5 =head1 SYNOPSIS
7  nbdkit --filter=pause PLUGIN [PLUGIN-ARGS...] pause-control=SOCKET
9 =head1 DESCRIPTION
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.
16 =head2 Control socket
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
23 resume processing.
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'>.
37 =head1 EXAMPLE
39 Pick a large file, disk image or ISO, serve it over NBD, and start
40 copying it:
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:
48  echo p | nc -U sock
50 To resume activity:
52  echo r | nc -U sock
54 =head1 PARAMETERS
56 =over 4
58 =item B<pause-control=>SOCKET
60 The Unix domain socket for controlling the filter.
61 See L</Control socket> above.
63 =back
65 =head1 NOTES
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
70 client itself.
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
82 level.
84 =head1 FILES
86 =over 4
88 =item F<$filterdir/nbdkit-pause-filter.so>
90 The filter.
92 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
94 =back
96 =head1 VERSION
98 C<nbdkit-pause-filter> first appeared in nbdkit 1.22.
100 =head1 SEE ALSO
102 L<nbdkit(1)>,
103 L<nbdkit-filter(3)>,
104 L<nbdkit-delay-filter(1)>,
105 L<nbdkit-rate-filter(1)>,
106 L<nc(1)>.
108 =head1 AUTHORS
110 Richard W.M. Jones
112 =head1 COPYRIGHT
114 Copyright Red Hat