vRO Return Datastores over a specified TB size

This code will return only the datastores over a specified Terabyte size.

Set two input parameters

inputTB as type number, this will be the TB size that will determine the Datastores to return.

set another input parameter as inDS as array type VC:Datastore

Set the output parameter as outDS as array type VC:Datastore


var tbSize = inputTB * 1073741824;

System.log("Variable tbSize is "+tbSize);

var ds = new Array();

for each (d in inDS){ if (d.summary.capacity >= tbSize){ ds.push(d);} System.log("name: " + d.name +" Size: "+ d.summary.capacity);}

outDS = ds;

Advertisement