Hi! I have a workflow i created a long time ago that aids in deploying new VMs from templates.
It will allow me to add additional disks to the VM at deployment time, set them to thin provisioned, add whatever nics I need, generate macs... all the boring stuff I dont want to do manually every time.
However, since upgrading to 8.10 I get an error message when I add duplicate values into the array I use to build the disk sizes.
Say someone asks for a VM with 3 50 GB disks and 2 150 GB disks.
When I try to add that second '50' to the array I get a message "Data provided is already entered."
There are obviously situations where folks are going to want more than one entry of the same value in an array, so this must be a bug, right?
I think this is not a vRO issue but a custom form limitation. For me it seems the data grid first column is a "key" that has to be unique.
I suggest to use an array instead, as an input:
That would result in a form:
Hi,
I was curious about this so wrote a quick workflow to look into it on the 8.10 instance I'm using
The workflow has a String/Array attribute like this
No problem adding duplicates that I could see
The workflow script task looks like this (basically adds *another* duplicate value to the Array and prints the result) - Again no problem there. The second part is just a JS object where I tried to set duplicate keys but it behaved as expected
Output when I run it is here
Can you give a little more detail on what the context of your usage is & maybe share the problem code?
Sure. I probably didnt do a great job of describing my issue, and im starting to wonder if it is even related to orchestrator.
I have an input form (a datagrid) where I take an array of numbers:
But i
This is where I am getting the error message. I dont think it is even running any of my javascript code yet, save for the action I created which loads the default value by getting the current size of the disk for the template you are running the workflow on:
And now if I try to add another 90 to this array, the form throws this error:
So I havent even submitted the form to run any of the javascript at this point.
And now to make matters even weirder.. I shut down my orchestrator appliance, and restored the previous 8.6 version that had been working before..
and I am still getting this error. I had to troll through past workflow runs to prove to myself that I am not crazy and that this used to work.
Here you can see I had an array with 10 numbers and numerous duplicates.
This run was done with 8.6. 8.10 is where I first saw the issue, but now I am seewing it with 8.6! crazy.
I did update vcenter to build 20990077, but I am running this workflow from the vRO client at this point, so that shouldnt affect this, right?
im baffled.
I think this is not a vRO issue but a custom form limitation. For me it seems the data grid first column is a "key" that has to be unique.
I suggest to use an array instead, as an input:
That would result in a form:
I built this workflow so long ago that I don't know why I used the datagrid, or why it used to work and suddenly stopped.
But your solution looks way better. 🙂
Thanks! I'll give it a go.
Ahhh.. I see why I used a datagrid now.
With a datagrid I was able to call an action to get the size of the templates disk and fill it in as a default value.
Then, if the user running the workflow changed the value to something larger the workflow would increase the disk size (if they changed to something smaller it just ignored it and left that disk size alone), and additional entries added to the datagrid would be added as additional disks.
It looks like I cant do that if I use the array?
Edit: no, I was wrong. you can totally do that.