|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * virt/logging_events_monitoring/virt-collecting-virt-data.adoc |
| 4 | + |
| 5 | +[id="virt-must-gather-usage-targeted-vm-data_{context}"] |
| 6 | += must-gather tool usage for targeted VM data |
| 7 | + |
| 8 | +When you use the `must-gather` CLI tool to collect {VirtProductName} data, the virtual machine (VM) information collected by default is limited to `VirtualMachine` and `VirtualMachineInstance` custom resources (CRs). You can request additional or targeted data by including parameters when you run the `must-gather` command. These parameters include environment variables and scripts. |
| 9 | + |
| 10 | +[discrete] |
| 11 | +[id="supported-parameters_{context}"] |
| 12 | +=== Supported parameters |
| 13 | + |
| 14 | +.Environment variables |
| 15 | + |
| 16 | +`NS=<namespace_name>`:: Gather virtual machine details from the namespace that you specify. |
| 17 | + |
| 18 | +`VM=<vm_name>`:: Gather details about a particular virtual machine. To use this option, you must also specify a namespace by using the `NS` environment variable. |
| 19 | + |
| 20 | +`PROS=<number_of_processes>`:: Modify the maximum number of parallel processes that the `must-gather` tool uses. By default, the tool uses no more than five parallel processes. |
| 21 | ++ |
| 22 | +[IMPORTANT] |
| 23 | +==== |
| 24 | +Using too many parallel processes can cause performance issues. Increasing the maximum number of parallel processes is not recommended. |
| 25 | +==== |
| 26 | + |
| 27 | +.Scripts |
| 28 | + |
| 29 | +Each script is only compatible with certain variable combinations. |
| 30 | + |
| 31 | +`gather_vms_details`:: Collect virtual machine 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 of the supported environment variables, but you must specify a namespace if you use the `VM` variable. |
| 32 | + |
| 33 | +`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. |
| 34 | + |
| 35 | +`gather_images`:: Collect image and image stream custom resource information. This script is only compatible with the `PROS` variable. |
| 36 | + |
| 37 | +[discrete] |
| 38 | +[id="usage_{context}"] |
| 39 | +=== Usage |
| 40 | + |
| 41 | +To customize the data that `must-gather` collects, append a double dash (`--`) to the command, followed by one or more compatible parameters. If you use any environment variables, you must specify a script. |
| 42 | + |
| 43 | +The following options are valid: |
| 44 | + |
| 45 | +* You can specify one script without using any environment variables. |
| 46 | +* You can use one or more environment variables in any order, followed by one script. |
| 47 | + |
| 48 | +.Syntax |
| 49 | + |
| 50 | +[source,terminal,subs="attributes+"] |
| 51 | +---- |
| 52 | +$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} \ |
| 53 | + -- <environment_variable_1> <environment_variable_2> <script_name> |
| 54 | +---- |
| 55 | + |
| 56 | +.Examples |
| 57 | + |
| 58 | +* The following command collects extensive VM details for the `my-vm` VM in the `mynamespace` namespace: |
| 59 | ++ |
| 60 | +[source,terminal,subs="attributes+"] |
| 61 | +---- |
| 62 | +$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} -- NS=mynamespace VM=my-vm gather_vms_details |
| 63 | +---- |
| 64 | ++ |
| 65 | +[IMPORTANT] |
| 66 | +==== |
| 67 | +If you use the `VM` environment variable, you must also specify a namespace. |
| 68 | +==== |
| 69 | + |
| 70 | +* The following command collects default `must-gather` information by using a maximum of three parallel processes: |
| 71 | ++ |
| 72 | +[source,terminal,subs="attributes+"] |
| 73 | +---- |
| 74 | +$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} -- PROS=3 gather |
| 75 | +---- |
| 76 | + |
| 77 | +* The following command collects image and image stream information from the cluster: |
| 78 | ++ |
| 79 | +[source,terminal,subs="attributes+"] |
| 80 | +---- |
| 81 | +$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v{HCOVersion} -- gather_images |
| 82 | +---- |
0 commit comments