1
votes

I'm struggling to get iscsiadm to connect from the iSCSI Initiator VM (using VirtualBox) to my iSCSI Target VM (also on VirtualBox).

E.g.

iscsiadm --mode discovery --type sendtargets --portal <ip address> --discover
iscsiadm: cannot make connection to <ip address>: Connection refused

There is a Host-only adapter network set up and I can SSH between the two VMs.

I disabled iptables to check if it was a firewall problem but was still getting the same problem.

Fwiw, on the Target machine I have:

# tgtadm --mode target --op show
Target 1: iqn.2014-03.my.target.server:tgt1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 55 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: rdwr
            Backing store path: /dev/vg_iscsi/lv_iscsi_1
            Backing store flags: 
    Account information:
    ACL information:
        ALL

Any suggestions what else I can try?

2
firewalld was active on target and initiator for me. Turning them off fixed it. Thanks for the iptables hint!Chimera.Zen

2 Answers

1
votes

Your client machine have another session logged into that target.

First you will have to logged out that target from your client, then discover using your new targetname.

       Logout(change parameter accordingly):

        iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout

If your client still does not discover, use 0.0.0.0 3260 as portal for this particular iqn in your server machine. This should work fine.

server:

 o- portals .................................................................... [Portals: 1]
  | |     o- 0.0.0.0:3260 ..................................................................... [OK]

This is not a firewall issue.

0
votes

me@here:~$ sudo iscsiadm -m discovery -t st -p 192.168.22.240

iscsiadm: cannot make connection to 192.168.22.240: Connection refused
iscsiadm: cannot make connection to 192.168.22.240: Connection refused
iscsiadm: cannot make connection to 192.168.22.240: Connection refused
^Ciscsiadm: caught SIGINT, exiting...

me@here:~$ sudo iscsiadm -m discoverydb -t st -p 192.168.22.240

# BEGIN RECORD 2.0-873
discovery.startup = manual
discovery.type = sendtargets
discovery.sendtargets.address = 192.168.22.240
discovery.sendtargets.port = 3260
discovery.sendtargets.auth.authmethod = None
discov...