From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <a.lauterer@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 22C527BB85
 for <pve-devel@lists.proxmox.com>; Tue,  2 Nov 2021 15:37:12 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 1A33DA5A8
 for <pve-devel@lists.proxmox.com>; Tue,  2 Nov 2021 15:36:42 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 94A63A59A
 for <pve-devel@lists.proxmox.com>; Tue,  2 Nov 2021 15:36:41 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6C1CD46014
 for <pve-devel@lists.proxmox.com>; Tue,  2 Nov 2021 15:36:41 +0100 (CET)
Message-ID: <79ae0f11-b5d7-2c5f-5ab6-e1e17cd8e7e5@proxmox.com>
Date: Tue, 2 Nov 2021 15:36:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.2.1
Content-Language: en-US
To: Fabian Ebner <f.ebner@proxmox.com>, pve-devel@lists.proxmox.com
References: <20211021113030.2649985-1-a.lauterer@proxmox.com>
 <e169fddf-3c71-b2a2-5ea2-b9e85820d588@proxmox.com>
From: Aaron Lauterer <a.lauterer@proxmox.com>
In-Reply-To: <e169fddf-3c71-b2a2-5ea2-b9e85820d588@proxmox.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.705 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A            -1.14 Looks like a legit reply (A)
 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 v3 storage qemu-server container 0/9] move
 disk or volume to other guests
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>
X-List-Received-Date: Tue, 02 Nov 2021 14:37:12 -0000



On 10/27/21 13:55, Fabian Ebner wrote:
> Nice work! For all patches except #8 it's only nits from my side, so those are:
> 
> Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
> Tested-by: Fabian Ebner <f.ebner@proxmox.com>
> 
> 
> I did run into one strange issue with RBD upon destroying a VM, but it didn't pop up consistently and maybe it's just my cluster (all VMs were powered off):
> 
> root@pve701 ~ # qm clone 12345 142
> /dev/rbd0
> create linked clone of drive scsi0 (rbdkvm:base-12345-disk-0)
> clone base-12345-disk-0: base-12345-disk-0 snapname __base__ to vm-142-disk-0
> root@pve701 ~ # qm move_disk 142 scsi0 --target-vmid 111 --target-disk scsi3
> moving disk 'scsi0' from VM '142' to '111'
> removing disk 'scsi0' from VM '142' config
> update VM 111: -scsi3 rbdkvm:base-12345-disk-0/vm-111-disk-0,size=4G
> /dev/rbd1
> root@pve701 ~ # qm move_disk 111 scsi3 --target-vmid 142 --target-disk scsi3
> moving disk 'scsi3' from VM '111' to '142'
> removing disk 'scsi3' from VM '111' config
> update VM 142: -scsi3 rbdkvm:base-12345-disk-0/vm-142-disk-0,size=4G
> /dev/rbd2
> root@pve701 ~ # qm destroy 142
> 2021-10-27T12:17:13.202+0200 7f8b00d0e700 -1 librbd::image::PreRemoveRequest: 0x55e08f1cac30 check_image_watchers: image has watchers - not removing
> Removing image: 0% complete...failed.
> rbd: error: image still has watchers
> Could not remove disk 'rbdkvm:base-12345-disk-0/vm-142-disk-0', check manually: rbd rm 'base-12345-disk-0/vm-142-disk-0' error: rbd: error: image still has watchers

I also came across this issue and it seems that we do not unmap KRBD mounted images prior to renaming them. This also applies to converting a guest to a template. I have it on my TODO list to work on that in an extra patch set.