public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
@ 2025-05-14 12:44 Andrei Perapiolkin via pve-devel
  2025-05-15  9:16 ` Fabian Grünbichler
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Perapiolkin via pve-devel @ 2025-05-14 12:44 UTC (permalink / raw)
  To: pve-devel; +Cc: Andrei Perapiolkin

[-- Attachment #1: Type: message/rfc822, Size: 6495 bytes --]

From: Andrei Perapiolkin <andrei.perepiolkin@open-e.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
Date: Wed, 14 May 2025 08:44:11 -0400
Message-ID: <1979bee4-2f4e-4af2-bfb4-3c320f37399e@open-e.com>

Hi,

I'm trying to test specific aspects of the storage plugin API,
and I'm not sure how to verify whether my function 
volume_rollback_is_possible
correctly sets up the blockers list.

I've checked REST API documentation:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback

CLI tool:
qm rollback

But I couldn't find where the list of blockers is returned or printed.

Are there any posts, guides, or documentation on how to test blockers or 
other return values from storage plugins?



Best regards,

Andrei Perepiolkin



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

* Re: [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
  2025-05-14 12:44 [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers) Andrei Perapiolkin via pve-devel
@ 2025-05-15  9:16 ` Fabian Grünbichler
  2025-05-15 11:23   ` Andrei Perapiolkin via pve-devel
       [not found]   ` <d32e8977-da91-427e-aa15-4937f9894fe3@open-e.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2025-05-15  9:16 UTC (permalink / raw)
  To: Proxmox VE development discussion


> Andrei Perapiolkin via pve-devel <pve-devel@lists.proxmox.com> hat am 14.05.2025 14:44 CEST geschrieben:

> Hi,
> 
> I'm trying to test specific aspects of the storage plugin API,
> and I'm not sure how to verify whether my function 
> volume_rollback_is_possible
> correctly sets up the blockers list.
> 
> I've checked REST API documentation:
> https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback
> 
> CLI tool:
> qm rollback
> 
> But I couldn't find where the list of blockers is returned or printed.

the $blockers parameter is currently only passed in replication contexts:

https://git.proxmox.com/?p=pve-guest-common.git;a=blob;f=src/PVE/AbstractConfig.pm;h=3d4fcbbf98553b1f4edc8f59307daae1cf1b8a2f;hb=HEAD#l1051

the expected behaviour is to
- fill $blockers with the snapshot names preventing the rollback, if there are any
- to die with an error message if rollback is not possible

the caller can then decide if they want to pass a $blockers reference, and upon
catching the error, inspect it to give a nicer error message.

you can see how the 'zfs' plugin handles it (the only one supporting replication
at the moment):

https://git.proxmox.com/?p=pve-storage.git;a=blob;f=src/PVE/Storage/ZFSPoolPlugin.pm;h=26fb0a4237e5c1013ebfa85ca2cc072c57d2c36f;hb=HEAD#l502

and model your implementation after its behaviour (of course, whether rolling
back is limited to the most recent snapshot like it is with ZFS is up to you
and your storage ;))

> Are there any posts, guides, or documentation on how to test blockers or 
> other return values from storage plugins?

out of interest - is your plugin publicly available?


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* Re: [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
  2025-05-15  9:16 ` Fabian Grünbichler
@ 2025-05-15 11:23   ` Andrei Perapiolkin via pve-devel
       [not found]   ` <d32e8977-da91-427e-aa15-4937f9894fe3@open-e.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Andrei Perapiolkin via pve-devel @ 2025-05-15 11:23 UTC (permalink / raw)
  To: Fabian Grünbichler, Proxmox VE development discussion
  Cc: Andrei Perapiolkin

[-- Attachment #1: Type: message/rfc822, Size: 8713 bytes --]

From: Andrei Perapiolkin <andrei.perepiolkin@open-e.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>, "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
Date: Thu, 15 May 2025 07:23:29 -0400
Message-ID: <d32e8977-da91-427e-aa15-4937f9894fe3@open-e.com>

Hi Fabian,


Thank you for detailed response.

> out of interest - is your plugin publicly available?

Yes, my plugin is available at https://github.com/open-e/JovianDSS-Proxmox

Regarding blockers usage: 
https://github.com/open-e/JovianDSS-Proxmox/blob/22d0f7f8c4606d470a988fc796b391f50cabd40f/OpenEJovianDSS/Common.pm#L472

Best regards,

Andrei Perepiolkin

On 5/15/25 05:16, Fabian Grünbichler wrote:
>> Andrei Perapiolkin via pve-devel <pve-devel@lists.proxmox.com> hat am 14.05.2025 14:44 CEST geschrieben:
>> Hi,
>>
>> I'm trying to test specific aspects of the storage plugin API,
>> and I'm not sure how to verify whether my function
>> volume_rollback_is_possible
>> correctly sets up the blockers list.
>>
>> I've checked REST API documentation:
>> https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback
>>
>> CLI tool:
>> qm rollback
>>
>> But I couldn't find where the list of blockers is returned or printed.
> the $blockers parameter is currently only passed in replication contexts:
>
> https://git.proxmox.com/?p=pve-guest-common.git;a=blob;f=src/PVE/AbstractConfig.pm;h=3d4fcbbf98553b1f4edc8f59307daae1cf1b8a2f;hb=HEAD#l1051
>
> the expected behaviour is to
> - fill $blockers with the snapshot names preventing the rollback, if there are any
> - to die with an error message if rollback is not possible
>
> the caller can then decide if they want to pass a $blockers reference, and upon
> catching the error, inspect it to give a nicer error message.
>
> you can see how the 'zfs' plugin handles it (the only one supporting replication
> at the moment):
>
> https://git.proxmox.com/?p=pve-storage.git;a=blob;f=src/PVE/Storage/ZFSPoolPlugin.pm;h=26fb0a4237e5c1013ebfa85ca2cc072c57d2c36f;hb=HEAD#l502
>
> and model your implementation after its behaviour (of course, whether rolling
> back is limited to the most recent snapshot like it is with ZFS is up to you
> and your storage ;))
>
>> Are there any posts, guides, or documentation on how to test blockers or
>> other return values from storage plugins?
> out of interest - is your plugin publicly available?
>


[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

* Re: [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers)
       [not found]   ` <d32e8977-da91-427e-aa15-4937f9894fe3@open-e.com>
@ 2025-05-15 12:28     ` Fabian Grünbichler
  0 siblings, 0 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2025-05-15 12:28 UTC (permalink / raw)
  To: Andrei Perapiolkin, Proxmox VE development discussion


> Andrei Perapiolkin <andrei.perepiolkin@open-e.com> hat am 15.05.2025 13:23 CEST geschrieben:
> 
>  
> Hi Fabian,
> 
> 
> Thank you for detailed response.
> 
> > out of interest - is your plugin publicly available?
> 
> Yes, my plugin is available at https://github.com/open-e/JovianDSS-Proxmox
> 
> Regarding blockers usage: 
> https://github.com/open-e/JovianDSS-Proxmox/blob/22d0f7f8c4606d470a988fc796b391f50cabd40f/OpenEJovianDSS/Common.pm#L472

depending on what the return value/$obj there is, that looks fine to me!

you could optimize the $blocker_found variable away, and just check
whether $blockers has any elements, but that's just making the code
a bit shorter :)


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

end of thread, other threads:[~2025-05-15 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-14 12:44 [pve-devel] checking output of storage plugin API - volume_rollback_is_possible(..., blockers) Andrei Perapiolkin via pve-devel
2025-05-15  9:16 ` Fabian Grünbichler
2025-05-15 11:23   ` Andrei Perapiolkin via pve-devel
     [not found]   ` <d32e8977-da91-427e-aa15-4937f9894fe3@open-e.com>
2025-05-15 12:28     ` Fabian Grünbichler

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