Hi i found this code in the forums. Im new with vRO, how do you specify whch VMs are to be moved? And how do you move both storage and hosts?
- for(var i in vmsToRelocate){
- var vm = vmsToRelocate[i];
- task = vm.relocateVM_Task(relocateSpec);
- var actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;
- System.log("Storage vMotion performed for VM : " + vm.name);
- }
**This code loops through all the VMs you select to migrate one at a time, it waits for the storage vMotion to complete for each VM before it executes the loop again for the next VM.
If you do want to do the storage vMotion in parallel for some VMs you can duplicate the code and just remove the line
- var actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate);
**and vRO will just execute the loop for each VM in parallel.
Thanks