vSphere5: Remove iSCSI Target from shell
Today I had a little time to improve my vSphere Lab and I started by upgrading the iSCSI Storage (Openfiler).
I migrated all my VM’s and then I shutdown the old iSCSI without removing the iSCSI targets for ESXi. It turned out that this was a big mistake because one of the ESXi server become unresponsive.
The only way I was able to connect to the ESXi server was by acessing the troubleshooting console.
After searching the logs for clues it was obvious that I had to remove the iSCSI target from cli.
Anyway, first I wanted to see how does the ESXi sees this lost device/path and used the esxcfg-scsidevs command: t10.F405E46494C45425362463E69485D254743613D2F6244655
t10.F405E46494C45400C4F4143537E4D22476F453D297361423
Device Type: Direct-Access
Size: 133216 MB
Multipath Plugin: NMP
Vendor: OPNFILER Model: VIRTUAL-DISK Revis: 0
SCSI Level: 4 Is Pseudo: false Status: dead
Is RDM Capable: true Is Removable: false
Is Local: false Is SSD: false
Device Type: Direct-Access
Size: 400320 MB
Multipath Plugin: NMP
Vendor: OPNFILER Model: VIRTUAL-DISK Revis: 0
SCSI Level: 4 Is Pseudo: false Status: on
Is RDM Capable: true Is Removable: false
Is Local: false Is SSD: false
STATIC DISCOVERY TARGET
NAME : iqn.2006-01.com.openfiler:tsn.acf1f3fdb247
ADDRESS : 192.168.40.4:3260
BOOT : No
LAST ERR : LOGIN: No Errors
STATIC DISCOVERY TARGET
NAME : iqn.2006-01.com.openfiler:tsn.da6f7f008898
ADDRESS : 192.168.40.99:3260
BOOT : No
LAST ERR : LOGIN: No Errors
Great, now I have everything I need to proceed! The following command helped remove the target:
Then, I restarted the the Management agents and then checked to see if there were any errors in vmkernel.log reported.
1 2 3 4 5 6 7 8 9 10 | /sbin/services.sh restart ~ # tail -f /var/log/vmkernel.log 2011-12-12T12:24:13.208Z cpu3:2649)WARNING: NMP: nmpDeviceAttemptFailover:562:Retry world restore device "t10.F405E46494C45400C4F4143537E4D22476F453D297361423" - no more commands to retry 2011-12-12T12:24:17.674Z cpu1:2662)Tcpip: 2236: msleep returned 4 2011-12-12T12:24:22.678Z cpu1:2662)Tcpip: 2236: msleep returned 4 2011-12-12T12:24:22.741Z cpu1:2156)ScsiPath: 4963: DeletePath : adapter=vmhba32, channel=1, target=0, lun=0 2011-12-12T12:24:22.741Z cpu1:2159)ScsiPath: 4963: DeletePath : adapter=vmhba32, channel=0, target=0, lun=0 2011-12-12T12:24:22.741Z cpu3:2156)WARNING: ScsiPath: 5022: Remove path: vmhba32:C1:T0:L0 2011-12-12T12:24:22.741Z cpu1:2159)WARNING: NMP: nmpUnclaimPath:1577:Physical path "vmhba32:C0:T0:L0" is the last path to NMP device "Unregistered Device". The device has been unregistered. 2011-12-12T12:24:22.741Z cpu1:2159)WARNING: ScsiPath: 5022: Remove path: vmhba32:C0:T0:L0 |
After removing the target the ESXi server become responsive and I could connect to it using the vSphere Client.
PS: I know that removing the old iSCSI storage this way isn’t in the best practice papers, but this happened in my lab where everything is allowed.
Cheers



December 13, 2011 
I’d vtenrue that this article has saved me more time than any other.