From 36850a0bb14e8aa29f4afb461c98551aab4516cf Mon Sep 17 00:00:00 2001 From: dgouju Date: Mon, 15 Apr 2024 13:16:33 +0200 Subject: [PATCH 1/2] Update proxy-startup.sh so LocalSSD NVMe will not to conflict with PD NVMe Newer machine families only supports NVMe Persistent Disks. With the current approach, those would be included in the list, including the boot disk. Per [documentation](https://cloud.google.com/compute/docs/disks/add-local-ssd#formatindividual) this proposition would take only LocalSSD (both SCSI & NVMe), and won't likely conflict with Persistent Disk. --- tutorial/proxy-startup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/proxy-startup.sh b/tutorial/proxy-startup.sh index dd88606..47eb8a0 100644 --- a/tutorial/proxy-startup.sh +++ b/tutorial/proxy-startup.sh @@ -30,9 +30,9 @@ NFS_MOUNT_POINT="/data" function create-fs-cache() { # List attatched NVME local SSDs - echo "Detecting local NVMe drives..." - DRIVESLIST=$(/bin/ls /dev/nvme0n*) - NUMDRIVES=$(/bin/ls /dev/nvme0n* | wc -w) + echo "Detecting local SSDs drives..." + DRIVESLIST=$(/bin/find /dev/disk/by-id/google-local-* | grep -v -E '\-part[0-9]+$') + NUMDRIVES=$(/bin/find /dev/disk/by-id/google-local-* | grep -v -E '\-part[0-9]+$' | wc -w) echo "Detected $NUMDRIVES drives. Names: $DRIVESLIST." # If there are local NVMe drives attached, start the process of formatting and mounting From 4b8b7093a6c33ad57da3c6615cde9b856e277f12 Mon Sep 17 00:00:00 2001 From: dgouju Date: Mon, 15 Apr 2024 17:27:45 +0200 Subject: [PATCH 2/2] Update proxy-startup.sh --- tutorial/proxy-startup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorial/proxy-startup.sh b/tutorial/proxy-startup.sh index 47eb8a0..6b3ecb6 100644 --- a/tutorial/proxy-startup.sh +++ b/tutorial/proxy-startup.sh @@ -31,8 +31,8 @@ NFS_MOUNT_POINT="/data" function create-fs-cache() { # List attatched NVME local SSDs echo "Detecting local SSDs drives..." - DRIVESLIST=$(/bin/find /dev/disk/by-id/google-local-* | grep -v -E '\-part[0-9]+$') - NUMDRIVES=$(/bin/find /dev/disk/by-id/google-local-* | grep -v -E '\-part[0-9]+$' | wc -w) + DRIVESLIST=$(/bin/find /dev/disk/by-id/ -regex '/dev/disk/by-id/google-local-ssd-[0-9]+$\|/dev/disk/by-id/google-local-nvme-ssd-[0-9]+$') + NUMDRIVES=$(/bin/find /dev/disk/by-id/ -regex '/dev/disk/by-id/google-local-ssd-[0-9]+$\|/dev/disk/by-id/google-local-nvme-ssd-[0-9]+$' | wc -w) echo "Detected $NUMDRIVES drives. Names: $DRIVESLIST." # If there are local NVMe drives attached, start the process of formatting and mounting