Kategorie szkoleń | Egzaminy | Kontakt
  • 0
  • 1
  • 24

Witam.

Mam nietypowy problem związany z poprawnym funkcjonowaniem serwera iscsi po restarcie. Poniżej komendy, które wykonałem do konfiguracji środowiska, korzystam z dwóch maszyn:

rhce1 (target) 192.168.56.201

rhce3 (iscsi-initiator) 192.168.56.203

 

RHCE1

hostnamectl set-hostname rhce1

[root@rhce1 ~]#vgcreate vgSAN /dev/sdb
[root@rhce1 ~]#lvcreate -l+100%FREE -n lvSAN vgSAN
[root@rhce1 ~]#targetcli


o- tpg1 ..................................................................................................... [no-gen-acls, no-auth]
o- acls ................................................................................................................ [ACLs: 1]
| o- iqn.2017-02.local.example:rhce3 ............................................................................ [Mapped LUNs: 1]
| o- mapped_lun0 ........................................................................................ [lun0 block/LUN1 (rw)]
o- luns ................................................................................................................ [LUNs: 1]
| o- lun0 ................................................................................. [block/LUN1 (/dev/mapper/vgSAN-lvSAN)]
o- portals .......................................................................................................... [Portals: 1]
o- 192.168.56.201:3260 .................................................................................................... [OK]
/iscsi/iqn.20....example/tpg1> cd ..
/iscsi/iqn.20...local.example> ls
o- iqn.2017-02.local.example ............................................................................................. [TPGs: 1]
o- tpg1 ................................................................................................... [no-gen-acls, no-auth]
o- acls .............................................................................................................. [ACLs: 1]
| o- iqn.2017-02.local.example:rhce3 .......................................................................... [Mapped LUNs: 1]
| o- mapped_lun0 ...................................................................................... [lun0 block/LUN1 (rw)]
o- luns .............................................................................................................. [LUNs: 1]
| o- lun0 ............................................................................... [block/LUN1 (/dev/mapper/vgSAN-lvSAN)]
o- portals ........................................................................................................ [Portals: 1]
o- 192.168.56.201:3260 .................................................................................................. [OK]

 

[root@rhce1 ~]#firewall-cmd --add-port=3260/tcp --permanent
[root@rhce1 ~]#firewall-cmd --reload
[root@rhce1 ~]#systemctl enable target.service

 

RHCE3


hostnamectl set-hostname rhce3

[root@rhce3 ~]#yum install iscsi-initiator-utils

[root@rhce3 ~]#iscsiadm --mode discovery --type sendtargets --portal 192.168.56.201

192.168.56.201:3260,1 iqn.2017-02.local.example

[root@rhce3 ~]#iscsiadm --mode node --targetname iqn.2017-02.local.example --portal 192.168.56.201:3260 --login

[root@rhce3 ~]# iscsiadm --mode node --targetname iqn.2017-02.local.example --portal 192.168.56.201:3260 --login
Logging in to [iface: default, target: iqn.2017-02.local.example, portal: 192.168.56.201,3260] (multiple)
Login to [iface: default, target: iqn.2017-02.local.example, portal: 192.168.56.201,3260] successful.


[root@rhce3 ~]#fdisk -l

Disk /dev/sdd: 1069 MB, 1069547520 bytes, 2088960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes

[root@rhce3 ~]#lvcreate -l+100%FREE -n lvRSAN vgRSAN
[root@rhce3 ~]#mkfs.ext4 /dev/mapper/vgRSAN-lvRSAN
[root@rhce3 ~]#vim /etc/fstab

/dev/mapper/vgRSAN-lvRSAN /rsan ext4 _netdev 0 0

[root@rhce3 ~]#mount -a

/dev/mapper/vgRSAN-lvRSAN 957M 2.5M 889M 1% /rsan

Po restarcie na RHCE3 widzę poprawnie dysk podmapowany.

● iscsi.service - Login and scanning of iSCSI devices
Loaded: loaded (/usr/lib/systemd/system/iscsi.service; enabled; vendor preset: disabled)
Active: active (exited) since Sun 2017-02-05 14:40:11 CET; 5min ago
Docs: man:iscsid(8)
man:iscsiadm(8)
Process: 1880 ExecReload=/sbin/iscsiadm -m node --loginall=automatic (code=exited, status=0/SUCCESS)
Process: 1366 ExecStart=/sbin/iscsiadm -m node --loginall=automatic (code=exited, status=0/SUCCESS)
Process: 1355 ExecStart=/usr/libexec/iscsi-mark-root-nodes (code=exited, status=0/SUCCESS)
Main PID: 1366 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/iscsi.service

Feb 05 14:40:10 rhce3 systemd[1]: Starting Login and scanning of iSCSI devices...
Feb 05 14:40:11 rhce3 iscsi-mark-root-nodes[1355]: iscsiadm: No active sessions.
Feb 05 14:40:11 rhce3 iscsiadm[1366]: Logging in to [iface: default, target: iqn.2017-02.local.example, portal: 192.168.56.201,3260] (multiple)
Feb 05 14:40:11 rhce3 iscsiadm[1366]: Login to [iface: default, target: iqn.2017-02.local.example, portal: 192.168.56.201,3260] successful.
Feb 05 14:40:11 rhce3 systemd[1]: Started Login and scanning of iSCSI devices.
Feb 05 14:41:30 rhce3 systemd[1]: Reloaded Login and scanning of iSCSI devices.
Feb 05 14:41:30 rhce3 systemd[1]: Reloaded Login and scanning of iSCSI devices.

/dev/mapper/vgRSAN-lvRSAN 957M 2.5M 889M 1% /rsan

Cyrk zaczyna się dziać, gdy wykonam restart RHCE1, mianowicie targetcli wygląda po restarcie tak:

[root@rhce1 ~]#
/> ls
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- block .................................................................................................. [Storage Objects: 0]
| o- fileio ................................................................................................. [Storage Objects: 0]
| o- pscsi .................................................................................................. [Storage Objects: 0]
| o- ramdisk ................................................................................................ [Storage Objects: 0]
o- iscsi ............................................................................................................ [Targets: 1]
| o- iqn.2017-02.local.example ......................................................................................... [TPGs: 1]
| o- tpg1 ............................................................................................... [no-gen-acls, no-auth]
| o- acls .......................................................................................................... [ACLs: 1]
| | o- iqn.2017-02.local.example:rhce3 ...................................................................... [Mapped LUNs: 0]
| o- luns .......................................................................................................... [LUNs: 0]
| o- portals .................................................................................................... [Portals: 1]
| o- 192.168.56.201:3260 .............................................................................................. [OK]
o- loopback ......................................................................................................... [Targets: 0]

znika kompletnie block device w backstores...

Informacja z logów:

-- Logs begin at Sun 2017-02-05 14:35:32 CET, end at Sun 2017-02-05 14:44:51 CET. --
Feb 05 14:35:49 rhce1 systemd[1]: Starting Restore LIO kernel target configuration...
Feb 05 14:35:51 rhce1 target[1430]: Could not create StorageObject LUN1: Cannot configure StorageObject because device /dev/mapper/vgSAN-lvSAN is already in use, skipped
Feb 05 14:35:51 rhce1 target[1430]: Could not find matching StorageObject for LUN 0, skipped
Feb 05 14:35:51 rhce1 target[1430]: Could not find matching TPG LUN 0 for MappedLUN 0, skipped
Feb 05 14:35:51 rhce1 systemd[1]: Started Restore LIO kernel target configuration.

informacja o dyskach:

[root@rhce1 ~]# fdisk -l
Disk /dev/mapper/vgSAN-lvSAN: 1069 MB, 1069547520 bytes, 2088960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vgRSAN-lvRSAN: 1035 MB, 1035993088 bytes, 2023424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@rhce1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vgOS-lvOS 6.2G 3.8G 2.1G 65% /
devtmpfs 482M 0 482M 0% /dev
tmpfs 497M 88K 497M 1% /dev/shm
tmpfs 497M 7.0M 490M 2% /run
tmpfs 497M 0 497M 0% /sys/fs/cgroup
/dev/sda1 497M 158M 339M 32% /boot
tmpfs 100M 16K 100M 1% /run/user/42
tmpfs 100M 0 100M 0% /run/user/0

[root@rhce1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvOS vgOS -wi-ao---- 6.38g
lvSwap vgOS -wi-ao---- 1020.00m
lvRSAN vgRSAN -wi-a----- 988.00m
lvSAN vgSAN -wi-ao---- 1020.00m
[root@rhce1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vgOS 1 2 0 wz--n- 7.38g 4.00m
vgRSAN 1 1 0 wz--n- 988.00m 0
vgSAN 1 1 0 wz--n- 1020.00m 0
[root@rhce1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 7.4G 0 part
├─vgOS-lvOS 253:0 0 6.4G 0 lvm /
└─vgOS-lvSwap 253:1 0 1020M 0 lvm [SWAP]
sdb 8:16 0 1G 0 disk
└─vgSAN-lvSAN 253:2 0 1020M 0 lvm
└─vgRSAN-lvRSAN 253:3 0 988M 0 lvm
sdc 8:32 0 1G 0 disk
sr0 11:0 1 1024M 0 rom

Po stronie serwera RHCE3 widzę poprawnie podłączone iscsi.

Wersje obu systemów:

CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.2.1511 (Core).

Czy ktoś trafił na podobny problem?

Szymon_Iwiński
  • Zapytał
  • @ Szymon_Iwiński | 11.02.2017
    • laureat
    • 15
    • 4
    • 26
Zaloguj się aby zadać pytanie
Pokrewne