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 71A8F6B252 for ; Tue, 3 Aug 2021 10:27:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 60869FC50 for ; Tue, 3 Aug 2021 10:27:04 +0200 (CEST) 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 804EFFC40 for ; Tue, 3 Aug 2021 10:27:02 +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 4E6A14029A for ; Tue, 3 Aug 2021 10:27:02 +0200 (CEST) To: pve-devel@lists.proxmox.com, Aaron Lauterer References: <20210719145254.2269142-1-a.lauterer@proxmox.com> From: Fabian Ebner Message-ID: <646b2824-f411-f391-f7ae-ba7cea4c8c4f@proxmox.com> Date: Tue, 3 Aug 2021 10:27:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210719145254.2269142-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.441 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 -0.001 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lvmplugin.pm, zfspoolplugin.pm, drive.pm, qm.pm, lxc.pm, lvmthinplugin.pm, proxmox.com, storage.pm, qemu.pm, plugin.pm, rbdplugin.pm, pct.pm] Subject: Re: [pve-devel] [PATCH v1 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 08:27:04 -0000 Looks mostly good to me, mostly nits and suggestions for some improvements. The only real issues I found are the < 9 instead of < 10 for checking the API version, and the check for running containers not being inside lock_config anymore (maybe that is not even a big deal, didn't check in detail). The suggested changes for the find_free_diskname interface would be nice to have IMHO, now that it's not set in stone yet, but it's not a must either. Am 19.07.21 um 16:52 schrieb Aaron Lauterer: > This is the continuation of 'disk-reassign' but instead of a separate > API endpoint we now follow the approach to make it part of the > 'move-disk' and 'move-volume' endpoints for VMs and containers. > > The main idea is to make it easy to move a disk/volume to another guest. > Currently this is a manual and error prone process that requires > knowledge of how PVE handles disks/volumes and the mapping which guest > they belong to. > > With this, the 'qm move-disk' and 'pct move-volume' are changed in the > way that the storage parameter is optional as well as the new > target-vmid and target-{disk,mp}. This will keep old calls to move the > disk/volume to another storage working. To move to another guest, the > storage needs to be omitted. > > Major changes since the last iteration as dedicated API endpoint [0] are > that the storage layer only implements the renaming itself. The layer > above (qemu-server and pve-container) define the name of the new > volume/disk. Therefore it was necessary to expose the > 'find_free_diskname' function. The rename function on the storage layer > handles possible template referneces and the creation of the new volid > as that is highly dependent on the actual storage. > > The following storage types are implemented at the moment: > * dir based ones > * ZFS > * (thin) LVM > * Ceph RBD > > > Most parts of the disk-reassign code has been taken and moved into the > 'move_disk' and 'move_volume' endpoints with conditional checking if the > reassign code or the move to other storage code is meant to run > depending on the given parameters. > > Changes since the RFC [1]: > * added check if target guest is replicated and fail if storage does not > support replication > * only pass minimum of needed parameters to the storage layer and infer > other needed information from that > * lock storage and check if the volume aready exists (handling a > possible race condition between calling find_free_disk and the actual > renaming) > * use a helper method to determine if the plugin needs the fmt suffix > in the volume name > * getting format of the source and pass it to find_free_disk > * style fixes (long lines, multiline post-if, ...) > > [0] https://lists.proxmox.com/pipermail/pve-devel/2021-April/047481.html > [1] https://lists.proxmox.com/pipermail/pve-devel/2021-June/048400.html > > storage: Aaron Lauterer (2): > storage: expose find_free_diskname > add disk rename feature > > PVE/Storage.pm | 31 +++++++++++++++-- > PVE/Storage/LVMPlugin.pm | 32 ++++++++++++++++++ > PVE/Storage/LvmThinPlugin.pm | 1 + > PVE/Storage/Plugin.pm | 65 ++++++++++++++++++++++++++++++++++++ > PVE/Storage/RBDPlugin.pm | 34 +++++++++++++++++++ > PVE/Storage/ZFSPoolPlugin.pm | 29 ++++++++++++++++ > 6 files changed, 190 insertions(+), 2 deletions(-) > > > qemu-server: Aaron Lauterer (4): > cli: qm: change move_disk to move-disk > Drive: add valid_drive_names_with_unused > api: move-disk: add move to other VM > api: move-disk: cleanup very long lines > > PVE/API2/Qemu.pm | 254 ++++++++++++++++++++++++++++++++++++++-- > PVE/CLI/qm.pm | 3 +- > PVE/QemuServer/Drive.pm | 4 + > 3 files changed, 250 insertions(+), 11 deletions(-) > > > container: Aaron Lauterer (3): > cli: pct: change move_volume to move-volume > api: move-volume: add move to another container > api: move-volume: cleanup very long lines > > src/PVE/API2/LXC.pm | 303 ++++++++++++++++++++++++++++++++++++++++---- > src/PVE/CLI/pct.pm | 3 +- > 2 files changed, 278 insertions(+), 28 deletions(-) > >