[SOLVED] Wait for NFS/Iscsi before starting other vms

DaYroXy

New Member
Jul 31, 2023
13
0
1
Hello guys! i have truenas as a vm inside of proxmox one issue im facing is sometimes my other VMs run before truenas is actually running so the NFS / Iscsi wont be available.
i know i can use startup delay i tried that and did set it to 60s but its not consistent sometimes it takes around 1:30m to fully load, is there a way to detect when nfs/iscsi is availabe after that start all vms as truenas has bootorder of 0
 
In principle the following should work;

1. Have all VMs that require that NFS to have Start at boot off
2. Write a small script that tests for that NFS to be available & then starts those VMs
 
  • Like
Reactions: waltar
In principle the following should work;

1. Have all VMs that require that NFS to have Start at boot off
2. Write a small script that tests for that NFS to be available & then starts those VMs
but then i have to manually add the VM everytime i create new one that require the nfs correct? this will also cause the issue where the storage is unknown for proxmox until truenas is started which causes very long startup boot
 
but then i have to manually add the VM everytime i create new one that require the nfs correct?
I am guessing what you mean to say: "Any newly created VM that also relies on this NFS storage, will have to be added to the script". And my answer will be, yes obviously. I don't find that very difficult as the part for starting that VM will be a one liner. You could also reserve a range of VMIDs (e.g. 500-550), which you wish to have NFS-dependent & have the script try & start that range of VMs, so that any new VM you wish to be NFS-dependent you just choose within that VMID range, & then you don't need to do anything with the script again.

this will also cause the issue where the storage is unknown for proxmox until truenas is started which causes very long startup boot
I'm not sure what you mean by this. If I understand you correctly, you have a TrueNAS VM that runs on Proxmox, which also provides an NFS share to the Proxmox storage backend. This TrueNAS VM will have Start at boot on as it does now in your current setup, so any problem you have with long boot times will not be caused by my suggested script. On the contrary, the script will probably speed up the boot process, as those other VMs that rely on the NFS share will not be trying to start, as above.

Maybe what you meant to say (but did not) is that even with the above script you still have the underlying problem of the Proxmox backend storage not finishing its boot-time setup due to the NFS share from the TrueNAS VM not yet being available. This is a pretty common catch 22 situation, and does not have many practical workarounds. Proxmox servers, being an HV system aren't meant to be rebooted often, so (an extra) 1.5 minutes of boot time is not to be considered lengthy in my books.

You can search this forum & others, for similar catch 22 situations.

Good luck.
 
  • Like
Reactions: UdoB and DaYroXy
I am guessing what you mean to say: "Any newly created VM that also relies on this NFS storage, will have to be added to the script". And my answer will be, yes obviously. I don't find that very difficult as the part for starting that VM will be a one liner. You could also reserve a range of VMIDs (e.g. 500-550), which you wish to have NFS-dependent & have the script try & start that range of VMs, so that any new VM you wish to be NFS-dependent you just choose within that VMID range, & then you don't need to do anything with the script again.


I'm not sure what you mean by this. If I understand you correctly, you have a TrueNAS VM that runs on Proxmox, which also provides an NFS share to the Proxmox storage backend. This TrueNAS VM will have Start at boot on as it does now in your current setup, so any problem you have with long boot times will not be caused by my suggested script. On the contrary, the script will probably speed up the boot process, as those other VMs that rely on the NFS share will not be trying to start, as above.

Maybe what you meant to say (but did not) is that even with the above script you still have the underlying problem of the Proxmox backend storage not finishing its boot-time setup due to the NFS share from the TrueNAS VM not yet being available. This is a pretty common catch 22 situation, and does not have many practical workarounds. Proxmox servers, being an HV system aren't meant to be rebooted often, so (an extra) 1.5 minutes of boot time is not to be considered lengthy in my books.

You can search this forum & others, for similar catch 22 situations.

Good luck.
Thank you so much for this awesome information! this is exactly what i meant and yeah extra 1.5 minutes isn't a lot but sometimes when im in hurry and i lose power which happens often where i live it becomes annoying sometimes to wait for power+proxmox+truenas but other than that thank you so much for this information.
 

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!