Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vdo] Capture more information about vdo volumes #3717

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcastill
Copy link
Member

@jcastill jcastill commented Jul 19, 2024

Capture more information about vdo volumes

Related: VDO-5797


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

@jcastill
Copy link
Member Author

In this case I moved the 'lvs' command to the VDO plugin because that will guarantee that the command is run when the conditions for the other VDO command captures are met. If I add it to the LVM plugin, I'll have to add extra logic to make sure VDO is in place, and I thought it was a more natural place to have it in the VDO than the LVM one. But I can change it if the logic is not sound.

Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3717
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

1 similar comment
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3717
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

sos/report/plugins/vdo.py Outdated Show resolved Hide resolved
@jcastill jcastill force-pushed the jcastillo-capture-more-vdo-data branch 2 times, most recently from c99b9b9 to b4b5448 Compare August 8, 2024 11:38
@jcastill
Copy link
Member Author

jcastill commented Aug 8, 2024

Added the missing comma and another extra command. With this change now we should capture both non-LVM and LVM VDO devices

@jcastill jcastill force-pushed the jcastillo-capture-more-vdo-data branch from b4b5448 to 23c7536 Compare August 8, 2024 11:54
Comment on lines 35 to 36
vdo_cols = 'vdo_deduplication,vdo_index_state'
lvs_opts = '-a -o +'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the two extra variables, if you use either of them just once?

Copy link
Member Author

Choose a reason for hiding this comment

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

Two reasons:

  • The LVS command was too long before I removed the headers option, so using these two variables I was within the limit, and
  • The request has a very big list of columns and I'll need to split the output in at least two variables to make sure is readable.

I'm still playing with the columns I need to display, so the name vdo_cols will probably change.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, could be.. Bit redundant for the code, more readable for users.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is still a draft PR so I'll see how can I improve it

vdo_cols = 'vdo_deduplication,vdo_index_state'
lvs_opts = '-a -o +'
lvm_vdos = self.collect_cmd_output(f"lvs {lvs_opts}{vdo_cols}")
for vdo in lvm_vdos['output'].splitlines():
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the lvs command would raise an error - is it safe to parse its output like this? (we often guard 'output' under if lvm_vdos['status'] == 0: - but here I see this plugin lacks this check (cf. lines 28-29).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do this, sorry I missed the check.

@jcastill jcastill force-pushed the jcastillo-capture-more-vdo-data branch from 23c7536 to abe4b00 Compare August 13, 2024 10:55
Capture more information about vdo volumes

Related: VDO-5797

Signed-off-by: Jose Castillo <[email protected]>
@jcastill jcastill force-pushed the jcastillo-capture-more-vdo-data branch from abe4b00 to 7a682a1 Compare August 13, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants