Bug 2058925 - Must-gather: for vms with longer name, gather_vms_details fails to collect qemu, dump xml logs
Summary: Must-gather: for vms with longer name, gather_vms_details fails to collect qe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Logging
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.11.0
Assignee: Nahshon Unna-Tsameret
QA Contact: Ohad
URL:
Whiteboard:
Depends On:
Blocks: 2059613
TreeView+ depends on / blocked
 
Reported: 2022-02-26 23:09 UTC by Debarati Basu-Nag
Modified: 2023-11-13 08:14 UTC (History)
2 users (show)

Fixed In Version: v4.10.1-57
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2059613 (view as bug list)
Environment:
Last Closed: 2022-09-14 19:28:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt must-gather pull 127 0 None Merged Fix bug, where the gather_vms_details script fails to collect VM with long names 2022-03-03 10:07:44 UTC
Github kubevirt must-gather pull 129 0 None Merged [release-4.10] Fix bug, where the gather_vms_details script fails to collect VM with long names 2022-04-06 12:25:21 UTC
Github kubevirt must-gather pull 137 0 None open [release-4.10] Fix BZ 2058925: failed to get detailed for VMs with long names 2022-04-06 12:27:00 UTC
Red Hat Issue Tracker CNV-16658 0 None None None 2023-11-13 08:14:58 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:29:07 UTC

Comment 2 Nahshon Unna-Tsameret 2022-03-02 08:39:29 UTC
The bug is where the script is trying to get the vm name from the virt-launcher pod name. The script assumes that the pod name is the vm name with a random addition, separated by a dash. But that is not true for VMs with to long name, and in this case the pod name is not exactly that; e.g. it lack the dash, and the last few characters.

PR https://github.com/kubevirt/must-gather/pull/127 fixes the bug by using different approach to get the VM name from the virt-launcher pod: it reads the "kubevirt.io/domain" annotation in the pod, assuming this is the VM name.

Comment 3 Nahshon Unna-Tsameret 2022-03-03 10:09:05 UTC
4.10 PR: https://github.com/kubevirt/must-gather/pull/129

Comment 4 Debarati Basu-Nag 2022-04-06 00:40:19 UTC
Verified against CNV-v4.11.0-192,

I still don't see vm files getting collected.
Below errors are snippets collected from the output:
========================
[must-gather-rsfnn] POD 2022-04-06T00:23:08.296710247Z + vm_collection_path=/must-gather/namespaces/must-gather-alternate/vms/must-gather-alternate-namespace-vm-2-1649204386-1836267
[must-gather-rsfnn] POD 2022-04-06T00:23:08.296710247Z + mkdir -p /must-gather/namespaces/must-gather-alternate/vms/must-gather-alternate-namespace-vm-2-1649204386-1836267
[must-gather-rsfnn] POD 2022-04-06T00:23:08.298974321Z + /usr/bin/oc adm inspect --dest-dir /must-gather -n must-gather-alternate pod ''
[must-gather-rsfnn] POD 2022-04-06T00:23:08.386632319Z error: resource name may not be empty
[must-gather-rsfnn] POD 2022-04-06T00:23:08.389719986Z + /usr/bin/oc adm inspect --dest-dir /must-gather -n must-gather-alternate virtualmachineinstances must-gather-alternate-namespace-vm-2-1649204386-1836267
[must-gather-rsfnn] POD 2022-04-06T00:23:09.407387586Z Wrote inspect data to /must-gather.
[must-gather-rsfnn] POD 2022-04-06T00:23:09.412875614Z + /usr/bin/oc exec '' -n must-gather-alternate -c compute -- virsh dumpxml must-gather-alternate_must-gather-alternate-namespace-vm-2-1649204386-1836267
[must-gather-rsfnn] POD 2022-04-06T00:23:09.489114578Z error: pod, type/name or --filename must be specified
[must-gather-rsfnn] POD 2022-04-06T00:23:09.493192622Z + /usr/bin/oc exec '' -n must-gather-alternate -c compute -- cat /var/log/libvirt/qemu/must-gather-alternate_must-gather-alternate-namespace-vm-2-1649204386-1836267.log
[must-gather-rsfnn] POD 2022-04-06T00:23:09.551922386Z error: pod, type/name or --filename must be specified
[must-gather-rsfnn] POD 2022-04-06T00:23:09.556664926Z + /usr/bin/oc exec '' -n must-gather-alternate -c compute -- ip a
========================
Will attach the full output and folder structure.

Comment 7 Debarati Basu-Nag 2022-07-25 21:17:12 UTC
Validated against 4.11 -577:
=========
[cnv-qe-jenkins@c01-db-411-8xdfz-executor ~]$ ls -ltR /tmp/pytest-MpsHiFh45QCm4zr3JcWipH/must_gather_scope_module0/registry-redhat-io-container-native-virtualization-cnv-must-gather-rhel8-sha256-17db4aff6e9eecd84f3afa845cdb64fd759f8ee12d69eea544b31ecf5b33360e/namespaces/node-gather-unprivileged/vms/must-gather-vm-this-is-supposed-to-be-long-2-1658783035-8249176/
/tmp/pytest-MpsHiFh45QCm4zr3JcWipH/must_gather_scope_module0/registry-redhat-io-container-native-virtualization-cnv-must-gather-rhel8-sha256-17db4aff6e9eecd84f3afa845cdb64fd759f8ee12d69eea544b31ecf5b33360e/namespaces/node-gather-unprivileged/vms/must-gather-vm-this-is-supposed-to-be-long-2-1658783035-8249176/:
total 32
drwxr-xr-x. 2 cnv-qe-jenkins cnv-qe-jenkins    6 Jul 25 21:06 log
-rw-r--r--. 1 cnv-qe-jenkins cnv-qe-jenkins 1496 Jul 25 21:06 virt-launcher-must-gather-vm-this-is-supposed-to-be-long-28zsz6.ruletables.txt
-rw-r--r--. 1 cnv-qe-jenkins cnv-qe-jenkins 2008 Jul 25 21:06 virt-launcher-must-gather-vm-this-is-supposed-to-be-long-28zsz6.bridge.txt
-rw-r--r--. 1 cnv-qe-jenkins cnv-qe-jenkins 2182 Jul 25 21:06 virt-launcher-must-gather-vm-this-is-supposed-to-be-long-28zsz6.ip.txt
-rw-r--r--. 1 cnv-qe-jenkins cnv-qe-jenkins 9505 Jul 25 21:06 virt-launcher-must-gather-vm-this-is-supposed-to-be-long-28zsz6.dumpxml.xml
-rw-------. 1 cnv-qe-jenkins cnv-qe-jenkins 8132 Jul 25 21:05 node-gather-unprivileged_must-gather-vm-this-is-supposed-to-be-long-2-1658783035-8249176.log

/tmp/pytest-MpsHiFh45QCm4zr3JcWipH/must_gather_scope_module0/registry-redhat-io-container-native-virtualization-cnv-must-gather-rhel8-sha256-17db4aff6e9eecd84f3afa845cdb64fd759f8ee12d69eea544b31ecf5b33360e/namespaces/node-gather-unprivileged/vms/must-gather-vm-this-is-supposed-to-be-long-2-1658783035-8249176/log:
total 0
[cnv-qe-jenkins@c01-db-411-8xdfz-executor ~]$

Comment 10 errata-xmlrpc 2022-09-14 19:28:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Virtualization 4.11.0 Images security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:6526


Note You need to log in before you can comment on or make changes to this bug.