ONTAP Discussions

Preventing suprise removals on host when using remove-nclunmap (data ontap powershell toolkit)

JEROENVRANCKX
2,488 Views

I have a question regarding the data ontap powershell toolkit. As probably most of you know by now; snapdrive has been quietly put out of order in favor of snapcenter which basically forces us to integrate with snapcenter if we need to do anything related to lun management. 

 

I have been looking into writing a powershell module which would emulate certain functions offered by snapdrive, so we can atleast do our lunmanagement on our w2k19 servers as we don't have snapcenter setup yet.  

 

I have checking into the data ontap powershell toolkit and have been able to recreate most basic functions which snapdrive does; but have run into a little issue regarding disconnecting LUNS connected by iSCSI. 

 

It's relatively easy to make sure that the mappings get removed but it seems the host itself is not happy suddenly not seeing it's disk anymore; basically stalling all storage related functions untill he times out. (you get a suprise removal in this case). 

 

following procedure s used for now: dismount the volume on the host itself first (so it loses it's access path); next remove the mapping by using remove-nclunmap. It sounds logic that he still has issues because after you dismount the volume he still sees this on OS level; but i wonder how i can can actually cover this problem). 

 

Hope you guys can help me out on this one. 

with kind regards

 

 

 

1 REPLY 1

hmoubara
2,247 Views

Hello,

The powershell toolkit does not have any other command that map more to snapdrive beside the one you are using or can find in the TR below:

https://www.netapp.com/us/media/tr-4475.pdf

 

Add-N?LunMap Maps the LUN to all the initiators in the specified initiator group

Remove-N?LunMap Reverses the effect of Add-NaLunMap on the specified LUN for
the specified group

 

When issuing the remove-Nlunmap the behavior you seeing in your host is expected as this ID 157 was introduced in windows 8.1 and server 2012 R2 to log a record of a disk disappearing.

 

https://docs.microsoft.com/en-us/archive/blogs/ntdebugging/event-id-157-disk-has-been-surprise-removed

 

Thanks 

Public