VMware Cloud Community
Luca82
Enthusiast
Enthusiast

Hot remove cpu/ram from vm

Hi everyone, I'm struggling to understand if is it possible to hot-remove cpu or ram from a vm as well as I can hot-add. Thank you

Reply
0 Kudos
7 Replies
Alex_Romeo
Leadership
Leadership

Hi,

You can do it if the Guest operating system allows it and it has been previously set to accept "hotadd"

Enable CPU Hot Add

https://www.vmwareblog.org/hot-add-ram-hot-plug-vcpus-vsphere-vms-different-environments/

https://www.altaro.com/vmware/vmware-hot-add/

Operating System support.

Not all operating systems support hot-add CPU and memory. I do know Red Hat has support for it and it has worked for me on Ubuntu/Debian machines before but the best thing to do is to check the VMware Compatibility Guide as it’s always updated. Generally, the operating systems listed below support the feature. I’ve had good success with Red Hat, Ubuntu and Debian Linux VMs.

  • Linux: Newer Linux kernels have support for CPU hot add. To verify this, check the documentation for your Linux distribution in the documentation directory of the distribution source code. The documentation contains directions for special boot time switches related to CPU Hot Plug. CPU hot-remove is not supported at this time.
  • Windows Server 2003 32bit/64bit – (Standard and Enterprise)
  • Windows Server 2008 32bit (Standard, Enterprise and Datacenter)
  • Windows Server 2008 64bit (Standard, Enterprise and Datacenter)
  • Windows Server 2008 R2 (Standard, Enterprise and Datacenter)
  • Windows Server 2012 (Standard, Enterprise and Datacenter)
  • Windows Server 2012 R2 (Standard, Enterprise and Datacenter)
  • Windows Server 2016 Standard, (Standard, Datacenter)

ARomeo

Blog: https://www.aleadmin.it/
Reply
0 Kudos
daphnissov
Immortal
Immortal

Some of the new operating systems will permit hot CPU remove, but no OS (to my knowledge) will support hot remove of RAM. This is because RAM, unlike CPU, is not a compressible resource.

Reply
0 Kudos
Luca82
Enthusiast
Enthusiast

Thank you @AlessandroRomeo68...but I asked if it was possible to REMOVE not ADD!!

Reply
0 Kudos
Luca82
Enthusiast
Enthusiast

Thank you @daphnissov ... do you have any documentation about that? Which OS supported hot cpu remove?

Reply
0 Kudos
daphnissov
Immortal
Immortal

You can do some Googling yourself, but otherwise it's based upon my years of experience. Don't take my word for it, though. Go set up some tests yourself and try to hot remove RAM.

Reply
0 Kudos
pan1268
Enthusiast
Enthusiast

Hi,

 

In my veiw  ( also checked on the lab) there is no option to hot remove CPU on any OS in vSphere 6.5 and 6.7.

 

Cheers

Reply
0 Kudos
vbondzio
VMware Employee
VMware Employee

The official KB is here: https://kb.vmware.com/s/article/82568

You can't hot-remove memory, but you could set a limit to get it ballooned away, not that this is recommended.

You can't remove vCPUs but you can offline them from the guest OS, as long as they are 100% idle they have a negligible* impact on the VM.

P.S.
There is a setting, vcpu.hotremove, it also used to be in the UI at some point in the past and some API docs still mention it. It was partially implemented for hosted, i.e. Workstation and Fusion but never finalized due to lacking guest support, i.e. right now it does nothing.

* if 100% means also no timer or other interrupts, which should be the case with modern OS / virtual hardware versions, the offlined vCPU basically has no impact on scheduling, potential co-stop etc.

Reply
0 Kudos