public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH cluster/manager 0/3] cluster join: check node versions and warn when joining cluster with version difference
@ 2026-11-23 17:59 Christian Ebner
  2026-11-23 17:59 ` [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version Christian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Ebner @ 2026-11-23 17:59 UTC (permalink / raw)
  To: pve-devel

Joining a new node to a cluster can come with some issues if either
the new node is older or newer than the clusters version.

This patches therefore add the currently highest version reported
by all cluster nodes to the join information on /cluster/config/join
and new nodes can check this info before joining the cluster.

If the versions do not match, warn the user accordingly. Old version
which do not know about this additional information can still join,
though without getting any warning on version mismatch.


pve-cluster:

Christian Ebner (1):
  api: join info: include the cluster's highest manager version

 src/PVE/API2/ClusterConfig.pm |  9 +++++++++
 src/PVE/Cluster.pm            | 25 +++++++++++++++++++++++++
 2 files changed, 34 insertions(+)


pve-manager:

Christian Ebner (2):
  ui: cluster join info: include the cluster's manager version
  ui: cluster join: point out version mismatch with the cluster

 www/manager6/dc/Cluster.js     | 23 +++++++----
 www/manager6/dc/ClusterEdit.js | 70 ++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 7 deletions(-)


Summary over all repositories:
  4 files changed, 120 insertions(+), 7 deletions(-)

-- 
Generated by murpp 0.11.0




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version
  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
  2026-11-23 17:59 ` [PATCH pve-manager 2/3] ui: cluster join info: include the cluster's " Christian Ebner
  2026-11-23 17:59 ` [PATCH pve-manager 3/3] ui: cluster join: point out version mismatch with the cluster Christian Ebner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2026-11-23 17:59 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH pve-manager 2/3] ui: cluster join info: include the cluster's manager version
  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 ` [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version Christian Ebner
@ 2026-11-23 17:59 ` Christian Ebner
  2026-11-23 17:59 ` [PATCH pve-manager 3/3] ui: cluster join: point out version mismatch with the cluster Christian Ebner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2026-11-23 17:59 UTC (permalink / raw)
  To: pve-devel

The encoded join information gets pasted into the join dialog of the
joining node, which has no other way to learn which Proxmox VE version
the cluster runs before actually joining. Include the version reported
by the join info API, so that the join dialog can point out a version
mismatch.

The version is only added if the API returned it, so older clusters
produce the same join information as before.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 www/manager6/dc/Cluster.js | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/www/manager6/dc/Cluster.js b/www/manager6/dc/Cluster.js
index 2ec5588c..d832f340 100644
--- a/www/manager6/dc/Cluster.js
+++ b/www/manager6/dc/Cluster.js
@@ -36,6 +36,7 @@ Ext.define('PVE.ClusterAdministration', {
         parent: null,
         data: {
             totem: {},
+            pveVersion: undefined,
             nodelist: [],
             preferred_node: {
                 name: '',
@@ -79,6 +80,7 @@ Ext.define('PVE.ClusterAdministration', {
                             }
                         }
                         vm.set('totem', {});
+                        vm.set('pveVersion', undefined);
                         vm.set('isInCluster', false);
                         vm.set('nodelist', []);
                         vm.set('preferred_node', {
@@ -89,6 +91,7 @@ Ext.define('PVE.ClusterAdministration', {
                         return;
                     }
                     vm.set('totem', data.totem);
+                    vm.set('pveVersion', data.pve_version);
                     vm.set('isInCluster', !!data.totem.cluster_name);
                     vm.set('nodelist', data.nodelist);
 
@@ -125,15 +128,21 @@ Ext.define('PVE.ClusterAdministration', {
 
                 onClusterInfo: function () {
                     let vm = this.getViewModel();
+                    let joinInfo = {
+                        ipAddress: vm.get('preferred_node.addr'),
+                        fingerprint: vm.get('preferred_node.fp'),
+                        peerLinks: vm.get('preferred_node.peerLinks'),
+                        ring_addr: vm.get('preferred_node.ring_addr'),
+                        totem: vm.get('totem'),
+                    };
+                    // older clusters do not expose their version
+                    let pveVersion = vm.get('pveVersion');
+                    if (pveVersion) {
+                        joinInfo.pveVersion = pveVersion;
+                    }
                     Ext.create('PVE.ClusterInfoWindow', {
                         autoShow: true,
-                        joinInfo: {
-                            ipAddress: vm.get('preferred_node.addr'),
-                            fingerprint: vm.get('preferred_node.fp'),
-                            peerLinks: vm.get('preferred_node.peerLinks'),
-                            ring_addr: vm.get('preferred_node.ring_addr'),
-                            totem: vm.get('totem'),
-                        },
+                        joinInfo,
                     });
                 },
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH pve-manager 3/3] ui: cluster join: point out version mismatch with the cluster
  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 ` [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version Christian Ebner
  2026-11-23 17:59 ` [PATCH pve-manager 2/3] ui: cluster join info: include the cluster's " Christian Ebner
@ 2026-11-23 17:59 ` Christian Ebner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2026-11-23 17:59 UTC (permalink / raw)
  To: pve-devel

Joining a node that runs a different Proxmox VE version than the
cluster can lead to problems that are hard to diagnose afterwards,
for example when the node was installed from a different ISO than the
one the cluster is based on.

If the pasted join information contains the highest manager version
of the cluster nodes, compare its major and minor version with the
one of the local node. A differing minor version shows a hint
recommending to upgrade the older side first. A differing major
version shows a warning instead, as mixed major versions are only
meant to exist temporarily during an upgrade.

Joining is still possible in both cases, as a minor version
difference is usually harmless and the user might have reasons to
proceed anyway.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 www/manager6/dc/ClusterEdit.js | 70 ++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/www/manager6/dc/ClusterEdit.js b/www/manager6/dc/ClusterEdit.js
index 10932585..9afb2368 100644
--- a/www/manager6/dc/ClusterEdit.js
+++ b/www/manager6/dc/ClusterEdit.js
@@ -157,6 +157,8 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                 clusterName: '',
             },
             hasAssistedInfo: false,
+            versionHint: '',
+            versionWarning: '',
         },
         formulas: {
             submittxt: function (get) {
@@ -206,9 +208,61 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                 linkEditor.setDefaultLinks();
             }
         },
+        updateVersionHint: function (clusterVersion) {
+            let vm = this.getViewModel();
+
+            let localVersion = PVE.VersionInfo?.version;
+            // the cluster version comes from pasted, possibly older or malformed join information
+            let parseVersion = (version) =>
+                typeof version === 'string'
+                    ? version
+                          .match(/^(\d+)\.(\d+)/)
+                          ?.slice(1)
+                          .map((v) => parseInt(v, 10))
+                    : undefined;
+
+            let local = parseVersion(localVersion);
+            let cluster = parseVersion(clusterVersion);
+
+            let hint = '';
+            let warning = '';
+            if (local && cluster && (local[0] !== cluster[0] || local[1] !== cluster[1])) {
+                let localIsOlder =
+                    local[0] < cluster[0] || (local[0] === cluster[0] && local[1] < cluster[1]);
+                let text = Ext.String.format(
+                    gettext(
+                        'This node runs Proxmox VE {0}, but the newest cluster node runs Proxmox VE {1}.',
+                    ),
+                    Ext.htmlEncode(localVersion),
+                    Ext.htmlEncode(clusterVersion),
+                );
+
+                if (local[0] !== cluster[0]) {
+                    let upgradeText = localIsOlder
+                        ? gettext('Upgrade this node before joining.')
+                        : gettext('Upgrade the cluster before joining.');
+                    let supportText = gettext(
+                        'Mixed major versions are only supported temporarily during an upgrade.',
+                    );
+                    warning =
+                        '<i class="fa fa-fw fa-exclamation-triangle warning"></i> ' +
+                        `${text} ${supportText} ${upgradeText}`;
+                } else {
+                    let upgradeText = localIsOlder
+                        ? gettext('Consider upgrading this node before joining.')
+                        : gettext('Consider upgrading the cluster before joining.');
+                    hint = `${text} ${upgradeText}`;
+                }
+            }
+
+            vm.set('versionHint', hint);
+            vm.set('versionWarning', warning);
+        },
         recomputeSerializedInfo: function (field, value) {
             let vm = this.getViewModel();
 
+            this.updateVersionHint(undefined);
+
             let assistedEntryBox = this.lookup('assistedEntry');
 
             if (!assistedEntryBox.getValue()) {
@@ -270,6 +324,7 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                 };
                 field.valid = true;
                 vm.set('hasAssistedInfo', true);
+                this.updateVersionHint(joinInfo.pveVersion);
             }
             vm.set('info', info);
         },
@@ -340,6 +395,21 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
             },
             value: '',
         },
+        {
+            xtype: 'displayfield',
+            userCls: 'pmx-hint',
+            bind: {
+                value: '{versionHint}',
+                hidden: '{!versionHint}',
+            },
+        },
+        {
+            xtype: 'displayfield',
+            bind: {
+                value: '{versionWarning}',
+                hidden: '{!versionWarning}',
+            },
+        },
         {
             xtype: 'panel',
             width: 776,
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH pve-cluster 1/3] api: join info: include the cluster's highest manager version Christian Ebner
2026-11-23 17:59 ` [PATCH pve-manager 2/3] ui: cluster join info: include the cluster's " Christian Ebner
2026-11-23 17:59 ` [PATCH pve-manager 3/3] ui: cluster join: point out version mismatch with the cluster Christian Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal