vcenter_vm

Resource layer for vCenter VMs (/api/vcenter/vm).

saltext.vcf.clients.vcenter_vm.search(opts, *, power_states=None, names=None, hosts=None, clusters=None, folders=None, datacenters=None, resource_pools=None, vms=None, profile=None)[source]

Server-side VM filtering via /api/vcenter/vm?<filter>=....

Each filter accepts a list (sent as repeated query keys). All filters are AND-combined by the server. power_states values: POWERED_ON, POWERED_OFF, SUSPENDED.

vCenter 9 uses flat parameter names (e.g. power_states=POWERED_ON); earlier versions used filter.power_states=....

saltext.vcf.clients.vcenter_vm.tree(opts, profile=None)[source]

Compose a nested {datacenter: {cluster: {host: [vm,...]}}} map.

Single REST call each for datacenters, clusters, hosts, vms, then aggregated in Python. VMs not bound to a host (templates, disconnected) land under the sentinel "__unbound__" host bucket within their cluster bucket.

saltext.vcf.clients.vcenter_vm.summary(opts, profile=None)[source]

Aggregate counts from list_(): by_power_state, by_cpu_count, total.