VMware Cloud Community
tdubb123
Expert
Expert

esxi 5.5 schedule svmotion VMs

IS it possible to do a schedule svmotion migration of all vms from one datastore to another? Can I create a workflow for this?

Reply
0 Kudos
2 Replies
iiToby
Enthusiast
Enthusiast

Hi tdubb123,

The easiest way I can think of doing this is using a PowerCLI Script

Get-Datastore DS_Source | Get-VM | Move-VM -Datastore DS_Destination

Have that run as a scheduled task in a script and you should be good to go.

Kind Regards

@iiToby

Reply
0 Kudos
maaca
Enthusiast
Enthusiast

I'm using VM.relocateVM_Task() to vMotion/svMotion/XvMotion VMs.

Usage:

...

var spec = new VcVirtualMachineRelocateSpec();

spec.datastore = targetDS;

spec.host = targetHost;

spec.pool = resourcePool;

task = VM.relocateVM_Task(spec, VcVirtualMachineMovePriority.defaultPriority);

...

Reply
0 Kudos