Microsoft Virtualization Discussions

Creating new volume via PowerShell

I am trying to create new volumes via the NetApp PowerShell Toolkit and I am running into some issues.

 

If I just input 'New-NcVol' and follow the prompts,it returns an error that the cmdlet must be directed at a data vserver

 

If I run the line as 'New-NcVol - vservercontext svm01' and follow the prompts it returns another error:

New-NcVol : entry doesn't exist
At line:1 char:1
+ New-NcVol -vservercontext svm01
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (192.168.1.10:NcController) [New-NcVol], EOBJECTNOTFOUND
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.NewNcVol

 

Does anyone have the correct cmdlet structure to allow for all the inputs for creation of a new volume in a single line?  Ideally I'd like to be define certain values (e.g vserver, aggregate, etc) and allow for input on the name, size and junction path, but at least getting it to work successfully is what I am shooting for.

5 REPLIES

Re: Creating new volume via PowerShell

Hello @steven_doan,

 

There are a number of examples for creating and managing volumes here.

 

Hope that helps!

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Creating new volume via PowerShell

Thanks, found what I needed right away!

Re: Creating new volume via PowerShell

So I'm back with a follow up since I could not find the answer on the site you specified.

 

I am trying to create a quota on a new qtree, but I am struggling with what I am missing here.

 

add-ncquota -vservercontext svm01 -disklimit 1mb -type tree -volume vol_test -qtree qtree_test

 

Returns a prompt that looks like an array and will keep accepting input until I cancel out of it and then spitting out an error:

 

add-ncquota -vservercontext svm01 -disklimit 1mb -type tree -volume vol_test -qtree qtree_test
cmdlet Add-NcQuota at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Target[0]: qtree
Target[1]: test
Target[2]: antyhing
Target[3]: help
Target[4]: !?
The quota target of the type specified.
Target[4]:
add-ncquota : Invalid target qtree,test,antyhing,help specified for tree quota rule. Target for explicit tree quota rule for volume vol_test must be in "/vol/vol_test/<qtree-name>" format.
At line:1 char:1
+ add-ncquota -vservercontext svm01 -disklimit 1mb -type tree -volume vol_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (192.168.1.10:NcController) [Add-NcQuota], EQUOTAINVALID
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Quota.AddNcQuota

 

I've tried sereval different iterations but all so far are throwing errors

 

cmdlet Add-NcQuota at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Target[0]: /vol_test
Target[1]: /qtree_test
Target[2]:
add-ncquota : Invalid target /vol_test,/qtree_test specified for tree quota rule. Target for explicit tree quota rule for volume vol_test must be in "/vol/vol_test/<qtree-name>" format.

 

Has anyone created/managed quotas via the PowerShell Toollkit and can provide some more guidance?

Re: Creating new volume via PowerShell

I usually use the pipeline when doing quotas...

 

Get-NcVserver $svmName | Add-NcQuota -Path "/vol/$($volName)/$(qtreeName)" -DiskLimit $limit

This will create a qtree quota for the FlexVol.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Creating new volume via PowerShell

@asulliva  Thanks again it worked.

 

I think my confusion was that I was missing /vol because of confusion on the namespace/junction point.

vol_test was the top junction point so I was leaving /vol off, once I included that it worked.

 

 

Forums