iSCSI: Failed to connect to LUN : iscsi_service failed

mbartho

Member
Jan 5, 2021
8
0
6
48
We are working on setting up a ZFS to iSCSI share on Freenas. We have the SSH keys setup up, installed the patches, and set up the zfs to iscsi share in proxmox. It appears to be connected is showing as available and reports the correct available storage. However, when we attempt to move the hard drive of a VM from the current location to the new storage, we receive the following error:

Code:
create full clone of drive scsi0 (Jarhead-Virtual:201/vm-201-disk-0.raw)
iscsiadm: No session found.
transferred: 0 bytes remaining: 33554432 bytes total: 33554432 bytes progression: 0.00 %
qemu-img: Could not open 'file.driver=iscsi,file.transport=tcp,file.initiator-name=iqn.1993-08.org.debian:01:cc69eb10e3cb,file.portal=10.0.1.4,file.target=iqn.2005-10.org.freenas.ctl:proxmox-iscsi-lab,file.lun=0,driver=raw': iSCSI: Failed to connect to LUN : iscsi_service failed with : iscsi_service_reconnect_if_loggedin. Can not reconnect right now.

TASK ERROR: storage migration failed: copy failed: command '/usr/bin/qemu-img convert -p -n -f raw --target-image-opts /mnt/pve/Jarhead-Virtual/images/201/vm-201-disk-0.raw 'file.driver=iscsi,file.transport=tcp,file.initiator-name=iqn.1993-08.org.debian:01:cc69eb10e3cb,file.portal=10.0.1.4,file.target=iqn.2005-10.org.freenas.ctl:proxmox-iscsi-lab,file.lun=0,driver=raw'' failed: exit code 1

Can anyone provide insight into the cause of the problem and hopefully a resolution? We have looked all over and have not been able to find a solution.
 
Last edited:
Hi,

Just fixed this with commit 0b760eefc3ae8787e4d83235ca20e2ae886cf166.

In TrueNAS-Scale the slashes (/) needed to be converted to dashes (-) which it was doing but only the first slash (/). Adding the 'g' parameters to the regex substitution fixed this.
You may need to 'edit' your extents on the TrueNAS to fix this or some other way to make it look like Jarhead-Virtual:201-vm-201-disk-0.raw.
 
Hi, have some problem, I can't understand your comment on how to correct it, if you can tell me with more details, thanks

command
/usr/bin/qemu-img convert -p -n -f raw --target-image-opts /mnt/pve/NAS00.DISK/images/167/vm-167-disk-0.raw 'file.driver=iscsi,file.transport=tcp,file.initiator-name=iqn.1993-08.org.debian:01:a0fd17a7dc2f,file.portal=30.30.30.30,file.target=iqn.iscsi.rak.00.nas.urbs:zfs,file.lun=1,driver=raw'

error
qemu-img: Could not open 'file.driver=iscsi,file.transport=tcp,file.initiator-name=iqn.1993-08.org.debian:01:a0fd17a7dc2f,file.portal=30.30.30.30,file.target=iqn.iscsi.rak.00.nas.urbs:zfs,file.lun=1,driver=raw': iSCSI: Failed to connect to LUN : iscsi_service failed with : iscsi_service_reconnect_if_loggedin. Can not reconnect right now.
 
Last edited:
I solved my problem, I had the portal configured wrong and I needed to execute the commands

"7. Once you have added the ZFS over iSCSI space within Proxmox GUI, you must log in to the iSCSI target from each node with the following commands:
iscsiadm --mode discovery --op update --type sendtargets --portal [Portal IP]
iscsiadm -m node -T [BaseName:TargetName] -p [Portal IP] -l
8. Verify the iSCSI connection with the following commands:
iscsiadm -m node
iscsiadm -m session"

from the guide, I am attaching the guide I found again, so that it may be of use to someone else, with these guides I was able to configure ZFS over ISCSI
 

Attachments

About

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!