Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
bcdd943
incusd/storage/truenas: introduce TrueNAS driver
jbendtsen Jan 16, 2025
6a1afab
incusd/storage/truenas: implement intial storage pool creation/removal
Jan 29, 2025
66a3ee3
incusd/storage/truenas: add api-key, url and key-file support
Jan 30, 2025
18020e8
incusd/storage/truenas: implement initial dataset creation/destruction
Jan 30, 2025
08848c9
incusd/storage/truenas: workaround issue with `get` in datasetExists
Jan 30, 2025
05f2cac
incusd/storage/truenas: added initial truenas volume support
Jan 31, 2025
1d35c8f
incusd/storage/truenas: add NFS share creation support
Feb 3, 2025
2a29fce
incusd/storage/truenas: add volume create/delete snapshot support
Feb 3, 2025
7ec110d
incusd/storage/truenas: refactor version handling, add tnHasUpdateShares
Feb 5, 2025
e4186e1
incusd/storage/truenas: rename/clone/origin/delete/move support
Feb 5, 2025
4d763b7
incusd/storage/truenas: getDatasetProperties now supports all|filesys…
Feb 5, 2025
ef3381f
incusd/storage/truenas: add tnHasNfsDeleteByDataset
Feb 5, 2025
77adaee
incusd/storage/truenas: add deleteNfsShare
Feb 5, 2025
5878004
incusd/storage/truenas: verify dataset creation
Feb 5, 2025
edb102a
incusd/storage/truenas: driver fixes and improvements
Feb 10, 2025
35f2229
incusd/storage/truenas: Added host name lookup before mounting NFS share
jbendtsen Feb 8, 2025
f94346e
incusd/storage/truenas: rework nfs dns lookup
Feb 10, 2025
ea3268f
incusd/storage/truenas: added noatime support to MountVolume
Feb 10, 2025
81f9b5f
incusd/storage/truenas: standup initial root.img support
Feb 10, 2025
4a39b2a
incusd/storage/truenas: block mode emulation support
Feb 11, 2025
10a149a
incusd/storage/truenas: strip support for versions truenas-admin < 0.…
Feb 12, 2025
05628b5
incusd/storage/truenas: fix deleted image restore
Feb 13, 2025
0c4746d
incusd/storage/truenas: fix message when attemptingt to clone a volum…
Feb 13, 2025
8678648
incusd/storage/truenas: fix custom block image support
Feb 13, 2025
9c5f70a
incusd/storage/truenas: support for specifying host in source
Feb 13, 2025
e231459
incusd/storage/truenas: fix bug renaming block snapshots
Feb 15, 2025
92b0dd6
incusd/storage/truenas: added createDatasets for batch dataset creation
Feb 18, 2025
c99ddeb
incusd/storage/truenas: Bulk tool calls
jbendtsen Feb 19, 2025
8436555
incusd/storage/truenas: update to truenas_incus_ctl v0.3
Feb 19, 2025
07c8878
incusd/storage/truenas: skip ensureInitialDatasets in Create()
Feb 19, 2025
2c3ec90
incusd/storage/truenas: add loopback img mounting support
Feb 20, 2025
44cc3e7
ncusd/storage/truenas: image/instance creation root.img support
Feb 20, 2025
a2d6c6c
incusd/storage/truenas: implement lxc image and container creation
Feb 20, 2025
9cabb51
incusd/storage/truenas: vm root.img support
Feb 21, 2025
4771ceb
incusd/storage/truenas: added createSnapshot
Feb 24, 2025
bab4397
incusd/storage/truenas: fix CreateVolume attempting to create an FS f…
Feb 24, 2025
717d37b
incusd/storage/truenas: Added getDatasetsAndProperties util
jbendtsen Feb 25, 2025
e41c135
incusd/storage/truenas: empty vm create/destroy support
Feb 24, 2025
ddbd021
incusd/storage/truenas: vm clone/launch support
Feb 26, 2025
b8e920f
incusd/storage/truenas: fixed VMBlock UnmountVolume
Feb 26, 2025
5062a93
incusd/storage/truenas: custom block volume creation
Feb 27, 2025
9dfcc4d
incusd/storage/truenas: SetVolumeQuota for custom blocks
Feb 27, 2025
2620ec6
incusd/storage/truenas: add setDatasetQuota
Feb 27, 2025
4bd7c2e
incusd/storage/truenas: implement setting quota for VM state volume
Feb 27, 2025
f854572
incusd/storage/truenas: CreateVolumeFromCopy now supports snapshots
Mar 6, 2025
76b0524
incusd/storage/truenas: getDatasets now uses generic list
Mar 7, 2025
87d1836
incusd/storage/truenas: fix Create/DeleteVolumeSnapshots for VMs and …
Mar 7, 2025
79ff23b
incusd/storage/truenas: fix snapshot copy for containers/vms
Mar 7, 2025
5725ff1
incusd/storage/truenas: implement RefreshVolume and MigrateVolume
Mar 10, 2025
3e2f02c
incusd/storage/truenas: implement BackupVolume and CreateFromBackup f…
Mar 12, 2025
cc684cf
incusd/storage/truenas: fix CreateVolume recursively deleting existin…
Mar 12, 2025
4bfda84
incusd/storage/truenas: cleanup
Mar 14, 2025
a3fbada
incusd/storage/truenas: remove customblock path customization
Mar 17, 2025
49eb2bf
incusd/storage/truenas: implement GetResources
Mar 17, 2025
735ff0e
incusd/storage/truenas: fix getDatasetProperties, optimize GetResources
Mar 17, 2025
aa537d3
incusd/storage/truenas: implement GetVolumeUsage()
Mar 17, 2025
57ee596
incusd/storage/truenas: update createOrRefresh based on 0.4.2 repl ch…
Mar 18, 2025
9ba6a6f
incusd/storage/truenas: fix repl task --allow-from-scratch handling
Mar 18, 2025
7df25a5
incusd/storage/truenas: cleanup
Mar 19, 2025
1b26792
tests/storage/truenas: added truenas test driver
Mar 24, 2025
c34157a
tests/storage/truenas: re-verified test run, temporarily disabled fai…
Mar 25, 2025
79cb7f3
docs/storage/truenas: add basic usage
Mar 26, 2025
2e7e32c
incusd/archive/unpack: remove superfluous nfs logging
Mar 26, 2025
be5f25e
tests/storage/truenas: improve backend detection
Mar 26, 2025
988c4eb
docs/storage/truenas: correct truenas_incus_ctl url
Mar 26, 2025
4e10211
tests/storage/truenas: correct truenas_incus_ctl detection
Mar 26, 2025
270f89a
tests/storage/truenas: fix test_snapshots
Mar 26, 2025
bd874d6
tests/storage/truenas: fix test_snap_restore
Mar 26, 2025
1206e11
tests/storage/truenas: fix test_incremental_copy
Mar 26, 2025
2fc4ab1
tests/storage/truenas: fix test_container_move
Mar 26, 2025
8f26228
tests/storage/truenas: fix storage_local_volume_handling
Mar 26, 2025
efae306
incusd/storage/truenas: fix issue creating vm images
Mar 27, 2025
17554b6
tests/storage/truenas: enable cluster tests now passing
Mar 27, 2025
dced386
tests/storage/truenas: fix test_storage
Mar 27, 2025
ea52e95
tests/storage/truenas: test_storage_volume_snapshots passing, excepti…
Mar 28, 2025
7729860
test/storage/truenas: disable test_storage_volume_import parts that r…
Mar 28, 2025
b68b4f6
tests/storage/truenas: restore test_storage_volume_import disable
Mar 28, 2025
e31266f
incusd/storage/truenas: implement iso support
Mar 28, 2025
a797788
tests/storage/truenas: re-enable test_storage_volume_import
Mar 28, 2025
2fd8a81
typo: fix typo "storgage"
Mar 28, 2025
93d6613
tests/storage/truenas: add storage create changes
Apr 4, 2025
86d1ad7
tests/storage/truenas: added truenas test driver
Mar 24, 2025
95bf711
tests/storage/truenas: re-verified test run, temporarily disabled fai…
Mar 25, 2025
d27b2ac
docs/storage/truenas: add basic usage
Mar 26, 2025
6b7ad24
tests/storage/truenas: improve backend detection
Mar 26, 2025
d2f5620
docs/storage/truenas: correct truenas_incus_ctl url
Mar 26, 2025
d6a43bb
tests/storage/truenas: correct truenas_incus_ctl detection
Mar 26, 2025
cedee3c
tests/storage/truenas: fix test_snapshots
Mar 26, 2025
914eb9f
tests/storage/truenas: fix test_snap_restore
Mar 26, 2025
a9b94d5
tests/storage/truenas: fix test_incremental_copy
Mar 26, 2025
4be0680
tests/storage/truenas: enable cluster tests now passing
Mar 27, 2025
47c9002
tests/storage/truenas: fix test_storage
Mar 27, 2025
8d2d205
tests/storage/truenas: test_storage_volume_snapshots passing, excepti…
Mar 28, 2025
6db3df0
test/storage/truenas: iso support implemented
Mar 28, 2025
6f6f0a3
tests/storage/truenas: use basedir instead of uuid for remote pool
Apr 8, 2025
6840489
incusd/storage/truenas: switch volume -> volsize
Apr 10, 2025
b6d4d7b
incusd/storage/truenas: add --parsable to activate/locate
Apr 10, 2025
4cf32bd
tests/storage/truenas: increase timeout for `storage delete`
Apr 10, 2025
1131df7
incusd/storage/truenas: add MountVolumeSnapshot/UnmountVolumeSnapshot…
Apr 10, 2025
b2638ef
tests/storage/truenas: restore storage_volume_snapshots tests
Apr 11, 2025
c9cacdc
tests/storage/truenas: disable PKI tests
Apr 11, 2025
363afe8
incusd/storage/truenas: add support for iscsi target-prefix
Apr 29, 2025
23ea6b7
tests/storage/truenas: add truenas disables
Apr 29, 2025
ed9554f
tests/storage/truneas: re-enable suites that are now passing
Apr 29, 2025
9428fa7
tests/storage/truenas: add truenas support to backup tests
May 1, 2025
a0d53f2
incusd/storage/truenas: add support for vm.state block devices to Lis…
May 1, 2025
3e19528
incusd/storage/truenas: eliminate calls to locate an iscsi dataset be…
May 1, 2025
ebd5c7c
incusd/storage/truneas: fix activatevolume when volume has no iscsi s…
May 7, 2025
b029cc9
tests/storage/truenas: add delay for re-try, add information on disab…
May 7, 2025
ac91a58
incusd/storage/truenas: workaround for truenas middleware race condit…
May 8, 2025
b22a393
incusd/storage/truenas: add debug log when performing cluster move
May 8, 2025
f52fbb3
tests/storage/truenas: disable failuring TN tests
May 8, 2025
414aec4
incusd/storage/truenas: add bug reference for iscsi.target race
May 9, 2025
bba88e6
incusd/storage/truenas: fix issue where incus:content_type is not cop…
May 9, 2025
4a28e22
incusd/storage/truenas: fix ListVolumes
May 9, 2025
e990baf
incusd/storage/truenas: add SyncFS before snapshot in CreateVolumeSna…
May 9, 2025
39b4fe6
tests/storage/truenas: enable more tests
May 9, 2025
b3c870a
incusd/storage/truenas: fix DeleteVolume and ListVolumes support for …
May 12, 2025
9ab9e3e
incusd/storage/truenas: parseConfig now called from FillConfig instea…
May 12, 2025
7787d04
tests/storage/truenas: re-enable container_recovery test
May 12, 2025
9e8d81f
incusd/storage/truenas: rename revert -> reverter
May 12, 2025
f5c4153
incusd/storage/truenas: now use implicit deactivation in DeleteVolume
May 13, 2025
149a0c9
incusd/storage/truenas: ignore "cannot shrink" zvol errors from middl…
May 13, 2025
23c3c08
incusd/storage/truenas: add CacheVolumeSnapshots
May 13, 2025
4ca170f
test/storage/truenas: re-enable project limits tests
May 13, 2025
cc46322
incusd/storage/truenas: fix passing lock by value
May 13, 2025
6d25751
incusd/storage/truenas: remove nfs support code
May 13, 2025
be36670
incusd/storage/truenas: stripped DeleteVolumeSnapshotOld
May 13, 2025
dd77b2c
incusd/storage/truenas: remove SetVolumeQuotaOld
May 15, 2025
16f3965
incusd/storage/truenas: enable remote driver functionality
May 15, 2025
871b33c
incusd/storage/truenas: add truenas.force_reuse property
May 15, 2025
2aaaa9f
incusd/storage/truenas: refactor properties, add support for tool v0.…
May 20, 2025
b1a22f8
incusd/storage/truenas: disable --allow-shrink
May 20, 2025
d5eddac
docs/storage/truenas: add current props docs
May 21, 2025
8a5a8be
incusd/storage/truenas: add support for v0.6.1 `locate --create`
May 21, 2025
9aee34e
incusd/storage/truenas: replace zfs.* props with truenas.* props
May 22, 2025
c231b06
incusd/storage/truenas: replace shorthand flags with longhand versions
May 22, 2025
cfbd90c
incusd/storage/truenas: simplified Update(changedConfig)
May 22, 2025
6971206
incusd/storage/truenas: add --allow-shrink
May 22, 2025
14856ac
incusd/storage/truenas: allow-shrink -> allow-shrinking
May 23, 2025
18cb447
incusd/storage/truenas: removed truenas.block_mode
May 23, 2025
5e5d5af
incusd/storage/truenas: stripped block_mode=false support
May 23, 2025
0faa239
incusd/storage/truenas: truenas.blocksize now only refers to volblock…
May 23, 2025
bc9f529
incusd/storage/truenas: remove truenas.reserve_space
May 23, 2025
e21af64
incusd/storage/truenas: remove needsRecursion
May 23, 2025
f65357d
incusd/storage/truenas: snapshot rename now calls tool directly
May 26, 2025
01e5b52
test/storage/truenas: disabled flaky test
May 26, 2025
9aa215f
incusd/storage/truenas: remove TODO
May 26, 2025
e2d7ef0
typo: TrueBAS -> TrueNAS
May 26, 2025
a17fbf0
incusd/storage/truenas: add support for `locate` statuses
May 27, 2025
8f38f08
incusd/storage/truenas: optimize snapshot name handling
May 27, 2025
1827f92
incusd/storage/truenas: replace calls to fmt.Errorf with errors.New w…
May 27, 2025
3f9e478
incusd/storage/truenas: UnmountVolumeSnapshot now deletes and deactiv…
May 28, 2025
c9f97ae
incusd/storage/truenas: temp snapshot volume names now include Server…
May 28, 2025
a5effcf
incusd/storage/truenas: retry deleting busy datasets
May 28, 2025
80e5855
api: add storage_driver_truenas extension
May 29, 2025
4c09e7d
test/storage/truenas: add stub truenas storage driver test
May 29, 2025
6a18a40
incusd/storage/truenas: pickup missed changes from merge
May 29, 2025
2152558
incusd/storage: remove spurious cr
May 29, 2025
b3826ce
test/truenas: fix lint
May 29, 2025
922717b
test/truenas: restore main.sh to master
May 30, 2025
eb3bd5e
tests/truenas: add main-tn.sh
May 30, 2025
4214bce
typo: fix typos from codespell.sh
May 30, 2025
5138c3b
doc/truenas: lint
May 30, 2025
2d51a52
incusd/storage/truenas: update min tool version to v0.6.2
May 30, 2025
7e17cf7
incusd/storage/truenas: de-lint
May 30, 2025
ba9befb
incusd/storage/truenas: gofumpt
May 30, 2025
1228e67
doc: add TrueNAS
May 30, 2025
9670ffd
incusd/storage/truenas: fix import lint
May 30, 2025
8cb72ca
incusd/storage/truenas: add truenas.initiator and portal properties
May 30, 2025
3a569c4
incusd/storage/truenas: add validation/update support for portal/init…
May 30, 2025
adc2112
incusd/storage/truenas: update min version to 0.6.3
Jun 2, 2025
8f0a428
lint: functional blocks are followed by newlines
Jun 2, 2025
008b793
docs/truenas: document additional properties
Jun 2, 2025
107d404
docs/lint: update wordlist
Jun 2, 2025
fbbf837
incusd/storage/truenas: de-lint oneline assign & test
Jun 2, 2025
6a765ea
tests/truenas: delint: no trailing spaces in shell scripts
Jun 2, 2025
80a5b48
test/truenas: delint: trailing space in script:
Jun 2, 2025
7b5858b
incusd/storage/truenas: verify iscsi setup during Create()
Jun 4, 2025
7d10957
tests/truenas: update truenas test environment variables
Jun 4, 2025
fea6ea2
tests/truenas: restore uuidgen for test pool naming
Jun 4, 2025
8b10878
incusd/storage/truenas: enable --setup code
Jun 4, 2025
ba23b45
typo: remove spurious x
Jun 4, 2025
1fb838c
tests/truenas: replace references to env variables with truenas funct…
Jun 4, 2025
1badd7c
tests: add helpful error when INCUS_TRUENAS_DATASET is not defined
Jun 4, 2025
c802ef5
tests: add storage_driver_truenas
Jun 5, 2025
c122ccc
incusd/storage/truenas: work-around of iscsiadm race condition
Jun 5, 2025
904efc5
tests/truenas: enable truenas storage driver tests for all fs
Jun 5, 2025
25f4d25
tests/truenas: de-lint: Double quote to prevent globbing and word spl…
Jun 5, 2025
57db896
typo: alrady -> already
Jun 5, 2025
1d1857a
test/truenas: fix storage_snapshots test
Jun 5, 2025
c27890c
incusd/storage/truenas: de-lint: functional blocks are followed by ne…
Jun 5, 2025
732e9a5
incusd/storage/truenas: remove workaround for cant stat error
Jun 6, 2025
7aa2e62
test/truenas: enable xfs and btrfs testing
Jun 6, 2025
260cf84
incusd/storage/truenas: verify and setup iscsi on mount
Jun 6, 2025
302c8c7
incusd/storage/truenas: replace usage of activateIscsiShare with loca…
Jun 10, 2025
8921986
tests/migration: add truenas to clone_copy test
Jun 11, 2025
1262df8
incusd/storage/truenas: add deactivate --wait support
Jun 11, 2025
bd7d982
incusd/storage/truenas: sync devices before snapshot
Jun 12, 2025
87bf599
incusd/storage/truenas: retry command POST EOF failures
Jun 12, 2025
c1e66f4
incusd/storage/truenas: remove args from POST EOF error
Jun 12, 2025
12403c9
test/container_recover: fix truenas recovery keys
Jun 12, 2025
23d309e
incusd/storage/truenas: use batch existance check for ImageFS deletion
Jun 12, 2025
0489150
test/storage/truenas: unset fs to prevent later failures
Jun 12, 2025
1df2c20
delint: spelling, shadows, comment periods, newlines after blocks, tr…
Jun 12, 2025
bbc106d
test/cluster/truenas: skip cluster tests for truenas
Jun 25, 2025
ff7e0dc
incusd/storage/trunas: remove non-desirable wordlist entries
Jul 31, 2025
6b29ecb
tests/snapshots/truenas: iteratively remove instances to prevent time…
Jul 31, 2025
cfba7be
tests/truenas: refuse to run cluster tests with TrueNAS backend
Jul 31, 2025
7b6dc0d
incusd/storage/truenas: strip out truenas.config_file support
Jul 31, 2025
3fac21a
docs/storage/truenas: strip out truenas.config_file support
Jul 31, 2025
39853da
tests/storage/truenas: stripout TRUENAS_CONFIG_FILE support
Jul 31, 2025
eb59b75
tests: delint supprt -> support
Jul 31, 2025
ef2937f
docs: attempt to fix "spelling"
Jul 31, 2025
b8aefe8
tests: fix truenas cluster exclusion logic
Jul 31, 2025
64df973
docs: spelling
Jul 31, 2025
9732cee
docs: escape truenas.example.com
Jul 31, 2025
33c00ce
docs/storage/truenas: update truenas storage documention with more de…
Aug 1, 2025
161188d
tests/storage/truenas: remove main-tn.sh test file
Aug 1, 2025
695c427
docs/storage: correct url coding
Aug 1, 2025
50bef0e
test/storage: delint trailing space
Aug 1, 2025
f47f1e9
tests/truenas: standardize indention
Aug 1, 2025
71656f0
tests/storage/truenas: iteratively delete instances
Aug 1, 2025
7a95cb4
docs: spelling
Aug 1, 2025
4923482
docs/truenas: removed "Passed as ..." uncessary detail
Aug 1, 2025
23b66d7
test/basic_usage: improve auto-restart test loop
Aug 5, 2025
6fc4ebc
tests/truenas: add INCUS_TRUENAS_ALLOW_INSECURE
Aug 6, 2025
82f1052
tests: remove obsolete truenas exclusions
Aug 6, 2025
0cfe4d7
incusd/storage/truenas: add IPv6 support to source property
Aug 6, 2025
ae96b65
tests: delint
Aug 6, 2025
f27d435
incusd/storage/truenas: add explicit error handling when for locate c…
Aug 12, 2025
31a57b4
incusd/storage/truenas: update EnsureMountPath usage
Aug 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bugfix
bugfixes
Centos
Ceph
CephFS
Ceph's
CephFS
CFS
cgroup
cgroupfs
Expand Down Expand Up @@ -106,6 +106,7 @@ GID
GIDs
Github
Golang
Goldeye
goroutines
GPUs
Grafana
Expand Down Expand Up @@ -139,6 +140,7 @@ IPAM
IPs
IPv
IPVLAN
iSCSI
JIT
jq
JSON
Expand All @@ -161,8 +163,8 @@ LTS
LV
LVM
LXC
LXCFS
LXC's
LXCFS
LXD
LXD's
macOS
Expand Down Expand Up @@ -270,6 +272,7 @@ simplestreams
SLAAC
SMTP
Snapcraft
snapshotted
SNAT
Solaris
SPAs
Expand Down Expand Up @@ -315,6 +318,7 @@ tmpfs
toolchain
topologies
TPM
TrueNAS
TSIG
TTL
UDP
Expand Down
4 changes: 4 additions & 0 deletions doc/api-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2869,3 +2869,7 @@ The following target keys are supported:
* `logging.NAME.target.retry` (How many times to retry the transmission)

The webhook data matches what's sent over the existing events API.

## `storage_driver_truenas`

This adds a TrueNAS storage driver.
85 changes: 85 additions & 0 deletions doc/howto/storage_pools.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,91 @@ Use the existing Ceph Object Gateway `https://www.example.com/radosgw` to create

incus storage create pool1 cephobject cephobject.radosgw.endpoint=https://www.example.com/radosgw
````
````{group-tab} TrueNAS

The `truenas` storage driver enables an Incus node to use a remote TrueNAS storage server to host one or more Incus storage pools. When the node is part of a cluster, all cluster members can access the storage pool simultaneously, making it ideal for use cases such as live migrating virtual machines (VMs) between nodes.

The driver operates in a block-based manner, meaning that all Incus volumes are created as ZFS Volume block devices on the remote TrueNAS server. These ZFS Volume block devices are accessed on the local Incus node via iSCSI.

Modeled after the existing ZFS driver, the `truenas` driver supports most standard ZFS functionality, but operates on remote TrueNAS servers. For instance, a local VM can be snapshotted and cloned, with the snapshot and clone operations performed on the remote server after synchronizing the local file system. The clone is then activated through iSCSI as necessary.

The driver relies on the [`truenas_incus_ctl`](https://github.com/truenas/truenas_incus_ctl) tool to interact with the TrueNAS API and perform actions on the remote server. This tool also manages the activation and deactivation of remote ZFS Volumes via `open-iscsi`. If `truenas_incus_ctl` is not installed or available in the system's PATH, the driver will be disabled.

To install the required tool, download the latest version (v0.7.2+ is required) from the [`truenas\_incus\_ctl` GitHub page](https://github.com/truenas/truenas_incus_ctl). Additionally, ensure that `open-iscsi` is installed on the system, which can be done using:

`sudo apt install open-iscsi`

#### Logging in to the TrueNAS host

As an alternative to manually creating an API Key and supplying using the `truenas.api_key` property, you can instead `login` to the remote server using the `truenas_incus_ctl` tool.

`sudo truenas_incus_ctl config login`

This will prompt you to provide connection details for the TrueNAS server, including authentication details, and will save the configuration to a local file. After logging in, you can verify the iSCSI setup with:

`sudo truenas_incus_ctl share iscsi setup --test`

Once the tool is configured, you can use it to interact with remote datasets and create storage pools:

`incus storage create <poolname> truenas source=[host:]<pool>[/<dataset>]/[remote-poolname]`

In this command:

* `source` refers to the location on the remote TrueNAS host where the storage pool will be created.
* `host` is optional, and can be specified using the `truenas.host` property, or by specifying a configuration with `truenas.config`
* If `remote-poolname` is not supplied, it will default to the name of the local pool.

#### Configuration

Each storage pool corresponds to a ZFS dataset on a remote TrueNAS host. The dataset is created automatically if it does not exist. The driver uses ZFS features available on the remote host to support efficient image handling, copy operations, and snapshot management without requiring nested ZFS (ZFS-on-ZFS).

To reference a remote dataset, the `source` property can be specified in the form:
`[<remote host>:]<remote pool>[[/<remote dataset>]...][/]`

If the path ends with a trailing `/`, the dataset name will be derived from the Incus storage pool name (e.g., `tank/pool1`).

| Key | Type | Default | Description
| -------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------
| `source` | string | - | ZFS dataset to use on the remote TrueNAS host. Format: `[<host>:]<pool>[/<dataset>][/]`. If `host` is omitted here, it must be set via `truenas.host`.
| `block.filesystem` | string | ext4 | File system to use when formatting block devices.
| `block.mount_options` | string | - | Mount options to use when mounting block devices.
| `truenas.allow-insecure` | boolean | false | If set to `true`, allows insecure (non-TLS) connections to the TrueNAS API.
| `truenas.api_key` | string | - | API key used to authenticate with the TrueNAS host.
| `truenas.blocksize` | string | - | Block size to use for newly created ZFS Volumes.
| `truenas.host` | string | - | Hostname or IP address of the remote TrueNAS system. Optional if included in the `source`, or a configuration is used.
| `truenas.dataset` | string | - | Remote dataset name. Typically inferred from `source`, but can be overridden.
| `truenas.initiator` | string | - | iSCSI initiator name used during block volume attachment.
| `truenas.portal` | string | - | iSCSI portal address to use for block volume connections.
| `truenas.remove_snapshots` | boolean | false | If enabled, instructs the driver to remove old snapshots automatically.
| `truenas.use_refquota` | boolean | false | If enabled, uses ZFS `refquota` instead of `quota`.

#### Example usage

To create a storage pool using dataset `tank/pool1` on `truenas.example.com` and authenticate using an API key in the environment variable `TN_APIKEY`:

`incus storage create pool1 truenas source=truenas.example.com:tank/ truenas.api_key=$TN_APIKEY`

To use a specific dataset:

`incus storage create pool1 truenas source=truenas.example.com:tank/remote-dataset truenas.api_key=$TN_APIKEY`

Or, specify the host separately:

`incus storage create pool1 truenas source=tank/remote-dataset truenas.host=truenas.example.com truenas.api_key=$TN_APIKEY`

Or, use a pre-existing configuration, which specifies the host and API key using the `truenas_incus_ctl config` functionality:

`incus storage create pool1 truenas source=tank/remote-dataset truenas.config=my-config`

```{note}
TrueNAS 25.10 - Goldeye, currently has a performance bottleneck which affects the performance of the TrueNAS Storage driver when
creating and destroying instances.

Creation can take circa 4s, and deletion can take circa 10-30s. If a high instance churn is expected, then TrueNAS may not be an appropriate storage driver for your work-load.

See: [`https://github.com/truenas/middleware/pull/16614`](https://github.com/truenas/middleware/pull/16614)
```
````
`````

(storage-pools-cluster)=
Expand Down
Loading
Loading