Provisioning storage and host LUN discovery
Discovering devices on the host
About this task
After exporting from an HPE Alletra Storage MP system to a host, VLUNs might not automatically appear. Use the following procedure to scan and verify the new LUNs. For more information, see the Red Hat Storage Administration Guide.
NOTE:
Some FC hardware requires that you perform a Loop Initialization Protocol (LIP) operation before showing a newly created LUN.
To discover presented LUNs, use the sg_luns command from the sg3_utils package to issue the SCSI REPORT LUNS command to the storage system.
Procedure
Scan for the new LUNs using either the rescan-scsi-bus.sh script or, the sysfs scan method:
Use the rescan-scsi-bus.sh script from sg3_utils. This method is recommended for FC and automatically updates the logical unit configuration of the host after adding a device to the storage system. For more information:
복사
rescan-scsi-bus.sh --help
Get device path information using the cat /proc/scsi/scsi, or sginfo -l as shown:
Scan for LUN 1 to LUN 4 on hosts 7 and 8.
#/usr/bin/rescan-scsi-bus.sh --hosts=7,8 --luns=1-4 --nooptscan
Example: Scan for all LUNs on the host.
IMPORTANT:
Scanning for all LUNs impacts I/O activity on the host.
#/usr/bin/rescan-scsi-bus.sh --nooptscan
Using the sysfs scan method:
#echo "c t l" > /sys/class/scsi_host/hosth/scan
Host or HBA number: h
Channel on the HBA: c
SCSI target ID: t
LUN number: l
Use the cat /proc/scsi/scsi, lsscsi -g, or sginfo -l command to get a list of device path information as shown:
NOTE:
Run the echo command for each path to a new device.
Scanning for LUN 1 on host or HBA 7, channel 0 SCSI target ID 0:
#echo "0 0 1" /sys/class/scsi_host/host7/scan
Scanning for all LUNs on host or HBA 7:
IMPORTANT:
Scanning for all LUNs impacts I/O activity on the host.
#echo "- - -" /sys/class/scsi_host/host7/scan
(Optional) After changing the device size, use the sysfs rescan method to update a device size.
Example rescanning LUN1 on host, or HBA 7, channel 0, SCSI target ID 0:
#echo 1 > /sys/class/scsi_device/7:0:0:1/device/rescan
IMPORTANT:
Scanning for all LUNs impacts I/O activity on the host.
Change the size of the device in the device-manager multipath:
#multipathd -k
multipathd> resize map 360002ac000000000000003e3000185df
ok
multipathd> exit
Verify that the new LUNs were discovered at the SCSI layer using either lsscsi or sginfo -l: For example,
Using the lsscsi -tig command (lsscsi requires the lsscsi rpm package):
#lsscsi -tig
[0:0:0:1] disk fc:0x23210002ac0185df0xba09a2 /dev/sdb 360002ac000000000000004b0000185df /dev/sg3
[0:0:1:1] disk fc:0x22210002ac0185df0xba09a1 /dev/sdv 360002ac000000000000004b0000185df /dev/sg24
The output shows:
The storage port WWN: 23210002ac0185df0xba09a2
The storage volume WWN: 360002ac000000000000004b0000185df
Equivalent command from the HPE GreenLake for Block Storage:
cli% showvlun -lvw
Lun VVName -------------VV_WWN------------- HostName -Host_WWN/iSCSI_Name- Port Type Status ID
1 rhvol.0 60002AC000000000000004B0000185DF dl380pg8-18 50014380231C4A3C 3:2:1 host active 1
The sg_map command on the host:
#sg_map -i -sd -x
/dev/sg3 0 0 0 1 0 /dev/sdb 3PARdata VV 3222
/dev/sg4 0 0 0 2 0 /dev/sdc 3PARdata VV 3222
Verify the new LUN from the /proc/scsi/scsi file:
#cat /proc/scsi/scsi
Attached devices:
Host: scsi7 Channel: 00 Id: 01 Lun: 01
Vendor: 3PARdata Model: VV Rev: 3140
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi7 Channel: 00 Id: 01 Lun: 02
Vendor: 3PARdata Model: VV Rev: 3140
Type: Direct-Access ANSI SCSI revision: 06
Show device information:
#smartctl -d scsi --all /dev/sdb
=== START OF INFORMATION SECTION ===
Vendor: 3PARdata
Product: VV
Revision: 3310
User Capacity: 21,474,836,480 bytes [21.4 GB]
Logical block size: 512 bytes
LU is thin provisioned, LBPRZ=1
Logical Unit id: 0x60002ac000000000000000040007e025
Serial number: 4UW0001036
Device type: disk
Transport protocol: Fibre channel (FCP-2)
Local Time is: Thu Feb 16 16:38:59 2017 PST
SMART support is: Available - device has SMART capability.
SMART support is: Disabled
Read Cache is: Enabled
Writeback Cache is: Disabled
Get all the SCSI attributes on the device:
#udevadm info --attribute-walk --path=/sys/class/scsi_device/7:0:0:1
...
ATTRS{state}=="running"
ATTRS{queue_depth}=="32"
ATTRS{vendor}=="3PARdata"
ATTRS{dh_state}=="alua"
ATTRS{eh_timeout}=="10"
Verify that the new LUNs were configured correctly by the multipathing software:
#multipath -ll
360002ac00000000000001f350007eedc dm-12 3PARdata,VV
size=60G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 9:0:5:18 sdae 65:224 active ready running
| - 10:0:4:18 sdan 66:112 active ready running -+- policy='service-time 0' prio=10 status=enabled
|- 9:0:4:18 sdl 8:176 active ready running
`- 10:0:5:18 sdbe 67:128 active ready running
ALUA priority values (prio) of multipath output:
Priority Value
Description
50
The device is in the active, optimized group (default 3PARdata device state).
10
The device is in an active but nonoptimized group.
1
The device is in the standby group. (3PARdata device uses this value for standby path).
0
All other groups.
The maximum number of LUNs: QLogic Host per initiator-target connection: 512 (0-511). Emulex host: 255 (0-254) with default driver settings.
NOTE:
General Linux Information: Sysfs is a virtual file system provided by Linux that is used for configuration and to show device and driver information from the kernel space to the user space. Each disk block device has an entry in /sys/block/ and each Host Bus Adapter (HBA) has an entry in /sys/class/scsi_host/hostX, where X is the host adapter instance number (starting at 0) in the server.