VMware Cloud Community
vmk2014
Expert
Expert
Jump to solution

Can we get the list of Data store reach threshold 85 % ?

Hi All,

Can we pull the report for the  lists of Datastore having crossed the threshold of 85 % or reached the threshold 85%.  ?  Also, want to know the free space left in the data store.

E.g Total capacity (TB) and free space left ( TB)

Thanks

vmk

Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Sure, try like this

Get-Datastore |

   where {$_.FreeSpaceGB / $_.CapacityGB -le .25} |

  Select -Property Name,CapacityGB,FreeSpaceGB,

   @{N='FreeSpace%';E={"{0:P}" -f ($_.FreeSpaceGB / $_.CapacityGB)}}


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

View solution in original post

Reply
0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Datastore |

   where {$_.FreeSpaceGB / $_.CapacityGB -le .25}


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

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

Can we add  % free space also?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, try like this

Get-Datastore |

   where {$_.FreeSpaceGB / $_.CapacityGB -le .25} |

  Select -Property Name,CapacityGB,FreeSpaceGB,

   @{N='FreeSpace%';E={"{0:P}" -f ($_.FreeSpaceGB / $_.CapacityGB)}}


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

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

Can we get Cluster name also in the report ?

Thanks

vmk

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Datastore |

   where {$_.FreeSpaceGB / $_.CapacityGB -le .25} |

  Select -Property Name, CapacityGB, FreeSpaceGB,

@{N = 'FreeSpace%'; E = {"{0:P}" -f ($_.FreeSpaceGB / $_.CapacityGB)}},

@{N = 'Cluster'; E = {(Get-VMHost -Datastore $_ | Get-Cluster).Name}}


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

vmk2014
Expert
Expert
Jump to solution

Thank you  LucD.

Reply
0 Kudos