From cffeb11592d62d0c29f4809ffc786348cd2afceb Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Wed, 6 Oct 2021 11:18:50 +0200 Subject: [PATCH] api: ceph: create osd: set correct partition type Signed-off-by: Fabian Ebner --- PVE/API2/Ceph/OSD.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm index ae691ac2..93433b3a 100644 --- a/PVE/API2/Ceph/OSD.pm +++ b/PVE/API2/Ceph/OSD.pm @@ -395,6 +395,11 @@ __PACKAGE__->register_method ({ PVE::Storage::LVMPlugin::lvm_create_volume_group($dev->{devpath}, $vg); PVE::Storage::LVMPlugin::lvcreate($vg, $lv, "${size}k"); + if (PVE::Diskmanage::is_partition($dev->{devpath})) { + eval { PVE::Diskmanage::change_parttype($dev->{devpath}, '8E00'); }; + warn $@ if $@; + } + push @udev_trigger_devs, $dev->{devpath}; return "$vg/$lv"; @@ -493,6 +498,11 @@ __PACKAGE__->register_method ({ PVE::Diskmanage::wipe_blockdev($devpath); + if (PVE::Diskmanage::is_partition($devpath)) { + eval { PVE::Diskmanage::change_parttype($devpath, '8E00'); }; + warn $@ if $@; + } + run_command($cmd); # FIXME: Remove once we depend on systemd >= v249.