public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Fabian Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] get_included_guests: handle non-existing guests
Date: Mon, 19 Oct 2020 14:38:42 +0200	[thread overview]
Message-ID: <7a6f8e5a-972d-166c-dafc-ccdd049226f7@proxmox.com> (raw)
In-Reply-To: <20201019105300.17898-1-f.ebner@proxmox.com>

(FYI: forgot to hit reply-all, so resending this for the list)

On 19.10.20 12:53, Fabian Ebner wrote:
> If a guest is removed without purge, the ID will remain
> in the backup configuration. Avoid using the variable $node
> when it is potentially undefined. Instead, skip non-existing
> guests and warn the user.
>
> Reported here:
> https://forum.proxmox.com/threads/purge-backup-does-not-remove-vm-from-datacenter-backup-list.77609/

a backup job referencing to an non-existent VM must fail, that's by design.
People should either use purge, if they really want to purge a VM, or else
remove it manually from the job.

It's just important that the backup of the remaining, existing, VMs is made
nonetheless, but the job is not successful, as it was asked to backup
something that does not exists - making such errors less prominent is not
ideal.

>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/VZDump.pm                      |  5 +++++
>  test/vzdump_guest_included_test.pl | 12 +++++++++++-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
> index 542228d6..6dbb6a44 100644
> --- a/PVE/VZDump.pm
> +++ b/PVE/VZDump.pm
> @@ -1217,6 +1217,11 @@ sub get_included_guests {
>      $vmids = check_vmids(@$vmids);
>  
>      for my $vmid (@$vmids) {
> +	if (!defined($vmlist->{ids}->{$vmid})) {
> +	    debugmsg('warn', "no guest with ID '$vmid' exists in the cluster!");
> +	    next;
> +	}
> +
>  	my $node = $vmlist->{ids}->{$vmid}->{node};
>  	next if (defined $job->{node} && $job->{node} ne $node);
>  





  reply	other threads:[~2020-10-19 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 10:53 Fabian Ebner
2020-10-19 12:38 ` Thomas Lamprecht [this message]
2020-10-20  6:25   ` Fabian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a6f8e5a-972d-166c-dafc-ccdd049226f7@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal