[SOLVED] when node reboots, vm's are taking a long time to start

RobFantini

Famous Member
May 24, 2012
2,042
107
133
Boston,Mass
i used this in our pve crontab pve4:
Code:
@reboot   root  sleep 120;  /usr/local/bin/pve-system-start-cron-script
that send email with a list of vm's plus more . most vm's that were supposed to start at boot did. or all.

on pve5 90-100% of vm's are stopped when i get the email - after changing the sleep to 180

is there something i can do with to fix the issue? i suppose it is a systemd timing issue and a config file needs to be changed.
 
Last edited:
why not move that one from cron to a systemd unit (you want to run it after boot at a certain point)? in your case, you can order it after pve-guests.service and pve-ha-lrm.service, all auto-started guests should have started at that point. something like the following should probably work:

Code:
[Unit]
Description=Send mail after start-on-boot guests have been started
After=pve-guests.service
After=pve-ha-lrm.service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/pve-system-start-cron-script

[Install]
WantedBy=multi-user.target

(put into /etc/systemd/system/SOMETHING.service, execute "systemctl daemon-reload" and "systemctl enable SOMETHING.service")
 
Fabian - thank you for the reply, however I did not use your suggestion as I figured there was a timing issue the devs had to correct or somthing./ i am a caveman at kernel / systemd stuff.

however lately the reboot mails show all vm's running. so they did something to improve things and this is fixed.