Cloud Articles and Resources

PS Script for LUN Mapping between 2 Windows Servers

Hi,

maybe this Script could be useful for somebody else.

We have been in the need to be able to switch LUNs between 2 different Windows Server easily.

For example you have a Productive and a Backup Windows Server. Productive is dead any you have a few LUNs which should now be mapped to the Backup Server.

For that reason i wrote this Script.

To make it work you will need a few things:

1. Our Igroup Names are the same like the Windows Hostnames

2. In the LUN comment field we have entered the Used Drive names. For example O, for Drive O under Windows

3. Snapdrive needs to be installed on both Servers (on all 3, if you want to use the Script from a Central Server to switch between 2 others)

4. ONTAP Powershell Plugin needs to be installed on both Servers (on all 3, if you want to use the Script from a Central Server to switch between 2 others)

5. You will need to adapt the Paths for the Logfiles, the Password txt file and so on.

The Script will always try to unmap or map via Snapdrive first. If Snapdrive connection isn't possible it will unmap or map directly on the Controller.

BR

Miran

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums