Query Information about vSphere Environment

Enterprise

Bacula 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:

  • filter specifies the vSphere inventory property on which to filter.

  • filter_value specifies the name or identifier to match.

Both options must be specified together.

The following filters are available:

Filtered object

Value assigned to filter

Value assigned to filter_value

Tag name

tag

Tag name, for example j1

Tag identifier

tag_id

Tag identifier

Virtual machine folder

folder

Folder name, for example bp

Datastore

datastore

Datastore name

Datacenter

datacenter

Datacenter name

ESXi host

host

ESXi host name

Resource pool

pool

Resource pool name or managed object reference

vApp

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

Go back to: Prepare Your ESXI or vCenter Environment.