public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [pve-dev][storage] clone vs import/export
@ 2021-09-15 16:30 Andrei Perapiolkin
  2021-09-16  6:12 ` Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Perapiolkin @ 2021-09-15 16:30 UTC (permalink / raw)
  To: pve-devel

Hi Proxmox Dev's!

I am developing plugin for the data storage system and want to 
avoid/minimize copying data on the proxmox side.

And it looks like Im missing something in understanding or copy/clone 
features. So can you please help me?


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.

Im talking about: /usr/share/perl5/PVE/Storage system.

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.

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?


Thanks for your attention,

Andrei




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pve-devel] [pve-dev][storage] clone vs import/export
  2021-09-15 16:30 [pve-devel] [pve-dev][storage] clone vs import/export Andrei Perapiolkin
@ 2021-09-16  6:12 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-09-16  6:12 UTC (permalink / raw)
  To: Proxmox VE development discussion, Andrei Perapiolkin

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-16  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 16:30 [pve-devel] [pve-dev][storage] clone vs import/export Andrei Perapiolkin
2021-09-16  6:12 ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal