Veritas NetBackup™ Commands Reference Guide
- Introduction
- Appendix A. NetBackup Commands
Name
nbdiscover — test query rules for automatic selection of VMware virtual machines for backup
SYNOPSIS
-noxmloutput path | -policy policy_name [-sched policy_schedule_type] [-includedonly | -excludedonly] [-noreason] [-escapechar x] [-quotechar x]
-noxmloutput query [-includedonly | -excludedonly] [-noreason] [-escapechar x] [-quotechar x]
On UNIX systems, the directory path to this command is /usr/openv/netbackup/bin/
On Windows systems, the directory path to this command is install_path\NetBackup\bin\
DESCRIPTION
The nbdiscover command is similar to the Test Query button in the VMware policy. It returns the virtual machines that NetBackup selects based on the specified query rules. You can specify the name of a policy that contains the query, or the query itself. The -noxmloutput option is required for user-friendly output (the default XML output is not supported for general use).
The nbdiscover command must be run on either the discovery host or the backup host.
For more information on how to create and test rules from the policy's Query Builder, see the NetBackup for VMware Administrator's Guide.
OPTIONS
- -escapechar x
Specifies the ASCII decimal value of an alternate escape character to be used in the nbdiscover output when you use the -noxmloutput option. The default escape character is a backslash (\) or -escapechar 92.
- -excludedonly x
Returns only excluded virtual machines that do not match the rules in the query.
- -includedonly x
Returns only included virtual machines virtual machines that match the rules in the query.
- -noreason
Omits from the results any explanation as to why a virtual machine was excluded by the query or failed the query. A virtual machine fails the query if the query cannot exclude the virtual machine and the virtual machine cannot be selected for backup.
- -noxmloutput
Displays one virtual machine per line. In the output, a plus sign (+) in the first column indicates that the virtual machine matches the rules in the query. A minus sign (-) indicates that the virtual machine does not match the rules in the query.
- -policy policy_name
Specifies a policy that contains a query. nbdiscover filters the virtual machines based on that query and on other policy attributes, such as Primary VM identifier (for example, VM host name or VM display name).
- query
Specifies a query without a policy. You must compose the query manually and enclose it in double quotes. For example:
"vmware:/?filter=Displayname Contains 'vm1'"
- -quotechar x
Specifies the ASCII decimal value of an alternate quote character to be used in the nbdiscover output when you use the -noxmloutput option. The default quote character is a double quote (") or -quotechar 34.
- -sched policy_schedule_type
Specifies the schedule type of the policy when you use the -policy policy_name option.
EXAMPLES
Example 1 - List the virtual machines that either match or do not match the query in the policy pol1. Do not list explanations for the virtual machines that failed the query or that the query excluded.
# nbdiscover -noxmloutput -policy pol1 -noreason + "grayvm3" + "grayvm5" + "grayvm7" - "vladvm1" - "vladvm2" - "bodvm23" - "bittle4"
Example 2 - List the virtual machines that have display names that contain "vm". Do not list virtual machines that do not have "vm" in the display names:
# nbdiscover -noxmloutput -includedonly "vmware:/?filter=Displayname / Contains 'vm'" grayvm3 grayvm5 grayvm7 vladvm1 vladvm2 bodvm23
Example 3 - List the virtual machines by whether they are turned on.
# nbdiscover -noxmloutput "vmware:/?filter=Powerstate Equal poweredOn" + "grayvm3" + "grayvm5" + "grayvm7" - "vladvm1" "VM excluded by discovery filter, display name=[vladvm1], server=esx1.acme.com]." + "vladvm2" + "bodvm23" + "bittle4"
Example 4 - List the virtual machines by whether they are turned on and have "7" in their display name. Do not list explanations for the virtual machines that failed the query or that the query excluded.
# nbdiscover -noxmloutput "vmware:/?filter=Powerstate Equal poweredOn / AND Displayname Contains '7'" -noreason - "grayvm3" - "grayvm5" + "grayvm7" - "vladvm1" - "vladvm2" - "bodvm23" - "bittle4"
Example 5 - Search all VM backups that have "test" in their vCloud vApp name. This example uses a query to search virtual machines in vCloud Director. nbdiscover must be run on the master server.
# nbdiscover -noxmloutput "vmsearch:/;reqType=search?filter= vCDvApp Contains 'test'" + "demovm%20(8c879791-2917-4428-8213-bea7ec727717)" + "small_vm%20(61e85579-7246-411f-b2f9-9fb570546755)" + "small_vm_percent_%25%20(61e85579-7246-411f-b2f9-9fb570546755)"
Example 6 - Show the hierarchy of the vCloud environment that was backed up. The output of this command is in XML. This example uses a query to search virtual machines in vCloud Director. nbdiscover must be run on the master server.
# nbdiscover "vmsearch:/;reqType=browse;viewType=vcloud" <?xml version="1.0" encoding="utf-8"?> <Start Iteration="vmsearch:/;reqType=browse;viewType=vcloud"> <VCDSERVER> <NBU> <NAME>hypervm1.acme.com</NAME> </NBU> <VCDORG> <NBU> <NAME>Test_vCloud</NAME> </NBU> <VCDORGVDC> <NBU> <NAME>TestOrg</NAME> </NBU> <VCDVAPP> <NBU> <NAME>TestvApp</NAME> </NBU> </VCDVAPP> </VCDORGVDC> </VCDORG> <VCDSERVER> <StatusMsg NBUStatus="0" Severity="0"></StatusMsg> </Start>