From: Christian Ebner <c.ebner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [RFC datacenter-manager 1/5] pdm-api-types/ui/resources: rename and bump PBS datastore high-usage
Date: Mon, 27 Oct 2025 15:25:47 +0100 [thread overview]
Message-ID: <20251027142551.458160-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20251027142551.458160-1-c.ebner@proxmox.com>
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@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
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-10-27 14:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 14:25 [pdm-devel] [RFC datacenter-manager 0/5] show uptrending datastores in dashboard panel Christian Ebner
2025-10-27 14:25 ` Christian Ebner [this message]
2025-10-27 14:25 ` [pdm-devel] [RFC datacenter-manager 2/5] pdm-api-types: extend datastore resources by optional estimated full Christian Ebner
2025-10-27 14:25 ` [pdm-devel] [RFC datacenter-manager 3/5] server: resources: account for datastores with upwards usage trend Christian Ebner
2025-10-27 14:25 ` [pdm-devel] [RFC datacenter-manager 4/5] ui: dashboard: show datastores with upwards trend in stats panel Christian Ebner
2025-10-27 14:25 ` [pdm-devel] [RFC datacenter-manager 5/5] pdm-api-types: calculate upwards trending datastore usage property Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251027142551.458160-2-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox