Is there a way to check if hardware is available before starting a VM?

jonathan.young

New Member
Apr 26, 2020
4
0
1
55
Hi,

My situation is I have several VMs that use the same hardware (i.e. a GPU) and I have scheduled backup job to back them up (normally as a snapshot).

Part of the backup process is to start the VM but the problem is if one of the VMs that share the same hardware is already running then it crashes and also the backup of the other VM fails.

Obviously only 1 VM (using the same hardware) can be run at the same time but would there be a way for the backup process to do a sanity check and see if the resources are available to start the VM (for backup) before actually starting and avoid the crash? I guess normally a 'qm start' will try to grab the resources and then fail if it can't but that process harms the VM using the resources in the first place. Maybe proxmox could keep a running list of hardware that is being used by running VMs to avoid this?

Kind Regards,

Jonathan
 

Dominic

Proxmox Staff Member
Staff member
Mar 18, 2019
1,162
130
68
You could try to use a VM or backup hook script for this.
 

samsepi0l

New Member
Jan 17, 2021
7
1
3
27
Among other stuff, I've been looking for this feature too, and I already submitted a few feature requests, right now, while waiting for it to be implemented officially, I'm using a custom hook script which is slow and not perfect but it works, see my post: https://forum.proxmox.com/threads/e...starting-vm-through-custom-hook-script.82622/
I can publish my script too but I'd like to clean it up first and ensure it won't mess up the system if someone decides to use it. If you need it in the current state please PM me.
 
  • Like
Reactions: Dominic

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!