ONTAP Discussions

[Netapp Powershell Toolkit] Assigning an export-policy

Nick_Talbot
3,421 Views

I'm having a hard time figuring out how to apply an export-policy to a volume using the netapp powershell toolkit.  Does anyone have a good example of how to do this?  I saw another thread on this subject on these forums but it didn't make it very clear to me.

2 REPLIES 2

wronald
3,389 Views

Hi @Nick_Talbot,

 

You probably found that post.

It is basically all in there:

 

1. Connect to a controller:

Connect-NcController

2. Create your policy and rule:

New-NcExportPolicy -VserverContext SVM_NAME -Name POLICY_NAME 

New-NcExportRule -VserverContext SVM_NAME -Policy POLICY_NAME -ClientMatch HOSTS

3. Apply the policy to the Volume:

update-ncvol -query @{name="VOL_NAME"} -Attributes @{volumeexportattributes=@{policy="POLICY_NAME"}}

 

You will need to change the follwing information:

- SVM_NAME

- POLICY_NAME (3 times)

- HOSTS (the client match is either a client or a range of IPs, or a subnet)

- VOL_NAME

 

 

I hope that helps.

 

Cheers,

Ron.

 

OhGrossAZ
1,373 Views

Thanks for this @wronald 

 

Worked for me and now saved to my 'netapp ps snippets'.

Public