From 27658f82411d7113f39f770b9d39d5f505231ee2 Mon Sep 17 00:00:00 2001 From: Xinning Shen Date: Thu, 18 Jun 2020 06:49:55 +0000 Subject: [PATCH] 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. --- cluster/gce/gci/configure-helper.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 8889ceb75ad..11ec508b340 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -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