The ability to rightsize VMs has long been one of the most widely used features in Aria Operations. Automation Central gave us even more power with the ability to schedule rightsizing jobs and we've blogged about it several times. But I've always wondered exactly how the rightsizing is done, here's how!
First, we check to see if HotAdd is enabled on the VM, specifically the cpuHotAdd Enabled and the memoryHotAddEnabled properties, details on those properties here.
If these are enabled, we'll adjust the vCPU and/or Memory via the Reconfigure action. We do consider these two Memory properties when adjusting Memory: hotPlugMemoryIncrementSize and hotPlugMemoryLimit
If the HotAdd properties aren't enabled, we'll attempt to power off the VM, make the vCPU and/or Memory adjustments, then power on the VM.
If we can't power off the VM, the attempt will fail. If we're attempting to rightsize multiple VMs from an Automation Central job, the attempt will fail and we'll move on to the next VM. Assuming there are successes in the job, it will then be considered partially successful.