Let us examine how to add delay to VM boot time Proxmox in a few simple steps and the configurations associated with it with the support of our Server Management Support services at Bobcares.
Proxmox first VM boot delay solution:
One of the simplest solutions to this problem is to change the grub menu timeout before booting ProxMox.
Edit /etc/default/grub and modify GRUB_TIMEOUT
#modify GRUB_TIMEOUT to your liking
GRUB_TIMEOUT=300
All that remains is to execute update-grub by entering the following command:
update-grub
The Proxmox server now waits 5 minutes before starting the OS, by which time the NAS should be operational. There will be no more manual restarting of virtual machines following a power outage.
Delay the auto-start of a virtual machine (VM) or a guest system in Proxmox VE:
Note that if we look at PVE node/PVE cluster name -> VM -> Options -> Start/Shutdown order -> Startup delay, this is most likely the incorrect location, even if we configure it to “Start/Shutdown order: 1” “Startup delay: 30.”
This refers to adding 30 seconds of delay to the next VM boot time after the current one, not starting this one after 30 seconds.
Delay the start of the entire VM on boot service.
Here’s how to Delay the entire VM start on boot service, which is exactly what we need.
- To begin, connect to the PVE terminal using SSH via the online GUI -> Shell.
- Make a backup of the configuration file that will be edited first, by typing in the following command line:
cd /etc/systemd/system/multi-user.target.wants cp pve-guests.service pve-guests.service.bk
Re-configure or edit the “PvE-guests.service” file:
nano pve-guests.service
On PVE 6.2, will include the content given below:
[Unit]
Description=PVE guests
ConditionPathExists=/usr/bin/pvesh
RefuseManualStart=true
RefuseManualStop=true
Wants=pvestatd.service
Wants=pveproxy.service
Wants=spiceproxy.service
Wants=pve-firewall.service
Wants=lxc.service
After=pveproxy.service
After=pvestatd.service
After=spiceproxy.service
After=pve-firewall.service
After=lxc.service
After=pve-ha-crm.service pve-ha-lrm.service
[Service]
Environment="PVE_LOG_ID=pve-guests"
ExecStartPre=-/usr/share/pve-manager/helpers/pve-startall-delay
ExecStart=/usr/bin/pvesh --nooutput create /nodes/localhost/startall
ExecStop=-/usr/bin/vzdump -stop
ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
Type=oneshot
RemainAfterExit=yes
TimeoutSec=infinity
[Install]
WantedBy=multi-user.target
Alias=pve-manager.service
- After this we have to add the following command line to add delay to VM boot time Proxmox:
ExecStartPre=/bin/sleep 30
- This command line indicates that we will wait 30 seconds before beginning the VM boot sequence.
Note: We can modify the time accordingly depending on the requirements e.g. Considering that the NAS is taking a huge chunk of time to start we can change this to 60 or even 120 depending on the necessity.
- Above the following line type in :
ExecStartPre=-/usr/share/pve-manager/helpers/pve-startall-delay
- As a result, the finished file looks like this for adding the delay to VM boot time Proxmox :
[Unit]
Description=PVE guests
ConditionPathExists=/usr/bin/pvesh
RefuseManualStart=true
RefuseManualStop=true
Wants=pvestatd.service
Wants=pveproxy.service
Wants=spiceproxy.service
Wants=pve-firewall.service
Wants=lxc.service
After=pveproxy.service
After=pvestatd.service
After=spiceproxy.service
After=pve-firewall.service
After=lxc.service
After=pve-ha-crm.service pve-ha-lrm.service
[Service]
Environment="PVE_LOG_ID=pve-guests"
ExecStartPre=/bin/sleep 30
ExecStartPre=-/usr/share/pve-manager/helpers/pve-startall-delay
ExecStart=/usr/bin/pvesh --nooutput create /nodes/localhost/startall
ExecStop=-/usr/bin/vzdump -stop
ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
Type=oneshot
RemainAfterExit=yes
TimeoutSec=infinity
[Install]
WantedBy=multi-user.target
Alias=pve-manager.service
- After that save and Exit out of the editor by typing n Ctrl+X, Y, Enter Key.
- Finally, restart the PVE host to check whether it works or not.
Note (Important)
Some system updates will revert the change; so, after each system update, we must check to see if the alteration is still present; if not, we must re-modify the file.
[Need assistance with similar queries? We are here to help]
Conclusion
To conclude we have now learned how to add delay to VM boot time Proxmox within a few simple steps with the assistance of our Server Management Support Services at Bobcares.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
Merci, je vie beaucoup mieux depuis cette modif, mon ceph à tout le temps de se mettre bien en route maintenant.
Hi,
Thanks for the feedback. We are glad to know that our article was helpful for you 🙂 .