iscsi backstores/block is wiped out after server reboot

Posted on

I am testing iscsi settings in my lab environment and experiencing a problem

targetcli version I am using is this

[root@server2 ~]# rpm -qa | grep targetcli
targetcli-2.1.fb41-3.el7.noarch

Problem is backstores/block definition is wiped out after target side server reboot occurs before client side shuts down.

After setting my backstores and tpg as below,

targetcli /backstores/block create dev=/dev/vdc
targetcli /backstores/iscsi create iqn.net.ywlocal.server2:lab-19-1
targetcli /iscsi/iqn.2017-02.net.ywlocal.server2:lab-19-1/tpg1/portals create 192.168.11.12 2020
targetcli /iscsi/iqn.2017-02.net.ywlocal.server2:lab-19-1/tpg1/luns create /backstores/block/lab-19-1
targetcli /iscsi/iqn.2017-02.net.ywlocal.server2:lab-19-1/tpg1 set attribute authentication=0 generate_node_acls=1 demo_mode_write_protect=0
targetcli saveconfig

backstores and tps are created correctly.

[root@server2 ~]# targetcli /backstores/block ls
o- block ...................................................................... [Storage Objects: 1]
o- iscsilab19-1 ......................................... [/dev/vdc (1.0GiB) write-thru activated]
[root@server2 ~]# targetcli /iscsi/iqn.2017-02.net.ywlocal.server2:lab-19-1 ls
o- iqn.2017-02.net.ywlocal.server2:lab-19-1 .............................................. [TPGs: 1]
o- tpg1 ...................................................................... [gen-acls, no-auth]
o- acls .............................................................................. [ACLs: 0]
o- luns .............................................................................. [LUNs: 1]
| o- lun0 ...................................................... [block/iscsilab19-1 (/dev/vdc)]
o- portals ........................................................................ [Portals: 1]
o- 192.168.11.12:2020 ................................................................... [OK]

I am able to create lvm from client side using the new lun.

[root@server1 ~]# mount -t xfs
/dev/mapper/rhel-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/vda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/mapper/vglab19--1-lvlab19--1 on /iscsilab19-1 type xfs (rw,relatime,seclabel,attr2,inode64,noquota,_netdev)

However, keeping the client side connected , backstores/block is gone after I reboot the server before rebooting.

[root@server2 ~]# targetcli /backstores/block ls
o- block ...................................................................... [Storage Objects: 0]

Target Portal Group seems intact.

[root@server2 ~]# targetcli /iscsi/iqn.2017-02.net.ywlocal.server2:lab-19-1 ls
o- iqn.2017-02.net.ywlocal.server2:lab-19-1 .......................... [TPGs: 1]
o- tpg1 .................................................. [gen-acls, no-auth]
o- acls .......................................................... [ACLs: 0]
o- luns .......................................................... [LUNs: 0]
o- portals .................................................... [Portals: 1]
o- 192.168.11.12:2020 ............................................... [OK]

I have other storage ,File storage, but this seems to remain.

[root@server2 ~]# targetcli /backstores/fileio ls
o- fileio ..................................................................................................... [Storage Objects: 1]
o- iscsifile1 ............................................................... [/usr/iscsifile1.img (50.0MiB) write-back activated]

Am I missing any command lines to keep the target side backstores/block configuration persistent?

Responses