* [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend
@ 2026-03-11 12:04 Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox v2 1/1] pbs-api-types: add backend type to datastore's status items Christian Ebner
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Christian Ebner @ 2026-03-11 12:04 UTC (permalink / raw)
To: pbs-devel
This patches try to more clearly show to the user that the statistic shown
in the datastore summary and overview only show the local cache usage.
To achieve this, the first patches include the datastore backend type in both,
responses for the `datastore-usage` as well as `status` api endpoints, in order
to be able to adapt the shown information conditionally.
Based on the backend, the title for the disk usage and rrd chart are adapted,
the estimated full values are also not shown in case of local caches.
Changes since version 1:
- rebased onto current master
- reordered and squashed patches to avoid inter-patch build failures
- fix a formatting issue surfaced when invoking proxmox-biome
proxmox:
Christian Ebner (1):
pbs-api-types: add backend type to datastore's status items
pbs-api-types/src/datastore.rs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
proxmox-backup:
Christian Ebner (3):
datastore: introduce helper to get store's backend type
api: status/datastore: expose backend type in datastore status/list
ui: Set datastore usage related titles based on backend
pbs-datastore/src/datastore.rs | 8 ++++++--
src/api2/admin/datastore.rs | 4 ++++
src/api2/status/mod.rs | 18 +++++++++++++++---
www/datastore/DataStoreListSummary.js | 10 ++++++++--
www/datastore/Summary.js | 13 +++++++++++++
5 files changed, 46 insertions(+), 7 deletions(-)
Summary over all repositories:
6 files changed, 65 insertions(+), 8 deletions(-)
--
Generated by murpp 0.9.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH proxmox v2 1/1] pbs-api-types: add backend type to datastore's status items
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
@ 2026-03-11 12:04 ` Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox-backup v2 1/3] datastore: introduce helper to get store's backend type Christian Ebner
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Christian Ebner @ 2026-03-11 12:04 UTC (permalink / raw)
To: pbs-devel
Add the backend type to both, the datastore status and the datastore
status list item. This allows to interpret the provided data based
on the backend without the need to determine the backend type by
additional api calls.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-api-types/src/datastore.rs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index b4e7ccf5..3e87eaaa 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -1677,6 +1677,9 @@ pub struct GarbageCollectionJobStatus {
type: Counts,
optional: true,
},
+ "backend-type": {
+ type: DatastoreBackendType,
+ },
},
)]
#[derive(Serialize, Deserialize)]
@@ -1695,6 +1698,9 @@ pub struct DataStoreStatus {
/// Group/Snapshot counts
#[serde(skip_serializing_if = "Option::is_none")]
pub counts: Option<Counts>,
+ /// Datastore backend type
+ #[serde(default)]
+ pub backend_type: DatastoreBackendType,
}
#[api(
@@ -1713,6 +1719,9 @@ pub struct DataStoreStatus {
description: "The usage of a time in the past. Either null or between 0.0 and 1.0.",
}
},
+ "backend-type": {
+ type: DatastoreBackendType,
+ },
},
)]
#[derive(Serialize, Deserialize, Clone, PartialEq)]
@@ -1752,10 +1761,18 @@ pub struct DataStoreStatusListItem {
/// Status of last GC
#[serde(skip_serializing_if = "Option::is_none")]
pub gc_status: Option<GarbageCollectionStatus>,
+ /// Datastore backend type
+ #[serde(default)]
+ pub backend_type: DatastoreBackendType,
}
impl DataStoreStatusListItem {
- pub fn empty(store: &str, err: Option<String>, mount_status: DataStoreMountStatus) -> Self {
+ pub fn empty(
+ store: &str,
+ err: Option<String>,
+ mount_status: DataStoreMountStatus,
+ backend_type: DatastoreBackendType,
+ ) -> Self {
DataStoreStatusListItem {
store: store.to_owned(),
total: None,
@@ -1768,6 +1785,7 @@ impl DataStoreStatusListItem {
estimated_full_date: None,
error: err,
gc_status: None,
+ backend_type,
}
}
}
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH proxmox-backup v2 1/3] datastore: introduce helper to get store's backend type
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox v2 1/1] pbs-api-types: add backend type to datastore's status items Christian Ebner
@ 2026-03-11 12:04 ` Christian Ebner
2026-03-11 12:05 ` [PATCH proxmox-backup v2 2/3] api: status/datastore: expose backend type in datastore status/list Christian Ebner
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Christian Ebner @ 2026-03-11 12:04 UTC (permalink / raw)
To: pbs-devel
In contrast to the pre-existing backend() helper, this newly
introduced backend_type() helper allows to determine a datastores
backend without already instantiating the s3 client in case the
backend is s3.
This will allow to fetch the backend type for the datastore's status
api without having to re-lookup the config.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-datastore/src/datastore.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index af883c467..15a34f376 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -403,7 +403,7 @@ impl DataStore {
/// Get the backend for this datastore based on it's configuration
pub fn backend(&self) -> Result<DatastoreBackend, Error> {
- let backend_type = match self.inner.backend_config.ty.unwrap_or_default() {
+ let backend = match self.backend_type() {
DatastoreBackendType::Filesystem => DatastoreBackend::Filesystem,
DatastoreBackendType::S3 => {
let s3_client_id = self
@@ -439,7 +439,11 @@ impl DataStore {
}
};
- Ok(backend_type)
+ Ok(backend)
+ }
+
+ pub fn backend_type(&self) -> DatastoreBackendType {
+ self.inner.backend_config.ty.unwrap_or_default()
}
pub fn cache(&self) -> Option<&LocalDatastoreLruCache> {
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH proxmox-backup v2 2/3] api: status/datastore: expose backend type in datastore status/list
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox v2 1/1] pbs-api-types: add backend type to datastore's status items Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox-backup v2 1/3] datastore: introduce helper to get store's backend type Christian Ebner
@ 2026-03-11 12:05 ` Christian Ebner
2026-03-11 12:05 ` [PATCH proxmox-backup v2 3/3] ui: Set datastore usage related titles based on backend Christian Ebner
2026-03-11 15:01 ` applied-series: [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Fabian Grünbichler
4 siblings, 0 replies; 6+ messages in thread
From: Christian Ebner @ 2026-03-11 12:05 UTC (permalink / raw)
To: pbs-devel
Analogous to the mount status, include the backend type in the
datastore status list item and datastore status. This allows to
interpret the provided data based on the backend type and therefore
to switch elements on the ui such as labels.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/admin/datastore.rs | 4 ++++
src/api2/status/mod.rs | 18 +++++++++++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 88ad5d53b..c1fd85a1e 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -622,6 +622,8 @@ pub async fn status(
(None, None)
};
+ let backend_type = datastore.backend_type();
+
Ok(if store_stats {
let storage = crate::tools::fs::fs_info(datastore.base_path()).await?;
DataStoreStatus {
@@ -630,6 +632,7 @@ pub async fn status(
avail: storage.available,
gc_status,
counts,
+ backend_type,
}
} else {
DataStoreStatus {
@@ -638,6 +641,7 @@ pub async fn status(
avail: 0,
gc_status,
counts,
+ backend_type,
}
})
}
diff --git a/src/api2/status/mod.rs b/src/api2/status/mod.rs
index 605072d60..61f0bc912 100644
--- a/src/api2/status/mod.rs
+++ b/src/api2/status/mod.rs
@@ -10,8 +10,8 @@ use proxmox_schema::api;
use proxmox_sortable_macro::sortable;
use pbs_api_types::{
- Authid, DataStoreConfig, DataStoreMountStatus, DataStoreStatusListItem, Operation,
- PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP,
+ Authid, DataStoreConfig, DataStoreMountStatus, DataStoreStatusListItem, DatastoreBackendConfig,
+ Operation, PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP,
};
use pbs_config::CachedUserInfo;
@@ -55,6 +55,10 @@ pub async fn datastore_status(
let store_config = config.lookup::<DataStoreConfig>("datastore", store)?;
+ let backend_config: DatastoreBackendConfig =
+ store_config.backend.as_deref().unwrap_or("").parse()?;
+ let backend_type = backend_config.ty.unwrap_or_default();
+
let mount_status = match get_datastore_mount_status(&store_config) {
Some(true) => DataStoreMountStatus::Mounted,
Some(false) => {
@@ -62,6 +66,7 @@ pub async fn datastore_status(
store,
None,
DataStoreMountStatus::NotMounted,
+ backend_type,
));
continue;
}
@@ -71,7 +76,12 @@ pub async fn datastore_status(
if !allowed {
if let Ok(datastore) = DataStore::lookup_datastore(store, Some(Operation::Lookup)) {
if can_access_any_namespace(datastore, &auth_id, &user_info) {
- list.push(DataStoreStatusListItem::empty(store, None, mount_status));
+ list.push(DataStoreStatusListItem::empty(
+ store,
+ None,
+ mount_status,
+ backend_type,
+ ));
}
}
continue;
@@ -84,6 +94,7 @@ pub async fn datastore_status(
store,
Some(err.to_string()),
mount_status,
+ backend_type,
));
continue;
}
@@ -102,6 +113,7 @@ pub async fn datastore_status(
estimated_full_date: None,
error: None,
gc_status: Some(datastore.last_gc_status()),
+ backend_type,
};
let rrd_dir = format!("datastore/{store}");
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH proxmox-backup v2 3/3] ui: Set datastore usage related titles based on backend
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
` (2 preceding siblings ...)
2026-03-11 12:05 ` [PATCH proxmox-backup v2 2/3] api: status/datastore: expose backend type in datastore status/list Christian Ebner
@ 2026-03-11 12:05 ` Christian Ebner
2026-03-11 15:01 ` applied-series: [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Fabian Grünbichler
4 siblings, 0 replies; 6+ messages in thread
From: Christian Ebner @ 2026-03-11 12:05 UTC (permalink / raw)
To: pbs-devel
If the datastore is backed by S3, replace the titles in the datastore
summary storage usage and the storage rdd chart to include the
information that this is local cache storage usage.
Further, the estimated full values are also not shown for local
datastore caches.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
www/datastore/DataStoreListSummary.js | 10 ++++++++--
www/datastore/Summary.js | 13 +++++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
index ff88afaa0..dad51fbd6 100644
--- a/www/datastore/DataStoreListSummary.js
+++ b/www/datastore/DataStoreListSummary.js
@@ -24,6 +24,7 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
error: '',
removable: false,
maintenance: '',
+ isS3: false,
},
},
setTasks: function (taskdata, since) {
@@ -115,7 +116,12 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
return entry;
});
- me.lookup('historychart').setData(data);
+ let historyChart = me.lookup('historychart');
+ if (statusData['backend-type'] === 's3') {
+ vm.set('isS3', true);
+ historyChart.setTitle(gettext('Cache Usage History'));
+ }
+ historyChart.setData(data);
},
items: [
@@ -189,7 +195,7 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
data: {
text: '{full}',
},
- visible: '{!error}',
+ visible: '{!error && !isS3}',
},
},
{
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index cdb34aea3..d26f02348 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -94,6 +94,10 @@ Ext.define('PBS.DataStoreInfo', {
let counts = store.getById('counts').data.value;
let used = store.getById('used').data.value;
let total = store.getById('avail').data.value + used;
+ let backendType = store.getById('backend-type').data.value;
+ if (backendType === 's3') {
+ me.lookup('usage').title = gettext('Local Cache Usage');
+ }
let usage = Proxmox.Utils.render_size_usage(used, total, true);
vm.set('usagetext', usage);
@@ -152,6 +156,7 @@ Ext.define('PBS.DataStoreInfo', {
{
iconCls: 'fa fa-fw fa-hdd-o',
title: gettext('Usage'),
+ reference: 'usage',
bind: {
data: {
usage: '{usage}',
@@ -337,6 +342,7 @@ Ext.define('PBS.DataStoreSummary', {
{
xtype: 'proxmoxRRDChart',
title: gettext('Storage usage (bytes)'),
+ name: 'usage-rrd-chart',
fields: ['unpriv-total', 'used'],
fieldTitles: [gettext('Total'), gettext('Storage usage')],
},
@@ -437,6 +443,13 @@ Ext.define('PBS.DataStoreSummary', {
unmountBtn.setDisabled(false);
mountBtn.setDisabled(true);
lastRequestWasFailue = false;
+
+ let backendType = s.getById('backend-type').data.value;
+ if (backendType === 's3') {
+ me.down('[name=usage-rrd-chart]').setTitle(
+ gettext('Local Cache Usage (bytes)'),
+ );
+ }
}
});
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* applied-series: [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
` (3 preceding siblings ...)
2026-03-11 12:05 ` [PATCH proxmox-backup v2 3/3] ui: Set datastore usage related titles based on backend Christian Ebner
@ 2026-03-11 15:01 ` Fabian Grünbichler
4 siblings, 0 replies; 6+ messages in thread
From: Fabian Grünbichler @ 2026-03-11 15:01 UTC (permalink / raw)
To: Christian Ebner, pbs-devel
On March 11, 2026 1:04 pm, Christian Ebner wrote:
> This patches try to more clearly show to the user that the statistic shown
> in the datastore summary and overview only show the local cache usage.
>
> To achieve this, the first patches include the datastore backend type in both,
> responses for the `datastore-usage` as well as `status` api endpoints, in order
> to be able to adapt the shown information conditionally.
>
> Based on the backend, the title for the disk usage and rrd chart are adapted,
> the estimated full values are also not shown in case of local caches.
>
> Changes since version 1:
> - rebased onto current master
> - reordered and squashed patches to avoid inter-patch build failures
> - fix a formatting issue surfaced when invoking proxmox-biome
>
>
> proxmox:
>
> Christian Ebner (1):
> pbs-api-types: add backend type to datastore's status items
>
> pbs-api-types/src/datastore.rs | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
>
>
> proxmox-backup:
>
> Christian Ebner (3):
> datastore: introduce helper to get store's backend type
> api: status/datastore: expose backend type in datastore status/list
> ui: Set datastore usage related titles based on backend
>
> pbs-datastore/src/datastore.rs | 8 ++++++--
> src/api2/admin/datastore.rs | 4 ++++
> src/api2/status/mod.rs | 18 +++++++++++++++---
> www/datastore/DataStoreListSummary.js | 10 ++++++++--
> www/datastore/Summary.js | 13 +++++++++++++
> 5 files changed, 46 insertions(+), 7 deletions(-)
>
>
> Summary over all repositories:
> 6 files changed, 65 insertions(+), 8 deletions(-)
>
> --
> Generated by murpp 0.9.0
>
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-11 15:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-11 12:04 [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox v2 1/1] pbs-api-types: add backend type to datastore's status items Christian Ebner
2026-03-11 12:04 ` [PATCH proxmox-backup v2 1/3] datastore: introduce helper to get store's backend type Christian Ebner
2026-03-11 12:05 ` [PATCH proxmox-backup v2 2/3] api: status/datastore: expose backend type in datastore status/list Christian Ebner
2026-03-11 12:05 ` [PATCH proxmox-backup v2 3/3] ui: Set datastore usage related titles based on backend Christian Ebner
2026-03-11 15:01 ` applied-series: [PATCH proxmox{,-backup} v2 0/4] switch local storage usage titles based on datastore backend 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