7.12 How are Virtual CPUs Allocated to Virtual Machines

When you create or edit a virtual machine, you have the option to specify two different values for the number of processors (also known as virtual CPUs) that are allocated to a virtual machine. These represent:

  • the maximum number of virtual CPUs that can be made available to a running virtual machine (maxvcpu)

  • the actual number of virtual CPUs that a virtual machine should be using at runtime (vcpu)

The number of virtual CPUs that the virtual machine actually has available at any one time is dynamically allocated by the hypervisor as required, by changing the number of processors (vcpu) for the running virtual machine within Oracle VM Manager. This value can never exceed the maximum number of processors (maxvcpu) that you have also specified within Oracle VM Manager.

If you want to change the maximum number of virtual CPUs (maxvcpu) that a virtual machine can have, the virtual machine must be rebooted after this value is changed. The maximum number of virtual CPUs (maxvcpu) cannot exceed the values described in Configuration Limits in the Oracle VM Release Notes.

Guest virtual machine boot behavior, in relation to virtual CPU allocation, differs depending on the mode of virtualization that the guest is configured for. Modes of virtualization are discussed further in Section 7.1, “What are Virtualization Modes or Domain Types?”. For instance, for a paravirtualized virtual machine (PVM), the guest virtual machine boots with as many virtual CPUs as are specified for the maximum number of processors (max_vcpu) in Oracle VM Manager and then works its way down to the configured number of processors (vcpu) that should be available to the virtual machine at runtime. If the difference between these two values is large, then it may take some time before the guest virtual machine is actually running with the specified number of virtual CPUs (vcpu). On the other hand, a hardware-virtualized virtual machine (HVM) boots with exactly the number of virtual CPUs (vcpu) that are specified in the configuration.

Once the virtual machine is running with the specified number of virtual CPUs, you can increase or decrease this value within Oracle VM Manager as required, and the number of processor cores available to the running guest operating system is automatically adjusted.