Skip to content

[disk] Convert /dev/root device to real device path#9577

Merged
albertvaka merged 3 commits into
mainfrom
albertvaka/psutils-convert-dev-root-path
Oct 19, 2021
Merged

[disk] Convert /dev/root device to real device path#9577
albertvaka merged 3 commits into
mainfrom
albertvaka/psutils-convert-dev-root-path

Conversation

@albertvaka

@albertvaka albertvaka commented Oct 19, 2021

Copy link
Copy Markdown
Contributor

What does this PR do?

Backport of upstream PR: giampaolo/psutil#2000

Motivation

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda1).

When using the tag_by_label option, the disk check tries to match the
output of psutil with the output of lsblk or blkid to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.

Describe how to test your changes

Run import psutil; psutil.disk_partitions() on both the py2 and py3 interpreters of an Agent running on an Ubuntu 20.04 AWS instance. It should list /dev/xvda1 with this patch and /dev/root without.

Backport of upstream PR: giampaolo/psutil#2000

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda).

When using the `tag_by_label` option, the disk check tries to match the
output of psutil with the output of `lsblk` or `blkid` to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.

@mx-psi mx-psi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after you add a release note/add the no changelog label

@albertvaka
albertvaka merged commit a55c04d into main Oct 19, 2021
@albertvaka
albertvaka deleted the albertvaka/psutils-convert-dev-root-path branch October 19, 2021 15:45
zandrewitte pushed a commit to StackVista/stackstate-agent that referenced this pull request Nov 17, 2022
Backport of upstream PR: giampaolo/psutil#2000

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda).

When using the tag_by_label option, the disk check tries to match the
output of psutil with the output of lsblk or blkid to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants