vRealize Orchestrator – Workflow to change DRS setting to default on single VM

0 Flares Filament.io 0 Flares ×

In the post vRealize Orchestrator – Workflow to change DRS setting to default on single VM I presented the workflow to change DRS to manual on single VM. Now it’s the time to change this setting back to the default one, as it was. So to do this it’s quite easy to make a copy of previously create workflow.

And just edit the code of “Scriptable task”, because input parameter and attributes remain the same as in workflow described in previous post.

So input parameter is : vm of type VC:VirtualMachine

and attributes are :cluster of type VC:ClusterComputeResource, Task of VC:Task, pollRate of number. progress of boolean

So the code for the “Scriptable task” should be

So instead of “VcArrayUpdateOperation.add” operation, I create “VcArrayUpdateOperation.remove” which needs on more paramater VM Id, defined in line below

And workflow is ready. However, when I tried to run it, I received

“Error in (Dynamic Script Module name:vim3WaitTaskEnd#20) Task ‘ReconfigureComputeResource_Task’ error: A specified parameter was not correct”

So it seems that there is something wrong with the task itself, but It’s not so easy. So after some digging and checking, error description is a bit misleading and it appears that there is some kind of type mismatch on vm.id.

So property “removeKey” requires a VM Id, which is a defined property of VC:VirtualMachine. However the property type is string.

“removeKey” requires a vm.id but of type “VC:VirtualMachine”

So it can be workarounded in the following way

And now full code of “Scriptable Task” goes like that

And now when I saved workflow it works fine for me. I hope it is useful.

0 Flares LinkedIn 0 Google+ 0 Facebook 0 Twitter 0 Filament.io 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.