Quantcast
Channel: VMware Communities : Discussion List - Site Recovery Manager
Viewing all articles
Browse latest Browse all 3691

Storage Migrating VMs with vRO

$
0
0

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?

 

  1. for(var i in vmsToRelocate){ 
  2.   var vm = vmsToRelocate[i]; 
  3.   task = vm.relocateVM_Task(relocateSpec); 
  4.   var actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ; 
  5.   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

 

 

  1. 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


Viewing all articles
Browse latest Browse all 3691

Trending Articles