I have a rarely used VM configured for GPU passthrough, this VM is manually started when needed. The same GPU is passed through to an LXC container that is running most of the time. I have hookscripts on both VM and LXC that stop the other when one is starting. This works pretty well.
As part of backup of the VM the VM hookscript is run (pre-start and post-start), which I did not expect. There does not appear to be any indication to the hookscript that the start is related to a backup, so it stops the LXC as if the VM is actually starting. Since I'd prefer to keep the LXC running, I modified the hook script for the VM to not stop the LXC if the reason for the start is a backup (a vzdump script is used to track this so the VM hook knows).
Unfortunately, backing up the VM while the GPU is still in the LXC causes the machine to kernel panic. My guess is that this is because of some conflict in the driver binding as the VM tries to set it up for passthrough, even though the VM will never start or use the GPU.
Is there a way to backup a VM without "starting" the VM? In addition to the confusion of states in the hookscript, it seem unnecessary to configure the GPU for passthrough just to backup the filesystem?
If not, is there a better option than manually adding the GPU passthrough every time I want to use the VM? I'm aware from other threads that I don't have the option of adding the GPU passthrough to the VM on the fly from the hookscript.
As part of backup of the VM the VM hookscript is run (pre-start and post-start), which I did not expect. There does not appear to be any indication to the hookscript that the start is related to a backup, so it stops the LXC as if the VM is actually starting. Since I'd prefer to keep the LXC running, I modified the hook script for the VM to not stop the LXC if the reason for the start is a backup (a vzdump script is used to track this so the VM hook knows).
Unfortunately, backing up the VM while the GPU is still in the LXC causes the machine to kernel panic. My guess is that this is because of some conflict in the driver binding as the VM tries to set it up for passthrough, even though the VM will never start or use the GPU.
Is there a way to backup a VM without "starting" the VM? In addition to the confusion of states in the hookscript, it seem unnecessary to configure the GPU for passthrough just to backup the filesystem?
If not, is there a better option than manually adding the GPU passthrough every time I want to use the VM? I'm aware from other threads that I don't have the option of adding the GPU passthrough to the VM on the fly from the hookscript.
Last edited: