I've been trying to write a QCOW2 image to an iSCSI LUN target but have been unsuccessful. Based on this link, this should be possible (and should be possible without having to mount the iSCSI LUN as a disk) but from what error I am getting back, it's unclear to me whether what I am trying to do simply can't be done or I have a syntax error in the URL.
The OS is Debian (Proxmox).
Based on this output, the LUN should be visible:
root@delta-vm:~# pvesm list TrueNAS
Volid Format Type Size VMID
TrueNAS:0.0.0.scsi-36589cfc000000f18d78a50cff1dec18b raw images 48318386176
root@delta-vm:~# ls /dev/disk/by-path/
ip-10.0.50.1:3260-iscsi-iqn.2005-10.org.freenas.ctl:delta-proxmox-target-lun-0 pci-0000:00:1f.2-ata-5.0-part1 pci-0000:00:1f.2-ata-5-part2
ip-10.0.60.1:3260-iscsi-iqn.2005-10.org.freenas.ctl:delta-proxmox-target-lun-0 pci-0000:00:1f.2-ata-5.0-part2 pci-0000:00:1f.2-ata-5-part3
pci-0000:00:1f.2-ata-5 pci-0000:00:1f.2-ata-5.0-part3 pci-0000:00:1f.2-ata-6
pci-0000:00:1f.2-ata-5.0
But when I try this, I am confused by the error message
root@delta-vm:~# qemu-img convert -O raw /var/lib/vz/template/iso/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2.img iscsi://10.0.50.1:3260/iscs-iqn.2005-10.org.freenas.ct
l/delta-proxmox-target-lun-0
qemu-img: iscsi://10.0.50.1:3260/iscsi-iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0: error while converting raw: Protocol driver 'iscsi' does not support image creation, and opening the image failed: Failed to parse URL : iscsi://10.0.50.1:3260/iscsi-iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0
I have tried a few permutations of the URL above, but nothing seems to be working. E.g. cutting out the
iscsi-
string in URL doesn't help (the iSCSI Global Config is iqn.2005-10.org.freenas.ctl
):
root@delta-vm:~# qemu-img convert -O raw /var/lib/vz/template/iso/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2.img iscsi://10.0.50.1:3260/iqn.2005-10.org.freenas.ctl/del
ta-proxmox-target-lun-0
qemu-img: iscsi://10.0.50.1:3260/iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0: error while converting raw: Protocol driver 'iscsi' does not support image creation, and opening the image failed: Failed to parse URL : iscsi://10.0.50.1:3260/iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0
Any clues what am I doing wrong? The iSCSI portal(s) are unauthenticated so I am providing no user/pass combination to the URL above.
For full disclosure (and I ack that this is tangential to my question), my ultimate goal with these gyrations would be to see if it's possible to re-target a disk (i.e. move storage) in qemu from local storage to iSCSI LUN but for some reason, this was never properly implemented in Proxmox so I have to take the scenic route. In other words, given this...
root@delta-vm:~# qm config 105
agent: 1
...
onboot: 1
scsi0: samsung:vm-105-disk-0,discard=on,iothread=1,replicate=0,size=12G,ssd=1
scsihw: virtio-scsi-single
....
...I'd like to substitute the scsi0
device with the iSCSI LUN. From what I gather , this currently isn't possible as the code to materialise the disk image onto the LUN simply doesn't exist and an error is thrown (storage migration failed: can't allocate space in iscsi storage
).
EDIT: Some progress - specifying the _size_ argument to the directive changes the error. It looks like there is something definitely wrong with the URL
root@delta-vm:~# qemu-img convert -O raw /var/lib/vz/template/iso/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2.img iscsi://10.0.50.1:3260/iscsi-iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0 10G
qemu-img: Could not open 'iscsi://10.0.50.1:3260/iscsi-iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0': Failed to parse URL : iscsi://10.0.50.1:3260/iscsi-iqn.2005-10.org.freenas.ctl/delta-proxmox-target-lun-0
Asked by quantum
(101 rep)
Mar 6, 2024, 01:16 AM
Last activity: Oct 24, 2024, 11:38 AM
Last activity: Oct 24, 2024, 11:38 AM