VMware Cloud Community
rogeraraj
Contributor
Contributor
Jump to solution

CloneVM with spefic CPU count

Hello Guys!

I am using CloneVm to create a new VM, but I would like to specify the number of CPUs. I have researched a little and figured out I could use 'changeVMvCPU' to achieve that. However I was wondering if it is not possible to define the CPUs count direct on 'CloneVM'. Does any one knows?

Thanks,

Roger

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

You can re-write your own cloneVM operations, manually rebuilding the action/workflow to add appropriate configSpec to modify the hardware at the time of the clone.. if you REALLY want to. I have never bothered as it has not been worth the effort since the way I outlined uses existing workflows and actions that don't add significant time to the overall deployment time. The choice is yours so in short the answer is YES you should be able to do this in one call, it's just a bunch of effort to get it setup Smiley Wink

See the code inside the changeVMvCPU action to see how to set the configSpec needed for CPU. Other important actions to look at code:

cloneVM - note the "spec" input

getCloneSpec

getConfigSpec

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
6 Replies
Burke-
VMware Employee
VMware Employee
Jump to solution

Build your custom workflow that calls the clone workflow, THEN once that's done, use the action within your workflow to modify the CPU count of the newly created VM. When you see such operations in vCenter, you may watch tasks when performed manually and see clone operation, followed by other operations that perform customization and hardware modifications.

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

Hello, I am currently doing exacly as you mentioned. What I would like to know is if there is some script or parameter that I could give to 'CloneVM' to configure CPU count to me. So VM would get created with everything configured.

After your explanation it seems not a bad practice to create the VM and then modify its properties, right?

Thank you!

0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

You can re-write your own cloneVM operations, manually rebuilding the action/workflow to add appropriate configSpec to modify the hardware at the time of the clone.. if you REALLY want to. I have never bothered as it has not been worth the effort since the way I outlined uses existing workflows and actions that don't add significant time to the overall deployment time. The choice is yours so in short the answer is YES you should be able to do this in one call, it's just a bunch of effort to get it setup Smiley Wink

See the code inside the changeVMvCPU action to see how to set the configSpec needed for CPU. Other important actions to look at code:

cloneVM - note the "spec" input

getCloneSpec

getConfigSpec

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
Burke-
VMware Employee
VMware Employee
Jump to solution

Hmmm... Actually....

It seems some of the library workflows have things in place for this request, but simply don't expose the inputs.. For example, for Clone/Customize Windows:

Clone, Windows with single NIC and credentials EDIT: Same steps below apply to the Clone, Linux with single NIC, and the other Clone/Customization workflows.

  • Duplicate this workflow
  • Edit
  • Select the getConfigSpecSimple action
  • Change the memoryMB and numCPUs inputs from null to new Input Parameters with matching names
  • Save and Close
  • Run workflow, provide amount of memory and cpu count

The change above will build the config spec to include the memory and CPU count.

Honestly, I never bothered looking deeper into this until your request because it was simply easier/faster to just use existing library elements Smiley Happy

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

I really appreciate your help!

0 Kudos
chrisheartland
Enthusiast
Enthusiast
Jump to solution

Interesting. I have a similar use case for adding a vDS portgroup and using a datastore cluster and a host cluster. In the default workflow, you can only use a standard swtich, a single host, and a single datastore. I have an additional action to change to a vDS (similar to your suggestion) but I have yet to look for a way to provision directly to a host/datastore cluster vs. the individual resources.

0 Kudos