}});
my $get_start_stop_list = sub {
- my ($nodename, $autostart) = @_;
+ my ($nodename, $autostart, $vmfilter) = @_;
my $vmlist = PVE::Cluster::get_vmlist();
+ my $vms;
+
+ if (defined($vmfilter)) {
+ $vms = {};
+ foreach my $vmid (PVE::Tools::split_list($vmfilter)) {
+ $vms->{$vmid} = 1;
+ }
+ }
+
my $resList = {};
foreach my $vmid (keys %{$vmlist->{ids}}) {
+ next if defined($vms) && !$vms->{$vmid};
my $d = $vmlist->{ids}->{$vmid};
my $startup;
type => 'boolean',
description => "force if onboot=0.",
},
+ vms => {
+ description => "Only consider Guests with these IDs.",
+ type => 'string', format => 'pve-vmid-list',
+ optional => 1,
+ },
},
},
returns => {
print "got quorum\n";
}
my $autostart = $force ? undef : 1;
- my $startList = &$get_start_stop_list($nodename, $autostart);
+ my $startList = &$get_start_stop_list($nodename, $autostart, $param->{vms});
# Note: use numeric sorting with <=>
foreach my $order (sort {$a <=> $b} keys %$startList) {
additionalProperties => 0,
properties => {
node => get_standard_option('pve-node'),
+ vms => {
+ description => "Only consider Guests with these IDs.",
+ type => 'string', format => 'pve-vmid-list',
+ optional => 1,
+ },
},
},
returns => {
$rpcenv->{type} = 'priv'; # to start tasks in background
- my $stopList = &$get_start_stop_list($nodename);
+ my $stopList = &$get_start_stop_list($nodename, undef, $param->{vms});
my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
my $datacenterconfig = cfs_read_file('datacenter.cfg');
type => 'integer',
minimum => 1
},
+ vms => {
+ description => "Only consider Guests with these IDs.",
+ type => 'string', format => 'pve-vmid-list',
+ optional => 1,
+ },
},
},
returns => {
$rpcenv->{type} = 'priv'; # to start tasks in background
- my $migrateList = &$get_start_stop_list($nodename);
+ my $migrateList = &$get_start_stop_list($nodename, undef, $param->{vms});
foreach my $order (sort {$b <=> $a} keys %$migrateList) {
my $vmlist = $migrateList->{$order};