* [pve-devel] [PATCH] pve7to8: ceph version check: ignore commit hash
@ 2023-06-02 16:04 Aaron Lauterer
2023-06-05 17:21 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2023-06-02 16:04 UTC (permalink / raw)
To: pve-devel
The commit hash of the Ceph version might be different between major
releases. For example:
ceph version 17.2.6 (810db68029296377607028a6c6da1ec06f5a2b27) quincy (stable)
ceph version 17.2.6 (995dec2cdae920da21db2d455e55efbc339bde24) quincy (stable)
This can lead to unnecessary warnings of multiple detected versions.
Therefore, extract the version, e.g. 'ceph version 17.2.6', and the
commit hash. Use the simplified version for the version checks and show
an info line when the commit is different instead of a warning.
If the commit hashes are the only difference, we are likely in the
middle of the upgrade.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
PVE/CLI/pve7to8.pm | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index 06f4e2bb..cc2bd643 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -500,9 +500,24 @@ sub check_ceph {
{ 'key' => 'osd', 'name' => 'OSD' },
];
+ my $ceph_versions_simple = {};
+ my $ceph_versions_commits = {};
+ for my $type (keys %$ceph_versions) {
+ for my $full_version (keys $ceph_versions->{$type}->%*) {
+ if ($full_version =~ m/^(.*) \((.*)\).*\(.*\)$/) {
+ # String is in the form of
+ # ceph version 17.2.6 (810db68029296377607028a6c6da1ec06f5a2b27) quincy (stable)
+ # only check the first part, e.g. 'ceph version 17.2.6', the commit hash can
+ # be different
+ $ceph_versions_simple->{$type}->{$1} = 1;
+ $ceph_versions_commits->{$type}->{$2} = 1;
+ }
+ }
+ }
+
foreach my $service (@$services) {
my ($name, $key) = $service->@{'name', 'key'};
- if (my $service_versions = $ceph_versions->{$key}) {
+ if (my $service_versions = $ceph_versions_simple->{$key}) {
if (keys %$service_versions == 0) {
log_skip("no running instances detected for daemon type $name.");
} elsif (keys %$service_versions == 1) {
@@ -513,6 +528,12 @@ sub check_ceph {
} else {
log_skip("unable to determine versions of running Ceph $name instances.");
}
+ if (my $service_commits = $ceph_versions_commits->{$key}) {
+ if (keys %$service_commits > 1) {
+ log_info("multiple version commits detected for daemon type $name. ".
+ "Are you in the middle of the upgrade?");
+ }
+ }
}
my $overall_versions = $ceph_versions->{overall};
@@ -521,7 +542,7 @@ sub check_ceph {
} elsif (keys %$overall_versions == 1) {
log_pass("single running overall version detected for all Ceph daemon types.");
$noout_wanted = 0; # off post-upgrade, on pre-upgrade
- } else {
+ } elsif (keys $ceph_versions_simple->{overall}->%* != 1) {
log_warn("overall version mismatch detected, check 'ceph versions' output for details!");
}
}
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH] pve7to8: ceph version check: ignore commit hash
2023-06-02 16:04 [pve-devel] [PATCH] pve7to8: ceph version check: ignore commit hash Aaron Lauterer
@ 2023-06-05 17:21 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-05 17:21 UTC (permalink / raw)
To: Proxmox VE development discussion, Aaron Lauterer
Am 02/06/2023 um 18:04 schrieb Aaron Lauterer:
> The commit hash of the Ceph version might be different between major
> releases. For example:
> ceph version 17.2.6 (810db68029296377607028a6c6da1ec06f5a2b27) quincy (stable)
> ceph version 17.2.6 (995dec2cdae920da21db2d455e55efbc339bde24) quincy (stable)
>
> This can lead to unnecessary warnings of multiple detected versions.
> Therefore, extract the version, e.g. 'ceph version 17.2.6', and the
> commit hash. Use the simplified version for the version checks and show
> an info line when the commit is different instead of a warning.
> If the commit hashes are the only difference, we are likely in the
> middle of the upgrade.
>
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
> PVE/CLI/pve7to8.pm | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-05 17:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 16:04 [pve-devel] [PATCH] pve7to8: ceph version check: ignore commit hash Aaron Lauterer
2023-06-05 17:21 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox