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.