Powershell – Provision NetApp Volume as NFS Datastore to vCenter

powercli-iconFor anyone that’s ever been through the process of provisioning a new datastore to multiple ESX hosts, you know it can take some time. Below are the steps I use

  1. Create Volume on NetApp
  2. Set Security Style to Unix
  3. Enable Storage Efficiency
  4. Set NFS Export permissions to allow Read/Write + Root Permissions to all applicable hosts
  5. Mount datastores on ESXi hosts

For a handful of hosts this is fine, but adding it to anything more than 4-5 hosts is reaaally painful in my experience. Below is a script you can use to take care of these steps in one swipe.

Prerequisites:

NetApp DataOnTap Toolkit

VMware PowerCLI

The script requires an array of the NFS clients (read ESXi hosts) you want to connect the datastore to.

Example 1 – assign the array to a variable, and manually add it to a parameter

Example 2 – Create an array, and pipe it to the script

Enjoy! Let me know if you have any challenges or questions

Add-VolumeAndAddToESXi.ps1

 

– Jon

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright VirtJunkie.com ยฉ 2024