2.4.1 Oracle VM Virtual Machine Control (ovm_vmcontrol)

The ovm_vmcontrol utility operates on a virtual machine. It passes basic virtual machine control commands from the command line to Oracle VM Manager. This utility allows you to lock a virtual machine, send and receive messages from a virtual machine, or set CPU pinning (hard partitioning).

Syntax

ovm_vmcontrol { -u username } { -p password | -E } { -h hostname } { -c command } [ -v vm_name ] [ -s cpu_thread ... ] [ -T tag ... ] { -C { preserve | restart | coredump-restart | coredump-destroy | none } }

Where command is:

{ lock | vcpuset | vcpuget | settags | gettags | setoncrash | getoncrash | setsuperpage | unsetsuperpage }

Options

The following table shows the available options for this command.

Option

Description

-u username

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

{ -p password | -E }

The -p option is the password corresponding with the admin username. Alternatively, you can use the -E option to set the password in an environment variable named OVMUTIL_PASS, and securely submit the password. To set this variable for a single session on Oracle Linux, use:

# export OVMUTIL_PASS=password

This option is required.

-h hostname

The hostname of the server running Oracle VM Manager. This option is required.

-c { lock | vcpuset | vcpuget | settags | gettags | setoncrash | getoncrash | setsuperpage | unsetsuperpage }

The command to execute. This option is required.

The lock command allows you to lock a virtual machine for a certain period of time. When a virtual machine is locked by the utility, it is not possible for other tools or users to perform operations on that specific virtual machine. This is particularly useful if you are an administrator and need to make a virtual machine back up while the virtual machine is stopped: you want to prevent anyone starting the virtual machine before the back up finishes.

The lock command sleeps until you press Ctrl+C to release the lock. If the ovm_control utility is killed, the virtual machine is unlocked as well.

The vcpuset command hard-binds or pins virtual CPUs to threads. For example, -c vcpuset -s 0,1,2 physically binds vcpu0 to thread0, vcpu1 to thread1, vcpu2 to thread2. Use the vcpuget 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.

The settags and gettags commands are used to manage tag metadata for a given virtual machine.

-v vm_name

The virtual machine name.

-s cpu_thread ...

A comma separated list of physical thread numbers with which to bind virtual CPUs.

The list of thread numbers can be a range, or a specific list of physical CPU threads. For example, -s 0-3 means any virtual CPU can be running anywhere on the physical CPU (threads) 0,1,2, or 3; and -s 0,3 means the specific physical CPU (threads) 0 and 3.

This command must be used in combination with:

-c vcpuset

-T tag ...

A comma separated list of strings to be associated with a virtual machine as metadata

This command must be used in combination with:

-c settags

-C { preserve | restart | coredump-restart | coredump-destroy | none }

Change a virtual machine's on_crash setting.

This command must be used in combination with:

-c setoncrash

Examples

Example 2.1 Locking a virtual machine

# ./ovm_vmcontrol -u admin -E -h localhost -v MyVM01 -c lock 
Oracle VM VM Control utility version.
Connected. 
Command : lock 
Locking VM 'MyVM01' 
Press Ctrl-C to unlock. 

Example 2.2 Checking CPU pinning for a virtual machine

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

# ./ovm_vmcontrol -u admin -E -h localhost -v MyVM01 -c vcpuget

Oracle VM VM Control utility version.
Connecting with a secure connection.
Connected.
Command : vcpuget
Current pinning of virtual CPUs to physical threads : 0-1

Example 2.3 Setting CPU pinning for a virtual machine

This example binds the virtual CPUs of the virtual machine to thread 0.

# ./ovm_vmcontrol -u admin -E -h localhost -v MyVM01 -c vcpuset -s 0

Oracle VM VM Control utility version.
Connecting with a secure connection.
Connected.
Command : vcpuset
Pinning virtual CPUs
Pinning of virtual CPUs to physical threads  '0' 'vm1' completed.