NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

Get root vol with PowerShell toolkit

solal
6,573 Views

Hi all.

I'm using it in a WFA command in order to append data into a configuration file (i.e RC file, hosts...).

At the moment i'm appending with Write-NaFile and it requires full path (/vol/vol0/etc/....) and not /etc/***.

I can't use always /vol/vol0 and need to query the filer and see which volume name is the root volume.

Did you ever try to get with one command / concatenated commands in PowerShell ToolKits a filer's root volume name?

Many thanks in advance!

Solal.

1 ACCEPTED SOLUTION

mark_schuren
6,573 Views

I just tried and found a builtin cmdlet:

PS H:\> Get-NaVolRoot

Name                      State       TotalSize  Used  Available Dedupe  FilesUsed FilesTotal Aggregate

----                      -----       ---------  ----  --------- ------  --------- ---------- ---------

volroot                   online       197,6 GB    3%   191,3 GB False          8k         7M aggr0

What version of the DataONTAP PS Toolkit are you using?

I'm on:

PS H:\> Get-Module DataOntap | fl

Name              : DataOntap

Path              : C:\Program Files (x86)\NetApp\Data ONTAP PowerShell Toolkit\DataOntap\DataOntap.psd1

Description       : Data ONTAP PowerShell Toolkit

ModuleType        : Manifest

Version           : 2.4.0

NestedModules     : {DataONTAP, DataONTAP.C, DataONTAP.Alias}

ExportedFunctions : Add-NaHelpInfoUri

ExportedCmdlets   : {Add-NaAggr, Add-NaCifsShare, Add-NaCredential, Add-NaFpolicyExtension...}

ExportedVariables : {}

ExportedAliases   : {Add-NcHostIscsiConnection, Connect-NcHostIscsiTarget, ConvertTo-NcLun, ConvertTo-NcVhd...}

View solution in original post

4 REPLIES 4

mark_schuren
6,574 Views

I just tried and found a builtin cmdlet:

PS H:\> Get-NaVolRoot

Name                      State       TotalSize  Used  Available Dedupe  FilesUsed FilesTotal Aggregate

----                      -----       ---------  ----  --------- ------  --------- ---------- ---------

volroot                   online       197,6 GB    3%   191,3 GB False          8k         7M aggr0

What version of the DataONTAP PS Toolkit are you using?

I'm on:

PS H:\> Get-Module DataOntap | fl

Name              : DataOntap

Path              : C:\Program Files (x86)\NetApp\Data ONTAP PowerShell Toolkit\DataOntap\DataOntap.psd1

Description       : Data ONTAP PowerShell Toolkit

ModuleType        : Manifest

Version           : 2.4.0

NestedModules     : {DataONTAP, DataONTAP.C, DataONTAP.Alias}

ExportedFunctions : Add-NaHelpInfoUri

ExportedCmdlets   : {Add-NaAggr, Add-NaCifsShare, Add-NaCredential, Add-NaFpolicyExtension...}

ExportedVariables : {}

ExportedAliases   : {Add-NcHostIscsiConnection, Connect-NcHostIscsiTarget, ConvertTo-NcLun, ConvertTo-NcVhd...}

solal
6,573 Views

Hi Mark,

Already found that

Sorry for not responding yet...

I needed that for a command I built in WFA.

Thanks!\

Solal.

ramong
6,573 Views

How about for a vFiler?  How can I find out which vol is root for a vFiler?  Thank you in advance.

mark_schuren
6,573 Views

when connected to a vfiler unit, the get-navolroot cmdlet also works.

Public