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 382D36A235 for ; Thu, 16 Sep 2021 08:13:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0D39F20961 for ; Thu, 16 Sep 2021 08:12:45 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 68B8920951 for ; Thu, 16 Sep 2021 08:12:43 +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 34ED7448CC; Thu, 16 Sep 2021 08:12:43 +0200 (CEST) Message-ID: Date: Thu, 16 Sep 2021 08:12:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Thunderbird/93.0 Content-Language: en-US To: Proxmox VE development discussion , Andrei Perapiolkin References: <2a93c230-0ca3-9a73-914b-5d598a4d6cbb@open-e.com> From: Thomas Lamprecht In-Reply-To: <2a93c230-0ca3-9a73-914b-5d598a4d6cbb@open-e.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.110 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.698 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] [pve-dev][storage] clone vs import/export 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, 16 Sep 2021 06:13:15 -0000 Hi Andrei, On 15.09.21 18:30, Andrei Perapiolkin wrote: > I was looking on cloning of virtual machines and volumes in proxmox and it seems like it is done through plain copy on the side of proxmox server. At least that is what happens when I press clone button in UI interface. Yes, a "linked clone" only happens if you clone from a guest converted to a template, as then we can guarantee that the original does not vanishes and it made a few thins simple in general. > > Im talking about: /usr/share/perl5/PVE/Storage system. I.e., the pve-storage git repo: https://git.proxmox.com/?p=pve-storage.git;a=summary > > I do not think that this is the most optimal behavior. And I want to know how to make proxmox delegate data copying to the storage system. There's certainly some room for improvements, but I do not think that is as simple as just swapping those method calls you refer below. > > In other words I want to make proxmox call for "clone_image" method instead of "volume_import and volume_export" when volumes being cloned/copied to the very same data storage. > > Is it possible to do so with configuration and plugin code alone? Or it require modification in proxmox code itself? There's no configuration knob to turn the behavior you describe on, if you mean that. So yes, one would need to adapt the Proxmox VE code, starting from the clone API calls in the pve-container and qemu-server repos working downward to ensure that we check if it is even possible (not all storage support that functionality and on some it may has some unexpected implications) and make it possible for the user to decide if they want to to the full-copy clone or a, if possible, cheaper thin clone. If you want to submit any work here it'd be great if you read over our high-level dev docs for an overview of the process we use: https://pve.proxmox.com/wiki/Developer_Documentation hope that cleared a few things up! cheers, Thomas