Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: Wokflow Exercise

$
0
0

Hi sorina,

 

here you will get your sample as "Scriptable Task" workflow code:

 


var allVms = new Array() ; // Declares 'allVms' as Array
allVms = System.getModule("com.vmware.library.vc.vm").getAllVMs(); // Returns all VMs

for each ( var vm in allVms ) // Runs now for each VM in 'allVms' Array
{
    if ( vm.name.search("x") != -1 ) // Is there a 'x' within the attribute 'name' of 'vm'
    {
        System.log( "Power On " + vm.name ); // Write the name of the VM to log
        vm.powerOnVM_Task(); // Powers On the virtual machine
    }
}

 

 

Scripting within vCenter Orchestrator is with javascript. So all you have to know is javascript and about to use the API of vCO. You will find very good examples on:

http://www.vcoteam.info/

http://www.vcoportal.de/

 

Hope this will help you getting started

 

Regards,

Chris


Viewing all articles
Browse latest Browse all 252940

Trending Articles