BackUp VM (same PCIe device (IOMMU) on two VM.

Mic-net

New Member
Jun 26, 2023
3
0
1
Hello,
Please advise how can they BackUp a virtual machine that is powered off and shares a PCIe device (IOMMU) with another virtual machine. (Always one of them is powered off.)

Any idea?
 
I created this hook script as a workaround for exactly that problem: https://forum.proxmox.com/threads/patchy-summary-usage-graphs.126659/post-565815

Edit it like this in case VMID 100 and 101 share a PCI device:
Code:
# set the VMIDs here of the VMs that can't be run at the same time
declare -a vmids_sharing_device1
vmids_sharing_device1=()
vmids_sharing_device1+=(100)
vmids_sharing_device1+=(101)
Code:
# if VMs that got shutdown because they were part of a group sharing a device
# should be started again when the backup job ends
resume_vmids_sharing_device="true"
Code:
# how many seconds need to be passed since booting the server before backup jobs are allowed to run.
# might be useful in case you virtualize a PBS or NAS that needs to be started first after boot
# in order for the backup storage to get available
boot_delay=0
When then a backup job triggers that should backup one of those two VMs, it should shutdown both VMs, do the backups and at the end start that VM the was shutdown for the backup job. That ensures that those VMs won't block each other and the backup shoudn't fail.
But keep in mind that I didn`t care about cluster compatability, so no idea if something bad will happen when running it in a cluster...
 
Last edited:
Thanks for the effort, but this won't work for me because the VM that should automatically shut down doesn't shut down, it only asks if it should shut down and timeout the shutdown process.
 
Thanks for the effort, but this won't work for me because the VM that should automatically shut down doesn't shut down, it only asks if it should shut down and timeout the shutdown process.
You try to install the QEMU guest agent inside the VM and enable it in the VMs options so PVE will tell the guestOS to shutdown instead of triggering an ACPI shutdown command. Most OSs also got options where you can define how they should behave when ACPI events happens.
With my KDE I can for example tell it what to do when hitting the shutdown button, if it then should shutdown or if a dialog should pop up asking me what to do.

Only other thing I could think of is a VM hook script, where you add a PCI device before starting it and remove the PCI device after shutting it down, so that device is never associated with more than one VM at a time. But no idea if that would really work.
 
Last edited:
Thank you so much for trying to help me, but I ended up working it out differently.

I always automatically comment out the PCIe device assignment in the VM configuration before the backup and uncomment it again after the backup is complete. (All using crone.)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!