Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In ESXi, what is the automation/script (I expect it would be using PowerCLI somehow) approach to modify the number of VCPUs in a VM?

In context, when using our kickstarts, RHEL won't install the SMP kernel unless there is more than one CPU on the machine.

For most cases, there is no reason to want/need more than one VCPU on our VMs, but if we eventually need to use them, the OS has to be installed to a SMP machine, or the kernel doesn't take as full advantage of the available resources as it could.

What we would like to be able to do is the following for life-cycle management:

  • create VM with 2 VCPUs
  • install OS
  • remove VCPU

At a later date:

  • add VCPU(s) as needed

How should we do this?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can use the PowerCLI command to set the number of CPUs on a VM:

Get-VM <VM Name> | Set-VM -numCPU 2
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.