From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 5729765BA8 for ; Fri, 24 Jul 2020 11:35:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 479669078 for ; Fri, 24 Jul 2020 11:34:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id B5A1C9018 for ; Fri, 24 Jul 2020 11:34:38 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 843A94329A for ; Fri, 24 Jul 2020 11:34:38 +0200 (CEST) To: Proxmox VE development discussion , Alwin Antreich References: <20200723132514.510051-1-a.antreich@proxmox.com> From: Thomas Lamprecht Message-ID: Date: Fri, 24 Jul 2020 11:34:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200723132514.510051-1-a.antreich@proxmox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.007 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [osd.pm] Subject: [pve-devel] applied: [PATCH manager] Allow setting device class on osd create X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 09:35:09 -0000 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 > --- > 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"; >