VMware Cloud Community
TheVMinator
Expert
Expert

What does ProvisionedSpaceGB Include?

Can anyone tell me if provisionedSpaceGB in powerCLi includes space for all virtual machine files such as swap files and page files?

Thanks!

0 Kudos
6 Replies
LucD
Leadership
Leadership

Afaik, yes, this includes all files.

You can do the following, it will show three values.

In case of Thin Disks you can see a difference between Provisioned and Used.

The calculated property FileTotal, takes the actual size of each file (including .vswp), and summaries.
You'll notice that UsedSpaceGB and FileTotal are more or less the same value (small difference might exists due to rounding).

Get-VM |

Select Name,ProvisionedSpaceGB,UsedSpaceGB,

    @{N='FileTotal';E={($_.ExtensionData.LayoutEx.File | Measure-Object -Property Size -Sum).Sum/1GB}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

TheVMinator
Expert
Expert

OK thanks - during times when a VM is running, the size of the swap file may increase or decrease.  Does this mean that "provisionedspaceGB" will also rise and fall as the swap file size increases and decreases during use?

0 Kudos
LucD
Leadership
Leadership

Afaik, the swap space is not included in this number.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

TheVMinator
Expert
Expert

OK thanks - it looks like I still may be a bit unclear then how to solve my problem.  Basically I have a lot of VMs with big swap and page files that take up space on datstores.  If the sum of all these page and swap files is a very large amount of space, I need to account for that.

The problem is that if I just take usedspaceGB or provisionedspaceGB using powerCLI, I'm not sure that I'm really accounting for how much total space might actually be needed to account for large swap and page files that might grow while VMs are powered on and having data written to swap / page.

Does this make sense and is there a surefire way to report on page and swap file size using PowerCLI?

Thanks!

0 Kudos
LucD
Leadership
Leadership

You could look at the each of the individual files that constitute a VM.

I did something like that in my Yadr – A Vdisk Reporter post.

In it's current form the script looks at all VMs, but it shouldn't be too hard to only look at a specific set of VM, or at all the VM on a specific datastore.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gordonng
Contributor
Contributor

Swap file sizes do not change. They are based on Memory allocated minus memory reserved.

 

I believe you are referring to snapshots that change.

 

I do not know if swap files are counted in ProvisionedSpaceGB.

0 Kudos