将 QCOW2 映像写入 iSCSI LUN?

将 QCOW2 映像写入 iSCSI LUN?

我一直在尝试将 QCOW2 映像写入 iSCSI LUN 目标,但没有成功。基于链接,这应该是可能的(并且应该是可能的,而无需将 iSCSI LUN 作为磁盘安装),但是从我返回的错误中,我不清楚我正在尝试做的事情是否根本无法完成,或者我URL 中有语法错误。

操作系统是 Debian (Proxmox)。

根据此输出,LUN 应该可见:

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 

但是当我尝试这个时,我对错误消息感到困惑

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

我已经尝试了上面 URL 的一些排列,但似乎没有任何效果。例如,删除iscsi-URL 中的字符串没有帮助(iSCSI 全局配置是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

有什么线索我做错了什么吗? iSCSI 门户未经身份验证,因此我没有向上面的 URL 提供用户/密码组合。

为了充分披露(我承认这与我的问题无关),我这些回转的最终目标是看看是否可以将 qemu 中的磁盘(即移动存储)从本地存储重新定位到 iSCSI LUN,但对于出于某种原因,这在 Proxmox 中从未得到正确实施,所以我必须走风景优美的路线。换句话说,鉴于此...

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
....

...我想scsi0用 iSCSI LUN 替换该设备。从我收集,目前这是不可能的,因为将磁盘映像具体化到 LUN 上的代码根本不存在,并且会引发错误 ( storage migration failed: can't allocate space in iscsi storage)。

编辑:一些进展 - 指定尺寸该指令的参数会更改错误。看起来 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

相关内容