[pve-devel] [pve-dev][storage] clone vs import/export

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Sep 16 08:12:00 CEST 2021


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





More information about the pve-devel mailing list