Could not create NetworkPortal in configFS issue resolved

I see that there is an error while creating iscsi portal ” Could not create NetworkPortal in configFS ” in Red hat enterprise Linux 7. I have installed targetcli, started services targetcli and created block storage, LUN, iscsi internet name. 

After creating all this i was trying to create an portal but it through an error ” could not create NetworkPortal in configFS “

i find no clue after few minutes i observe that there is an default portal has been created with 0.0.0.0:3260, i thought that was not created by me and i was trying to delete default port with 0.0.0.0:3260. See the Guide to create iscsi server

could not create NetworkPortal in configFS error resolution

/> ls
o- / ................................................ [...]
 o- backstores ......................................... [...]
 | o- block ............................. [Storage Objects: 1]
 | | o- iscsi_storage .................. [/dev/iscsi_vg/iscsi_lv (3.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.2014-09.com.example.com:server .................................. [TPGs: 1]
 | o- tpg1 ...................................... [no-gen-acls, no-auth]
 | o- acls ................................................... [ACLs: 1]
 | | o- iqn.2014-09.example.com:desktop ......................................... [Mapped LUNs: 1]
 | | o- mapped_lun0 .................................. [lun0 block/iscsi_storage (rw)]
 | o- luns ................................................ [LUNs: 1]
 | | o- lun0 ............................... [block/iscsi_storage (/dev/iscsi_vg/iscsi_lv)]
 | o- portals ...................................................... [Portals: 2]
 | o- 0.0.0.0:3260 ............................................... [OK]
 o- loopback .................................... [Targets: 0]
/> /iscsi/iqn.2014-09.com.example.com:server/tpg1/portals delete 0.0.0.0
Missing required parameter ip_port

Here is an solution to resolve above error

/> /iscsi/iqn.2014-09.com.example.com:server/tpg1/portals delete 0.0.0.0 ip_port=3260
Deleted network portal 0.0.0.1:3260

Now try to create portal with specified IP address

/> /iscsi/iqn.2014-09.com.example.com:server/tpg1/portals/ create 192.168.4.20
Using default IP port 3260
Created network portal 192.168.4.20:3260.
/> ls
o- / ....................................................... [...]
 o- backstores ......................................... [...]
 | o- block .................................... [Storage Objects: 1]
 | | o- iscsi_storage ................... [/dev/iscsi_vg/iscsi_lv (3.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.2014-09.com.example.com:server ................................ [TPGs: 1]
 | o- tpg1 .................................... [no-gen-acls, no-auth]
 | o- acls ...................................... [ACLs: 1]
 | | o- iqn.2014-09.example.com:desktop ............................. [Mapped LUNs: 1]
 | | o- mapped_lun0 ................................. [lun0 block/iscsi_storage (rw)]
 | o- luns ....................................... [LUNs: 1]
 | | o- lun0 ......................... [block/iscsi_storage (/dev/iscsi_vg/iscsi_lv)]
 | o- portals .......................................... [Portals: 2]
 | o- 192.168.4.20:3260 ............................................ [OK]
 | o- 192.168.4.21:3260 ................................. [OK]
 o- loopback ....................................... [Targets: 0]
/>

Conclusion

Issue occurred due to an default portal was created and it was pointing to all of the interface by default. Deleting default portal which is 0.0.0.0:3260 using ip_port=3260 option resolve the issue. 

Thanks.

Please do comment if this issue resolution helped.

Thanks for your wonderful Support and Encouragement