From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 518C01FF15E
	for <inbox@lore.proxmox.com>; Tue, 11 Feb 2025 13:51:14 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id C3F392C516;
	Tue, 11 Feb 2025 13:51:10 +0100 (CET)
Mime-Version: 1.0
Date: Tue, 11 Feb 2025 13:50:37 +0100
Message-Id: <D7PMOFP7YVOU.2HAVW7OVBQJRV@proxmox.com>
From: "Christoph Heiss" <c.heiss@proxmox.com>
To: "Dominik Csapak" <d.csapak@proxmox.com>
X-Mailer: aerc 0.20.0
References: <20250120145203.282363-1-d.csapak@proxmox.com>
 <20250120145203.282363-17-d.csapak@proxmox.com>
In-Reply-To: <20250120145203.282363-17-d.csapak@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.028 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH manager v5 2/5] bulk migrate: improve
 precondition checks
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

On Mon Jan 20, 2025 at 3:51 PM CET, Dominik Csapak wrote:
[..]
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index 9cdf19db..6fe7a5fd 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -2331,11 +2331,23 @@ my $create_migrate_worker = sub {
>  	    $invalidConditions .= join(', ', map { $_->{volid} } @{$preconditions->{local_disks}});
>  	}
>  
> -	if (@{$preconditions->{local_resources}}) {
> +	if ($online && scalar($preconditions->{local_resources}->@*)) {
>  	    $invalidConditions .= "\n  Has local resources: ";
>  	    $invalidConditions .= join(', ', @{$preconditions->{local_resources}});
>  	}
>  
> +	if (my $not_allowed_nodes = $preconditions->{not_allowed_nodes}) {
> +	    if (my $unavail_storages = $not_allowed_nodes->{$target}->{unavailable_storages}) {
> +		$invalidConditions .= "\n  Has unavailable storages: ";
> +		$invalidConditions .= join(', ', $unavail_storages->@*);
> +	    }
> +
> +	    if (my $unavail_resources = $not_allowed_nodes->{$target}->{'unavailable-resources'}) {
> +		$invalidConditions .= "\n  Has unavailable resources ";

Nit: Above both messages have colons before the item names, so add it
here too?

> +		$invalidConditions .= join(', ', $unavail_resources->@*);
> +	    }
> +	}
> +


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel