VMware Cloud Community
trmtbi
Contributor
Contributor

Cloning multiple VMs / Workflow

Hi,

it's ease to create a workflow with orchestrator to clone a vm one time.

But I need a workflow to clone a vm multiple times e.g. 20

I think I must build a loop with user choise for the number of vms to build.

And there must be a script to modifiy the new vm name for each loop:

first clone: vm name = vm01

second clone: vm name = vm02

..

Any idea for an example?

(my knowledge in self scripting is not so good)

Have a nice day

Best Regards

Tom

--

0 Kudos
7 Replies
cdecanini_
VMware Employee
VMware Employee

Here is an example on creating a workflow loop. It can be adapted to clone VMs and change name on each loop.

http://www.vcoteam.info/learn-vco/creating-workflow-loops.html

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
trmtbi
Contributor
Contributor

thanks, I've seen this tutorial before and I have build a workflow with a simple loop.

The loop is still working, I have build a "dialog" to ask how much clones should be created first. The part "decrease counter", "VMs left" and "Clone VM" is working, but I have problems to build the part with the script that generate the new vm names for each loop. Is there an example specially for this?

Best Regards

Tom

--

0 Kudos
cdecanini_
VMware Employee
VMware Employee

Not specifically but this should be as simple as a scriptable box with

index++;

vmname = name + index;

With :

index, a number in the in and out parameters of the scriptable box

vmname, a string in the  out parameters of the scriptable box

name, a string in the in parameters of the scriptable box

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
trmtbi
Contributor
Contributor

I think it could be easer for you to have a look into my test workflow (attachment)

So you can see my first dilletantish steps to use the orchestrator workflow mechanism..   Smiley Happy

Best Regards

Tom

--

0 Kudos
cdecanini_
VMware Employee
VMware Employee

There are 2 fixes needed:

1 - Set new VM must be before the cloneVM workflow

2- cloneVM name input need to be linked on the vmName (you spelled it vmname) attribute.

Screen shot 2012-08-23 at 1.47.25 PM.png

Als I am not sure why you set the number of VMs in a user interaction instead of having an input in the main workflow presentation.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
trmtbi
Contributor
Contributor

Great, it works, thanks!

You see, I'm a orchestrator beginner.

I set the numer of VMs in a userinteraction because this workflow could be one possibility to build a "classroom scenario" in futurehttp://dict.leo.org/ende?lp=ende&p=DOKJAA&search=possibility&trestr=0x8001. One day I need the vm ten times, another day 50 times. The template, datastore and ressource pool would be the same all times, so I could set these parameters fixed in the final workflow. And the workflow must clone the vm including sysprep.

The first major hurdle is passed - Thanks again for your help!

Best Regards

Tom

--

0 Kudos
cdecanini_
VMware Employee
VMware Employee

Glad it worked.

If all parameters are defaulted except the number of VMs then you could move your input parameters as workflows attributes and set them once and move the user interaction one as an input parameter.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos