Description of problem: As a user, I want to be able to collect specific assets based on filter criteria, in order to have a smaller archive to analyze. From an implementation point of view, we need to be able to connect by plan, and by VM inside a plan. It would be great to drive this through environment variables: Namespace name - If set, only data for the plans in this namespace is considered. Plan name - If set, only the data for the specified plan is considered. VM name - If set, only the data for the specified VM in the specified plan is considered.
A note for QE for testing&usage of the feature implemented by this RFE - basic usage is described in README on github [0], more examples (with parameters combinations) are part of dev preview video [1]. [0] https://github.com/konveyor/forklift-must-gather#targeted-gathering [1] https://youtu.be/c2FwJPbhnR4?t=224
Moving it to ASSIGNED I ran a negative test and used unexisting namespace/plan/vm as command's arguments: oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest -- NS=ns1 PLAN=plan1 VM=vm-3345 /usr/bin/targeted There were no errors regarding namespace and VM not found. In addition, this file was created /must-gather/namespaces/crs/virtualmachine/ns1.yaml contains this line: Error from server (NotFound): namespaces "-o" not found Command output: [must-gather ] OUT namespace/openshift-must-gather-qf4r8 created [must-gather ] OUT clusterrolebinding.rbac.authorization.k8s.io/must-gather-s88q8 created [must-gather ] OUT pod for plug-in image quay.io/konveyor/forklift-must-gather:latest created [must-gather-ck8kl] POD 2021-08-18T07:41:59.808888958Z Targeted gathering for Forklift in namespaces [openshift-mtv] [must-gather-ck8kl] POD 2021-08-18T07:41:59.823737626Z Targeted gathering for Namespace: ns1 [must-gather-ck8kl] POD 2021-08-18T07:41:59.823737626Z Targeted gathering for Plan: plan1 [must-gather-ck8kl] POD 2021-08-18T07:42:00.222258270Z Error from server (NotFound): plans.forklift.konveyor.io "plan1" not found [must-gather-ck8kl] POD 2021-08-18T07:42:00.249318515Z Targeted gathering for VM ID: vm-3345 [must-gather-ck8kl] POD 2021-08-18T07:42:00.249789402Z Gathering virtualmachines.. [must-gather-ck8kl] POD 2021-08-18T07:42:01.119544513Z jq: error (at <stdin>:1): Cannot iterate over null (null) [must-gather-ck8kl] POD 2021-08-18T07:42:01.121252597Z Dumping virtualmachine: ns1 from [must-gather-ck8kl] POD 2021-08-18T07:42:01.948873484Z Gathering logs for namespaces [openshift-mtv] [must-gather-ck8kl] POD 2021-08-18T07:42:02.319702274Z [ns=openshift-mtv][pod=forklift-controller-7fdf79598d-58hrq] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:02.328072931Z [ns=openshift-mtv][pod=forklift-operator-5c594c977b-wc8m6] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:02.339160506Z [ns=openshift-mtv][pod=forklift-ui-564b5649c-xrsdm] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:02.350617391Z [ns=openshift-mtv][pod=forklift-validation-7d7d47bc9-xw2zm] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:02.368116897Z [ns=openshift-mtv][pod=virt-launcher-v2v-migration-rhel8-2disks2nics-p7ktv] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:02.394691303Z [ns=openshift-mtv][pod=virt-launcher-v2v-migration-win2019-p4hfv] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:03.392049890Z [ns=openshift-cnv][pod=cdi-apiserver-8649f9764b-9rrkh] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:03.431665521Z [ns=openshift-cnv][pod=cdi-deployment-54b56d9fbf-2bbkv] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:03.492650477Z [ns=openshift-cnv][pod=cdi-operator-759f4977cd-hfdzf] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:03.522437841Z [ns=openshift-cnv][pod=cdi-uploadproxy-8f9c6b68b-jw99z] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:04.558482428Z [ns=openshift-cnv][pod=vm-import-controller-7567c7b868-xhcz9] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:04.572174370Z [ns=openshift-cnv][pod=vm-import-operator-7d555df844-5tb97] Collecting Pod logs... [must-gather-ck8kl] POD 2021-08-18T07:42:05.947570726Z Tarring must-gather artifacts... [must-gather-ck8kl] POD 2021-08-18T07:42:05.958534708Z tar: Removing leading `/' from member names [must-gather-ck8kl] POD 2021-08-18T07:42:05.990574063Z Created /must-gather/must-gather.tar.gz [must-gather-ck8kl] POD 2021-08-18T07:42:05.990574063Z Waiting for copy phase... [must-gather-ck8kl] POD 2021-08-18T07:42:05.947570726Z Tarring must-gather artifacts... [must-gather-ck8kl] POD 2021-08-18T07:42:05.958534708Z tar: Removing leading `/' from member names [must-gather-ck8kl] POD 2021-08-18T07:42:05.990574063Z Created /must-gather/must-gather.tar.gz [must-gather-ck8kl] POD 2021-08-18T07:42:05.990574063Z Waiting for copy phase... [must-gather-ck8kl] OUT waiting for gather to complete [must-gather-ck8kl] OUT downloading gather output [must-gather-ck8kl] OUT receiving incremental file list [must-gather-ck8kl] OUT ./ [must-gather-ck8kl] OUT must-gather.tar.gz [must-gather-ck8kl] OUT [must-gather-ck8kl] OUT sent 46 bytes received 1,068 bytes 742.67 bytes/sec [must-gather-ck8kl] OUT total size is 946 speedup is 0.85 [must-gather ] OUT clusterrolebinding.rbac.authorization.k8s.io/must-gather-s88q8 deleted [must-gather ] OUT namespace/openshift-must-gather-qf4r8 deleted
As the negative test case is not a common case from a user point of view, this RFE should be FailedQE due to the following issue: Bug 1994978 - [MTV][Must-gather] Empty log files under openshift-cnv/logs and openshift-mtv/logs
Based on provided access to the Maayan's testing ENV, there are commands which I believe should be used for testing basic functionality of this feature: ``` # NS oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest -- NS=mguetta /usr/bin/targeted # PLAN oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest -- PLAN=mguetta-test /usr/bin/targeted #VM oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest -- VM=vm-7485 NS=mguetta /usr/bin/targeted ``` Similar commands are added to upstream README and will be updated in docs. Other issues like not great error handling with not expected parameters or improvement of logs filtering will be solved in followup BZs (already reported).
The commands mentioned in comment#4 have been tested and the must-gather.tar.gz created directory looks good in these cases Based on that, moving this RFE to VERIFIED. Thank you
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 (Migration Toolkit for Virtualization 2.1.0), 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/RHEA-2021:3278