Truenas
Hypervisor-layer VM inventory for TrueNAS SCALE, via the JSON-RPC WebSocket API.
TrueNAS SCALE 24.10+ runs guest VMs as Incus instances; earlier releases use libvirt. The @mccormick/truenas/inventory model asks TrueNAS for that guest state and turns it into a typed swamp inventory: one vm resource per guest (normalized state, vcpus, memory, disks, NICs, and MAC addresses) and a single summary roll-up (host, TrueNAS version, and running/stopped/other counts).
The discover method fans out across every guest in one virt.instance.query (or legacy vm.query) call — no per-VM loop. Guests share the common name/state/vcpus/memoryMib/macs field contract with the Proxmox and Omni inventory providers, so a workflow report can join all three hypervisors into one fleet view.
Read-only: the model issues only query and system.info calls and never mutates TrueNAS state. Transport is the JSON-RPC WebSocket API authenticated with an API key; the key is supplied through a vault, marked sensitive, and redacted from logs and error text.
The companion @mccormick/truenas/vm model provisions guests from a ZFS zvol (create_zvol, create_vm, attach_disk, attach_nic, start/stop/ status/delete) over the same JSON-RPC transport — the TrueNAS half of the migrate-vm workflow. Every provisioning method is idempotent (queries before it writes), stamps a swamp marker into the VM description, and gates deletes on it. Read-only inventory and read-write provisioning are deliberately split across two models so the inventory safety story stays intact.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| endpoint | string | TrueNAS host or base URL, e.g. truenas.example.net or |
| apiKey | string | TrueNAS API key (read-only is sufficient); supply via |
| insecureSkipTlsVerify | boolean | Skip TLS verification (limited support over WebSocket — prefer a |
| backend | enum | Guest backend: 'incus' (SCALE 24.10+), 'libvirt' (legacy), or 'auto' |
| timeoutSecs | number | Per-discovery WebSocket timeout in seconds |
Resources
Global Arguments
| Argument | Type | Description |
|---|---|---|
| endpoint | string | TrueNAS host or base URL, e.g. truenas.example.net |
| apiKey | string | TrueNAS API key (read-write — provisioning mutates VMs and datasets); |
| insecureSkipTlsVerify | boolean | Skip TLS verification (limited over WebSocket — prefer a trusted CA) |
| timeoutSecs | number | Per-call WebSocket timeout in seconds |
| Argument | Type | Description |
|---|---|---|
| pool | string | ZFS pool (e.g. Main) |
| sizeGib | number | Provisioned size in GiB |
| sparse | boolean | Thin-provision the volume |
| blocksize? | string | volblocksize (e.g. 16K); omit for the pool default |
| Argument | Type | Description |
|---|---|---|
| vcpus | number | Virtual CPU count |
| coresPerSocket? | number | |
| memoryMib | number | Memory in MiB |
| bootloader | enum | UEFI for ovmf guests; UEFI_CSM for legacy-BIOS/GRUB guests |
| autostart | boolean | |
| description? | string |
| Argument | Type | Description |
|---|---|---|
| vmId | number | Owning VM id |
| zvolPath | string | Backing device, /dev/zvol/<pool>/<name> |
| bus | enum | |
| order? | number | Boot/attach order, if needed |
| Argument | Type | Description |
|---|---|---|
| vmId | number | Owning VM id |
| mac | string | MAC address (pass the source VM's MAC for a same-IP cutover) |
| bridge | string | Host bridge to attach to (e.g. br0) |
| model | enum |
| Argument | Type | Description |
|---|---|---|
| vmId? | number | |
| name? | string |
| Argument | Type | Description |
|---|---|---|
| vmId? | number | |
| name? | string | |
| force | boolean | Hard power-off after graceful |
| Argument | Type | Description |
|---|---|---|
| vmId? | number | |
| name? | string |
| Argument | Type | Description |
|---|---|---|
| vmId? | number | |
| name? | string | |
| deleteZvol | boolean | Also delete the VM's zvols (attached, and zvolPath if given) |
| zvolPath? | string | A dangling zvol device path to remove even if the VM is already gone |
| force | boolean | Override the safety gate: delete even a VM lacking the swamp marker |
Resources
Added 1 models
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned