Skip to content

Instantly share code, notes, and snippets.

@alexhk
alexhk / vzdump-pcie-hookscript.sh
Created February 21, 2026 10:46
PVE vzdump hookscript handing VM backups with single PCIE GPUs pass-through
#!/bin/bash
# PVE vzdump hookscript handing VM backups with single PCIE GPUs pass-through
#
# Temporarily removes the single PCI passthrough device from VM config of a
# stopped VM before backup to prevent the "PCI device already in use" error
# when PCIE devices are attached to other running VMs.
#
# ATTENTION:
# ** handles only VMs with single PCIE devices, rewrite to handle more