i want to know, why the parmeter -target has to have the volume /vol/VOLNAME/qtree path in it:
PS C:\Users\c5103331> set-ncquota -Volume myfirstvol -target quota -type tree -disklimit 1g -Vservercontext derotvs0002
Set-NcQuota : Invalid target quota specified for tree quota rule. Target for explicit tree quota rule for volume myfir
stvol must be in "/vol/myfirstvol/<qtree-name>" format.
At line:1 char:12
+ set-ncquota <<<< -Volume myfirstvol -target quota -type tree -disklimit 1g -Vservercontext derotvs0002
+ CategoryInfo : InvalidOperation: (NetApp.Ontapi.Filer.C.NcController:NcController) [Set-NcQuota], E
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Quota.SetNcQuota
set-ncquota -Volume myfirstvol -target /vol/myfirstvol/quota -type tree -disklimit 1g -Vservercontext derotvs0002
On the the cli
volume quota rule create -vserver derotvs0002 -policy-name default -volume myfirstvol -type tree -target quota -disk-limit 1g
volume quota> rule show -vserver derotvs0002 -policy-name default -volume myfirstvol
(volume quota policy rule show)
Vserver: derotvs0002 Policy: default Volume: myfirstvol
User Disk Disk Files Files
Type Target Qtree Mapping Limit Limit Limit Limit Threshold
----- -------- ------- ------- -------- ------- ------ ------- ---------
tree q_first "" - 10GB - - - -
tree quota "" - 1GB - - - -
2 entries were displayed.
Quotes only exist on qtrees (not volumes) and to date, I've always had to refer to LUNs and QTrees by their paths. In this case, since you are setting a quota on a qtree, you have to specify the path to the QT. I imagine the reason why is you can have more than one LUN or qtree in a volume, so specifying the volume name is not specific enough.
I think any API that interacts with either a LUN or Qtree expects a path, not just a name. I'm willing to bet there aren't many (if any) exceptions. Get-NaLun for instance expects a LUN path, not a LUN name. Get-NaQtree is the same way.