VMware Cloud Community
Arkady
Contributor
Contributor
Jump to solution

Create custom virtual machine workflow

Hello,

I am using a native workflow "Create custom virtual machine", but it does not allow to deploy a machine from the ntemplate.

It builds a raw VM with custom specs. Some other workflows allow to deploy VM from the template but without customization.

Is it possible to include a template option to "Create custom virtual machine" workflow?

Thank you in advance

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Use multiple workflows and actions as building blocks to build one that meets your needs.. For example, let's say you want to deploy a Windows VM with customization...

Create a new workflow called "Deploy Windows VM"

Inside that workflow, add the following workflows:

Clone, Windows with single NIC and credential <-- this will Clone a VM Windows VM from template, perform Sysprep (change unique ID, guest os name, set administrator password, join domain if specified, and set IP address as specified).

Take the output (a new VM) from that workflow and pass it to each of the following workflows/actions:

  • Change RAM (Workflow)
  • Add disk (Workflows)
  • changeVMvCPU (Action)

should look a little something like this:

Screen Shot 2011-09-26 at 4.44.08 PM.png

Once you have everything linked together properly and all the bindings set, you'll probably want to adjust the Presentation so that the CPU/Mem are in the right section, as well as the Additional Disk info.. Below is a quick example:

Screen Shot 2011-09-26 at 4.44.55 PM.png

This process would be replicated, but using a Linux specific clone workflow to meet similar needs deploying customized Linux VMs.

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
15 Replies
tschoergez
Leadership
Leadership
Jump to solution

Hi!

There is the "Change Virtual Hardware"-checkbox in vSphere Client, which allows "customizing" the hardware during deploying a template.

This is also, what the "Create custom Virtual Machine" does.

If you want this, you could modify the clone-workflow, and include the VcVirtualMachineConfigSpec when calling the cloneVM()-Method.

Then, there is the Guest Customization, which sets hostname, IP, .... inside the guest os during deployment from template.

This is a compelte different thing, here there are some workflows in the library available.

Also, see for further ideas:

http://communities.vmware.com/message/1819483?tstart=0

http://www.vcoportal.de/2011/04/customize-a-virtual-machine/

http://www.vcoteam.info/development/how-to-deploy-vms-form-template-in-orchestrator.html

What kind of customization do you want?

Regards,

Joerg

0 Kudos
Arkady
Contributor
Contributor
Jump to solution

Hello Joerg,

I need to deploy VM from the template (Linux and Windows) but with ability to add disk, change RAM, CPU, assign IP address and name.

0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

Use multiple workflows and actions as building blocks to build one that meets your needs.. For example, let's say you want to deploy a Windows VM with customization...

Create a new workflow called "Deploy Windows VM"

Inside that workflow, add the following workflows:

Clone, Windows with single NIC and credential <-- this will Clone a VM Windows VM from template, perform Sysprep (change unique ID, guest os name, set administrator password, join domain if specified, and set IP address as specified).

Take the output (a new VM) from that workflow and pass it to each of the following workflows/actions:

  • Change RAM (Workflow)
  • Add disk (Workflows)
  • changeVMvCPU (Action)

should look a little something like this:

Screen Shot 2011-09-26 at 4.44.08 PM.png

Once you have everything linked together properly and all the bindings set, you'll probably want to adjust the Presentation so that the CPU/Mem are in the right section, as well as the Additional Disk info.. Below is a quick example:

Screen Shot 2011-09-26 at 4.44.55 PM.png

This process would be replicated, but using a Linux specific clone workflow to meet similar needs deploying customized Linux VMs.

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
Arkady
Contributor
Contributor
Jump to solution

Joerg,

Thank you very much!

I added 2 workflows: Cloning and Change RAM just to test.

As a result VM was cloned from the template but then workflow "Change RAM" tried to change a memory on a template instead of VM.

Assume because the output new VM was not passed to "Change RAM" workflow. How can I do this?

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

You need to link the output vm of the first workflow to an attribute (see example here: http://www.vcoteam.info/learn-vco/create-a-simple-vco-self-service-vm-provisioning-portal-part-1.htm... where I link the new VM to a newVm attribute) and use this new VM attribute as input of the second workflow.

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
Arkady
Contributor
Contributor
Jump to solution

Hello Christophe,

Thank you very much - it worked!

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Glad it worked.

Please mark this discussion as answered and mark useful answers in the discussions so other community users can use this as a reference.

Thanks,

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
pushmycar
Contributor
Contributor
Jump to solution

Hi Everyone,

Sorry for the thread necromancy, but I've been working on a deployment flow based on these suggestions but I'm running into a major problem during the execution. It fails while cloning with the following error:

Task 'CloneVM_Task' error: Customization of the guest operating system 'windows7Server64Guest' is not supported in this configuration. Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations. (Dynamic Script Module name : vim3WaitTaskEnd#20)

Our hosts are running 5.1 ! Do you think its an issue with VMware tools ?

0 Kudos
pushmycar
Contributor
Contributor
Jump to solution

FYI everyone it was a VMware tools issue, it looks like. I installed the latest version on the template and re-ran the workflow and it got past that part (though failed on another I'm working out now).

0 Kudos
pushmycar
Contributor
Contributor
Jump to solution

Hi Burke,

I followed your instructions in this thread to create an autodeployment workflow but I'm running into a problem.

If I run the workflow by trying to clone from a template the setup gets pretty far and fails with the error "Task 'ReconfigVM_Task' error: The operation is not supported on the object. (Dynamic Script Module name : vim3WaitTaskEnd#20)"

If I run it by trying to clone from a VM it fails moments after beginning to clone with the error "VIM Task is null (Dynamic Script Module name : vim3WaitTaskEnd#35)"

The #20 and #35 seem like line addresses but the script for that task is only one line. What do the numbers at the end of the error messages signify ?

I'm using Orchestrator and vSphere 5.1

Any troubleshooting steps you'd reccomend would be very very much appreciated.

Thanks,

Neil

0 Kudos
pushmycar
Contributor
Contributor
Jump to solution

Converting the template to VM and then back to template is an option too but I'm not sure at what point to do the conversion since both of the error messages are occuring during the vim3waittaskend portion of the workflow.

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

If you clone the VM make sure you do not have the option to power on the VM as the workflows changing RAM, CPU need a powered of VM.

If it is not that I suggest looking at the vCenter logs to see what happens.

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
pushmycar
Contributor
Contributor
Jump to solution

Hi Christophe, when I tried the VM method it wasn't with a powered on VM.

I'm going to pull some logs from the Log Browser in vCenter right now and post here while I look at them.

0 Kudos
pushmycar
Contributor
Contributor
Jump to solution

Hi Christophe,

Which logs should I be looking at ? I'm looking at the vpxd logs on vCenter around the time of a clone operation from the workflow but I'm not seeing anything that immediately stands out as related. Am I way off ?

Thanks for your help,

Neil

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I was expecting that you would have something in the vpxd logs (since the error is coming from vCenter).

Do you get the same error if you pause the workflow (insert a user interaction) and then proceed to the wanted change in vCenter manually ?

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