Automation

 View Only
Expand all | Collapse all

get Datastore Overprovisioned% in percentage

  • 1.  get Datastore Overprovisioned% in percentage

    Posted Dec 06, 2019 12:10 PM

    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



  • 2.  RE: get Datastore Overprovisioned% in percentage

    Posted Dec 06, 2019 12:15 PM

    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%?



  • 3.  RE: get Datastore Overprovisioned% in percentage

    Posted Dec 06, 2019 12:36 PM

    well, 150% would be fine...



  • 4.  RE: get Datastore Overprovisioned% in percentage
    Best Answer

    Posted Dec 06, 2019 01:11 PM

    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



  • 5.  RE: get Datastore Overprovisioned% in percentage

    Posted Dec 06, 2019 03:07 PM

    cool,

    thanks Luc



  • 6.  RE: get Datastore Overprovisioned% in percentage

    Posted Dec 21, 2019 06:47 AM

    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



  • 7.  RE: get Datastore Overprovisioned% in percentage

    Posted Dec 21, 2019 07:04 AM

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



  • 8.  RE: get Datastore Overprovisioned% in percentage

    Posted Jan 04, 2020 06:50 AM

    LucD,

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

    thanks

    v



  • 9.  RE: get Datastore Overprovisioned% in percentage

    Posted Jan 04, 2020 08:33 AM

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



  • 10.  RE: get Datastore Overprovisioned% in percentage

    Posted Jan 04, 2020 05:46 PM

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

    thanks

    v



  • 11.  RE: get Datastore Overprovisioned% in percentage

    Posted Apr 17, 2023 03:03 PM

    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.



  • 12.  RE: get Datastore Overprovisioned% in percentage

    Posted Apr 17, 2023 06:28 PM

     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.



  • 13.  RE: get Datastore Overprovisioned% in percentage

    Posted Apr 18, 2023 07:38 AM

    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.



  • 14.  RE: get Datastore Overprovisioned% in percentage

    Posted Apr 18, 2023 07:55 AM

    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