PowerShell script exchange
Post Reply
rawnet
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2021 11:35 am
Contact:

VM Report UsedSize,ProvisionedSize

Post by rawnet »

Hi,

Is it possible to generate csv report like this:
Image

VMname,UsedSize,ProvisionedSize

from PowerShell (Veeam Backup and Replication Community Edition v11)?

Any hints?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by oleg.feoktistov »

Hi,

Can you try these queries?

For Hyper-V:

Code: Select all

$server = Get-VBRServer -Name 'Server Name'
$vms = Find-VBRHvEntity -Server $server -HostsAndVMs
$vms | select Name, UsedSize, ProvisionedSize
For VMware vSphere:

Code: Select all

$server = Get-VBRServer -Name 'Server Name'
$vms = Find-VBRViEntity -Server $server -VMsAndTemplates
$vms | select Name, UsedSize, ProvisionedSize
Thanks,
Oleg
rawnet
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2021 11:35 am
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by rawnet »

Thx for Your reply but I'm getting an empty response:

Image
rawnet
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2021 11:35 am
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by rawnet »

I was using wrong server name. After providing proper server name I'm still not getting the results:
Image
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by soncscy »

Just a practical question, is there a reason you don't want to generate such a report on the HyperV servers themselves? Microsoft has Get-VM and seems like it's better to go that route, no?

I'm sure you have a reason, and I'm just very curious!
rawnet
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2021 11:35 am
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by rawnet »

UsedSize - I can't get it directly from HyperV
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by soncscy »

soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by soncscy »

Also I checked it in my lab quick and get the same within Veeam; seems that for HyperV there isn't the same periodic caching of the data like with VMware. If you go to Inventory you'll see that it sits there "Calculating" for awhile, so I guess there's no persistent data for this stored and it's looked up on the fly?

Is it possible the values just aren't returned to Powershell like it's returned to the UI? I tried refreshing the view in the UI and then recollecting the data, but couldn't get it to work on fully patched v11a
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by oleg.feoktistov » 1 person likes this post

Hi guys,

Talked to QA, Harvey is correct. We don't launch caching for Hyper-V items through powershell.
For the UI we do calculate these values, but we do it manually through opening and summing up vm disk values.
In Powershell the same approach affected performance a lot, so we decided to not reflect this info.
Works for Vi items via Powershell though.

Thanks,
Oleg
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by soncscy »

Ah, interesting.

Is it just that the HyperV API calls (WMI?) are non-performant? (Or VMware's are that much better?) Just seems weird that it'd be that different.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: VM Report UsedSize,ProvisionedSize

Post by oleg.feoktistov »

In fact, they are. It is not much of a difference if you have very few Hyper-V VMs, but it turned out to be an issue with hundreds and even dozens of them.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests