Bobcares

Add Delay to VM Boot Time Proxmox: Explained

by | Sep 28, 2022

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:

add delay to vm boot time proxmox

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.

GET STARTED

2 Comments

  1. tedesco

    Merci, je vie beaucoup mieux depuis cette modif, mon ceph à tout le temps de se mettre bien en route maintenant.

    Reply
    • Hiba Razak

      Hi,
      Thanks for the feedback. We are glad to know that our article was helpful for you 🙂 .

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF