]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
Allow setting device class on osd create
authorAlwin Antreich <a.antreich@proxmox.com>
Thu, 23 Jul 2020 13:25:14 +0000 (15:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 24 Jul 2020 08:26:11 +0000 (10:26 +0200)
In some situations Ceph's auto-detection doesn't recognize the device
class correctly. The option allows to set it directly on osd create,
instead of altering it afterwards. This way the cluster doesn't need to
shift data back and forth unnecessarily.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
PVE/API2/Ceph/OSD.pm

index ceaed129bf558e7c88245a1a18faa0c1cae93263..f1f39bf9acadef2ad0a98b7d58fc48824291c0a9 100644 (file)
@@ -260,6 +260,11 @@ __PACKAGE__->register_method ({
                default => 0,
                description => "Enables encryption of the OSD."
            },
+           'crush-device-class' => {
+               optional => 1,
+               type => 'string',
+               description => "Set the device class of the OSD in crush."
+           },
        },
     },
     returns => { type => 'string' },
@@ -429,7 +434,9 @@ __PACKAGE__->register_method ({
                # update disklist
                $disklist = PVE::Diskmanage::get_disks($devlist, 1);
 
+               my $dev_class = $param->{'crush-device-class'};
                my $cmd = ['ceph-volume', 'lvm', 'create', '--cluster-fsid', $fsid ];
+               push @$cmd, '--crush-device-class', $dev_class if $dev_class;
 
                my $devpath = $disklist->{$devname}->{devpath};
                print "create OSD on $devpath (bluestore)\n";