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 1B8E165808 for ; Thu, 23 Jul 2020 15:25:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0E667298A6 for ; Thu, 23 Jul 2020 15:25:20 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DD7C02989C for ; Thu, 23 Jul 2020 15:25:18 +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 A165241610 for ; Thu, 23 Jul 2020 15:25:18 +0200 (CEST) From: Alwin Antreich To: pve-devel@lists.proxmox.com Date: Thu, 23 Jul 2020 15:25:14 +0200 Message-Id: <20200723132514.510051-1-a.antreich@proxmox.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 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 Subject: [pve-devel] [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: Thu, 23 Jul 2020 13:25:20 -0000 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(+) 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." + }, }, }, 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"; -- 2.26.2