0

I am trying to add a storage domain on oVirt with iSCSI as storage type, first i need to know whether i am doing this correctly.My understanding is there must be a storage server (target) and Initiator (for the case of oVirt this is oVirt Engine). So i set up an iSCSI target this is the output of targetcli ls on target server

# 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]

then i edited /etc/iscsi/initiatorname.iscsi file and added this line

InitiatorName=iqn.2017-01.ovirt.bamboo:ovirt

Now on oVirt Administration portal when i try to add a data domain with iSCSI as storage type, the targer is discovered but when i try to login i end up with this error message

Error while executing action: Failed to login to iSCSI node due to authorization failure 

image showing this error

Surprisingly i can login into the target from the machine that running oVirt Engine and the disk sda is added

[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

My questions, how comes i can login into the target and the disk is created but when i do it on Ovirt Engine Administration portal i end up with errors? does oVirt Engine use a different Initiator Name from the one in the /etc/iscsi/initiatorname.iscsi file? is there somewhere i can configure oVirt Engine to use a particular Initiator Name? what am i doing wrong? is the whole approach incorrect?

ahmedjaad
  • 137
  • 2
  • 11
  • Nothing about your approach is incorrect, and you've done everything right... up until the Ovirt stuff. I think it's probably pulling an initiator name from somewhere else when you use the portal rather than iscsiadm. Is there nowhere in the Ovirt portal configuration that you can put an initiator name? – Spooler Jan 11 '17 at 16:09
  • Actually that what i was asking my self too, i should have put that on the list of questions. i did not see anywhere on the oVirt Administration portal to configure the initiator name. – ahmedjaad Jan 11 '17 at 16:20

1 Answers1

0

First of all, the initiator cannot be the engine. It needs to be one of the hosts that are actually running VMs. The engine doesn't even need access to the iscsi network, because the hosts are doing all the storage manipulations.

The valid initiator name thus, is the one configured on the virtualization hosts, not the engine.

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • Thanks a lot, this has been very helpful, i am having a difficult time setting up an oVirt platform, i find oVirt to have very insufficient documentation. – ahmedjaad Jan 17 '17 at 16:55
  • new documentation has just been rolled out yesterday – dyasny Jan 17 '17 at 18:11