22
Call 1 (415) 252-9164 Email: [email protected] Web: http://mokumsolutions.com About the Author The author of the Oracle Cloud Cookbook is none other than the owner of Mokum Solutions, Inc., Roddy Rodstein. Roddy is one of the most respected Oracle Cloud Computing experts, having designed and managed many of the world’s largest and most complex Oracle clouds. Before establishing Mokum, Roddy spent three years at Oracle on the Oracle VM and Linux team designing and supporting Oracle's largest Oracle VM environments. Before Oracle, Roddy spent six years at Citrix, designing and supporting Citrix's largest and most complex customer environments, Including Oracle's. About Mokum Solutions, Inc. Founded in March 2011, Mokum Solutions, Inc. specializes in virtualizing Oracle workloads in private and hybrid clouds. Mokum corporate headquarters are located in San Francisco, CA http://mokumsolutions.com or call 1 415 252 9164. Why Mokum? Mokum has deployed hundreds of successful Oracle VM environments. Mokum can save you months, and years of trial and error, and deliver an enterprise-ready Oracle VM private cloud managed by Oracle Enterprise Manager 12c or OpenStack, without having to overprovision hardware or Oracle licenses. All of Mokum’s customers are Oracle VM success stories that have saved MILLIONS in Oracle licensing and hardware costs. Unlike Mokum, Oracle consulting and traditional Oracle partners have no incentive for customers to succeed with Oracle VM, since Oracle VM is used to reduce Oracle licensing costs, and eliminates the need to buy $$$$ Oracle Engineered Systems. Our customers that have engaged with Oracle and traditional Oracle partners for Oracle VM projects received junior engineers with little or no Oracle VM experience that regularly reference our books and blogs for their deployments. All of Mokum’s customers are Oracle VM success stories that have saved MILLIONS in Oracle licensing and hardware costs. Copyright © 2015 Mokum Solutions, Inc. All rights reserved. Distribution of the Oracle Cloud Cookbook or derivative of the work in any form is prohibited unless prior permission is obtained from the Copyright holder.

Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Embed Size (px)

Citation preview

Page 1: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Call 1 (415) 252-9164

Email: [email protected] Web: http://mokumsolutions.com

About the Author The author of the Oracle Cloud Cookbook is none other than the owner of Mokum Solutions, Inc., Roddy Rodstein. Roddy is one of the most respected Oracle Cloud Computing experts, having designed and managed many of the world’s largest and most complex Oracle clouds. Before establishing Mokum, Roddy spent three years at Oracle on the Oracle VM and Linux team designing and supporting Oracle's largest Oracle VM environments. Before Oracle, Roddy spent six years at Citrix, designing and supporting Citrix's largest and most complex customer environments, Including Oracle's. About Mokum Solutions, Inc. Founded in March 2011, Mokum Solutions, Inc. specializes in virtualizing Oracle workloads in private and hybrid clouds. Mokum corporate headquarters are located in San Francisco, CA http://mokumsolutions.com or call 1 415 252 9164. Why Mokum? Mokum has deployed hundreds of successful Oracle VM environments. Mokum can save you months, and years of trial and error, and deliver an enterprise-ready Oracle VM private cloud managed by Oracle Enterprise Manager 12c or OpenStack, without having to overprovision hardware or Oracle licenses. All of Mokum’s customers are Oracle VM success stories that have saved MILLIONS in Oracle licensing and hardware costs. Unlike Mokum, Oracle consulting and traditional Oracle partners have no incentive for customers to succeed with Oracle VM, since Oracle VM is used to reduce Oracle licensing costs, and eliminates the need to buy $$$$ Oracle Engineered Systems. Our customers that have engaged with Oracle and traditional Oracle partners for Oracle VM projects received junior engineers with little or no Oracle VM experience that regularly reference our books and blogs for their deployments. All of Mokum’s customers are Oracle VM success stories that have saved MILLIONS in Oracle licensing and hardware costs. Copyright © 2015 Mokum Solutions, Inc. All rights reserved. Distribution of the Oracle Cloud Cookbook or derivative of the work in any form is prohibited unless prior permission is obtained from the Copyright holder.

Page 2: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Document Created: 07/11/12Last Update: 01/22/15

This chapter of the Oracle Cloud Cookbook describes how to use hard and soft partitioning with Oracle VM for x86 to gain total control over Oracle CPU license costs. The Oracle VM product line includes Oracle VM for x86 and Oracle VM for SPARC, previously called Sun Logical Domains. This chapter of the Oracle Cloud Coookbook covers Oracle VM for x86 and applies to all Oracle VM 3 releases.

Table of ContentsOracle Licensing and Hard and Soft Partitioning with Oracle VMHard Partitioning RAC and RAC One Node with Oracle VM

How to Pin a Virtual MachineConfirm the Oracle VM Server CPU TopologyDownload and Install the Oracle VM Manager UtilitiesPin CPUs with the ovm_vmcontrol UtilityCPU Pinning and the vm.cfg FileHow to Remove CPU PinningChange Log

Oracle Licensing and Hard and Soft Partitioning with Oracle VMTwo and four core CPUs are now end of life. New Intel and AMD x86 servers ship with quad-, hexa-, 8-, 10-, 12-, and 16-core CPUs. As Intel and AMD add more cores to CPUs, your next hardware refresh could dramatically increase your Oracle CPU license costs. The goal of this chapter of the Oracle Cloud Cookbook is to explain how Oracle VM for x86 can be used with hard and soft partitioning to gain total control over Oracle CPU license costs.

Most Oracle customers license their Oracle technology products, including database and applications, by physical processor, and/or by named user. With physical servers, Oracle processor and named user licensing is static, with each Oracle product bound to a physical server licensed by the number of the server's processors. Conversely, with server virtualization, Oracle processor licensing is dynamic, with each Oracle product allocated to a subset of a hypervisor's CPUs, this is referred to as hard partitioning, and/or bound to a single hypervisor, or a subset of hypervisors within a cluster, this is referred to as soft partitioning. Unlike hard partitioning that allows us to license a subset of a hypervisor's CPUs to Oracle products, soft partitioning requires all of a hypervisor's processors to be licensed for each Oracle product. Many Oracle customers often select standard editions products over enterprise editions products to reduce Oracle

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 3: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

licensing costs. The Oracle Software Investment Guide (SIG) states that Oracle standard edition products are limited to 4 CPU sockets. Oracle standard edition products are fully supported with Oracle VM soft partitioning. Understanding how to use hard and soft partitioning with Oracle VM can help your organization gain total control of their Oracle licensing costs. Since the first release of Oracle VM, which was announced at Oracle Open World in November 2007, Oracle has provided certified support for Oracle technology products on Oracle VM, including both hard and soft partitioning for Oracle license management. Oracle VM is Oracle's flagship server virtualization solution that makes Oracle applications easier to deploy, manage, support, and license. Oracle VM is the only x86 virtualization solution that Oracle tests, certifies and is fully supported by Oracle for Oracle technology products. Oracle does not test, certify, or support Oracle technology products on any Non-Oracle x86 virtualization solutions. With Non-Oracle x86 virtualization solutions, the only Oracle licensing option is soft partitioning. To help understand how to use Oracle VM as an Oracle license management tool, lets review how Oracle processor licensing is calculated. Oracle processor licensing is calculated by counting the number of each CPU core accessed by an operating system running an Oracle technology product, this calculation is called a processor factor. Oracle recognizes each CPU core as a separate CPU and each CPU type with a different processor factor. Table 1 lists Oracle' processor factors.

Oracle Processor LicensingProcessor Factor

UltraSparc T1 0.25

AMD/Intel 0.50

All other Multi-core Servers 0.75

Single Core Servers & IBM’s P6 and P7 Multi-Core chips

1.00

Note: Oracle VM for x86 exclusively uses Intel or AMD CPUs. To better understand Oracle processor licensing with Oracle VM and AMD/Intel multi-core CPUs, let’s review List 1. List 1 shows the processor factor for a single socket four, eight, ten, twelve and sixteen core Intel and/or AMD CPU.

Intel or AMD CPU

1 four core CPU requires 2 processor licenses1 eight core CPU requires 4 processor licenses1 ten core CPU requires 5 processor licenses1 twelve core CPU requires 6 processor licenses1 sixteen core CPU requires 8 processor licenses

As shown in List 1, as the core count increases, so does the Oracle processor license count, and Oracle licensing costs. Intel/AMD CPUs have Hyperthreading technology that makes one CPU core look like two. From an Oracle processor licensing perspective, Hyper-threading does not increase the Oracle processor license count. Enabling Hyper-threading will increase the overall processor capacity of an Oracle VM Server, and an Oracle VM Server pool. For example, with hyper-threading disabled, a CPU is running a single thread per core. With hyper-threading enabled, the number of threads within a core double, and virtual machines can use the additional threads without incurring additional Oracle processor licensing penalties. With hyper-threading enabled, a virtual machine with 4 CPUs is actually is accessing 2 CPU cores, 4 CPU threads, or 1 Oracle CPU license. With hyper-threading disabled, the same virtual machine with 4 CPUs is actually is consuming 4 CPU cores, or 2 Oracle CPU license. Oracle recognizes each CPU core as a separate CPU and each CPU type with a different processor factor. The processor factor determines the processor count. The processor count determines the number of processors required to license the Oracle product.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 4: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

With Oracle VM, hard partitioning allows us to pin a virtual machine's CPUs to a subset of an Oracle VM Server’s CPU cores, and only pay Oracle for the pinned CPUs. For example, with Oracle VM hard partitioning, a standard or enterprise edition Database could run on a virtual machine that is pinned to an Oracle VM Server with 4 CPUs (four sockets) each with 24 cores (96 cores), and you only pay Oracle for the pinned CPUs, i.e. you can pin the virtual machine's CPUs to the exact number of CPUs you need. The same virtual machine running on a VMWare server with 4 CPUs (four sockets) each with 24 cores (96 cores) with a standard or enterprise edition Database would require 48 Oracle processor licenses. With any Non-Oracle x86 virtualization solutions, the only Oracle licensing option is soft partitioning. With hard partitioning you only pay Oracle for the CPUs you actaully need/pin. Soft partitioning requires all of the physical server's processors to be licensed. The number one use case with soft partitioning is the ability to license a subset of Oracle VM Servers within a cluster. For example, with Oracle VM soft partitioning, a standard or enterprise edition Database could run on virtual machines that are restricted to a subset of Oracle VM Servers within a cluster, for example 2 Oracle VM Servers from 32, essentally reducing the processor count and licensing costs from 32 servers to 2 servers. Customers elect to use soft parttitoning over hard partitiong to take advantage of Oracle VM's Live Migration, Distributed Resource Scheduler (DRS) and Distributed Power Management (DPM) features that are only supported with soft partitioning. The use of hard and soft partition will influence your Oracle VM server pool design. Tip: Hard and soft partitioned virtual machines can be restricted to one or more Oracle VM Servers by placing the virtual machine files on a storage repository that is presented only to the Oracle VM Server(s) were the virtual machine can run. Table 1 provides an overview of hard and soft partitioning with Oracle VM.

Partitioning Type

Overview Requirements

Hard Partitioning

Hard partitioning allows us to pin a virtual machine's CPUs to a subset of an Oracle VM Server’s CPU cores, and only pay Oracle for the pinned CPUs. Note: Oracle VM High Availability is fully supported by Oracle with hard partitioning. Live Migration, Distributed Resource Scheduler (DRS) and Distributed Power Management (DPM) are not supported by Oracle with hard partitioning.

CPU pinning is a manual process that includes documenting an Oracle VM Server's CPU topology, then pinning each virtual machine's CPUs to the desired Oracle VM Server CPU cores using ovm_vmcontrol. ovm_vmcontrol is included in the Oracle VM 3 utilities. The Oracle VM 3 utilities are available via My Oracle Support Patch 13602094.

Soft Partitioning

Soft partitioning requires all of the physical server's processors to be licensed. The number one use case with soft partitioning is the ability to license a subset of Oracle VM Servers within a cluster. Note: High Availability, Live Migration, Distributed Resource Scheduler (DRS) and Distributed Power Management (DPM) are supported with soft partitioning.

Soft partitioned virtual machines can take advantage of Live Migration, Distributed Resource Scheduler (DRS) and/or Distributed Power Management (DPM).

The next example in Figure 1 shows three AMD/Intel servers, each server has two eight core CPUs with a processor factor of eight. The first AMD/Intel server is an example of a physical server with an operating system installed directly on the server hardware, running a single Oracle 11G Database. The second AMD/Intel server is an example of soft partitioning with Oracle VM installed directly on the server hardware running eight virtual machines, each virtual machine is running an Oracle 11G Database. The third AMD/Intel server is an example of hard partitioning with an Oracle VM installed directly on the server hardware running eight virtual machines, and only one of the eight virtual machines is running an Oracle 11G Database with one pinned Oracle processor license.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 5: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

As shown in Figure 1, the first AMD/Intel physical server has only one Oracle 11G Database licensed with soft partitioning with eight Oracle processor licenses. With physical servers, Oracle processor licensing is fixed, with each Oracle product bound to a physical server licensed by the number of the server's processors. Regardless of the number of Oracle processor licenses you need, you must pay Oracle for all of the physical server's processors. The second AMD/Intel Oracle VM example is licensed with soft partitioning running eight Oracle 11G Database virtual machines, with eight Oracle processor licenses. In contrast to the first example with an operating system installed directly on the server hardware running a single Oracle 11G Database, the second example shows how Oracle VM with soft partitioning can run 8 or more Oracle 11G Database virtual machines on the same hardware as the physical server with 1 Oracle Database. An Oracle VM Server's CPU, RAM and I/O resources determine the number of virtual machines that can simultaneously run. I select the number 8 as an arbitrary example. The third AMD/Intel Oracle VM example is licensed with hard partitioning one Oracle 11G Database virtual machine using as little as one up to eight Oracle processor license. Using hard partitioning you can license only the CPU you need regardless of the physical server's processor factor. The additional Oracle VM Server CPUs could be used to hard partition other Oracle technologies, or be used to run other workloads along side the hard partitioned Oracle 11G Database virtual machine. Tip: We can restrict hard partitioned virtual machines to one or more Oracle VM Servers by placing the virtual machine files on a storage repository that is presented only to the Oracle VM Server(s) where the virtual machine can run. The next hard partitioning example in Figure 2 shows an Oracle VM Server with two eight core Intel CPUs, with one hard partitioned virtual machine running an Oracle 11G Database. The virtual machine is pinned to two of the Oracle VM Server’s CPU cores (2 cores = 1 CPU license). From an Oracle licensing perspective, the Oracle VM Server has a processor factor of 8. Using hard partitioning, the pinned virtual machine requires only 1 Oracle processor license. The additional 7 CPUs could be used to hard partition other Oracle technologies or be used to run other workloads on the same Oracle VM Server.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 6: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

The next hard partitioning example in Figure 3 shows an Oracle VM Server with two eight core Intel CPUs, with two pinned virtual machines running an Oracle 11G Database. The virtual machines are pinned to the same CPU cores, with a processor factor of 1. It’s possible to pin multiple virtual machines running an Oracle 11g Database to the same CPU cores, and only pay for the pinned CPU cores. In this example multiple virtual machines are running Oracle 11g Databases using the same CPU cores, and the same license. Please note that since each virtual machine is pinned to the same CPU cores, the performance of each virtual machine may be impacted by CPU contention. The additional 7 CPU cores could be used to hard partition other Oracle technologies or be shared for other workloads on the Oracle VM Server.

Soft partitioning requires all of the physical server's processors to be licensed. An interesting use case with soft partitioning is the ability to license a

subset of Oracle VM Servers within a cluster. For example, with soft partitioning, it’s possible to license as little as 2 Oracle VM Servers from an Oracle VM cluster with 32 Oracle VM Servers, essentally reducing the processor count and licensing costs from 32 servers to 2 servers. Soft partitioning with Oracle VM supports High Availability, Live Migration, Distributed Resource Scheduler (DRS) and Distributed Power Management (DPM) with total control over the total number of licensed CPU cores with an Oracle VM cluster.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 7: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Tip: We can restrict soft partitioned virtual machines to one or more Oracle VM Servers by placing the virtual machine files on a storage repository that is presented only to the Oracle VM Server(s) were the virtual machine can run. The next example in Figure 4 shows an Oracle VM server pool with six Oracle VM Servers. Each Oracle VM Server has two eight core CPUs. The Oracle VM server pool has a total of 96 cores with a processor factor of 48 Oracle CPU licenses. In Figure 4, there are a total of eight virtual machines in the Oracle VM pool running Oracle Database 11G. The eight virtual machines with Oracle Database 11G can run on any of the 6 Oracle VM Servers, requiring a total of 48 Oracle processor licenses.

Figure 5 shows the same Oracle VM server pool as in Figure 4, with a total of 96 cores and a processor factor of 48 Oracle CPU licenses. In Figure 5, there are a total of 8 virtual machines in the pool running Oracle Database 11G that are pinned to two of the six Oracle VM Servers. The soft partitioning scenario shown in Figure 5 requires only 16 Oracle CPU licenses.

The example shown in Figure 5 supports Live Migration without Distributed Resource Scheduler (DRS) and/or Distributed Power Management.

Hard Partitioning RAC and RAC One Node with Oracle VMOracle has a wide variety of high availability solutions for databases, applications and virtualization that offer different levels of

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 8: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

availability. Hard and soft partitioning with Oracle VM can be used with Oracle RAC, RAC One Node, DataGuard and Application Server Guard to provide an additional layer of high availability with total control over Oracle CPU licensing costs. Oracle VM's high availability features are complementary with Oracle's high availability solutions for databases, Fusion Middleware and applications. For example, Oracle VM high availability (HA) detects and responds to catastrophic Oracle VM Server failures by restarting virtual machines, RAC nodes, RAC One Nodes, DataGuard and/or Application Server Guard nodes on a live Oracle VM Server. Oracle VM Live Migration is used to eliminate planned downtime by migrating running virtual machines from one Oracle VM Server to another Oracle VM Server during a maintenance event, i.e. for repairs or an upgrade. Hard and soft partitioning with Oracle VM can be used with RAC, RAC One Node, DataGuard and Application Server Guard to provide and additional layer of high availability with total control over Oracle CPU licensing costs. RAC is one of Oracle’s database high availability solutions that offers operational continuity in the event of server and hardware failure. If one RAC node in a multi node RAC cluster fails, the Oracle database would continue to run without disruption of service. An Oracle 11g Database R2 feature named RAC One Node, also offers database high availability in the event of catastrophic failure, with a single node architecture. Both RAC and RAC One Node are certified and supported with Oracle VM. Hard partitioning with Oracle VM can be used with RAC and RAC One Node to provide database high availability with total control over Oracle CPU licensing costs. Figure 6 shows how hard partitioning with Oracle VM can be used with RAC to gain total control over processor licensing costs.

If reducing costs, Database high availability and Live migration is a requirement, RAC One node with Omotion can be used as live fail-over option on Oracle VM without incurring additional CPU license penalties. RAC One Node is certified and supported with Oracle VM. RAC One Node continually monitors the status of a Database running inside a virtual machine, and if the RAC One Node instance experiences a catastrophic failure, RAC One Node will restart the affected database in place or on another standby RAC One Node virtual machine. Following the Oracle Software Investment Guide (SIG) failover rule, a standby RAC One Node virtual machine can run an Oracle Database without additional licensing fees for up to 10 days in any calendar year. Figure 7 shows how hard partitioning with Oracle VM can be used with RAC One Node to gain total control over processor licensing costs.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 9: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Note: The 10-day rule applies to Oracle products using failover technologies in an active/passive cluster. With Oracle products in an active/passive cluster, if a primary node fails, failover to a second node for up to 10 days in any calendar year is permitted without additional license fees.

How to Pin a Virtual MachineThis section will start with a brief review of Oracle VM's CPU credit scheduler. Next, we will walk through the procedure to pin a virtual machine's CPUs to a subset of an Oracle VM Server's CPU cores using the ovm_vmcontrol utility. The chapter concludes with CPU pinning examples by manually editing a vm.cfg file with the xm command. Virtual Machine CPU Pinning Road MapHard Partitioning:1- Validate the hard partitioned Oracle VM Server CPU topology2- Pin CPUs with the ovm_vmcontrol Utility Oracle VM’s default CPU scheduler is the credit scheduler. The credit scheduler uses a credit/debit system to fairly share CPU resources between virtual machines. Credits are assigned to each running virtual machine, along with the allocated fraction of CPU resources. The credit scheduler continually increments/decrements credits from running virtual machines, which is how the credit scheduler balances CPU resources. In many ways, the credit scheduler is like the Linux scheduler. The Linux scheduler is used as the default CPU scheduler with the KVM hypervisor. Both schedulers can preempt processes as needed while trying to ensure proportional fair share allocations. The default behavior of the credit scheduler is to bind each virtual machine CPU to a separate physical core. For example, when you create a virtual machine with two CPUs, the credit scheduler will map the two virtual machine CPUs to two physical cores. So when pinning virtual machine CPUs, we follow the credit scheduler’s default behavior of mapping virtual machine CPUs to an Oracle VM Server’s CPU cores. Excluding pinned virtual machine’s, virtual machine CPUs will occasionally bind to different physical cores. A virtual machine's CPUs will bind to different physical cores, due to the credit scheduler’s use of the credit/debit system that dynamically re-balances CPU resources. For example, if you periodically checked an unpinned virtual machine’s CPU mapping, you would see a different CPU mappings throughout the day. There are two methods to pin virtual machine CPUs. The CPU mapping can be hardcode a virtual machine’s vm.cfg file or mapped using the xm command. The difference between pinning CPUs by hardcoding in the vm.cfg file and with the xm command is the persistence of

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 10: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

the CPU mapping. Hard coding the CPU mapping in a virtual machines’s vm.cfg file is persistent between reboots. CPUs that are pinned with the xm command are not persistent between reboots. Please note that hard partitioning could cause guest performance issues. For example, if you pin a virtual machine’s CPUs to a specific subset of named CPUs without considering how the lower-level I/O interrupts are being assigned, you can end-up hurting performance. I/O interrupts are typically mapped to a specific CPU. If that CPU is not the same as the pinned CPU, the interrupts have to be "re-directed" to the CPU you pinned, which could cause the performance of the guest to decrease. If a hard partitioned virtual machines experience performance issues, the CPU pinning would be an area to investigate. Tip: All CPU cores are not equal, so you may need to test various virtual CPU mappings using the xm command before pinning CPUs in a vm.cfg file.

Confirm the Oracle VM Server CPU TopologyBefore you pin a virtual machine's CPUs to an Oracle VM Server's CPU cores, its necessary to understand the Oracle VM Server's CPU topology to be able to pin a virtual machine's CPUs to the desired Oracle VM Server's CPU cores and/or threads. There are a number of commands to list an Oracle VM Server's CPU topology. dmidecode and xenpm are my favorite commands to map out an Oracle VM Server's CPU topology. dmidecode is a tool that reports information about a system's hardware as described in the system BIOS. As root, type "man dmidecode" to print the dmidecode man page. xenpm stands for Xen Power Management. Xenpm is a userspace program that lists CPU power information and provides control over power policies. Type xenpm or xenpm --help to print the xenpm command list. To gain a clear picture of an Oracle VM Server's CPU topology, as root, type "dmidecode -t 4 | grep CPU" to list the system' CPU details. Next, as root, type “xenpm get-cpu-topology“ to list the CPU topology. The details from dmidecode and xenpm get-cpu-topology will allow you to generate a CPU pinning plan showing the mapping between virtual machine CPUs to Oracle VM Server CPU cores. The next example shows the CPU topology of an Oracle VM Server with Quad (4), Octo-core (8) CPUs, with hyper-threading enabled. The example server has 32 CPU cores with an Oracle processor factor of 16, i.e. 16 CPU licenses. Virtual machine CPUs can be pinned from 1 up to 16 of CPU licenses. Table 2 shows the example servers processor factor, cores, threads, and virtual machine pinning and NUP options.

Sockets/CPUs Cores Threads Processor Factor VM Pinning Options DB NUPs App Server NUPs

4 32 6416 CPU

Licenses

1 CPU License = 2 Cores = 4 Threads = 4 vCPUs

2 CPU License = 4 Cores = 8 Threads = 8 vCPUs

3 CPU License = 6 Cores = 12 Threads = 12 vCPUs

4 CPU License = 8 Cores = 16 Threads = 12 vCPus

5 CPU License = 10 Cores = 20 Threads = 20 vCPUs

6 CPU License = 12 Cores = 24 Threads = 24 vCPUs

7 CPU License = 14 Cores = 28 Threads = 28 vCPUs

8 CPU License = 16 Cores = 32 Threads = 32 vCPUs

9 CPU License = 18 Cores = 36 Threads = 36 vCPUs

10 CPU License = 20 Cores = 40 Threads = 40 vCPus

11 CPU License = 22 Cores = 44 Threads = 44 vCPUs

12 CPU License = 24 Cores = 48 Threads = 48 vCPU

13 CPU License = 26 Cores = 52 Threads = 52 vCPUs

14 CPU License = 28 Cores = 56 Threads = 56

vCPUs

15 CPU License = 30 Cores = 60 Threads = 60 vCPUs

16 CPU License = 32 Cores = 64 Threads = 64 vCPUs

25 users per processor

10 users per processor

dmidecode -t 4 | grep CPUFrom the Oracle VM Server's console, as root, type "dmidecode -t 4 | grep CPU" to list the system' CPU details:

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 11: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

# dmidecode -t 4 | grep CPU Socket Designation: CPU1 Version: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz Socket Designation: CPU2 Version: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz Socket Designation: CPU3 Version: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz Socket Designation: CPU4 Version: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz The above "dmidecode -t 4 | grep CPU" command uses the "-t 4" option, -t means type, and 4 means CPU, then we use grep CPU to only show the CPU details. xenpm get-cpu-topologyFrom the Oracle VM Server's console, as root, type "xenpm get-cpu-topology to list the servers CPU topology:# xenpm get-cpu-topologyCPU core socket nodeCPU0 0 0 0CPU1 0 0 0CPU2 1 0 0CPU3 1 0 0CPU4 2 0 0CPU5 2 0 0CPU6 3 0 0CPU7 3 0 0CPU8 4 0 0CPU9 4 0 0CPU10 5 0 0CPU11 5 0 0CPU12 6 0 0CPU13 6 0 0CPU14 7 0 0CPU15 7 0 0CPU16 0 1 1CPU17 0 1 1CPU18 1 1 1CPU19 1 1 1CPU20 2 1 1CPU21 2 1 1CPU22 3 1 1CPU23 3 1 1CPU24 4 1 1CPU25 4 1 1CPU26 5 1 1CPU27 5 1 1CPU28 6 1 1CPU29 6 1 1CPU30 7 1 1CPU31 7 1 1CPU32 0 2 2CPU33 0 2 2CPU34 1 2 2CPU35 1 2 2

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 12: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

CPU36 2 2 2CPU37 2 2 2CPU38 3 2 2CPU39 3 2 2CPU40 4 2 2CPU41 4 2 2CPU42 5 2 2CPU43 5 2 2CPU44 6 2 2CPU45 6 2 2CPU46 7 2 2CPU47 7 2 2CPU48 0 3 3CPU49 0 3 3CPU50 1 3 3CPU51 1 3 3CPU52 2 3 3CPU53 2 3 3CPU54 3 3 3CPU55 3 3 3CPU56 4 3 3CPU57 4 3 3CPU58 5 3 3CPU59 5 3 3CPU60 6 3 3CPU61 6 3 3CPU62 7 3 3CPU63 7 3 3 Once you have the Oracle VM server’s CPU topology, you can pin a virtual machine’s CPUs to any of the Oracle VM Server's cores. A best practice is to follow the default behavior of the credit scheduler and pin each of the virtual machine CPUs to a separate physical core. From an Oracle CPU licensing perspective, Hyper-threading does “not” increase the CPU license count of an Oracle VM Server or a pinned virtual machine. Enabling

Hyper-threading will increase the overall CPU capacity of an Oracle VM Server and its virtual machines. For example, without hyper-threading, an Oracle VM Server or

virtual machine is only running a single thread per core. With hyper-threading, the number of cores increases, and the Oracle VM Server or virtual machine can use the

additional threads without incurring additional Oracle CPU licensing penalties.

The next example shows the CPU topology of an Oracle VM Server with Dual (2), Quad-core (4) CPUs, without hyper-threading enabled. The example server has 8 CPU cores with an Oracle processor factor of 4, i.e. 4 CPU licenses. Virtual machine CPUs can be pinned from 1 up to 4 of CPU licenses. Table 2 shows the example servers processor factor, cores, threads, and virtual machine pinning and NUP options.

Sockets/CPUs Cores Threads Processor Factor VM Pinning Options DB NUPs App Server NUPs

2 8 NA 4 CPU Licenses

1 CPU License = 2 Cores = 2 vCPUs

2 CPU License = 4 Cores = 4 vCPUs

3 CPU License = 6 Cores = 6 vCPUs

4 CPU License = 8 Cores = 8 vCPus

25 users per processor 10 users per processor

dmidecode -t 4 | grep CPUFrom the Oracle VM Server's console, as root, type "dmidecode -t 4 | grep CPU" to list the system' CPU details:

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 13: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

# dmidecode -t 4 | grep CPU Version: Intel(R) Xeon(R) CPU E5-2637 v2 @ 3.50GHz Version: Intel(R) Xeon(R) CPU E5-2637 v2 @ 3.50GHz

The above "dmidecode -t 4 | grep CPU" command uses the "-t 4" option, -t means type, and 4 means CPU, then we use grep CPU to only show the CPU details. xenpm get-cpu-topologyFrom the Oracle VM Server's console, as root, type "xenpm get-cpu-topology to list the servers CPU topology:# xenpm get-cpu-topologyCPU core socket nodeCPU0 1 0 0CPU1 2 0 0CPU2 3 0 0CPU3 4 0 0CPU4 1 1 1CPU5 2 1 1CPU6 3 1 1CPU7 4 1 1 Once you have the Oracle VM server’s CPU topology, you can pin a virtual machine’s CPUs to any of the Oracle VM Server's cores. A best practice is to follow the default behavior of the credit scheduler and pin each of the virtual machine CPUs to a separate physical core.

Download and Install the Oracle VM Manager UtilitiesApplicable to all Oracle VM 3.x Releases. The Oracle VM utilities (My Oracle Support Patch 13602094) are an Oracle VM Manager add-on that provide a command line interface for Oracle VM Manager. The Oracle VM utilities allows Oracle VM Manager administrative tasks to be performed from the command line or executed using scripts, including virtual machine CPUs pinning using the ovm_vmcontrol utility.The Oracle VM utilities consists of 2 seperate packages:

ovm_utils_1.0.2.zip for Oracle VM Release 3.0,3.1, and 3.2. The ovm_utils_1.0.2 package contains the base ovm_utils for Oracle VM 3.0,3.1, and 3.2.ovm_utils_2.0.1.zip for Oracle VM Release 3.3 and up. The ovm_utils_2.0.1 package contains the Oracle VM Release 3.3 ovm_utils.

Tip: The Oracle VM utilities are a great command line alternative to Oracle VM Manager, as well as the Oracle VM Manager CLI, and offer exceptional performance over WAN connections when Oracle VM Manager is not an option. The Oracle VM utilities are available as a patch download from My Oracle Support. The Oracle VM utilities should be installed on the Oracle VM Manager host. As of this writing the latest release is My Oracle Support patch 13602094 (p13602094_30_Linux-x86-64.zip). The p13602094_30_Linux-x86-64.zip file contains seven files:

1. readme.txt2. ovmutils/3. ovmutils/ovm_utils_1.0.2.zip4. ovmutils/ovm_utils_2.0.1.zip5. ovmutils/readme6. ovmutils/readme-1.0.27. ovmutils/readme-2.0.1

Tip: If a previous version of the Oracle VM utilities are already installed, Oracle recommends to delete the previous version before installing the new version., i.e.# cd /u01/app/oracle/ovm-manager-3/# rm -rf ./ovm_utils Next, on the Oracle VM Manager host unzip the p13602094_30_Linux-x86-64.zip archive. The next examples shows how to unzip the p13602094_30_Linux-x86-64.zip archive as root. # unzip p13602094_30_Linux-x86-64.zipArchive: p13602094_30_Linux-x86-64.zip inflating: readme.txt

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 14: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

creating: ovmutils/ extracting: ovmutils/ovm_utils_1.0.2.zip extracting: ovmutils/ovm_utils_2.0.1.zip inflating: ovmutils/readme inflating: ovmutils/readme-1.0.2 inflating: ovmutils/readme-2.0.1

Next, unzip the appoprate Oracle VM utilities package, ovmutils/ovm_utils_1.0.2.zip for Oracle VM Release 3.0,3.1 and 3.2, or ovmutils/ovm_utils_2.0.1.zip for Oracle VM Release 3.3 and up into the /u01/app/oracle/ovm-manager-3directory. Oracle VM Release 3.3: Oracle VM Utilities Installation and ConfigurationThe next example shows how to extract the ovmutils/ovm_utils_2.0.1.zip file into the Oracle VM Manager home, /u01/app/oracle/ovm-manager-3. As root, change into the directory where the p13602094_30_Linux-x86-64.zip archive was unzipped. Next, type the following command: # unzip ovm_utils_2.0.1.zip -d /u01/app/oracle/ovm-manager-3/Archive: ovm_utils_2.0.1.zip creating: /u01/app/oracle/ovm-manager-3/ovm_utils/ creating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/ creating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmcontrol.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmhostd.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmdisks.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_reporestore.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmmessage.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmdisks creating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/ inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmMessage.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmRepoRestore.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmHostd.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmMessage$1.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmHostd$1.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmHostd$InsecureTrustManager.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmDisks.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmMessage$InsecureTrustManager.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmcontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmhostd inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/vm-dump-metrics inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_reporestore creating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/ inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/jython.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/log4j.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/OvmClient.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/OvmWsClient.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/ovm_shell.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/commons-logging-1.1.3.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/jline.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/commons-logging.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmmessage The man pages for the Oracle VM utilities are in the ovm_utils/man/man8 directory. Since the Oracle VM utilities man pages are not in the default man path, it is necessary to type "man path_to_man_page to read each man page.

Starting with Oracle VM Release 3.3, Oracle VM Manager must use TCP over SSH (TCPS) to run the Oracle VM utilities. The next example shows how to enable TCP over SSH on an Oracle VM Manager host. As root, type the following commands, when prompted enter the keystore password (save this password!), your first and last name, the name of your organizational unit, the name of your organization, the name of your State or Province, your two-letter country code and the keystore password. Tip: Use the same password as the admin account for the keystore password. # cd /u01/app/oracle/ovm-manager-3/bin# ./secureOvmmTcpGenKeyStore.sh

Generate OVMM TCP over SSH key store by following steps:

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 15: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Enter keystore password: passwordRe-enter new password: passwordWhat is your first and last name?[Unknown]: name What is the name of your organizational unit?[Unknown]: unit What is the name of your organization?[Unknown]: organizationWhat is the name of your City or Locality?[Unknown]: CityWhat is the name of your State or Province?[Unknown]: StateWhat is the two-letter country code for this unit?[Unknown]: country_codeIs CN=name, OU=unit, O=organization, L=City, ST=State, C=country_code correct?[no]: yes

Enter key password for <ovmm>Re-enter new password: password Next, enable the keystore using the secureOvmmTcp.sh script located in the same directory as the secureOvmmTcpGenKeyStore.sh script. As root, type the following command, when prompted enter the OVM manager user name (admin), the OVM manager user password, and the password for TCPS keystore (the keystore password that was entered 2x above):

# ./secureOvmmTcp.sh

Enabling OVMM TCP over SSH servicePlease enter the OVM manager user name: usernamePlease enter the OVM manager user password: passwordPlease enter the password for TCPS key store : passwordThe job of enabling OVMM TCPS service is committed, please restart OVMM to take effect. After successfully running the secureOvmmTcpGenKeyStore.sh and secureOvmmTcp.sh scripts, the Oracle VM Manager keystore file namedovmmCoreTcps.ks is created in the <OVM_MANAGER_HOME> directory, i.e. /u01/app/oracle/ovm-manager-3/ovmmCoreTcps.ks. Before restarting Oracle VM Manager and enableding the TCP over SSH service, the Core API will be listening on 127.0.0.1/localhost tcp 54321. After restarting Oracle VM Manager, the Core API will be listening on tcps 54322 using the FQDN. To verify the listening port, as root, type:For tpc localhost:# netstat -a | grep 54321For tcps with FQDN:# netstat -a | grep 54322 Next, restart Oracle VM Manager. As root, type:# /sbin/service ovmm stop# /sbin/service ovmm start To verify the TCP over SSH service is running, as root type:# netstat -a | grep 54322tcp 0 0 *:54322 *:* LISTEN The above example shows that the TCP over SSH service is indeed running and listening on port 54322. Oracle VM Release 3.0,3.1 and 3.2: Oracle VM Utilities Installation and ConfigurationThe next example shows how to extract the ovmutils/ovm_utils_1.0.2.zip file into the Oracle VM Manager home, /u01/app/oracle/ovm-manager-3. As root, change into the directory where the p13602094_30_Linux-x86-64.zip archive was unzipped. Next, type the following command:# unzip ovmutils/ovm_utils_1.0.2.zip -d /u01/app/oracle/ovm-manager-3Archive: ovmutils/ovm_utils_1.0.2.zipreplace /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmcontrol.8? [y]es, [n]o, [A]ll, [N]one, [r]ename: y inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmcontrol.8 replace /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmhostd.8? [y]es, [n]o, [A]ll, [N]one, [r]ename: A inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmhostd.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_logger.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmdisks.8

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 16: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_reporestore.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_poolcontrol.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_managercontrol.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_vmmessage.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_servercontrol.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8/ovm_repocontrol.8 inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_logger inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_repocontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmdisks inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmMessage.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmLogger.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmRepoRestore.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmHostd.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmRepoControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmVmDisks.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmServerControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmCoreControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/class/OvmPoolControl.class inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmcontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_managercontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmhostd inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/vm-dump-metrics inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_reporestore inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/log4j.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/OvmClient.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/lib/commons-logging.jar inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_servercontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_poolcontrol inflating: /u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmmessage

The man pages for the Oracle VM utilities are in the ovm_utils/man/man8 directory. Since the Oracle VM utilities man pages are not in the default man path, it is necessary to type "man path_to_man_page to read each man page.

Pin CPUs with the ovm_vmcontrol UtilityIn this section, we will pin a virtual machine with two CPUs to various CPU threads using the ovm_vmcontrol utility. A virtual machine's CPUs can be immediately pinned to any CPU core or thread using the ovm_vmcontrol utility as well as with the xm command, xm vcpu-set. This section of the Oracle Cloud Cookbook reviews CPU pinning with the ovm_vmcontrol utility. Note: The Max. Processors property shows the maximum number of CPUs that can be allocated and/or pinned. The number of processors is actually the number of allocated physical CPU cores or threads, and is limited to 128. The Max. Processors property can only be edited when a virtual machine is stopped. The Processors property shows the current number of allocated CPUs. The Processors property can be changed with running virtual machine up to the value of Max. Processors. Figure 8 shows the CPU properties for the example virtual machine used through this chapter. The ID and the CPU allocations are highlighted in red.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 17: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

The virtual machine's ID is 0004fb0000060000dbf90ab3718822c0 with two CPUs allocated. The Oracle VM 3 utilities' ovm_vmcontrol is an ideal tool used to query and immediately set virtual machine CPU pinning using Oracle VM Manager. The Oracle VM utilities provide a command line interface for Oracle VM Manager. The Oracle VM utilities allow Oracle VM Manager administrative tasks such as CPU pinning to be performed from the command line or executed using scripts. Before you pin a virtual machine's CPUs to an Oracle VM Server's CPU cores, it is necessary to understand the Oracle VM Server's CPU topology. There

are a number of commands to list an Oracle VM Server's CPU topology. The xenpm command is my favorite command, xenpm stands for Xen Power

Management. Xenpm is a userspace program that lists CPU power information and provides control over power policies. Type xenpm or xenpm --help to

print the xenpm command list.

The next exmple shows the CPU topology from the Oracle VM Server used through this section. The example Oracle VM Server has 1 CPU, 4 cores with hyperthreading enabled. # xenpm get-cpu-topologyCPU core socket nodeCPU0 0 0 0CPU1 0 0 0CPU2 1 0 0CPU3 1 0 0CPU4 2 0 0CPU5 2 0 0CPU6 3 0 0CPU7 3 0 0 The next example shows how to query the CPU pinning from a virtual machine named yum-chekov. Substitute admin with your Oracle VM Manager user account, password with your admin user account password, and yum-chekov with the name of your virtual machine, i.e. the name displayed in Oracle VM Manager. Run ovm_vmcontrol from the Oracle VM Manager host:

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 18: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpugetOracle VM VM Control utility 0.5.2.Connected.Command : vcpugetVirtual Machine 'yum-sulu' has no pinned vcpus. The above example shows that the virtual machine is not pinned. The next example shows how to pin both CPUs to core 0. Run ovm_vmcontrol from the Oracle VM Manager host.

# ./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpuset -s 0Oracle VM VM Control utility 0.5.2.Connected.Command : vcpusetPinning virtual CPUsPinning of virtual CPUs to physical threads '0' 'yum-chekov' completed. To confirm CPU pinning, access the Oracle VM Server running the pinned virtual machine, (Oracle VM Manager shows which server virtual machines are running on and the virtual machine's UUID/name), and as root type "xm vcpu-list Domain ID or UUID". The next example shows the output from "xm vcpu-list Domain ID or UUID" for yum-chekov. Replace 0004fb0000060000dbf90ab3718822c0 with your virtual machines name or ID, i.e. type xm list to list the running virtual machines on a host.

# xm vcpu-list 0004fb0000060000dbf90ab3718822c0Name ID VCPU CPU State Time(s) CPU Affinity0004fb0000060000dbf90ab3718822c0 41 0 0 -b- 17.0 00004fb0000060000dbf90ab3718822c0 41 1 0 -b- 40.4 0

The next example shows how to pin both CPUs to core 0 and 3. Run ovm_vmcontrol from the Oracle VM Manager host.

# ./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpuset -s 0,3Oracle VM VM Control utility 0.5.2.Connected.Command : vcpusetPinning virtual CPUsPinning of virtual CPUs to physical threads '0,3' 'yum-chekov' completed. To confirm CPU pinning, access the Oracle VM Server running the pinned virtual machine, (Oracle VM Manager shows which server virtual machines are running on and the virtual machine's UUID/name), and as root type "xm vcpu-list Domain ID or UUID". The next example shows the output from "xm vcpu-list Domain ID or UUID" for yum-chekov. Replace 0004fb0000060000dbf90ab3718822c0 with your virtual machines name or ID, i.e. type xm list to list the running virtual machines on a host.

# xm vcpu-list 0004fb0000060000dbf90ab3718822c0Name ID VCPU CPU State Time(s) CPU Affinity0004fb0000060000dbf90ab3718822c0 41 0 0 -b- 17.3 0,30004fb0000060000dbf90ab3718822c0 41 1 3 -b- 40.5 0,3

The next example shows how to pin both CPUs to core 1 and 2. Run ovm_vmcontrol from the Oracle VM Manager host.

# ./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpuset -s 1,2Oracle VM VM Control utility 0.5.2.Connected.Command : vcpuset

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 19: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

Pinning virtual CPUsPinning of virtual CPUs to physical threads '1,2' 'yum-chekov' completed.

To confirm CPU pinning, access the Oracle VM Server running the pinned virtual machine, (Oracle VM Manager shows which server virtual machines are running on and the virtual machine's UUID/name), and as root type "xm vcpu-list Domain ID or UUID". The next example shows the output from "xm vcpu-list Domain ID or UUID" for yum-chekov. Replace 0004fb0000060000dbf90ab3718822c0 with your virtual machines name or ID, i.e. type xm list to list the running virtual machines on a host.

# xm vcpu-list 0004fb0000060000dbf90ab3718822c0Name ID VCPU CPU State Time(s) CPU Affinity0004fb0000060000dbf90ab3718822c0 41 0 2 -b- 17.4 1-20004fb0000060000dbf90ab3718822c0 41 1 1 -b- 40.7 1-2

CPU Pinning and the vm.cfg FileIn this section, we show how to view the CPU pinning in a virtual machine's vm.cfg file. Each virtual machine has a vm.cfg file which controls the virual machine's resource allocations. vm.cfg files are managed by Oracle VM Manager, editing vm.cfg files by hand is not recomended and will cause unexpected results. Before you can view a virtual machine's vm.cfg file, you must locate it. To list all of the virtual machines vm.cfg files in an Oracle VM server pool, as root, access one of the Oracle VM pool members and type:# find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; To list a specific virtual machine's vm.cfg file, as root, access one of the Oracle VM pool members and type:# find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; | grep <VIRTUAL MACHINE NAME> Note: Replace <VIRTUAL MACHINE NAME> with the virtual machines name. Once the vm.cfg file has been located, it can be viewed using Vim (vi). Vim is the default text editor for Oracle VM Server. Let’s locate and view a virtual machine's default “unpinned” vm.cfg file. The virtual machine's vm.cfg file can be located by accessing one of the Oracle VM servers in the pool, and as root, type:find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; | grep yum-chekov/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualMachines/0004fb0000060000dbf90ab3718822c0/vm.cfg:OVM_simple_name = 'yum-chekov' Note: Substitute yum-chekov with the name of your virtual machine.Please note the maxvcpus = 2 and the vcpus = 2 entries. # vi /OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualMachines/0004fb0000060000dbf90ab3718822c0/vm.cfgvif = ['mac=00:21:f6:00:00:52,bridge=0004fb001025f15', 'mac=00:21:f6:00:00:69,bridge=192.168.3.0']OVM_simple_name = 'yum-chekov'disk = ['file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200001715425de783bb2a.img,xvda,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb0000120000b400de1a5c40d6dc.img,xvdb,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200005266f7966823c7c8.img,xvdc,w']uuid = '0004fb00-0006-0000-dbf9-0ab3718822c0'on_reboot = 'restart'boot = 'c'cpu_weight = 27500memory = 1024cpu_cap = 0maxvcpus = 2OVM_high_availability = True

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 20: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

maxmem = 1024timer_mode = 0OVM_description = ''on_poweroff = 'destroy'on_crash = 'restart'bootloader = '/usr/bin/pygrub'name = '0004fb0000060000dbf90ab3718822c0'guest_os_type = 'linux'vfb = ['type=vnc,vncunused=1,vnclisten=127.0.0.1,keymap=en-us']vcpus = 2OVM_os_type = 'Oracle Linux 5'OVM_cpu_compat_group = NoneOVM_domain_type = 'xen_pvm':q! The maxvcpus = 2 entry defines the maximum CPU count for the virtual machine. In this example, maxvcpus = 2 means that the virtual machine can have up to two CPUs (CPUs actually mean CPU cores or threads). The vcpus = 2 entry defines the initially allocated number of CPUs. If the virtual machine has maxvcpus = 2 with vcpus = 1, 1 additional CPU could be allocated using Oracle VM Manager up to the maxvcpus = 2 vaule. Listing the above virtual machine CPU pinning with ovm_vmcontrol would show that the virtual machine is not pinned. The next example shows the output from ovm_vmcontrol on an unpinned virtual machine. ./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpugetOracle VM VM Control utility 0.5.2.Connected.Command : vcpugetVirtual Machine 'yum-sulu' has no pinned vcpus. The next vm.cfg example shows a new line in the vm.cfg file, cpus = '1,2'. The cpus = '1,2' entry shows that the virtual machine’s CPUs are pinned to the Oracle VM server’s CPU cores 1 and 2. The following example vm.cfg CPU pinning was set by typing the following command: # ./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpuset -s 1,2Oracle VM VM Control utility 0.5.2.Connected.Command : vcpusetPinning virtual CPUsPinning of virtual CPUs to physical threads '1,2' 'yum-chekov' completed. Please note the vcpus = 2 entry, one line above the cpus = '1,2' entry. The vcpus = 2 entry defines the allocated number of CPUs. # vi /OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualMachines/0004fb0000060000dbf90ab3718822c0/vm.cfgvif = ['mac=00:21:f6:00:00:52,bridge=0004fb001025f15', 'mac=00:21:f6:00:00:69,bridge=192.168.3.0']OVM_simple_name = 'yum-chekov'disk = ['file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200001715425de783bb2a.img,xvda,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb0000120000b400de1a5c40d6dc.img,xvdb,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200005266f7966823c7c8.img,xvdc,w']uuid = '0004fb00-0006-0000-dbf9-0ab3718822c0'on_reboot = 'restart'boot = 'c'cpu_weight = 27500memory = 1024

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 21: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

cpu_cap = 0maxvcpus = 2OVM_high_availability = Truemaxmem = 1024timer_mode = 0OVM_description = ''on_poweroff = 'destroy'on_crash = 'restart'bootloader = '/usr/bin/pygrub'name = '0004fb0000060000dbf90ab3718822c0'guest_os_type = 'linux'vfb = ['type=vnc,vncunused=1,vnclisten=127.0.0.1,keymap=en-us']vcpus = 2cpus = '1,2'OVM_os_type = 'Oracle Linux 5'OVM_cpu_compat_group = NoneOVM_domain_type = 'xen_pvm':wq! The above example vm.cfg file shows a hard partitioned virtual machine with two CPUs using 1 Oracle processor license. The virtual machine’s CPUs are pinned to the Oracle VM Server’s CPU cores 1 and 2.

How to Remove CPU Pinning

In this section, we show how to remove CPU pinning. CPU pinning is controled in a virtual machine's vm.cfg file by adding the cpus attribute with a text editor, or with

the ovm_vmcontrol utility. Before you can remove a virtual machine's CPU pinning, you must locate its vm.cfg file.

To list all of the virtual machines vm.cfg files in an Oracle VM server pool, as root, access one of the Oracle VM pool members and type:# find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; To list a specific virtual machine's vm.cfg file, as root, access one of the Oracle VM pool members and type:# find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; | grep <VIRTUAL MACHINE NAME> Note: Replace <VIRTUAL MACHINE NAME> with the virtual machines name. Once the vm.cfg file has been located, it can be edited using Vim (vi). Vim is the default text editor for Oracle VM Server. Let’s locate and remove the CPU pinning from a virtual machines named yum-chekov. The virtual machine's vm.cfg file can be located by accessing one of the Oracle VM servers in the pool, and as root, type:find /OVS/Repositories -type f -name vm.cfg -exec grep -iH simple_name {} \; | grep yum-chekov/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualMachines/0004fb0000060000dbf90ab3718822c0/vm.cfg:OVM_simple_name = 'yum-chekov' The bold text above show the path to the vm.cfg file. The next example shows the vm.cfg file from yum-chekov with the CPU pinning as cpus = '1,2'. yum-chekov’s CPUs are pinned to the Oracle VM Server’s CPU cores 1 and 2. # cat /OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualMachines/0004fb0000060000dbf90ab3718822c0/vm.cfgvif = ['mac=00:21:f6:00:00:52,bridge=0004fb001025f15', 'mac=00:21:f6:00:00:69,bridge=192.168.3.0']OVM_simple_name = 'yum-chekov'disk = ['file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200001715425de783bb2a.img,xvda,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb0000120000b400de1a5c40d6dc.img,xvdb,w', 'file:/OVS/Repositories/0004fb000003000000c6307a0210108c/VirtualDisks/0004fb00001200005266f7966823c7c8.img,xvdc,w']uuid = '0004fb00-0006-0000-dbf9-0ab3718822c0'on_reboot = 'restart'boot = 'c'

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/

Page 22: Hard and Soft Partitioning with Oracle VM | Mokum ...mokumsolutions.com/system/files/downloads/Hard_and_Soft... · The author of the Oracle Cloud Cookbook is none ... Download and

cpu_weight = 27500memory = 1024cpu_cap = 0maxvcpus = 2OVM_high_availability = Truemaxmem = 1024timer_mode = 0OVM_description = ''on_poweroff = 'destroy'on_crash = 'restart'bootloader = '/usr/bin/pygrub'name = '0004fb0000060000dbf90ab3718822c0'guest_os_type = 'linux'vfb = ['type=vnc,vncunused=1,vnclisten=127.0.0.1,keymap=en-us']vcpus = 2cpus = '1,2'OVM_os_type = 'Oracle Linux 5'OVM_cpu_compat_group = NoneOVM_domain_type = 'xen_pvm'

To remove the CPU pinning, edit the vm.cfg file directly using vi and remove the cpus = '1,2' line, then reboot the virtual machine.

Call 415-252-9164 Mokum Oracle Cloud Cookbook http://mokumsolutions.com/

Call 415-252-9164 Mokum Solutions, Inc. http://mokumsolutions.com/