VMware Cloud Community
vespavbb
Enthusiast
Enthusiast
Jump to solution

get Datastore Overprovisioned% in percentage

Hi,

I try to generate a report where I can see the overprovisioned in percentage. but the math does not work. Can someone help me out here?

$dsrz1 = get-datastore | where-object {$_.name -match “RZ1_”} | get-view

$dsrz1rreport = @()

foreach($ds1 in $dsrz1){

   

  $ds1 = $dsrz1 | select -expandproperty summary | select name,

@{N=”Capacity (GB)”; E={[math]::round($_.Capacity/1GB,2)}},

@{N=”FreeSpace (GB)”;E={[math]::round($_.FreeSpace/1GB,2)}},

@{N='Overprovisioned%';E={[math]::Round(100/$_.Capacity*$_.ProvisionedSpaceGB,1)}},

@{N='Freespace%';E={[math]::Round($_.Freespace/$_.Capacity*100,1)}},

@{N=”Provisioned (GB)”; E={[math]::round(($_.Capacity – $_.FreeSpace + $_.Uncommitted)/1GB,2) }}| sort -Property Name

    $dsrz1rreport += $ds1

       

      

}

$dsrz1rreport

VCP4,VCP5,VCP6,VCP7,VCP8
Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-View -ViewType Datastore -Property Name,Summary -Filter @{Name="RZ1_"} |

Select Name,

@{N=”Capacity (GB); E={[math]::round($_.Summary.Capacity/1GB,2)}},

@{N=”FreeSpace (GB);E={[math]::round($_.Summary.FreeSpace/1GB,2)}},

@{N='Overprovisioned%';E={[math]::Round(($_.Summary.Capacity - $_.Summary.FreeSpace + $_.Summary.Uncommitted)/$_.Summary.Capacity*100,1)}},

@{N='Freespace%';E={[math]::Round($_.Summary.Freespace/$_.Summary.Capacity*100,1)}},

@{N=”Provisioned (GB); E={[math]::round(($_.Summary.Capacity$_.Summary.FreeSpace + $_.Summary.Uncommitted)/1GB,2) }} |

Sort-Object -Property Name


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

View solution in original post

Reply
0 Kudos
13 Replies
LucD
Leadership
Leadership
Jump to solution

How do you want to see the overprovisioned percentage?

Assume the capacity is 100GB and you assigned 150GB, would you show this as 150% or 50%?


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

Reply
0 Kudos
vespavbb
Enthusiast
Enthusiast
Jump to solution

well, 150% would be fine...

VCP4,VCP5,VCP6,VCP7,VCP8
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-View -ViewType Datastore -Property Name,Summary -Filter @{Name="RZ1_"} |

Select Name,

@{N=”Capacity (GB); E={[math]::round($_.Summary.Capacity/1GB,2)}},

@{N=”FreeSpace (GB);E={[math]::round($_.Summary.FreeSpace/1GB,2)}},

@{N='Overprovisioned%';E={[math]::Round(($_.Summary.Capacity - $_.Summary.FreeSpace + $_.Summary.Uncommitted)/$_.Summary.Capacity*100,1)}},

@{N='Freespace%';E={[math]::Round($_.Summary.Freespace/$_.Summary.Capacity*100,1)}},

@{N=”Provisioned (GB); E={[math]::round(($_.Summary.Capacity$_.Summary.FreeSpace + $_.Summary.Uncommitted)/1GB,2) }} |

Sort-Object -Property Name


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

Reply
0 Kudos
vespavbb
Enthusiast
Enthusiast
Jump to solution

cool,

thanks Luc

VCP4,VCP5,VCP6,VCP7,VCP8
Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

Can we pull over provisioning report for  all the data store in vc ? current script is specific to particular data store. i.e. RZ1

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, just leave out the -Filter parameter on the Get-View cmdlet.


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

vmk2014
Expert
Expert
Jump to solution

LucD,

Can we add data store utilization statistics (percentage used & percentage free) along with data store over provisioning % ?

thanks

v

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, use calculated properties (similar to the other thread I just replied to).


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

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

Thank you. You are awesome and this forum is active & alive because of  you. I'll check and test.

thanks

v

Reply
0 Kudos
VassilisC
Contributor
Contributor
Jump to solution

ok, my message probably was not on the correct section but from here i got the info.

You deleted my message but you could mnove it to a more appropriate thread or make a new thread or at leaste notify my !

I wrote three paragraphs and now my message is gone and i cannot find it, very difficult to rewrite it. Does it exist anywhere ? an admin bin something that you can send me over DM so i can create a new thread.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

 Vassilis I assume you mean me?
Would be helpful if you tagged me in that case.

And no, I didn't delete your message.
It was automatically moved to the spam folder.

LucD_1-1681755939902.png

And no, I'm afraid I can't see the original content anymore.


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

Reply
0 Kudos
VassilisC
Contributor
Contributor
Jump to solution

No i didn't mean you, i do not know who is handling the admin of the page.

But you said the message was not deleted but it was automatically sent to spam folder ?! why ? did i use a bad keyword ?

this was a legit post (ok wrong category) but not have an admin move it or tell me about and automatically(!) moved to spam is completely not fair for the user. So why was moved to spam, automatically.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I don't know why that happened.
Perhaps ask in the Technical Community Resources and Help Discussions



In the meantime, I was able to fish up your post.
I don't see an immediate reason why that would be marked as spam.

========================================

Hi,

I have used the script and got the following output on my selected datastore

Name             : <storage>
Capacity (GB)    : 10239,75
FreeSpace (GB)   : 3228,69
Overprovisioned% : 98,1
Freespace%       : 31,5
Provisioned (GB) : 10046,6

 

This is the image i get when adding a disk (which shows the overprovisioning) from VCenter 7

LucD_0-1681804108473.png

 

Excuse my ignorance but i'm very confused about the results and what do they actually means in terms of "getting the LUN dead"

From the screenshot my logic says that the capacity is 10TB i have provisioned 9.81 TB and the Free is 3.15TB which accordind to math 9.81+3.15=12,96 it is over 10TB so you are in a bad position.

From the excellent script of LucD a get the %of overprovisioned to be 98.1 which what does it mean it is below 100%, is it overprovisioned ?

What is my margin here ? the freespace% 31% means what? is this the 3.15TB the 31.5% freespace% ?

Does this mean that when the thin disks allready on the VMs grow 10TB-9.81TB (from the image) =190GB more the lun will be full and stopped working.

Sorry for the confusing questions, if anyone can try and help will be greatlly appreciated.

regards,

Vassilis


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

Reply
0 Kudos