PS Script for LUN Mapping between 2 Windows Servers

by on ‎2012-03-09 04:31 AM

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

Warning!

This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to 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
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.