Hi, I'm new to vRealize Orchestrator.
We are trying to use one of the built-in workflows called "Remove Old Snapshots" but this task fails when we have one or more hosts in standby mode.
We are using DPM to automatically power off hosts when the utilization is low.
The part which is failing is:
var hosts = VcPlugin.getAllHostSystems(); var instance = new VcManagedObjectReference(); instance.type = "ServiceInstance"; instance.value = "ServiceInstance"; var instanceObject; var timeVC; var myHostDateTimeSystem; var timeHost; var differenceInMinute; for each (host in hosts){ instanceObject = VcPlugin.convertToVimManagedObject(host , instance); timeVC = instanceObject.currentTime().getTime(); myHostDateTimeSystem = VcPlugin.convertToVimManagedObject(host , host.configManager.dateTimeSystem); timeHost = myHostDateTimeSystem.queryDateTime().getTime(); differenceInMinute = (timeHost-timeVC)/60000; if(differenceInMinute<0)differenceInMinute = -differenceInMinute; if(differenceInMinute>2){ bigDifference=true; break; } }
Does anyone know if it's possible to create a filter in this code to remove standby or disconnected hosts?