Skip to content

Commit

Permalink
scylla_util.py: resolve /dev/root to get actual device on aws
Browse files Browse the repository at this point in the history
When psutil.disk_paritions() reports / is /dev/root, aws_instance mistakenly
reports root partition is part of ephemeral disks, and RAID construction will
fail.
This prevents the error and reports correct free disks.

Fixes #8055

Closes #8040

(cherry picked from commit 32d4ec6)
  • Loading branch information
syuu1228 authored and avikivity committed Feb 21, 2021
1 parent b47bdb0 commit d1ab376
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/common/scripts/scylla_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ def _non_root_nvmes(self):
raise Exception("found more than one disk mounted at root'".format(root_dev_candidates))

root_dev = root_dev_candidates[0].device
if root_dev == '/dev/root':
root_dev = run('findmnt -n -o SOURCE /', shell=True, check=True, capture_output=True, encoding='utf-8').stdout.strip()
nvmes_present = list(filter(nvme_re.match, os.listdir("/dev")))
return {"root": [ root_dev ], "ephemeral": [ x for x in nvmes_present if not root_dev.startswith(os.path.join("/dev/", x)) ] }

Expand Down

0 comments on commit d1ab376

Please sign in to comment.