Академический Документы
Профессиональный Документы
Культура Документы
Email:
sales@mokumsolutions.com
Web: http://mokumsolutions.com
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.
Document Created: 07/11/12
Last 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 Contents
Oracle Licensing and Hard and Soft Partitioning with Oracle VM
Hard Partitioning RAC and RAC One Node with Oracle VM
How to Pin a Virtual Machine
Confirm the Oracle VM Server CPU Topology
Download and Install the Oracle VM Manager Utilities
Pin CPUs with the ovm_vmcontrol Utility
CPU Pinning and the vm.cfg File
How to Remove CPU Pinning
Change Log
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
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.
Processor
Oracle Processor Licensing
Factor
UltraSparc T1 0.25
AMD/Intel 0.50
All other Multi-core Servers 0.75
Single Core Servers & IBM’s
1.00
P6 and P7 Multi-Core chips
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.
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.
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
Overview Requirements
Type
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
CPU pinning is a manual process that includes documenting an
the pinned CPUs.
Oracle VM Server's CPU topology, then pinning each virtual
Hard machine's CPUs to the desired Oracle VM Server CPU cores using
Note: Oracle VM High Availability is fully
Partitioning ovm_vmcontrol. ovm_vmcontrol is included in the Oracle VM 3
supported by Oracle with hard partitioning.
utilities. The Oracle VM 3 utilities are available via My Oracle
Live Migration, Distributed Resource
Support Patch 13602094.
Scheduler (DRS) and Distributed Power
Management (DPM) are not supported by
Oracle with hard 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
Soft partitioned virtual machines can take advantage of Live
Soft Oracle VM Servers within a cluster.
Migration, Distributed Resource Scheduler (DRS) and/or Distributed
Partitioning
Power Management (DPM).
Note: High Availability, Live Migration,
Distributed Resource Scheduler (DRS) and
Distributed Power Management (DPM) are
supported with soft partitioning.
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.
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.
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.
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.
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.
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.
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.
Sockets/CPUs Cores Threads Processor Factor VM Pinning Options DB NUPs App Server NUPs
vCPUs
dmidecode -t 4 | grep CPU
From the Oracle VM Server's console, as root, type "dmidecode -t 4 | grep CPU" to list the system' CPU details:
Sockets/CPUs Cores Threads Processor Factor VM Pinning Options DB NUPs App Server NUPs
dmidecode -t 4 | grep CPU
From the Oracle VM Server's console, as root, type "dmidecode -t 4 | grep CPU" to list the system' CPU details:
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-topology
From the Oracle VM Server's console, as root, type "xenpm get-cpu-topology to list the servers CPU topology:
# xenpm get-cpu-topology
CPU core socket node
CPU0 1 0 0
CPU1 2 0 0
CPU2 3 0 0
CPU3 4 0 0
CPU4 1 1 1
CPU5 2 1 1
CPU6 3 1 1
CPU7 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.
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.txt
2. ovmutils/
3. ovmutils/ovm_utils_1.0.2.zip
4. ovmutils/ovm_utils_2.0.1.zip
5. ovmutils/readme
6. ovmutils/readme-1.0.2
7. 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.zip
Archive: p13602094_30_Linux-x86-64.zip
inflating: readme.txt
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-3
directory.
Oracle VM Release 3.3: Oracle VM Utilities Installation and Configuration
The 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
# ./secureOvmmTcp.sh
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.
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-topology
CPU core socket node
CPU0 0 0 0
CPU1 0 0 0
CPU2 1 0 0
CPU3 1 0 0
CPU4 2 0 0
CPU5 2 0 0
CPU6 3 0 0
CPU7 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:
./ovm_vmcontrol -u admin -p password -h localhost -v yum-chekov -c vcpuget
Oracle VM VM Control utility 0.5.2.
Connected.
Command : vcpuget
Virtual 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.
# xm vcpu-list 0004fb0000060000dbf90ab3718822c0
Name ID VCPU CPU State Time(s) CPU Affinity
0004fb0000060000dbf90ab3718822c0 41 0 0 -b- 17.0 0
0004fb0000060000dbf90ab3718822c0 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.
# xm vcpu-list 0004fb0000060000dbf90ab3718822c0
Name ID VCPU CPU State Time(s) CPU Affinity
0004fb0000060000dbf90ab3718822c0 41 0 0 -b- 17.3 0,3
0004fb0000060000dbf90ab3718822c0 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.
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 0004fb0000060000dbf90ab3718822c0
Name ID VCPU CPU State Time(s) CPU Affinity
0004fb0000060000dbf90ab3718822c0 41 0 2 -b- 17.4 1-2
0004fb0000060000dbf90ab3718822c0 41 1 1 -b- 40.7 1-2
maxmem = 1024
timer_mode = 0
OVM_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 = 2
OVM_os_type = 'Oracle Linux 5'
OVM_cpu_compat_group = None
OVM_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 vcpuget
Oracle VM VM Control utility 0.5.2.
Connected.
Command : vcpuget
Virtual 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,2
Oracle VM VM Control utility 0.5.2.
Connected.
Command : vcpuset
Pinning virtual CPUs
Pinning 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.cfg
vif = ['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 = 27500
memory = 1024
cpu_cap = 0
maxvcpus = 2
OVM_high_availability = True
maxmem = 1024
timer_mode = 0
OVM_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 = 2
cpus = '1,2'
OVM_os_type = 'Oracle Linux 5'
OVM_cpu_compat_group = None
OVM_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.
cpu_weight = 27500
memory = 1024
cpu_cap = 0
maxvcpus = 2
OVM_high_availability = True
maxmem = 1024
timer_mode = 0
OVM_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 = 2
cpus = '1,2'
OVM_os_type = 'Oracle Linux 5'
OVM_cpu_compat_group = None
OVM_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.