Previous page

Next page

Locate page in Contents

Print this page

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 configure 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 (Standard Edition)
  • x64 version of Windows Server 2008 (Enterprise Edition)
  • x64 version of Windows Server 2008 (Datacenter Edition)
  • x64 version of Windows Server 2008 R2 (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 pctl set command. For example, to enable the CPU hotplug support in the MyVM virtual machine that runs one of the supported operating systems, stop the MyVM virtual machine and run this command:

# pctl set MyVM --cpu-hotplug on

set cpu hotplug: 1

The VM has been successfully configured.

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

# pctl set MyVM --cpus 3

set cpus(4): 3

The VM has been successfully configured.

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

# pctl 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.