Effective December 3, NetApp adopts Microsoft’s Business-to-Customer (B2C) identity management to simplify and provide secure access to NetApp resources.
For accounts that did not pre-register (prior to Dec 3), access to your NetApp data may take up to 1 hour as your legacy NSS ID is synchronized to the new B2C identity.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

powershell commandlet for vol size cli


Is the powershell cmdlets of  bGet-NaVolSize    Given the name of a flexible volume, return its current size in bytes.

same as the ontap cli vol size <volume name>?

Similary is  Set-NaVolSize  Given the name of a flexible volume, set the volume's size to the stated amount.

same as the ontap cli vol size <vol name> +/- new size ?





Adai, the design point for the PowerShell Toolkit is to report all sizes, rates, etc. in bytes unless specifically stated otherwise.  The data formatters do reduce those to human-readable values with units, and the setter cmdlets accept both byte values as well as values with units.  The Toolkit invokes Data ONTAP APIs in most cases, rather than calling the CLI, but the Toolkit and CLI should obviously return the same results.


Hi clinton,

Let me explain the situation.

Say i create a volume snapmirror between two filers f1 and f2.In order to make sure that the VSM update always succed and to avoid constant resizing of the vsm destination volume I create the volume to the size of the aggr.

So if i have a source volume f1:v1 of 10g and aggr on filer f2: of size 100G. now in order to create a VSM destination volume on filer f2 i create a volume v2 of size 100G with guarntee set to none.

Now, once the VSM baseline is completed. On the destination filer f2.

df -h will give the size of f2:v2 as 10G( same as source)

where as

vol size v2 will give the size as 100G( the size to which it was created)

so my question now is does running Get-NaVolSize will it reutrn 10g or 100G ?

I am looking for the command that will list 100G and not 10G.




Get-NaVol will report the size actually being used.  The *-NaVolSize cmdlets are to modify the actual size.

it is different though...

apollo [0:90]≥ Invoke-NaSsh -Command 'df -g /vol/vmdata0'
Filesystem               total       used      avail capacity  Mounted on
/vol/vmdata0/           8192GB      135GB     6153GB      25%  /vol/vmdata0/
/vol/vmdata0/.snapshot     2048GB        0GB     2047GB       0%  /vol/vmdata0/.snapshot

apollo [0:91]≥ Get-NaVol vmdata0 | Select-Object -ExpandProperty SizeUsed | ConvertTo-FormattedNumber



Thanks Clinton and Glen...that solves my issue.

When the volume is a snapmirror destination and the source volume is smaller, there is a difference between the "df" results and the "vol size" results. 

Here is how the different volume sizes are reflected in the powershell commandlet's

  • Get-NaVolSize dest
    • Returns the results of "vol size dest"
  • Get-NaVol dest | Format-Table TotalSize
    • Returns the results of "df -g /vol/dest"

filer1> df -g /vol/dest

/vol/dest/             1GB    0GB    1GB   0%  /vol/dest/
/vol/dest/.snapshot    0GB    0GB    0GB   0%  /vol/dest/.snapshot

filer1> vol size dest

Warning: Volume 'dest' has fs_size_fixed option set.  The file system

size may differ from the volume size.

See 'vol status -b' for more detail.

vol size: Flexible volume 'dest' has size 5g.



Get-NaVolSize will return the actual size, ignoring snapshot reserve, etc.  That's what you want.


From my experience, the netapp cli command "vol size" returns size in the units in which size was set.  In other words, if I enter "vol size vol1 1200g" and then enter the command "vol size vol1," I will expect a result of "1200g".

The command "df vol1" would return size in kibibytes (KiB) or 1024 bytes.  The commandled "Get-NaVolSize vol1" command returns the size in bytes.

For example, here are the outputs for various commands in my environment for a volume named "vol1" (the volume name and NetApp names have been changed).  The volume size was set previously to 200g by using the command "vol size vol1 200g"

filer> vol size vol1
vol size: Flexible volume 'vol1' has size 200g.

filer> df vol1
Filesystem              kbytes       used      avail capacity  Mounted on
/vol/vol1/            188743680   80478696  108264984      43%  /vol/vol1/
/vol/vol1/.snapshot   20971520     373032   20598488       2%  /vol/vol1/.snapshot

PS> $volSize = Get-NaVolSize vol1

PS> $volSize.VolumeSize

PS> $volSize.VolumeSize / 1GB

PowerShell allows conversion from bytes to Gibibytes (1 GiB = 1024^3 bytes) by dividing the bytes by 1GB.

When using Set-NaVolSize, the size is specified in the same format used by the NetApp CLI.  So, a NewSize value of "214748364800" is just as valid as "200g"

I hope that helps.


NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner