[pve-devel] applied: [PATCH v3 storage] api: fix get content call for volumes

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 20 16:36:35 CET 2023


Am 09/03/2023 um 10:41 schrieb Christian Ebner:
> `pvesh get /nodes/{node}/storage/{storage}/content/{volume}` failed for
> several storage types, because the respective storage plugins returned
> only the volumes `size` on `volume_size_info` calls, while also the format
> is required.
> 
> This patch fixes the issue by returning also `format` and where possible `used`.
> 
> The issue was reported in the forum:
> https://forum.proxmox.com/threads/pvesh-get-nodes-node-storage-storage-content-volume-returns-error.123747/
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
> 
> Changes since v1:
>  * Remove errous check for $used being set, rely on fallback to 0 if undef
>  * Return `parent` for RBD and ZFS
>  * Return `used` for ZFS
> 
> Changes since v2:
>  * Add conditional call to `rbd du` to get `used` for RBD based volumes
>  * Get `usedbydataset` instead of `used` for ZFS volumes, refactor
>    zfs_get_properties call
>  
>  Note: The file_size_info for iscsi direct targets unfortunately does
>        not return anything usefull for `used` storage size, so it stayed as
>        is.
> 
>  PVE/Storage/ISCSIDirectPlugin.pm |  2 +-
>  PVE/Storage/RBDPlugin.pm         | 44 ++++++++++++++++++++++++++++++--
>  PVE/Storage/ZFSPoolPlugin.pm     | 11 +++++---
>  3 files changed, 50 insertions(+), 7 deletions(-)
> 
>

applied, thanks!





More information about the pve-devel mailing list