From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 1/5] pve6to7: use new flags API
Date: Tue, 6 Jul 2021 14:13:44 +0200 [thread overview]
Message-ID: <20210706121348.3505015-2-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20210706121348.3505015-1-f.gruenbichler@proxmox.com>
the old one is not available post-upgrade, let's use a single codepath
for this.
the new API only allows querying user-settable flags, but the only flags
we check besides 'noout' are not relevant for an upgrade of PVE 6.x to
7.x (PVE 6.x only supports Nautilus+ which requires these flags to be
set in order to work) so we can just drop those outdated checks instead
of extending/refactoring the API.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
PVE/CLI/pve6to7.pm | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/PVE/CLI/pve6to7.pm b/PVE/CLI/pve6to7.pm
index 60edac11..c693e0d4 100644
--- a/PVE/CLI/pve6to7.pm
+++ b/PVE/CLI/pve6to7.pm
@@ -8,6 +8,7 @@ use PVE::API2::Ceph;
use PVE::API2::LXC;
use PVE::API2::Qemu;
use PVE::API2::Certificates;
+use PVE::API2::Cluster::Ceph;
use PVE::AccessControl;
use PVE::Ceph::Tools;
@@ -389,9 +390,12 @@ sub check_ceph {
log_info("getting Ceph status/health information..");
my $ceph_status = eval { PVE::API2::Ceph->status({ node => $nodename }); };
- my $osd_flags = eval { PVE::API2::Ceph->get_flags({ node => $nodename }); };
+ my $noout = eval { PVE::API2::Cluster::Ceph->get_flag({ flag => "noout" }); };
+ if ($@) {
+ log_fail("failed to get 'noout' flag status - $@");
+ }
+
my $noout_wanted = 1;
- my $noout = $osd_flags && $osd_flags =~ m/noout/;
if (!$ceph_status || !$ceph_status->{health}) {
log_fail("unable to determine Ceph status!");
@@ -409,17 +413,6 @@ sub check_ceph {
}
}
- log_info("getting Ceph OSD flags..");
- eval {
- if (!$osd_flags) {
- log_fail("unable to get Ceph OSD flags!");
- } else {
- if (!($osd_flags =~ m/recovery_deletes/ && $osd_flags =~ m/purged_snapdirs/)) {
- log_fail("missing 'recovery_deletes' and/or 'purged_snapdirs' flag, scrub of all PGs required before upgrading to Nautilus!");
- }
- }
- };
-
# TODO: check OSD min-required version, if to low it breaks stuff!
log_info("getting Ceph daemon versions..");
--
2.30.2
next prev parent reply other threads:[~2021-07-06 12:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 12:13 [pve-devel] [PATCH manager 0/5] pve6to7 ceph fixes Fabian Grünbichler
2021-07-06 12:13 ` Fabian Grünbichler [this message]
2021-07-06 12:13 ` [pve-devel] [PATCH manager 2/5] pve6to7: remove PASS noise for ceph Fabian Grünbichler
2021-07-06 12:13 ` [pve-devel] [PATCH manager 3/5] pve6to7: check for >= Octopus Fabian Grünbichler
2021-07-06 12:13 ` [pve-devel] [PATCH manager 4/5] pve6to7: dont guard noout check on Ceph version Fabian Grünbichler
2021-07-06 12:13 ` [pve-devel] [PATCH stable-6 manager 5/5] pve6to7: enable noout before upgrade Fabian Grünbichler
2021-07-06 12:53 ` [pve-devel] applied-series: [PATCH manager 0/5] pve6to7 ceph fixes Thomas Lamprecht
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=20210706121348.3505015-2-f.gruenbichler@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