Script – Create VMware vSphere NetApp NFS Volume

A few weeks ago I started to write a PowerShell Function that creates an optimized VMware vSphere NetApp NFS Volume and mounts this new volume to all VMware ESXi hosts within a vSphere Cluster. During the scripting process, I found, that a lot of NetApp specific inputs are required to process these steps. This was the perfect project to finally play with Dynamic ValidateSets in Dynamic Parameters.  Fabian Wendlandt already created a great example for the usage of Dynamic ValidateSets in Dynamic Parameters with his Switch-VMSwitch script.

Create VMware vSphere NetApp NFS Volume - PowerShell Console

Create VMware vSphere NetApp NFS Volume Function

The New-VsphereNetappVolume PowerShell Function automates the following steps:

  1. Create a NetApp Volume
  2. Create an Export Policy if required
  3. Set recommended VMware settings for the new Volume
  4. Set Snapshot Policy for the new Volume
  5. Select the right IP of the NetApp SVM
  6. Mount the new NetApp Volume on all ESXi hosts within a vSphere Cluster

The function is designed to create or use a NetApp Export Policy per vSphere Cluster. The Export Policy is named like the vSphere Cluster. If the Export Policy does not exist on the NetApp SVM, a new one is created and all ESXi IPs are added as Export Rule.

Create VMware vSphere NetApp NFS Volume - PowerShell Dynamic Parameters with Dynamic ValidateSet

All Inputs are created as Dynamic Parameters with Dynamic ValidateSet, this means that it is possible to tab through valid inputs for e.g. the vSphere Cluster or the NetApp SVM.


The inputs are not validated against each other, so you are able to select an interface that does not exist on the selected SVM.

Created NetApp objects




Export Policy



Export Rule



VMware Datastore


Get the Module

The function is part of my new vSphere NetApp Toolkit PowerShell Module. At the moment it`s the only only function in the module, but more function will follow!

PowerShell Gallery Read The Docs GitHub Project


Preview of upcoming functions of the module (and Blog Posts):

Create VMware vSphere NetApp NFS Volume - Preview: Get-VsphereNetappVolume


Feel free to share your NetApp Best Practice to make this PowerShell function even better.

  • Do you set any additional Volume options?
  • Do you use any special Snapshot settings or options?

You are welcome to leave a comment or raise a GitHub issue.

Share with:

Leave a Reply