Skip to content

Instantly share code, notes, and snippets.

@ProjectInitiative
ProjectInitiative / hookscript-pci.py
Last active May 23, 2022 02:09
A proxmox hookscript for prepping and validation of bound vfio-pci drivers for PCI devices before starting and stopping a VM with physical hardware passthrough.
#!/usr/bin/env python3
#Copyright 2022 Kyle Petryszak
# Exmple hook script for PVE guests (hookscript config option)
# You can set this via pct/qm with
# pct set <vmid> -hookscript <volume-id>
# qm set <vmid> -hookscript <volume-id>
# where <volume-id> has to be an executable file in the snippets folder
# of any storage with directories e.g.:
# qm set 100 -hookscript local:snippets/hookscript-pci.py