mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
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:
parent
d8febccacf
commit
27658f8241
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user