Part of epic: nudgebee/nudgebee-enterprise#35404. Blocked on target-environment input: which hypervisor is in use. Build exactly one connector first — not all three.
What we're building, in one sentence
Ask the target environment's hypervisor for its list of VMs — because it's the only source that also knows about powered-off VMs (a powered-off VM answers no ping and no SSH; without the hypervisor it simply doesn't exist to us, and the coverage report would silently lie).
New action: discovery_hypervisor
Takes a datasource_id pointing at a configured hypervisor datasource (new datasource types, configured like the db proxies, read-only credentials via pkg/secrets).
Response per VM, whichever backend:
{"uuid": "4c4c4544-...", "name": "web-01", "power_state": "poweredOff",
"guest_os": "Ubuntu 22.04", "ips": ["10.0.1.15"]}
The UUID is the point — it's the SMBIOS UUID the SSH inventory also sees from inside the guest (/sys/class/dmi/id/product_uuid), so the server can merge "VM per vCenter" and "host we SSHed into" into one asset.
The three candidate backends (build ONE)
vCenter — library: govmomi (Apache-2.0, VMware's own Go SDK). Property-collector query over all VMs for config.uuid, name, runtime.powerState, guest.guestFullName, guest.net. Credential: a vCenter user with the built-in Read-Only role.
Proxmox — plain REST, no SDK needed: GET /api2/json/cluster/resources?type=vm with an API token (PVEAuditor role = read-only). Returns vmid/name/status per node; VM UUID via the config endpoint.
libvirt/KVM without management UI — no daemon API exposed: SSH to the KVM host (reuse pkg/proxy/ssh plumbing) and run virsh list --all --name + virsh domuuid <name> + virsh domifaddr <name>. Slower, but works on any plain KVM box.
Acceptance criteria (each is a test)
Design: docs/design/vm-discovery-phase0.md §5, §9 (PR #117).
Part of epic: nudgebee/nudgebee-enterprise#35404. Blocked on target-environment input: which hypervisor is in use. Build exactly one connector first — not all three.
What we're building, in one sentence
Ask the target environment's hypervisor for its list of VMs — because it's the only source that also knows about powered-off VMs (a powered-off VM answers no ping and no SSH; without the hypervisor it simply doesn't exist to us, and the coverage report would silently lie).
New action:
discovery_hypervisorTakes a
datasource_idpointing at a configured hypervisor datasource (new datasource types, configured like the db proxies, read-only credentials viapkg/secrets).Response per VM, whichever backend:
{"uuid": "4c4c4544-...", "name": "web-01", "power_state": "poweredOff", "guest_os": "Ubuntu 22.04", "ips": ["10.0.1.15"]}The UUID is the point — it's the SMBIOS UUID the SSH inventory also sees from inside the guest (
/sys/class/dmi/id/product_uuid), so the server can merge "VM per vCenter" and "host we SSHed into" into one asset.The three candidate backends (build ONE)
vCenter — library: govmomi (Apache-2.0, VMware's own Go SDK). Property-collector query over all VMs for
config.uuid,name,runtime.powerState,guest.guestFullName,guest.net. Credential: a vCenter user with the built-in Read-Only role.Proxmox — plain REST, no SDK needed:
GET /api2/json/cluster/resources?type=vmwith an API token (PVEAuditor role = read-only). Returns vmid/name/status per node; VM UUID via the config endpoint.libvirt/KVM without management UI — no daemon API exposed: SSH to the KVM host (reuse
pkg/proxy/sshplumbing) and runvirsh list --all --name+virsh domuuid <name>+virsh domifaddr <name>. Slower, but works on any plain KVM box.Acceptance criteria (each is a test)
power_state: poweredOffon the next poll.powered-off, not as "unknown machine".Design:
docs/design/vm-discovery-phase0.md§5, §9 (PR #117).