wait to start VM until storage available

tessus

Active Member
Oct 5, 2020
45
4
28
Toronto, Canada
After booting a Proxmox node, a VM that was set to autostart failed to do so due to storage 'iscsi-storage' is not online

As you can see from my great naming, the storage is an iSCSI disk image. Usually that storage is always available, unless I boot up the NAS with the iSCSI target at the same time as Proxmox (this happens when power returns after a long (more than 2h) power outage). Proxmox is either so blazingly fast or my NAS is terribly slow at bootup. Either way, there is not much I can do about that.

Is there a way to tell the VM to wait (when autostarting) until the storage is available? Similar to the after=x.service y.target setting in systemd unit files.
I read the documentation and the startup delay doesn't seem to do what I thought it would do. Instead of delaying the startup of the VM, it delays the startup of other VMs.

I can think of a few very hacky workarounds, which seem a bit fragile though. But resource management is part of Proxmox and I think this is not an unfeasible use-case.
If there is no such thing possible, what is the best way to ask for a feature request? Is this even something that the devs would consider?
 
I can think of a few very hacky workarounds, which seem a bit fragile though. But resource management is part of Proxmox and I think this is not an unfeasible use-case.
We do something similar with externally unlocked local encryted storage. We just loop over the VMs with autostart enabled and try to start them by hand. This can be done in a script added to rc.local.