7.12. Setting Hard Partitioning for Virtual Machine CPUs

Oracle VM offers an advanced feature for hard partitioning, also known as CPU pinning. Hard partitioning means binding a virtual machine CPU to a physical CPU or core, and preventing it from running on other physical cores than the ones specified. This is done for Oracle CPU licensing purposes, since Oracle VM is licensed on a per-CPU basis.


Hard partitioning is the ONLY case where you are allowed to modify the virtual machine configuration file manually. For all other changes to a virtual machine, use the Oracle VM Manager user interface.


For more information about special Oracle licensing policies, please consult the Oracle Technology Network and open the PDF document on the subject of Partitioning.

To set hard partitioning for a virtual machine:

  1. In the the Home view of Oracle VM Manager, use the navigation pane to select the virtual machine you wish to pin to the Oracle VM Server.

  2. In the Info tab of the management pane, look up the virtual machine ID and the storage repository containing the virtual machine configuration file.

  3. In the navigation pane, select Server Pools. In the management pane, open the Repositories tab. Look up the file system path of the storage repository containing the virtual machine configuration file.

  4. Log into the server hosting the storage repository.

  5. Using a text editor, open the virtual machine configuration file, which is located in this directory: /<repository file system path>/VirtualMachines/<virtual machine ID>/. For example, using the vi text editor, you open the vm.cfg file as follows:

    # vi /<repository file system path>/VirtualMachines/<virtual machine ID>/vm.cfg
    disk = ['file:/OVS/Repositories/0004fb0000030000a3ff6bbfe68511a6/VirtualDisks/
    vif = ['mac=00:21:f6:00:00:00']
    uuid = '0004fb00-0006-0000-ebed-b32c30706fad'
    OVM_description = 'Oracle Linux 5 64bit quad-core 8GB'
    guest_os_type = 'Oracle Linux 5'
    OVM_simple_name = 'MyOL5VM'
    on_poweroff = 'destroy'
    vfb = ['type=vnc,vncunused=1,vnclisten=']
    on_crash = 'restart'
    on_reboot = 'restart'
    vcpus = 4
    cpu_weight = 27500
    OVM_os_type = 'Oracle Linux 5'
    memory = 8192
    cpu_cap = 0
    OVM_high_availability = False
    bootloader = '/usr/bin/pygrub'
    maxmem = 2048
    name = '0004fb0000060000ebedb32c30706fad'

  6. To pin the virtual CPUs to specific physical cores of the host Oracle VM Server, make sure the vm.cfg file contains a line containing the parameter cpus = 'value'. For example:

    cpus = '0-3' 
    -- or --  
    cpus = '0,1' 

    In the first case, only CPUs or cores 0, 1, 2 and 3 can be used for the virtual machine. In the second case, cores 0 and 1. If the virtual machine has 4 virtual CPUs, and you put cpus = '0' in the vm.cfg file, then all 4 virtual CPUs will be scheduled on the same physical core.

  7. Save vm.cfg the file. The virtual machine is now set up with hard partitioning.


Live-migration of CPU pinned virtual machines to another Oracle VM Server is not permitted under the terms of the license. Consequently, DRS and DPM policies should not be enabled for server pools containing CPU pinned guests.


If your Oracle VM Servers support NUMA (non-uniform memory access), make sure that the systems are running correctly in NUMA mode. In a clustered setup, a CPU can access its local memory faster than non-local and shared memory. To make full use of the performance advantages of NUMA, be sure to pin the virtual CPUs to the physical CPUs in a single Oracle VM Server. For more information about NUMA, consult your server hardware documentation.