3.1.5. Enabling CPU Hotplug for Virtual Machines

If a guest operating system supports the CPU hotplug functionality, you can enable this functionality for the virtual machine. Once the CPU hotplug functionality is turned on, you can increase the number of CPUs available to your virtual machines even if they are running.

Currently, the following systems come with the CPU hotplug support:

Linux (both x86 and x64 versions)

  • Linux operating systems based on the RHEL 5 kernel and higher (Red Hat Linux Enterprise 5, CentOS 5, and so on)

Windows

  • x64 version of Windows Server 2008 R2 (Datacenter Edition)
  • x64 version of Windows Server 2012 (Standard and Datacenter Edition)
  • x64 version of Windows Server 2008 (Standard Edition)
  • x64 version of Windows Server 2008 (Enterprise Edition)
  • x64 version of Windows Server 2008 (Datacenter Edition)

By default, the CPU hotplug support is disabled for all newly created virtual machines. To enable this functionality, you can use the --cpu-hotplug option of the prlctl set command. For example, to enable the CPU hotplug support in the virtual machine MyVM that runs one of the supported operating systems, stop the virtual machine MyVM and run this command:

# prlctl set MyVM --cpu-hotplug on
set cpu hotplug: 1
The VM has been successfully configured.

Once the functionality is enabled, you can increase the number of CPUs in the virtual machine MyVM even it is running. Assuming that your physical server has 4 CPUs installed and the processes in the virtual machine MyVM are set to be executed on two CPUs, you can run the following command to assign 3 CPUs to the virtual machine:

# prlctl set MyVM --cpus 3
set cpus(4): 3
The VM has been successfully configured.

To disable the CPU hotplug support in the virtual machine MyVM, use this command:

# prlctl set MyVM --cpu-hotplug off
set cpu hotplug: 0
The VM has been successfully configured.

The changes will come into effect on the next virtual machine start.