Add logic to check if local NVMe SSDs in node boot-up script

Current logic would assume all the NVMe disks are data disks and
applicable for reformat and mount. This will cause the issue when
booting disk is also NVMe disk, which will fail the node boot up. This
change will check if any additional NVMe disks are required/specified
and skip the reformat step otherwise.
This commit is contained in:
Xinning Shen 2020-06-18 06:49:55 +00:00
parent d8febccacf
commit 27658f8241

View File

@ -364,6 +364,13 @@ function ensure-local-ssds() {
# The following mounts or symlinks NVMe devices
get-local-disk-num "nvme" "block"
local nvmeblocknum="${localdisknum}"
get-local-disk-num "nvme" "fs"
local nvmefsnum="${localdisknum}"
# Check if NVMe SSD specified.
if [ "${nvmeblocknum}" -eq "0" ] && [ "${nvmefsnum}" -eq "0" ]; then
echo "No local NVMe SSD specified."
return
fi
local i=0
for ssd in /dev/nvme*; do
if [ -e "${ssd}" ]; then