fix ec2 provisioning for cloud init
This commit is contained in:
parent
7c5573c24d
commit
a92c838d23
2 changed files with 10 additions and 9 deletions
|
|
@ -15,14 +15,13 @@ NVME_DEV="/dev/nvme1n1"
|
|||
NVME_MOUNT="/data"
|
||||
|
||||
if [ ! -d "$NVME_MOUNT" ]; then
|
||||
# Find the NVMe instance store (not the root EBS)
|
||||
# i3.large has one 475GB NVMe at /dev/nvme1n1 or similar
|
||||
# Find the NVMe instance store — look for unmounted nvme devices
|
||||
if [ ! -b "$NVME_DEV" ]; then
|
||||
# Try finding it
|
||||
NVME_DEV=$(lsblk -dpno NAME,SIZE | grep -v "$(lsblk -dpno NAME /)" | head -1 | awk '{print $1}')
|
||||
NVME_DEV=$(lsblk -dpno NAME | grep nvme | head -1)
|
||||
if [ -z "$NVME_DEV" ]; then
|
||||
echo "ERROR: Could not find NVMe instance store device"
|
||||
echo "Run 'lsblk' and set NVME_DEV manually"
|
||||
echo "Available devices:"
|
||||
lsblk
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue