[pve-devel] [PATCH v2 storage 1/2] fix #5071: zfs over iscsi: add 'zfs-base-path' configuration option
Christoph Heiss
c.heiss at proxmox.com
Thu Jun 5 13:02:14 CEST 2025
Tested the series by setting up a iSCSI target using targetcli(d) (on a
separate PVE 8.4 system as a base, due to ZFS goodies) and then adding a
ZFS-over-iSCSI storage using the LIO provider to a test cluster.
Confirmed that
- `zfs-base-path` is correctly detected when adding the storage
- the iSCSI storage is seen correctly after setting up and that VM disks
can be (live-)migrated to the ZFS-over-iSCSI storage w/o problems.
One small comment inline, just a typo in the API description.
Please consider the series in any case
Tested-by: Christoph Heiss <c.heiss at proxmox.com>
--
One unrelated thing I noticed during testing, but wanted to note for
reference:
When one hits the error due to a bad `zfs-base-path` (e.g. as currently
happens):
`TASK ERROR: storage migration failed: Could not open /dev/<poolname>/vm-100-disk-0`
the target zvol isn't cleaned up, e.g. the above would result in
`<poolname>/vm-100-disk-0` still being present on the remote zpool.
Fortunately this doesn't really break anything, as the next available
disk number (in this case, `vm-100-disk-1`), is chosen automatically
anyway when creating a new disk.
On Tue May 27, 2025 at 3:34 PM CEST, Fiona Ebner wrote:
> Use '/dev/zvol' as a base path for new storages for providers 'iet'
> and 'LIO', because that is what modern distributions use.
>
> This is a breaking change regarding the addition of new storages on
> older distributions, but it's enough to specify the base path '/dev'
> explicitly for setups that require it.
>
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
[..]
> diff --git a/src/PVE/Storage/ZFSPlugin.pm b/src/PVE/Storage/ZFSPlugin.pm
> index 94cb11f..64f1eda 100644
> --- a/src/PVE/Storage/ZFSPlugin.pm
> +++ b/src/PVE/Storage/ZFSPlugin.pm
> @@ -39,13 +39,13 @@ my $zfs_get_base = sub {
> my ($scfg) = @_;
>
> if ($scfg->{iscsiprovider} eq 'comstar') {
> - return PVE::Storage::LunCmd::Comstar::get_base;
> + return PVE::Storage::LunCmd::Comstar::get_base($scfg);
> } elsif ($scfg->{iscsiprovider} eq 'istgt') {
> - return PVE::Storage::LunCmd::Istgt::get_base;
> + return PVE::Storage::LunCmd::Istgt::get_base($scfg);
> } elsif ($scfg->{iscsiprovider} eq 'iet') {
> - return PVE::Storage::LunCmd::Iet::get_base;
> + return PVE::Storage::LunCmd::Iet::get_base($scfg);
> } elsif ($scfg->{iscsiprovider} eq 'LIO') {
> - return PVE::Storage::LunCmd::LIO::get_base;
> + return PVE::Storage::LunCmd::LIO::get_base($scfg);
> } else {
> $zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
> }
> @@ -204,6 +204,12 @@ sub properties {
> description => "target portal group for Linux LIO targets",
> type => 'string',
> },
> + 'zfs-base-path' => {
> + description => "Base path where to look for the created ZFS block devices. Set"
> + ." automatically during creation if not specificed. Usually '/dev/zvol'.",
small typo :^)
s/specificed/specified/g
More information about the pve-devel
mailing list