From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F2EA460A39 for ; Thu, 3 Sep 2020 11:07:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F02FA17357 for ; Thu, 3 Sep 2020 11:07:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 661791734D for ; Thu, 3 Sep 2020 11:07:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2EB2F449DA for ; Thu, 3 Sep 2020 11:07:58 +0200 (CEST) Date: Thu, 03 Sep 2020 11:07:51 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Aaron Lauterer , pve-devel@lists.proxmox.com References: <20200901124421.25901-1-a.lauterer@proxmox.com> <20200901124421.25901-2-a.lauterer@proxmox.com> <1599118042.6ymt99i7i5.astroid@nora.none> In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1599123649.4ibqozwy6z.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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 v2 qemu-server 1/5] disk reassign: add API endpoint X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2020 09:07:59 -0000 On September 3, 2020 10:30 am, Aaron Lauterer wrote: >=20 >=20 > On 9/3/20 9:46 AM, Fabian Gr=C3=BCnbichler wrote: >> On September 1, 2020 2:44 pm, Aaron Lauterer wrote: >=20 >=20 > [..] >=20 >>> + >>> + my $drive =3D PVE::QemuServer::parse_drive($disk, $conf->{$disk})= ; >>> + die "disk '$disk' has no associated volume\n" if !$drive->{file}; >>=20 >> missing check for whether it's actually volume-based, and not >> pass-through.. what about templates/base volumes/linked >> clones/snapshots? >=20 > Passed through disks will fail later on in the code but having a check ri= ght away with a nicer error msg is probably a good idea. I haven't thought = about templates, base volumes and linked clones yet. Same goes for Snapshot= s :/ >=20 > I guess we won't want to rename a ZFS dataset with snapshots present? Ano= ther thing is that renaming the dataset will most likely break replication. >=20 from the top of my head, but please verify/check for missing stuff: snapshot: can't re-assign if volume is referenced in a snapshot (would=20 invalidate that reference!), need to remove snapshot(s) first base volume: does not make much sense (except if it does not have any clone= s, in=20 which case we could re-assign to another template but that seems rather=20 contrived) linked volume: needs special handling in storage (pass and encode base=20 volume/template VMID so that new volid is still correct) replicated source: reassigning from a VM that is replicated should work (fr= om=20 replication's PoV, that's just like removing a disk -> it will get=20 cleaned up on the next run), but some special handling to also remove=20 the replication snapshots might be a good idea to return the volume to a=20 clean slate replicated target: should work, but check that volume is replicatable=20 (like when adding a disk) might make sense? =