[pve-devel] [RFC manager 6/9] api: ceph: create osd: set correct partition type

Fabian Ebner f.ebner at proxmox.com
Tue Sep 28 13:39:58 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

RFC, because the previous one is and this only makes sense with it.

Dependency bump for pve-storage is needed for the new helpers.

 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 c511f315..18329eeb 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -396,6 +396,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";
@@ -494,6 +499,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.
-- 
2.30.2






More information about the pve-devel mailing list