Am 7/23/20 um 3:25 PM schrieb Alwin Antreich:
> 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.antre...@proxmox.com>
> ---
>  PVE/API2/Ceph/OSD.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

applied, thanks - comments still inline

> diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
> index ceaed129..f1f39bf9 100644
> --- a/PVE/API2/Ceph/OSD.pm
> +++ b/PVE/API2/Ceph/OSD.pm
> @@ -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."
> +         },

why not having an enum with 'nvme', 'ssd', and 'hdd' here?

>       },
>      },
>      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 ];

nit: rather would have the declaration here, or even more explicit:

if (my $dev_class = $param->{'crush-device-class'}) {
    push @$cmd, '--crush-device-class', $dev_class;
}

but as said, a very nit, just that the split addition of lines got my attention
somehow ^^

> +             push @$cmd, '--crush-device-class', $dev_class if $dev_class;
>  
>               my $devpath = $disklist->{$devname}->{devpath};
>               print "create OSD on $devpath (bluestore)\n";
> 



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to