When considering an Oracle RAC environment, one of the main questions that always seems to be asked is “How much is Oracle RAC licensing going to cost me?” While Oracle RAC licensing can be expensive, there is a way to cut some of those expenses out by ensuring that the amount of CPUs you are licensing is truly what you need. While attempting to size your physical environment with the correct amount of CPU cores required is possible, it is also very difficult due to vast growth of multi-cored CPUs in the market. A better option would be using Oracle VM to hard partition only the cores required for your Oracle RAC environment. This methodology known as ‘hard partitioning’ allows you to take advantage of Oracle RAC technology and save on Oracle RAC licensing costs.
The great thing about Oracle VM hard partitioning is that it is easy to accomplish. The only steps required are the modification of a virtual machine’s vm.cfg file that you wish to enable hard partitioning on. Below I will detail the step by step guide in accomplishing hard partitioning.
1) Ensure that the virtual machine(s) you wish to modify our powered down.
2) Go to your virtual machine’s home directory usually located under /OVS/running_pool/<VM_NAME>/
3) Backup your existing vm.cfg using the cp command. i.e. ‘cp vm.cfg vm.cfg.bkup’
4) Open the vm.cfg file using the vi text editor i.e. ‘vi vm.cfg’
5) Add a new line labeled ‘cpus’ and add the appropriate amount CPU cores you wish to pin.
Example: cpus = ’0-4′ or cpus = ’0,1′.
The example cpus = ’0-4′ ensures that your virtual machine when pinning VCPUs only uses only the physical cores (0,1,2,3,4). Imagine that you create a virtual machine that has 6 VCPUs. While the virtual machine will still show 6 VCPUs, at least one of those VCPUs will be pinned to the same physical core since you only enabled a total of 5 physical CPU cores.
Example: cpus = ’0,1′
This example is just different syntax in how to pin physical CPU cores to your virtual machine. This particular example only pins two physical CPU cores to the virtual machine.
6) Save your vm.cfg and start up your virtual machine.
7) To ensure you have pinned your physical cores you can use the following command within the OVM Server: xm vcpu-list <VM_NAME>
While Oracle VM hard partitioning is a great feature to save on Oracle RAC licensing costs, it is important to note that when you enable Oracle VM hard partitioning you lose support for Oracle VM live migration. If live migration is an important feature to your environment, hard partitioning might not be the solution for you.
Hope you enjoyed the article and feel free to leave any feedback.
« How to grow/extend the disk size of an Oracle VM guest VM Debugging Oracle VM 2.2 & Oracle VM Manager 2.2 errors using the many log files »

Roger,
I’d like to point out that Oracle is pretty restrictive when it comes to licensing their database on VM solutions. According to their latest Document on partitioning and licensing (here), only hard partitioning in the way you described it will save you money. You can soft partition with Oracle VM as well, but then you’ll have to pay for every core in your box. VM solutions other than Oracle VM are currently regarded as soft partitioned. They don’t mention their newly acquired VirtualBox, by the way…
Hello oraculix,
Your absolutely right. Hard partitioning is the only thing that is supported when partitioning your CPUs to save on Oracle RAC licensing. Soft partitioning is not accepted as a method to partition CPUs and save on Oracle RAC licensing costs. I believe Oracle’s intension, for right now anyway, with VirtualBox is to keep it in the client space, not enterprise.
Scenario: Multiple servers are used in a OVM environment running various Oracle DBs with one server dormant as an N+1.
Server A has 8 Core with 4 DBs hard partitioned with 4 DBs, 2 core each.
Server B has 8 Core with 4 different DBs
Server C is N+1
Using Live Migration, would Server B need to be licensed for Server A DBs if Server A OVMs can migrate to Server B?
(If you repin licenses to migrated server)
Assume Processor license.
Hello,
To my understanding if you repin the the CPUs you should be okay. However, I recommend contacting Oracle for any licensing doubts.
Information on hard partition can be found here:
http://www.oracle.com/technetwork/topics/virtualization/ovm-hardpart-167739.pdf
Notice that last note: NOTE: On live migration, when using xm vcpu-pin or when you modify the config file using cpus = ”, the settings are lost and you need to repin the cpus on the other physical machine.
Cheers,
Roger