VMware {code} Community
bblood
Contributor
Contributor

Working "Relocate VM" workflow

I noticed that the "Relocate VM" workflow as shipped with vCO 4.0 is broken. A simple workflow that includes it and nothing else results in:

Cannot convert ch.dunes.model.sdk.FinderResult@19adc90 to com.vmware.vim.vi4.VirtualMachineRelocateTransformation (Workflow:Relocate VM / Relocate VM (item0)#5)

I took a look at its implementation and made a new workflow consisting of the same two elements (a scriptable task and vim3WaitTaskEnd), but changed the scriptable task to use:

/* begin script */

var my_transform = VcVirtualMachineRelocateTransformation.fromString(dst_transform.name);

var relocateSpec = new VcVirtualMachineRelocateSpec();

relocateSpec.datastore = dst_datastore.reference;

relocateSpec.disk = null;

relocateSpec.host = dst_host.reference;

relocateSpec.pool = dst_pool.reference;

relocateSpec.transform = my_transform;

var priority = VcVirtualMachineMovePriority.fromString(dst_priority.name);

var task = vm.relocateVM_Task(relocateSpec, priority);

/*end script */

I had to add an extra input for 'priority' as well.

I recall encountering a few other default workflows in the past that don't work - I believe the one that corresponds to VMotion of a running guest needs a similar fixup.

Reply
0 Kudos
1 Reply
admin
Immortal
Immortal

Yes Brent, this seems to be bug as the correct RelocateVM_task API is not getting invoked. We have filled an internal bug for the same.

Thanks for letting us know.

You had also mentioned observing some errors in other built-in workflows, it would be great to have your inputs on them as well.

Thanks,

Angela

Reply
0 Kudos