public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH/RFC storage] prune backups: activate storage
@ 2021-04-16  8:51 Fabian Ebner
  2021-06-14  6:29 ` Fabian Ebner
  2021-06-15  8:17 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2021-04-16  8:51 UTC (permalink / raw)
  To: pve-devel

which also checks whether the storage is even enabled. VZDump jobs already
activate the storage, but more direct calls via API/CLI didn't do so yet.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Or should the call rather be made in the API endpoints?

For functions like volume_resize, the callers in qemu-server/pve-container do
the activation via activate_volumes, while for vdisk_* functions the activation
happens directly in the functions.

The snapshot-related functions are also currently missing the activation/enabled
check! Should the callers in guest-common do an activate_volumes call, or should
we do an activate_storage in the functions themselves?

The first appraoch has the advantage of being more efficient (one activation
call for the whole operation) and also more precise (if volume activation itself
is actually needed), while the second one ensures that we do not forget to make
the calls.

 PVE/Storage.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 122c3e9..a856266 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -1630,6 +1630,8 @@ sub prune_backups {
 	$keep = PVE::JSONSchema::parse_property_string('prune-backups', $scfg->{'prune-backups'});
     }
 
+    activate_storage($cfg, $storeid);
+
     my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
     return $plugin->prune_backups($scfg, $storeid, $keep, $vmid, $type, $dryrun, $logfunc);
 }
-- 
2.20.1





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

* Re: [pve-devel] [PATCH/RFC storage] prune backups: activate storage
  2021-04-16  8:51 [pve-devel] [PATCH/RFC storage] prune backups: activate storage Fabian Ebner
@ 2021-06-14  6:29 ` Fabian Ebner
  2021-06-15  8:17 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Ebner @ 2021-06-14  6:29 UTC (permalink / raw)
  To: pve-devel

Any feedback for this?

Am 16.04.21 um 10:51 schrieb Fabian Ebner:
> which also checks whether the storage is even enabled. VZDump jobs already
> activate the storage, but more direct calls via API/CLI didn't do so yet.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Or should the call rather be made in the API endpoints?
> 
> For functions like volume_resize, the callers in qemu-server/pve-container do
> the activation via activate_volumes, while for vdisk_* functions the activation
> happens directly in the functions.
> 
> The snapshot-related functions are also currently missing the activation/enabled
> check! Should the callers in guest-common do an activate_volumes call, or should
> we do an activate_storage in the functions themselves?
> 
> The first appraoch has the advantage of being more efficient (one activation
> call for the whole operation) and also more precise (if volume activation itself
> is actually needed), while the second one ensures that we do not forget to make
> the calls.
> 
>   PVE/Storage.pm | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/PVE/Storage.pm b/PVE/Storage.pm
> index 122c3e9..a856266 100755
> --- a/PVE/Storage.pm
> +++ b/PVE/Storage.pm
> @@ -1630,6 +1630,8 @@ sub prune_backups {
>   	$keep = PVE::JSONSchema::parse_property_string('prune-backups', $scfg->{'prune-backups'});
>       }
>   
> +    activate_storage($cfg, $storeid);
> +
>       my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
>       return $plugin->prune_backups($scfg, $storeid, $keep, $vmid, $type, $dryrun, $logfunc);
>   }
> 




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

* [pve-devel] applied: [PATCH/RFC storage] prune backups: activate storage
  2021-04-16  8:51 [pve-devel] [PATCH/RFC storage] prune backups: activate storage Fabian Ebner
  2021-06-14  6:29 ` Fabian Ebner
@ 2021-06-15  8:17 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-06-15  8:17 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 16.04.21 10:51, Fabian Ebner wrote:
> which also checks whether the storage is even enabled. VZDump jobs already
> activate the storage, but more direct calls via API/CLI didn't do so yet.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Or should the call rather be made in the API endpoints?
> 
> For functions like volume_resize, the callers in qemu-server/pve-container do
> the activation via activate_volumes, while for vdisk_* functions the activation
> happens directly in the functions.

both can be OK as of now, this here seems a bit more convenient for the specific case,
we may want to stream line that a bit sometimes, but should be evaluated if there's
any gain from that (and be it only to have a nicer architecture to use), or at least
define some rough set of rules about when to do use what.

> 
> The snapshot-related functions are also currently missing the activation/enabled
> check! Should the callers in guest-common do an activate_volumes call, or should
> we do an activate_storage in the functions themselves?
> 
> The first appraoch has the advantage of being more efficient (one activation
> call for the whole operation) and also more precise (if volume activation itself
> is actually needed), while the second one ensures that we do not forget to make
> the calls.

here the activate_volumes in guest-common seems slightly more sensible for me, mostly
due the single call for multiple volumes and IIRC we handle specific sets of volumes
more often that way, compared to the prune above, which does not yet has a specific
set of volumes to operate one, it always goes on the whole storage (so IMO fits slightly
better in the pve-storage part)

> 
>  PVE/Storage.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, thanks!




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

end of thread, other threads:[~2021-06-15  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16  8:51 [pve-devel] [PATCH/RFC storage] prune backups: activate storage Fabian Ebner
2021-06-14  6:29 ` Fabian Ebner
2021-06-15  8:17 ` [pve-devel] applied: " 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