From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ha-manager 3/5] scheduling: make static scheduling optional
Date: Tue, 23 Sep 2025 14:21:20 +0200 [thread overview]
Message-ID: <175863008035.406570.859744530012770408@yuna.proxmox.com> (raw)
In-Reply-To: <DD02K1PS9WX9.2E78VXDGAVWDL@proxmox.com>
Quoting Daniel Kral (2025-09-23 11:23:42)
> On Mon Sep 22, 2025 at 2:04 PM CEST, Fabian Grünbichler wrote:
> > it's not available in the simulator
> >
> > Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> > ---
> > src/PVE/HA/Manager.pm | 21 +++++++++++++++------
> > 1 file changed, 15 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm
> > index ba59f64..cfd509a 100644
> > --- a/src/PVE/HA/Manager.pm
> > +++ b/src/PVE/HA/Manager.pm
> > @@ -14,7 +14,12 @@ use PVE::HA::Rules::NodeAffinity qw(get_node_affinity);
> > use PVE::HA::Rules::ResourceAffinity
> > qw(get_affinitive_resources get_resource_affinity apply_positive_resource_affinity apply_negative_resource_affinity);
> > use PVE::HA::Usage::Basic;
> > -use PVE::HA::Usage::Static;
> > +
> > +my $have_static_scheduling;
> > +eval {
> > + require PVE::HA::Usage::Static;
> > + $have_static_scheduling = 1;
> > +};
> >
> > ## Variable Name & Abbreviations Convention
> > #
> > @@ -244,11 +249,15 @@ sub recompute_online_node_usage {
> >
> > if (my $mode = $self->{crs}->{scheduler}) {
> > if ($mode eq 'static') {
> > - $online_node_usage = eval {
> > - my $scheduler = PVE::HA::Usage::Static->new($haenv);
> > - $scheduler->add_node($_) for $online_nodes->@*;
> > - return $scheduler;
> > - };
> > + if ($have_static_scheduling) {
> > + $online_node_usage = eval {
> > + my $scheduler = PVE::HA::Usage::Static->new($haenv);
> > + $scheduler->add_node($_) for $online_nodes->@*;
> > + return $scheduler;
> > + };
> > + } else {
> > + $@ = "static scheduling not available\n";
> > + }
>
> Since this cropped up almost 3 years after the static load scheduler was
> added and the GTK-based ha-simulator might be on its way out already
> [0], I think it would be nice to add a stub for
> PVE::HA::Usage::Static here the same way as you did for PVE::Cluster as
> otherwise it clutters the main code for the rather rarely used
> standalone ha-simulator.
>
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=6743
yes, that's definitely doable and should just require a `new()` implementation
that dies, so fairly simple..
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-23 12:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 12:04 [pve-devel] [RFC ha-manager 0/5] make simulator standalone again Fabian Grünbichler
2025-09-22 12:04 ` [pve-devel] [PATCH ha-manager 1/5] fix #6839: move PVE::Notify usage to "real" Env Fabian Grünbichler
2025-09-22 12:04 ` [pve-devel] [PATCH ha-manager 2/5] build: install PVE::HA::Rules::* in simulator as well Fabian Grünbichler
2025-09-22 12:04 ` [pve-devel] [PATCH ha-manager 3/5] scheduling: make static scheduling optional Fabian Grünbichler
2025-09-23 9:23 ` Daniel Kral
2025-09-23 12:21 ` Fabian Grünbichler [this message]
2025-09-22 12:04 ` [pve-devel] [PATCH ha-manager 4/5] build: install PVE::HA::Usage::Basic in simulator as well Fabian Grünbichler
2025-09-22 12:04 ` [pve-devel] [PATCH ha-manager 5/5] sim: add Cluster.pm stub with completion stub Fabian Grünbichler
2025-09-23 9:34 ` [pve-devel] [RFC ha-manager 0/5] make simulator standalone again Daniel Kral
2025-09-23 10:42 ` Thomas Lamprecht
2025-09-23 11:04 ` Daniel Kral
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=175863008035.406570.859744530012770408@yuna.proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=pve-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