Skip to main content

Truenas

@mccormick/truenasv2026.06.09.1· 1mo agoMODELS
01README

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.

02Models2
inventory.tsv2026.06.09.1

Global Arguments

ArgumentTypeDescription
endpointstringTrueNAS host or base URL, e.g. truenas.example.net or
apiKeystringTrueNAS API key (read-only is sufficient); supply via
insecureSkipTlsVerifybooleanSkip TLS verification (limited support over WebSocket — prefer a
backendenumGuest backend: 'incus' (SCALE 24.10+), 'libvirt' (legacy), or 'auto'
timeoutSecsnumberPer-discovery WebSocket timeout in seconds
fn discover()
Query TrueNAS for every guest VM in one call and write one vm

Resources

vm— A TrueNAS-managed guest VM (Incus instance or libvirt VM)
vm.tsv2026.06.09.1

Global Arguments

ArgumentTypeDescription
endpointstringTrueNAS host or base URL, e.g. truenas.example.net
apiKeystringTrueNAS API key (read-write — provisioning mutates VMs and datasets);
insecureSkipTlsVerifybooleanSkip TLS verification (limited over WebSocket — prefer a trusted CA)
timeoutSecsnumberPer-call WebSocket timeout in seconds
fn create_zvol()
Create a sparse/thick ZFS volume to back a guest disk (idempotent;
fn create_vm()
Create a libvirt VM (idempotent on name). Stamps the swamp marker
fn attach_disk()
Attach a zvol to a VM as a DISK device (idempotent on the device path).
fn attach_nic()
Attach a NIC to a VM with a fixed MAC (idempotent on the MAC). Pass
fn start()
Start a VM and poll briefly for the running state.
fn stop()
Stop a VM (graceful, then force when requested).
fn status()
Read a VM
fn delete()
Delete a VM (and optionally its zvols). Refuses a VM lacking the

Resources

zvol— A ZFS volume backing a guest disk
vm_instance— A TrueNAS libvirt VM created or observed by this model
03Previous Versions3
2026.06.07.2
2026.06.07.1

Added 1 models

2026.06.04.1
04Stats
A
100 / 100
Downloads
2
Archive size
40.3 KB
  • 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
05Platforms
06Labels