From: "Max R. Carrara" <m.carrara@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager master v1 1/2] fix #6652: ceph: osd: enable autoactivation for OSD LVs on creation
Date: Tue, 12 Aug 2025 18:46:29 +0200 [thread overview]
Message-ID: <20250812164631.428424-2-m.carrara@proxmox.com> (raw)
In-Reply-To: <20250812164631.428424-1-m.carrara@proxmox.com>
... by directly calling lvcreate instead of using the LVM storage
plugin's helper sub.
Autoactivation is required for LVs used by Ceph OSDs, as Ceph
otherwise doesn't activate them by itself.
This is a regression from f296ffc4e4d in pve-storage [0].
[0]: https://git.proxmox.com/?p=pve-storage.git;a=commitdiff;h=f296ffc4e4d64b574c3001dc7cc6af3da1406441
Fixes: #6652
Signed-off-by: Max R. Carrara <m.carrara@proxmox.com>
---
PVE/API2/Ceph/OSD.pm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 23e187ce..4801f8dd 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -443,7 +443,25 @@ __PACKAGE__->register_method({
my $lv = $type . "-" . UUID::uuid();
PVE::Storage::LVMPlugin::lvm_create_volume_group($dev->{devpath}, $vg);
- PVE::Storage::LVMPlugin::lvcreate($vg, $lv, "${size}k");
+
+ my $cmd = [
+ '/sbin/lvcreate',
+ '-aly',
+ '-Wy',
+ '--yes',
+ '--size',
+ # size in kilobytes
+ $size . "k",
+ '--name',
+ $lv,
+ # explicitly enable autoactivation,
+ # otherwise ceph-volume cannot bring the LV online
+ '--setautoactivation',
+ 'y',
+ $vg,
+ ];
+
+ run_command($cmd, errmsg => "lvcreate '$vg/$lv' error");
if (PVE::Diskmanage::is_partition($dev->{devpath})) {
eval { PVE::Diskmanage::change_parttype($dev->{devpath}, '8E00'); };
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-08-12 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 16:46 [pve-devel] [PATCH pve-manager master v1 0/2] Fix #6652: LVM Autoactivation Missing for Ceph OSD LVs Max R. Carrara
2025-08-12 16:46 ` Max R. Carrara [this message]
2025-08-13 7:48 ` [pve-devel] [PATCH pve-manager master v1 1/2] fix #6652: ceph: osd: enable autoactivation for OSD LVs on creation Fabian Grünbichler
2025-08-13 8:28 ` Max R. Carrara
2025-08-12 16:46 ` [pve-devel] [PATCH pve-manager master v1 2/2] fix #6652: d/postinst: enable autoactivation for Ceph OSD LVs Max R. Carrara
2025-08-13 7:52 ` Fabian Grünbichler
2025-08-13 8:50 ` Max R. Carrara
2025-08-13 9:01 ` Friedrich Weber
2025-08-13 9:02 ` Fabian Grünbichler
2025-08-13 9:40 ` Max R. Carrara
2025-08-13 10:05 ` Fabian Grünbichler
2025-08-13 13:43 ` [pve-devel] superseded: [PATCH pve-manager master v1 0/2] Fix #6652: LVM Autoactivation Missing " Max R. Carrara
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=20250812164631.428424-2-m.carrara@proxmox.com \
--to=m.carrara@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.