Code / Python · August 10, 2024

Storage: Cluster and Datastore Utilization

Datastore Utilization: Script to monitor datastore usage and send alerts if usage exceeds a threshold

 

for datastore in datacenter.datastore:
if datastore.summary.capacity – datastore.summary.freeSpace < threshold:
print(f”Warning: Datastore {datastore.name} is running out of space!”)