* [PATCH cluster/manager 0/2] datacenter config: next-id: reject an empty range
@ 2026-11-23 15:20 Michael Köppl
2026-11-23 15:20 ` [PATCH cluster 1/2] " Michael Köppl
2026-11-23 15:21 ` [PATCH manager 2/2] ui: dc options: next-id: require upper to be above lower Michael Köppl
0 siblings, 2 replies; 3+ messages in thread
From: Michael Köppl @ 2026-11-23 15:20 UTC (permalink / raw)
To: pve-devel
The upper boundary of the next-id range is exclusive, but the
datacenter config only rejected a lower boundary above the upper one.
Setting both to the same value was accepted and left no guest ID in
the range, so requesting the next free guest ID always failed.
1/2 fixes the check when writing datacenter.cfg, which covers API and
CLI. 2/2 adds the check in the edit window in the web UI, so that users
are already stopped from entering such a value in the web UI.
cluster:
Michael Köppl (1):
datacenter config: next-id: reject an empty range
src/PVE/DataCenterConfig.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
manager:
Michael Köppl (1):
ui: dc options: next-id: require upper to be above lower
www/manager6/dc/OptionView.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
Summary over all repositories:
2 files changed, 14 insertions(+), 1 deletions(-)
--
Generated by murpp 0.12.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH cluster 1/2] datacenter config: next-id: reject an empty range
2026-11-23 15:20 [PATCH cluster/manager 0/2] datacenter config: next-id: reject an empty range Michael Köppl
@ 2026-11-23 15:20 ` Michael Köppl
2026-11-23 15:21 ` [PATCH manager 2/2] ui: dc options: next-id: require upper to be above lower Michael Köppl
1 sibling, 0 replies; 3+ messages in thread
From: Michael Köppl @ 2026-11-23 15:20 UTC (permalink / raw)
To: pve-devel
The upper boundary of the next-id range is exclusive, but writing the
config only rejected a lower boundary above the upper one. Setting both
to the same value was accepted and left no guest ID in the range.
Requesting the next free guest ID would then always fail. With enforce
set, every guest ID was rejected.
Adapt the condition to check that the value of the upper bound is
strictly greater than the value of the lower bound.
Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
src/PVE/DataCenterConfig.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 9829241..5ea0587 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -767,7 +767,7 @@ sub write_datacenter_config {
my $lower = int($next_id->{lower} // $next_id_format->{lower}->{default});
my $upper = int($next_id->{upper} // $next_id_format->{upper}->{default});
- die "lower ($lower) <= upper ($upper) boundary rule broken\n" if $lower > $upper;
+ die "lower ($lower) < upper ($upper) boundary rule broken\n" if $lower >= $upper;
$cfg->{'next-id'} = PVE::JSONSchema::print_property_string($next_id, $next_id_format);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH manager 2/2] ui: dc options: next-id: require upper to be above lower
2026-11-23 15:20 [PATCH cluster/manager 0/2] datacenter config: next-id: reject an empty range Michael Köppl
2026-11-23 15:20 ` [PATCH cluster 1/2] " Michael Köppl
@ 2026-11-23 15:21 ` Michael Köppl
1 sibling, 0 replies; 3+ messages in thread
From: Michael Köppl @ 2026-11-23 15:21 UTC (permalink / raw)
To: pve-devel
The backend rejects a next-id range whose exclusive upper boundary is
not above the lower one. Check this in the window already, so that users
see the error at the field instead of only after submitting.
Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
www/manager6/dc/OptionView.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 19e6d54e..e9e88758 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -372,6 +372,10 @@ Ext.define('PVE.dc.OptionView', {
minValue: 100,
maxValue: 1000 * 1000 * 1000 - 1,
submitValue: true,
+ listeners: {
+ change: (field) =>
+ field.up('inputpanel').down('field[name=upper]').validate(),
+ },
},
{
xtype: 'proxmoxintegerfield',
@@ -381,6 +385,15 @@ Ext.define('PVE.dc.OptionView', {
minValue: 100,
maxValue: 1000 * 1000 * 1000 - 1,
submitValue: true,
+ validator: function () {
+ let lower =
+ this.up('inputpanel').down('field[name=lower]').getValue() ?? 100;
+ let upper = this.getValue() ?? 1000 * 1000;
+ if (upper <= lower) {
+ return gettext('Must be greater than the lower boundary');
+ }
+ return true;
+ },
},
{
xtype: 'proxmoxcheckbox',
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-23 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 15:20 [PATCH cluster/manager 0/2] datacenter config: next-id: reject an empty range Michael Köppl
2026-11-23 15:20 ` [PATCH cluster 1/2] " Michael Köppl
2026-11-23 15:21 ` [PATCH manager 2/2] ui: dc options: next-id: require upper to be above lower Michael Köppl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox