Community

Subscribe
Highlighted
Accepted Solution

Get root vol with PowerShell toolkit

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.

Re: Get root vol with PowerShell toolkit

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...}

Re: Get root vol with PowerShell toolkit

Hi Mark,

Already found that

Sorry for not responding yet...

I needed that for a command I built in WFA.

Thanks!\

Solal.

Re: Get root vol with PowerShell toolkit

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

Re: Get root vol with PowerShell toolkit

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