[pdm-devel] [RFC datacenter-manager 1/5] pdm-api-types/ui/resources: rename and bump PBS datastore high-usage
Christian Ebner
c.ebner at proxmox.com
Mon Oct 27 15:25:47 CET 2025
Renames the currently used high-usage to critical-usage and bumps the
limit to 95% usage threshold. This further escalates the value,
already bumped to 80% in commit b346b9a0 ("api types: increase
high-usage threshold from 75% to 80%"), with the intend to extend the
dashboard panel by an uptrending metric to show datastores which are
estimated to be full in the near future.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
lib/pdm-api-types/src/resource.rs | 12 ++++++------
server/src/api/resources.rs | 7 ++++---
ui/src/dashboard/pbs_datastores_panel.rs | 10 +++++-----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs
index e3c84cf..def8500 100644
--- a/lib/pdm-api-types/src/resource.rs
+++ b/lib/pdm-api-types/src/resource.rs
@@ -7,8 +7,8 @@ use proxmox_schema::{api, ApiStringFormat, ApiType, EnumEntry, OneOfSchema, Sche
use super::remotes::{RemoteType, REMOTE_ID_SCHEMA};
-/// High PBS datastore usage threshold
-pub const PBS_DATASTORE_HIGH_USAGE_THRESHOLD: f64 = 0.80;
+/// Critical PBS datastore usage threshold
+pub const PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD: f64 = 0.95;
#[api(
"id-property": "id",
@@ -117,8 +117,8 @@ impl Resource {
if r.backing_device.is_some() {
properties.push("removable".to_string());
}
- if r.usage > PBS_DATASTORE_HIGH_USAGE_THRESHOLD {
- properties.push("high-usage".to_string());
+ if r.usage > PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD {
+ properties.push("critical-usage".to_string());
}
}
properties.join(",")
@@ -582,9 +582,9 @@ pub struct PbsDatastoreStatusCount {
pub online: u64,
/// Amount of datastores which are in a maintenance mode
pub in_maintenance: Option<u64>,
- /// Amount of datastores which have high datastore usage
+ /// Amount of datastores which have critical datastore usage
#[serde(skip_serializing_if = "Option::is_none")]
- pub high_usage: Option<u64>,
+ pub critical_usage: Option<u64>,
/// Amount of datastores in unknown state
#[serde(skip_serializing_if = "Option::is_none")]
pub unknown: Option<u64>,
diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
index 57563b3..586c732 100644
--- a/server/src/api/resources.rs
+++ b/server/src/api/resources.rs
@@ -13,7 +13,8 @@ use pdm_api_types::remotes::{Remote, RemoteType};
use pdm_api_types::resource::{
FailedRemote, PbsDatastoreResource, PbsNodeResource, PveLxcResource, PveNodeResource,
PveQemuResource, PveSdnResource, PveStorageResource, RemoteResources, Resource, ResourceType,
- ResourcesStatus, SdnStatus, SdnZoneResource, TopEntities, PBS_DATASTORE_HIGH_USAGE_THRESHOLD,
+ ResourcesStatus, SdnStatus, SdnZoneResource, TopEntities,
+ PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD,
};
use pdm_api_types::subscription::{
NodeSubscriptionInfo, RemoteSubscriptionState, RemoteSubscriptions, SubscriptionLevel,
@@ -464,8 +465,8 @@ pub async fn get_status(
} else {
*counts.pbs_datastores.in_maintenance.get_or_insert_default() += 1;
}
- if r.usage > PBS_DATASTORE_HIGH_USAGE_THRESHOLD {
- *counts.pbs_datastores.high_usage.get_or_insert_default() += 1;
+ if r.usage > PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD {
+ *counts.pbs_datastores.critical_usage.get_or_insert_default() += 1;
}
if r.backing_device.is_some() {
*counts.pbs_datastores.removable.get_or_insert_default() += 1;
diff --git a/ui/src/dashboard/pbs_datastores_panel.rs b/ui/src/dashboard/pbs_datastores_panel.rs
index e028476..4cfc0c8 100644
--- a/ui/src/dashboard/pbs_datastores_panel.rs
+++ b/ui/src/dashboard/pbs_datastores_panel.rs
@@ -42,7 +42,7 @@ pub enum StatusRow {
InMaintenance(u64),
Removable(u64),
S3Backend(u64),
- HighUsage(u64),
+ CriticalUsage(u64),
Unknown(u64),
All(u64),
}
@@ -77,7 +77,7 @@ impl yew::Component for PbsDatastoresPanelComponent {
StatusRow::InMaintenance(status.in_maintenance.unwrap_or_default()),
StatusRow::Removable(status.removable.unwrap_or_default()),
StatusRow::S3Backend(status.s3_backend.unwrap_or_default()),
- StatusRow::HighUsage(status.high_usage.unwrap_or_default()),
+ StatusRow::CriticalUsage(status.critical_usage.unwrap_or_default()),
StatusRow::Unknown(status.unknown.unwrap_or_default()),
StatusRow::All(status.online + status.in_maintenance.unwrap_or_default()),
];
@@ -109,11 +109,11 @@ fn create_list_tile(
"Online",
Some(("online", "status")),
),
- StatusRow::HighUsage(count) => (
+ StatusRow::CriticalUsage(count) => (
Fa::from(Status::Warning),
count,
- "High usage",
- Some(("high-usage", "property")),
+ "Critical Usage",
+ Some(("critical-usage", "property")),
),
StatusRow::InMaintenance(count) => (
Fa::new("wrench"),
--
2.47.3
More information about the pdm-devel
mailing list