Friday, December 8, 2017

How to do Lun reset and target reset operations on ESXi 6.x ?


LUN reset - Resets the specified LUN by clearing any SCSI reservation on the LUN and making the LUN available to all servers again. The reset does not affect any of the other LUNs on the device. If another LUN on the device is reserved, it remains reserved.

Target reset - Resets the entire target. The reset clears any SCSI reservations on all the LUNs associated with that target and makes the LUNs available to all servers again.

To check all the available devices:

# esxcfg-scsidevs -l
naa.60002ac000000000000000860001cb64
   Device Type: Direct-Access
   Size: 2609152 MB
   Display Name: 3PARdata Fibre Channel Disk (naa.60002ac000000000000000860001cb64)
   Multipath Plugin: NMP
   Console Device: /vmfs/devices/disks/naa.60002ac000000000000000860001cb64
   Devfs Path: /vmfs/devices/disks/naa.60002ac000000000000000860001cb64
   Vendor: 3PARdata  Model: VV                Revis: 3312
   SCSI Level: 6  Is Pseudo: false Status: on
   Is RDM Capable: true  Is Removable: false
   Is Local: false Is SSD: false
   Other Names:
      vml.020005000060002ac000000000000000860001cb64565620202020
   VAAI Status: supported


To reset LUN:

# vmkfstools -L lunreset /vmfs/devices/disks/naa.60002ac000000000000000860001cb64

Sometimes resetting LUN using "naa." device doesn't work, in that case try running same command with "vml" device reference:

# vmkfstools -L lunreset /vmfs/devices/disks/vml.020005000060002ac000000000000000860001cb64565620202020


# tail -f /var/log/vmkernel.log

2017-12-08T16:48:49.072Z cpu25:71333)WARNING: NMP: nmpDeviceTaskMgmt:2291: Attempt to issue lun reset on device naa.60002ac000000000000000860001cb64. This will clear any SCSI-2 reservations on the device.
2017-12-08T16:48:49.072Z cpu25:71333)Resv: 633: Executed out-of-band lun reset on naa.60002ac000000000000000860001cb64


To reset Target:


# vmkfstools -L targetreset /vmfs/devices/disks/naa.60002ac000000000000000860001cb64

OR

# vmkfstools -L targetreset /vmfs/devices/disks/vml.020005000060002ac000000000000000860001cb64565620202020


# tail -f /var/log/vmkernel.log

2017-12-08T16:49:53.525Z cpu0:71347)WARNING: NMP: nmpDeviceTaskMgmt:2291: Attempt to issue target reset on device naa.60002ac000000000000000860001cb64. This will clear any SCSI-2 reservations on the device.
2017-12-08T16:49:53.525Z cpu2:71347)Resv: 633: Executed out-of-band target reset on naa.60002ac000000000000000860001cb64


If still you are seeing issues with SCSI reservation conflicts, you can use "busreset" option

It resets all accessible targets on the bus. The reset clears any SCSI reservation on all the LUNs accessible through the bus and makes them available to all servers again.



No comments:

Post a Comment