From 5640390f66c0b97731d12a28dc57032c23a10bc4 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Wed, 8 Jul 2020 10:25:09 +0800 Subject: [PATCH] vstart: specify the NVME PCI BUS ID when enable spdk. Currently we use vendor::device to specify the nvme name when using spdk. But it have some problems: a)it can't use different vendor or different device with the same device. b)if machine has same vendor&device, we don't choose specific device. So we diretly specify the PCI BUS ID for NVME device. Signed-off-by: Jianpeng Ma --- src/vstart.sh | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index b23f80cab96c..be7020068a21 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -163,7 +163,6 @@ rgw_compression="" lockdep=${LOCKDEP:-1} spdk_enabled=0 #disable SPDK by default zoned_enabled=0 -pci_id="" with_mgr_dashboard=true if [[ "$(get_cmake_variable WITH_MGR_DASHBOARD_FRONTEND)" != "ON" ]] || @@ -222,7 +221,7 @@ usage=$usage"\t--short: short object names only; necessary for ext4 dev\n" usage=$usage"\t--nolockdep disable lockdep\n" usage=$usage"\t--multimds allow multimds with maximum active count\n" usage=$usage"\t--without-dashboard: do not run using mgr dashboard\n" -usage=$usage"\t--bluestore-spdk :: enable SPDK and specify the PCI-ID of the NVME device\n" +usage=$usage"\t--bluestore-spdk: enable SPDK and with a comma-delimited list of PCI-IDs of NVME device (e.g, 0000:81:00.0)\n" usage=$usage"\t--msgr1: use msgr1 only\n" usage=$usage"\t--msgr2: use msgr2 only\n" usage=$usage"\t--msgr21: use msgr2 and msgr1\n" @@ -427,7 +426,7 @@ case $1 in ;; --bluestore-spdk ) [ -z "$2" ] && usage_exit - pci_id="$2" + IFS=',' read -r -a bluestore_spdk_dev <<< "$2" spdk_enabled=1 shift ;; @@ -515,14 +514,6 @@ wconf() { fi } -get_pci_selector() { - which_pci=$1 - lspci -mm -n -D -d $pci_id | cut -d ' ' -f 1 | sed -n $which_pci'p' -} - -get_pci_selector_num() { - lspci -mm -n -D -d $pci_id | cut -d' ' -f 1 | wc -l -} do_rgw_conf() { @@ -637,14 +628,6 @@ EOF fi if [ "$objectstore" == "bluestore" ]; then if [ "$spdk_enabled" -eq 1 ]; then - if [ "$(get_pci_selector_num)" -eq 0 ]; then - echo "Not find the specified NVME device, please check." >&2 - exit - fi - if [ $(get_pci_selector_num) -lt $CEPH_NUM_OSD ]; then - echo "OSD number ($CEPH_NUM_OSD) is greater than NVME SSD number ($(get_pci_selector_num)), please check." >&2 - exit - fi BLUESTORE_OPTS=" bluestore_block_db_path = \"\" bluestore_block_db_size = 0 bluestore_block_db_create = false @@ -842,7 +825,7 @@ start_osd() { EOF if [ "$spdk_enabled" -eq 1 ]; then wconf <