VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

creating snapshot of multiple virtual machines_vRO

Hi llian/All,

could you suggest why i am getting validation error while saving the following workflow.this is to create snapshot of multiple vms which are stored in variable"vms".

though this worked fine but i got validation error which indicates there is something not right.

pastedImage_0.png

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

These are the inputs from the snapshot creation workflow you choose when dropped Foreach element. You need to expose them either as inputs to the wrapping workflow, or you can bind them to attributes. To expose them as inputs or skip them for now and later bound them to attributes, click the Setup button (shown in the upper right on the second screenshot) and process them in the dialog.

When you expose them as inputs, they will be exposed as arrays and when running the workflow you'll have to provide the same number of items in the array as the arrays of VM being iterated. During the iteration, the snapshot creation workflow will be called with the values at the corresponding position in the arrays; ie. the first iteration will get the VM at index 0 and the other parameters from their respective arrays also at index 0, the second iteration will use elements at index 1, etc.

BTW, which snapshot creation workflow do you use? The workflow Create a snapshot I pointed to in a previous post has completely different parameters. Is this some custom workflow?

View solution in original post

8 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Could you post the scripting code as text and not as an image?

From what is seen on the image, the problem is with missing/unbalanced brackets.

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

iam going to send you the code as text in short time .however it is not missing bracket i have already checked that.

this workflow runs fine  and gave deseired output but while saving it gave error .

all i did is to create input parameters which are shown in pink as they are properly bound .howeve  iam using "vm " (shown in black)as iterator not as predefined input parameter

.

can this cause problem

do yu have anyother way of doing it using the native capabilities of vRO without writing code (only drag and dropout of box  different schema elements and binding parameters )

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Yes, there is a way to create snapshots of multiple virual machnes without writing code. You need to use Foreach element to iterate over the array containing virtual machines and for each element of the array to call the workflow Create a snapshot (available under Library > vCenter > Virtual Machine management > Snapshot).

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks llian,

iam checking the another way also however my previous query has been resolved as now iam not getting errors .

i will let you know shortly about another method .

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

this is what i have been trying to do for last two days but unsuccessful.

could you please help me on this .

iam doing following .

1:creating input parameter "vms" to hold list of virtual machines whose snapshot to be taken .in my example three vms and iam inputing them in "vms" .

pastedImage_0.png

2:then i draged foreachelement and search for snapshot creation workflow .it looked like below.

pastedImage_1.png

3:

i set "vms" as array to be traversed .

pastedImage_2.png

4:however  iam not able to understand following can yu please guide me from  step 3 onwards.

pastedImage_3.png

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

These are the inputs from the snapshot creation workflow you choose when dropped Foreach element. You need to expose them either as inputs to the wrapping workflow, or you can bind them to attributes. To expose them as inputs or skip them for now and later bound them to attributes, click the Setup button (shown in the upper right on the second screenshot) and process them in the dialog.

When you expose them as inputs, they will be exposed as arrays and when running the workflow you'll have to provide the same number of items in the array as the arrays of VM being iterated. During the iteration, the snapshot creation workflow will be called with the values at the corresponding position in the arrays; ie. the first iteration will get the VM at index 0 and the other parameters from their respective arrays also at index 0, the second iteration will use elements at index 1, etc.

BTW, which snapshot creation workflow do you use? The workflow Create a snapshot I pointed to in a previous post has completely different parameters. Is this some custom workflow?

jvm2016
Hot Shot
Hot Shot
Jump to solution

I am trying this again as per yur suggestion and will let yu know .

however i am doing this on hand son lab 1825-01 and using the outof box workflow .it should not be custom one.

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i checked again it should be the "create a snapshot for VC plugin ".by mistake i dragged for vra.

once i dragged it took vms as array to be traversed and bind to local vm parameter .

pastedImage_0.png

pastedImage_1.png

then made name,description,memory and quiesce as input parameters.

pastedImage_2.png

pastedImage_3.png

finally it was kind enough to work i will check other workflows with foreach.thanks for your help.

0 Kudos