From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version
Date: Mon, 23 Nov 2026 18:59:13 +0100 [thread overview]
Message-ID: <20261123175915.396455-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20261123175915.396455-1-c.ebner@proxmox.com>
Joining a node that runs a different Proxmox VE version than the
cluster can cause problems, for example when a node freshly installed
from a newer ISO joins a cluster that was not yet upgraded. So far,
neither the join information nor the join dialog gave any indication
of such a mismatch.
Return the highest manager version that any cluster node broadcast via
the cluster's key-value store, so that clients can compare it with the
version of the joining node and warn the user beforehand. The highest
version is used rather than the one of the node that the join
information was requested from, as a cluster that is in the middle of
an upgrade should be joined with the version it is upgraded to.
The field is optional, as the version is only available once pvestatd
has broadcast it.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/PVE/API2/ClusterConfig.pm | 9 +++++++++
src/PVE/Cluster.pm | 25 +++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/src/PVE/API2/ClusterConfig.pm b/src/PVE/API2/ClusterConfig.pm
index bfffb88..4c8ca57 100644
--- a/src/PVE/API2/ClusterConfig.pm
+++ b/src/PVE/API2/ClusterConfig.pm
@@ -569,6 +569,11 @@ __PACKAGE__->register_method({
},
},
preferred_node => get_standard_option('pve-node'),
+ pve_version => {
+ type => 'string',
+ description => "The highest Proxmox VE manager version of all cluster nodes.",
+ optional => 1,
+ },
totem => { type => 'object' },
config_digest => { type => 'string' },
},
@@ -606,6 +611,10 @@ __PACKAGE__->register_method({
config_digest => $corosync_config_digest,
};
+ # informational only, so do not fail if the version info cannot be queried
+ my $version = eval { PVE::Cluster::get_highest_pvecfg_version() };
+ $res->{pve_version} = $version if defined($version);
+
return $res;
},
});
diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm
index cceb686..230ba87 100644
--- a/src/PVE/Cluster.pm
+++ b/src/PVE/Cluster.pm
@@ -1002,6 +1002,31 @@ sub get_node_pvecfg_version {
return $version_info->{version};
}
+# Returns the highest manager version that any cluster node broadcast, or undef if none did. Offline
+# nodes are included with the last version they broadcast. Debian revision suffixes are ignored.
+sub get_highest_pvecfg_version {
+ my $nodes_version_info = get_node_kv('version-info');
+
+ my ($highest, @highest_parts);
+ for my $raw (values $nodes_version_info->%*) {
+ my $version = eval { decode_json($raw)->{version} } // next;
+ my @parts = ($version =~ m/^(\d+)\.(\d+)(?:[.-](\d+))?/) or next;
+ $parts[2] //= 0;
+
+ if (defined($highest)) {
+ my $cmp =
+ $parts[0] <=> $highest_parts[0]
+ || $parts[1] <=> $highest_parts[1]
+ || $parts[2] <=> $highest_parts[2];
+ next if $cmp <= 0;
+ }
+ $highest = $version;
+ @highest_parts = @parts;
+ }
+
+ return $highest;
+}
+
sub node_pvecfg_version_at_least {
my ($node, $major, $minor, $release) = @_;
--
2.47.3
next prev parent reply other threads:[~2026-11-23 17:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 17:59 [PATCH cluster/manager 0/3] cluster join: check node versions and warn when joining cluster with version difference Christian Ebner
2026-11-23 17:59 ` Christian Ebner [this message]
2026-11-23 17:59 ` [PATCH pve-manager 2/3] ui: cluster join info: include the cluster's manager version Christian Ebner
2026-11-23 17:59 ` [PATCH pve-manager 3/3] ui: cluster join: point out version mismatch with the cluster 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=20261123175915.396455-2-c.ebner@proxmox.com \
--to=c.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.