Error creating VM on FreeNAS

Ronald Vyhmeister

New Member
Jan 10, 2019
I have a new installation of Proxmox 5.3, and have attached a FreeNAS to it using ZFS over iSCSI. When I try to just use iSCSI it does not connect properly.

Everything seems to go right until I try to create a VM on the FreeNAS. On the one hand it appears to create it, and then it also gives an error and dies... See the message and screenshot below. It shows the disks created, but I can't remove them. Any ideas?

Thanks in advance!

The error:

sh:1: no such file or directory: /usr/sbin/stmfadm
TASK ERROR: unable to create VM 105 - error with cfs lock 'storage-freenas': command '/usr/bin/ssh -o 'BatchMode=yes' -i /etc/pve/priv/zfs/ root@ /usr/sbin/stmfadm create-lu -p 'wcd=false' -p 'guid=600144f2279279f6b3e955273f4c6bd7' /dev/zvol/rdsk/Storage/vm-105-disk-0' failed: exit code 127

hm - it seems like you're using the wrong provider for ZFS over iSCSI?
/usr/sbin/stmfadm belongs to Solaris/Comstar implementation - AFAIK FreeBSD/FreeNAS has a different implementation (istgt if I remember correctly) - the exit code 127 also indicates that the stmfadm command is missing.
Hi Stoiko,

Thanks for this reminder... I fixed the Comstar to istgt.... and that error is gone, but it gives this one:

TASK ERROR: unable to create VM 200 - error with cfs lock 'storage-freenas': No configuration found. Install istgt on at /usr/share/perl5/PVE/Storage/LunCmd/ line 99.

Looking at the file, lines 13 and 14 show

'/usr/local/etc/istgt/istgt.conf', # FreeBSD, FreeNAS
'/var/etc/iscsi/istgt.conf' # NAS4Free

The interesting thing is that FreeNAS has no /usr/local/etc/istgt directory, and certainly no configuration file... this is a clean install... where do I go now?

Thanks in advance!

As written on our docs the supported backends are Comstar (Solaris), istgt (FreeBSD), LIO (modern linux), IET (legacy linux).

I guess FreeNAS has a different iscsi-target implementation, despite being based on FreeBSD (haven't used FreeNAS).
IIRC there was an external repository with an implementation for ZFS over iSCSI and FreeNAS - but since it's external I do not know whether it still works
Please search the threads as this topic is discussed on other posts.
FreeNAS changed their iscsi implementation from istgt to ctld, so you will need to apply a patch.
Github: TheGrandWazoo/freenas-proxmox


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!