vmk2014
Expert
Expert

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

Jump to solution

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

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

0 Kudos
6 Replies
LucD
Leadership
Leadership

Try like this

Get-Datastore |

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


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

0 Kudos
vmk2014
Expert
Expert

Can we add  % free space also?

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
vmk2014
Expert
Expert

LucD,

Can we get Cluster name also in the report ?

Thanks

vmk

0 Kudos
LucD
Leadership
Leadership

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

Thank you  LucD.

0 Kudos