How to change configuration of virtual machine from command line of VMWare ESXi host

vmware-esxivmware-vsphere

I need to automate some tests that each time the number of CPUs and memory size of the Virtual Machine is changed. I'm wondering how to change them from command line? It seems starting and stopping guest os can be done from ESXi host's command line. But is there a command to change the virtual machine's #CPUs and memory size? Or in general, can this be done in a command line manner?

Best Answer

The easiest way to do this would be through PowerCLI, which is a PowerShell plugin for vSphere. With that you can use the Set-VMResesourceConfiguration cmdlet to modify the resource configuration of your guest machines.