主机是kvm宿主机,安装了虚拟化组件
编辑/etc/iscsi/iscsid.conf
[root@192 ~]# vi /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
node.session.auth.username = admin
node.session.auth.password = 123456789123
discovery.sendtargets.auth.authmethod = CHAP
discovery.sendtargets.auth.username = admin
discovery.sendtargets.auth.password = 123456789123
[root@192 ~]# systemctl restart iscsid
[root@192 ~]# iscsiadm -m discovery -t st -p 192.168.0.20
iscsiadm: No portals found \\iscsi服务器上未添加权限,所以这里要先去服务器上添加本机的权限
[root@192 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:335c72a789d \\把iqn添加到服务器
添加完成后重新扫描
[root@192 ~]# iscsiadm -m discovery -t st -p 192.168.0.20
192.168.0.20:3260,1 iqn.1991-05.com.microsoft:win-8olmgmomodt-192.168.10.5-target
192.168.20.20:3260,1 iqn.1991-05.com.microsoft:win-8olmgmomodt-192.168.10.5-target
挂载
[root@192 ~]# iscsiadm -m node -p 192.168.0.20 -l
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:win-8olmgmomodt-192.168.10.5-target, portal: 192.168.0.20,3260] (mul