Query Information about vSphere Environment
EnterpriseBacula Enterprise Only
This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.
Attention
New in version 16.0.12
Using a similar mechanism to what was described in the previous section about user permissions, it is possible to query VMware to get different kinds of information. Below some examples:
// List networks
.query client=my-fd plugin="vsphere:" parameter=network
// List resource pools
.query client=my-fd plugin="vsphere:" parameter=pool
// List datastore
.query client=my-fd plugin="vsphere:" parameter=datastore
// List current configuration
.query client=my-fd plugin="vsphere:" parameter=config_list
// Check some configuration section
.query client=my-fd plugin="vsphere: sectionname=vsphere" parameter=config_check
In addition to the examples above, the vSphere Plugin can query the vSphere inventory for virtual
machines by using parameter=host. The results can be restricted with the filter and
filter_value plugin options.
Note
This filtering mechanism can also be used by the Automatic Object Integration Scan Plugin to limit discovery to a specific part of the vSphere inventory.
The general syntax is:
.query client=my-fd plugin="vsphere: filter=<filter_type> filter_value=<filter_value>" parameter=host
The two options have the following purposes:
filterspecifies the vSphere inventory property on which to filter.filter_valuespecifies the name or identifier to match.
Both options must be specified together.
The following filters are available:
Filtered object |
Value assigned to |
Value assigned to |
|---|---|---|
Tag name |
|
Tag name, for example |
Tag identifier |
|
Tag identifier |
Virtual machine folder |
|
Folder name, for example |
Datastore |
|
Datastore name |
Datacenter |
|
Datacenter name |
ESXi host |
|
ESXi host name |
Resource pool |
|
Resource pool name or managed object reference |
vApp |
|
vApp name |
For example, the following command lists all virtual machines associated with the tag named j1:
.query client=my-fd plugin="vsphere: filter=tag filter_value=j1" parameter=host
The following command lists the virtual machines contained in the folder named bp:
.query client=my-fd plugin="vsphere: filter=folder filter_value=bp" parameter=host
If no virtual machine matches the specified filter, the query returns an error similar to the following:
.query client=my-fd plugin="vsphere: filter=tag filter_value=testing-1" parameter=host
error=No Virtual Machines were found with the Tag: testing-1
See also
Previous articles:
Go back to: Prepare Your ESXI or vCenter Environment.