9.1 Oracle VM Virtual Machine Control (ovm_vmcontrol)

The ovm_vmcontrol script lets you configure CPU pinning, which is also referred to as hard partitioning, on virtual machines.

Note
  • The ovm_vmcontrol script supports CPU pinning for virtual machines running on x86-based Oracle VM Servers only. You cannot configure CPU pinning for virtual machines running on Oracle VM Server for SPARC.

  • If you are using Oracle VM Release 3.4.1 or Release 3.4.2, after you configure CPU pinning for a virtual machine, you must stop and then start the virtual machine for the configuration to take effect. Restarting the virtual machine does not load the configuration changes for CPU pinning.

  • As of Oracle VM Release 3.4.3, support for dynamic CPU pinning is available. As a result, after you configure CPU pinning for a virtual machine, there is no longer a requirement to stop and then start the virtual machine for the configuration to take effect.

Syntax

ovm_vmcontrol { -u username } [ -p password | -E ] { -h hostname } { -c command } { -v vm_name | -U vm_uuid } [ -s cpu_thread_list ... ]

Where command is:

{ setvcpu | getvcpu | rmvcpu }

Options

The following table shows the available options for this command.

Option

Description

-u username

Username of an Oracle VM Manager admin user. This option is required.

[ -p password | -E ]

Corresponding password for the Oracle VM Manager admin user. You can specify the password as follows:

  • Do not set an option for the password in the command line. The Oracle VM Utilities then prompt you to specify it. You should use this method to set the password.

  • Set the password as an environment variable and then use the -E option. It is best practice to remove the environment variable when it is no longer required.

    You must use the OVMUTIL_PASS environment variable with the -E option. Set this variable for a single session as follows:

    # export OVMUTIL_PASS=password
  • Specify the password on the command line with the -p option. This option is deprecated as of Oracle VM Release 3.4.

{ -h hostname }

Hostname of the server running Oracle VM Manager.

-c { setvcpu | getvcpu | rmvcpu }

Command to execute. This option is required.

The setvcpu command hard-binds or pins virtual CPUs to threads. For example, -c setvcpu -s 0,1,2 physically binds vcpu0 to thread0, vcpu1 to thread1, vcpu2 to thread2. Use the getvcpu command to retrieve information about pinned virtual CPUs for the selected virtual machine. CPU binding immediately takes effect, and will continue on subsequent start ups of the virtual machine.

-v vm_name

Virtual machine name.

-U vm_uuid

Virtual machine UUID. If you do not specify the virtual machine name with the -v vm_name option, you must specify the UUID of the virtual machine.

-s cpu_thread_list ...

List of physical thread numbers to which you can bind virtual CPUs. You can set the value as follows:

  • One or more numbers separated by a comma. For example, 0,1,2,3,4.

  • A range of numbers. For example, 0-4 is equal to 0,1,2,3,4.

  • A range of numbers that excludes one number. For example, 0-4,^2 is equal to 0,1,3,4.

  • A combination of comma-separated numbers and ranges. For example, 0-2,4,6-8 is equal to 0,1,2,4,6,7,8.

Note

You must not set a number as the value for the -s option that is greater than the physical CPU count for the server. For example, if a server has 8 physical CPUs then you can set 0 to 7. Setting 8 or higher is not valid.

You must use this command in combination with:

-c setvcpu

Examples

Example 9.1 Setting CPU pinning for a virtual machine

This example binds the virtual CPUs of the virtual machine to threads 0, 1, 3, 5, and 7.

# ./ovm_vmcontrol -u admin -h localhost -v MyVM01 -c setvcpu -s 0-3,^2,5-7,^6
Oracle VM VM Control utility 2.1.
Connecting to OVM Manager using Web Service.
Connected.
OVM Manager version: version
Command : setvcpu
Pinning vCPU '0-3,^2,5-7,^6' to VM 'MyVM01'
Pin vCPU succeed.

Example 9.2 Checking CPU pinning for a virtual machine

This example shows the virtual CPUs of the virtual machine are bound to threads 0, 1, 3, 5, and 7.

# ./ovm_vmcontrol -u admin -h localhost -v MyVM01 -c getvcpu
Oracle VM VM Control utility 2.1.
Connecting to OVM Manager using Web Service.
Connected.
OVM Manager version: version
Command : getvcpu
Getting pinned CPU list...
Current pinned CPU:0-3,^2,5-7,^6