|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * virt/logging_events_monitoring/virt-collecting-virt-data.adoc |
| 4 | + |
| 5 | +:_content-type: REFERENCE |
| 6 | +[id="virt-must-gather-options_{context}"] |
| 7 | += must-gather tool options |
| 8 | + |
| 9 | +You can specify a combination of scripts and environment variables for the following options: |
| 10 | + |
| 11 | +* Collecting detailed virtual machine (VM) information from a namespace |
| 12 | +* Collecting detailed information about specified VMs |
| 13 | +* Collecting image and image stream information |
| 14 | +* Limiting the maximum number of parallel processes used by the `must-gather` tool |
| 15 | +
|
| 16 | +[id="parameters"] |
| 17 | +== Parameters |
| 18 | + |
| 19 | +.Environment variables |
| 20 | + |
| 21 | +You can specify environment variables for a compatible script. |
| 22 | + |
| 23 | +`NS=<namespace_name>`:: Collect virtual machine information, including `virt-launcher` pod details, from the namespace that you specify. The `VirtualMachine` and `VirtualMachineInstance` CR data is collected for all namespaces. |
| 24 | + |
| 25 | +`VM=<vm_name>`:: Collect details about a particular virtual machine. To use this option, you must also specify a namespace by using the `NS` environment variable. |
| 26 | + |
| 27 | +`PROS=<number_of_processes>`:: Modify the maximum number of parallel processes that the `must-gather` tool uses. The default value is `5`. |
| 28 | ++ |
| 29 | +[IMPORTANT] |
| 30 | +==== |
| 31 | +Using too many parallel processes can cause performance issues. Increasing the maximum number of parallel processes is not recommended. |
| 32 | +==== |
| 33 | + |
| 34 | +.Scripts |
| 35 | + |
| 36 | +Each script is only compatible with certain environment variable combinations. |
| 37 | + |
| 38 | +`gather_vms_details`:: Collect VM log files, VM definitions, and namespaces (and their child objects) that belong to {VirtProductName} resources. If you use this parameter without specifying a namespace or VM, the `must-gather` tool collects this data for all VMs in the cluster. This script is compatible with all environment variables, but you must specify a namespace if you use the `VM` variable. |
| 39 | + |
| 40 | +`gather`:: Use the default `must-gather` script, which collects cluster data from all namespaces and includes only basic VM information. This script is only compatible with the `PROS` variable. |
| 41 | + |
| 42 | +`gather_images`:: Collect image and image stream custom resource information. This script is only compatible with the `PROS` variable. |
| 43 | + |
| 44 | +[id="usage-and-examples_{context}"] |
| 45 | +== Usage and examples |
| 46 | + |
| 47 | +Environment variables are optional. You can run a script by itself or with one or more compatible environment variables. |
| 48 | + |
| 49 | +[cols="1a,1a", options="header"] |
| 50 | +.Compatible parameters |
| 51 | +|=== |
| 52 | +|Script |Compatible environment variable |
| 53 | +|`gather_vms_details` |
| 54 | +|* For a namespace: `NS=<namespace_name>` |
| 55 | + |
| 56 | +* For a VM: `VM=<vm_name> NS=<namespace_name>` |
| 57 | + |
| 58 | +* `PROS=<number_of_processes>` |
| 59 | + |
| 60 | +|`gather` |* `PROS=<number_of_processes>` |
| 61 | +|`gather_images` |* `PROS=<number_of_processes>` |
| 62 | +|=== |
| 63 | + |
| 64 | +To customize the data that `must-gather` collects, you append a double dash (`--`) to the command, followed by a space and one or more compatible parameters. |
| 65 | + |
| 66 | +.Syntax |
| 67 | + |
| 68 | +[source,terminal,subs="attributes+"] |
| 69 | +---- |
| 70 | +$ oc adm must-gather \ |
| 71 | + --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} \ |
| 72 | + -- <environment_variable_1> <environment_variable_2> <script_name> |
| 73 | +---- |
| 74 | + |
| 75 | +.Detailed VM information |
| 76 | + |
| 77 | +The following command collects detailed VM information for the `my-vm` VM in the `mynamespace` namespace: |
| 78 | + |
| 79 | +[source,terminal,subs="attributes+"] |
| 80 | +---- |
| 81 | +$ oc adm must-gather \ |
| 82 | + --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} \ |
| 83 | + -- NS=mynamespace VM=my-vm gather_vms_details <1> |
| 84 | +---- |
| 85 | +<1> The `NS` environment variable is mandatory if you use the `VM` environment variable. |
| 86 | + |
| 87 | +.Default data collection limited to three parallel processes |
| 88 | + |
| 89 | +The following command collects default `must-gather` information by using a maximum of three parallel processes: |
| 90 | + |
| 91 | +[source,terminal,subs="attributes+"] |
| 92 | +---- |
| 93 | +$ oc adm must-gather \ |
| 94 | + --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} \ |
| 95 | + -- PROS=3 gather |
| 96 | +---- |
| 97 | + |
| 98 | +.Image and image stream information |
| 99 | + |
| 100 | +The following command collects image and image stream information from the cluster: |
| 101 | + |
| 102 | +[source,terminal,subs="attributes+"] |
| 103 | +---- |
| 104 | +$ oc adm must-gather \ |
| 105 | + --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} \ |
| 106 | + -- gather_images |
| 107 | +---- |
0 commit comments