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 E0D2B8DC5 for ; Wed, 23 Aug 2023 11:38:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B4A1D14DED for ; Wed, 23 Aug 2023 11:38:48 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 for ; Wed, 23 Aug 2023 11:38:48 +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 DF123435D7 for ; Wed, 23 Aug 2023 11:38:47 +0200 (CEST) Message-ID: <6cc3a0c1-9cbd-484a-9737-c07552825beb@proxmox.com> Date: Wed, 23 Aug 2023 11:38:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Wolfgang Bumiller Cc: pve-devel@lists.proxmox.com References: <20230821114554.1775149-1-a.lauterer@proxmox.com> From: Aaron Lauterer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.084 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH manager v2] fix #4631: ceph: osd: create: add osds-per-device 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: Wed, 23 Aug 2023 09:38:48 -0000 >> >> die "unable to get fsid\n" if !$monstat->{monmap} || !$monstat->{monmap}->{fsid}; > > Does it make sense to still keep this line above if we don't use fsid > anymore? (And if not, $monstat then also becomes unused.) > thanks for catching this, will remove it >> - my $fsid = $monstat->{monmap}->{fsid}; >> - $fsid = $1 if $fsid =~ m/^([0-9a-f\-]+)$/; >> >> my $ceph_bootstrap_osd_keyring = PVE::Ceph::Tools::get_config('ceph_bootstrap_osd_keyring'); >> >> @@ -470,7 +484,10 @@ __PACKAGE__->register_method ({ >> $test_disk_requirements->($disklist); >> >> my $dev_class = $param->{'crush-device-class'}; >> - my $cmd = ['ceph-volume', 'lvm', 'create', '--cluster-fsid', $fsid ]; >> + # create allows for detailed configuration of DB and WAL devices >> + # batch for easy creation of multiple OSDs (per device) >> + my $create_mode = $param->{'osds-per-device'} ? 'batch' : 'create'; >> + my $cmd = ['ceph-volume', 'lvm', $create_mode ]; >> push @$cmd, '--crush-device-class', $dev_class if $dev_class; >> >> my $devname = $devs->{dev}->{name}; >> @@ -504,8 +521,11 @@ __PACKAGE__->register_method ({ >> push @$cmd, "--block.$type", $part_or_lv; >> } >> >> - push @$cmd, '--data', $devpath; >> + push @$cmd, '--data' if $create_mode eq 'create'; >> + push @$cmd, $devpath; > > ^ not the biggest fan of mixing positional arguments and options - does > `ceph-volume` support `--` to separate positional arguments explicitly? > If so, we should use it. > ceph-volume lvm create --osds-per-device 3 -- /dev/path > as opposed to > ceph-volume lvm create /dev/path --osds-per-device 3 > that's just bad style and potentially dangerous good point. I'll rework the building of the call > >> push @$cmd, '--dmcrypt' if $param->{encrypted}; >> + push @$cmd, '--osds-per-device', $param->{'osds-per-device'}, '--yes', '--no-auto' >> + if $create_mode eq 'batch'; >> >> PVE::Diskmanage::wipe_blockdev($devpath); >> >> -- >> 2.39.2