sosreport Should Collect the Output of systemd-detect-virt(1)

Bug #1659498 reported by Dominique Poulain
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sosreport (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

To the best of my knowledge, at present sosreport does not include data to determine whether the machine it was run on is a container. An easy way to fill that gap, IMHO, would be to collect the output of systemd-detect-virt(1).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sosreport (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I appreciate the quality of this bug report and I'm sure it'll be helpful to others experiencing the same issue.

I happend to find plugins for docker and lxd which should add some info:
sos/plugins/docker.py
sos/plugins/lxd.py

Interestingly enough in the latest upload there is a accidential file left
(3.3+git50-g3c0349b-1) which is sos/policies/.util.py.swp

...
CONTAINER_TESTS = (['systemd-detect-virt', '--quiet', '--container']
...

That came in by Louis Bouchard, subscribing him to get hit summary if that is being worked on or dropped intentionally. He's also more into sosreport than I am, so maybe he can correct some of my assumptions.

Never the less - depending on Luis statement - if true this still sounds like an upstream bug to me. Please can you verify this by building directly from the latest upstream source? If this can be confirmed as an upstream bug, the best route to getting it fixed in Ubuntu in this case would be to file an upstream bug if you're able to do that. Otherwise, I'm not sure what we can do directly in Ubuntu to fix the problem.

If you do end up filing an upstream bug, please link to it from here. Thanks!

Revision history for this message
Dominique Poulain (dominique-poulain) wrote :

I've used the latest upstream code (<https://github.com/sosreport/sos>) to generate sosreports with the lxd and docker plugins enabled, both inside docker/lxd containers, and on a VM - the behaviour is the same. The data those plugins collect is about lxd/docker software running on the node, not about the nature of the node itself:

# ls sos_commands/lxd
lxc_image_list lxc_list lxc_profile_list var-lxd-dirs.txt

# cat sos_commands/lxd/var-lxd-dirs.txt
   519209 4 drwxr-xr-x 9 lxd nogroup 4096 Mar 22 07:36 /var/lib/lxd
   529342 4 drwx------ 2 root root 4096 Mar 22 07:36 /var/lib/lxd/snapshots
   529341 4 drwx--x--x 2 root root 4096 Mar 22 07:36 /var/lib/lxd/shmounts
   529339 4 drwx------ 2 root root 4096 Mar 22 07:36 /var/lib/lxd/images
   529337 4 drwx--x--x 2 root root 4096 Mar 22 07:36 /var/lib/lxd/devices
   529340 4 drwx------ 2 root root 4096 Mar 22 07:36 /var/lib/lxd/security
   529338 4 drwxr-xr-x 2 root root 4096 Mar 22 07:36 /var/lib/lxd/devlxd
   529336 4 drwx--x--x 2 root root 4096 Mar 22 07:36 /var/lib/lxd/containers

# ls sos_commands/docker/
journalctl_--no-pager_--unit_docker ls_-alhR_.etc.docker

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Please feel free to make a pull request (or open an upsteam bug) with the requested change to https://github.com/sosreport/sos/blob/master/sos/plugins/systemd.py. Thanks!

Eric Desrochers (slashd)
Changed in sosreport (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Eric Desrochers (slashd) wrote :

IMHO, introducing "systemd-detect-virt" in sos/plugins/systemd.py should work just fine.
and if no virt nor container is type is found,

Worst case the content of "/path_to_sosreport/sos_commands/systemd/systemd-detect-virt" will be 'none' if :
- sosreport is run on Physical server
- sosreport isn't able to identify the container/VM type.

Dominique, do you want to take care of submitting this trivial change to github ?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for sosreport (Ubuntu) because there has been no activity for 60 days.]

Changed in sosreport (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.