nbdkit-pause-filter(1)

✨ nbdkit-pause-filter(1) ✨

okay bestie, welcome to the nbdkit-pause-filter(1) page from the nbdkit manual πŸ’… this one is short, sweet, and honestly kinda powerful β€” let's get into it 🫢

🌸 NAME 🌸

nbdkit-pause-filter β€” pause NBD requests ⏸️


πŸ¦‹ SYNOPSIS πŸ¦‹

nbdkit --filter=pause PLUGIN [PLUGIN-ARGS...] pause-control=SOCKET

πŸ’– DESCRIPTION πŸ’–

nbdkit-pause-filter is a filter for nbdkit(1) that can temporarily stop NBD requests from being handled by nbdkit, and then later resume them. it's giving "hold my calls" energy πŸ“žβœ‹

the whole point? if you need to take a snapshot of the underlying storage, this is your girl πŸ’β€β™€οΈ

πŸŽ€ Control socket πŸŽ€

the pause-control parameter is the name of a Unix domain socket that the filter listens for commands on πŸ”Œ

  • to pause NBD request processing, you send the character 'p' to the socket. any NBD requests received after that will just... hang 😭 until you resume processing.
  • to resume processing, you send the character 'r' to the socket ✨

so you actually know when pausing/resuming has taken effect, the filter echoes the character back over the socket in uppercase β€” so either 'P' or 'R' πŸ’Œ

when pausing, the 'P' response is not sent until all outstanding NBD requests (the ones received before the pause) have been completed. this usually means the plugin is idle β€” although be aware that it's possible for plugins to create background threads and do work that the filter literally cannot "see" πŸ‘€

any unknown commands are ignored, and the filter responds with 'X' πŸ™ˆ


🌈 EXAMPLE 🌈

pick a large file, disk image or ISO, serve it over NBD, and start copying it πŸ“€

nbdkit --filter=pause --filter=rate \
  file BIG_FILE.ISO rate=10M pause-control=sock \
       --run 'qemu-img convert -p "$uri" /var/tmp/out'

to cause the copy to appear to hang, do:

echo p | nc -U sock

to resume activity:

echo r | nc -U sock

πŸ’… PARAMETERS πŸ’…

  • pause-control=SOCKET β€” the Unix domain socket for controlling the filter. see "Control socket" above πŸ‘†

⭐ NOTES ⭐

if you're connecting a kernel client, virtual machine or similar to nbdkit, then only short pauses are tolerated, and you'll soon get timeout errors πŸ’€ the timeouts are not generated by nbdkit β€” they come from the client itself, no cap.

the pause filter does not flush requests to disk, although this is a possible future enhancement πŸ‘€ (manifesting it fr fr)

a virtual machine with multiple disks connected through multiple nbdkit instances cannot get a consistent snapshot using this filter, because even if you send the pause commands to all instances at the same time, they'll be processed at slightly different times β€” and this can matter if a VM is doing something like RAID across the disks 😭 this is not something that can be solved at the level of individual devices; the only way to solve it is at the hypervisor level. periodt.


🧚 FILES 🧚

  • $filterdir/nbdkit-pause-filter.so β€” the filter πŸ’–
    • use nbdkit --dump-config to find the location of $filterdir πŸ”

πŸ‘‘ VERSION πŸ‘‘

nbdkit-pause-filter first appeared in nbdkit 1.22 ✨


πŸ“ SEE ALSO πŸ“

nbdkit(1), nbdkit-filter(3), nbdkit-delay-filter(1), nbdkit-rate-filter(1), nc(1) 🫢


πŸ’œ AUTHORS πŸ’œ

Richard W.M. Jones 🌟


Copyright Red Hat


🌸 LICENSE 🌸

redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met βœ…

  1. redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer πŸ“
  2. redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution πŸ“š
  3. neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission 🚫
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 😌

and that's the whole page bestie 🫢 this is nbdkit-1.48.1, dated 2026-08-29 β€” go pause some requests, you've got this πŸ’…βœ¨

πŸ“¦ where this page comes from