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.
4.10 PR: https://github.com/kubevirt/must-gather/pull/129
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.
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 ~]$
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