[pve-devel] [PATCH 3/3] Allow migrate-all button on HA enabled VMs

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 14 09:57:13 CET 2016


This patch builds upon the previous patch, so please rebase it also when
you update the other one else it won't apply, else it looks good.


On 03/11/2016 12:59 PM, Caspar Smit wrote:
> When using the migrate all button, HA enabled VMs and Containers are now also
> migrated. The start/stop all button still skips HA enabled VMs because pve-ha-manager handles those.
>
> Signed-off-by: Caspar Smit <casparsmit at supernas.eu>


Reviewed-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  PVE/API2/Nodes.pm | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index 6f639d2..bb12e46 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -1208,9 +1208,6 @@ my $get_start_stop_list = sub {
>  		$startup = { order => $bootorder };
>  	    }
>  
> -	    # skip ha managed VMs (started by pve-ha-manager)
> -	    return if PVE::HA::Config::vm_is_ha_managed($vmid);
> -
>  	    $resList->{$startup->{order}}->{$vmid} = $startup;
>  	    $resList->{$startup->{order}}->{$vmid}->{type} = $d->{type};
>  	};
> @@ -1286,6 +1283,9 @@ __PACKAGE__->register_method ({
>  		    next if PVE::QemuServer::is_template($conf);
>  		    next if PVE::LXC::is_template($conf);
>  
> +		    # skip ha managed VMs (started by pve-ha-manager)
> +		    next if PVE::HA::Config::vm_is_ha_managed($vmid);
> +
>  		    PVE::Cluster::check_cfs_quorum(); # abort when we loose quorum
>  	    
>  		    eval {
> @@ -1413,6 +1413,9 @@ __PACKAGE__->register_method ({
>  		};
>  
>  		foreach my $vmid (sort {$b <=> $a} keys %$vmlist) {
> +		    # skip ha managed VMs (stopped by pve-ha-manager)
> +		    next if PVE::HA::Config::vm_is_ha_managed($vmid);
> +
>  		    my $d = $vmlist->{$vmid};
>  		    my $upid;
>  		    eval { $upid = &$create_stop_worker($nodename, $d->{type}, $vmid, $d->{down}); };





More information about the pve-devel mailing list