[pve-devel] [PATCH 2/3] Skip templates when using the start all VMs button

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 14 09:33:07 CET 2016


The idea of this patch looks good,

please address the issues mentioned by Fabian (respin it on current
master & move the "next if .." parts in the respective branch above) and
sign the CLA (as mentioned in my other reply to your first patch) and
then this should be good to go.

Thanks for your contribution.

cheers,
Thomas

On 03/11/2016 12:59 PM, Caspar Smit wrote:
> Signed-off-by: Caspar Smit <casparsmit at supernas.eu>
> ---
>  PVE/API2/Nodes.pm | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index d4af788..6f639d2 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -1274,6 +1274,18 @@ __PACKAGE__->register_method ({
>  		foreach my $vmid (sort {$a <=> $b} keys %$vmlist) {
>  		    my $d = $vmlist->{$vmid};
>  
> +		    # skip templates
> +		    my $conf;
> +		    if ($d->{type} eq 'lxc') {
> +			$conf = PVE::LXC::load_config($vmid);
> +		    } elsif ($d->{type} eq 'qemu') {
> +			$conf = PVE::QemuServer::load_config($vmid);
> +		    } else {
> +			die "unknown VM type '$d->{type}'\n";
> +		    }
> +		    next if PVE::QemuServer::is_template($conf);
> +		    next if PVE::LXC::is_template($conf);
> +
>  		    PVE::Cluster::check_cfs_quorum(); # abort when we loose quorum
>  	    
>  		    eval {





More information about the pve-devel mailing list