我正在尝试在 oVirt 上添加一个存储域,存储类型为 iSCSI,首先我需要知道我是否正确执行了此操作。我的理解是必须有一个存储服务器(目标)和启动器(对于 oVirt 的情况,这是 oVirt Engine)。因此我设置了一个 iSCSI 目标,这是目标服务器上 targetcli ls 的输出
# targetcli ls
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- block .................................................................................................. [Storage Objects: 1]
| | o- bamboo_disk .................................................... [/dev/mapper/cl-bamboo_lv (300.0GiB) write-thru activated]
| o- fileio ................................................................................................. [Storage Objects: 0]
| o- pscsi .................................................................................................. [Storage Objects: 0]
| o- ramdisk ................................................................................................ [Storage Objects: 0]
o- iscsi ............................................................................................................ [Targets: 1]
| o- iqn.2017-01.ovirt.bamboo:bamboo ................................................................................... [TPGs: 1]
| o- tpg1 ............................................................................................... [no-gen-acls, no-auth]
| o- acls .......................................................................................................... [ACLs: 1]
| | o- iqn.2017-01.ovirt.bamboo:ovirt ....................................................................... [Mapped LUNs: 1]
| | o- mapped_lun0 ........................................................................... [lun0 block/bamboo_disk (rw)]
| o- luns .......................................................................................................... [LUNs: 1]
| | o- lun0 ................................................................... [block/bamboo_disk (/dev/mapper/cl-bamboo_lv)]
| o- portals .................................................................................................... [Portals: 1]
| o- 0.0.0.0:3260 ..................................................................................................... [OK]
o- loopback ......................................................................................................... [Targets: 0]
然后我编辑了 /etc/iscsi/initiatorname.iscsi 文件并添加了这一行
InitiatorName=iqn.2017-01.ovirt.bamboo:ovirt
现在,在 oVirt 管理门户上,当我尝试添加以 iSCSI 为存储类型的数据域时,会发现目标,但当我尝试登录时,会出现此错误消息
Error while executing action: Failed to login to iSCSI node due to authorization failure
令人惊讶的是,我可以从运行 oVirt Engine 的机器登录目标,并且添加了磁盘 sda
[root@ovirt ~]# iscsiadm -m node -T iqn.2017-01.ovirt.bamboo:bamboo -p 10.1.10.3:3260 -l
Logging in to [iface: default, target: iqn.2017-01.ovirt.bamboo:bamboo, portal: 10.1.10.3,3260] (multiple)
Login to [iface: default, target: iqn.2017-01.ovirt.bamboo:bamboo, portal: 10.1.10.3,3260] successful.
[root@ovirt ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 300G 0 disk
sr0 11:0 1 1024M 0 rom
vda 252:0 0 600G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└──vda2 252:2 0 199G 0 part
├─cl_ovirt-root 253:0 0 100G 0 lvm /
├─cl_ovirt-swap 253:1 0 3.9G 0 lvm [SWAP]
└─cl_ovirt-home 253:2 0 2G 0 lvm /home
我的问题是,为什么我可以登录目标并创建磁盘,但当我在 Ovirt Engine 管理门户上执行此操作时却出现错误?oVirt Engine 使用的启动器名称是否与 /etc/iscsi/initiatorname.iscsi 文件中的启动器名称不同?我是否可以在某处配置 oVirt Engine 以使用特定的启动器名称?我做错了什么?整个方法是否不正确?
答案1
首先,启动器不能是引擎。它必须是实际运行虚拟机的主机之一。引擎甚至不需要访问 iscsi 网络,因为主机正在执行所有存储操作。
因此,有效的启动器名称是在虚拟化主机上配置的名称,而不是引擎上配置的名称。