mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-16 01:20:21 +00:00
Add delay in startall to reduce load at boot time
This commit is contained in:
parent
9b4ea96225
commit
9db78b5ee6
4
qm
4
qm
@ -231,9 +231,13 @@ __PACKAGE__->register_method ({
|
|||||||
my $vzlist = PVE::QemuServer::vzlist();
|
my $vzlist = PVE::QemuServer::vzlist();
|
||||||
my $storecfg = PVE::Storage::config();
|
my $storecfg = PVE::Storage::config();
|
||||||
|
|
||||||
|
my $count = 0;
|
||||||
foreach my $vmid (keys %$vzlist) {
|
foreach my $vmid (keys %$vzlist) {
|
||||||
next if $vzlist->{$vmid}->{pid}; # already running
|
next if $vzlist->{$vmid}->{pid}; # already running
|
||||||
|
|
||||||
|
sleep(2) if $count != 0; # reduce load
|
||||||
|
$count++;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $conf = PVE::QemuServer::load_config($vmid);
|
my $conf = PVE::QemuServer::load_config($vmid);
|
||||||
if ($conf->{onboot}) {
|
if ($conf->{onboot}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user