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;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s