3.3. Features of the Oracle VM Guest Additions

3.3.1. Using the Messaging Channel
3.3.2. Displaying the Guest IP Address

Together with the ovm_vmmessage utility on the Oracle VM Manager, the Oracle VM Guest Additions form a bi-directional messaging channel between Oracle VM Manager and the guest. More specifically, as part of the Oracle VM Guest Additions, a command line tool called ovmd is installed. It allows first-boot installation configuration, and is capable of sending and receiving messages consisting of key-value pairs just like the ovm_vmmessage utility. As you can see in the help, ovmd has the following command line options:

# ovmd --help
usage: ovmd [options]

options:
-p, --set-param=PARAM   Set param in format: key=value.
-g, --get-param=KEY     Get param value.
-r, --delete-param=KEY  Delete param by key name.
-x, --delete-params     Delete all params.
-l, --list-params       List all params.
-e, --event=EVENT       Inject event.
-s, --script=SCRIPT     Run script.
-d, --debug=LEVEL       Set debug level: 0(DEBUG_OFF), 1(DEBUG_STDERR) or 2(DEBUG_SYSLOG). 
                        Default: 2.
-f, --pid-file=FILENAME Set the pathname of the process ID (PID) file.
-t, --time-period=secs  Set the period for daemon mode(default=10 seconds).
-v, --version           Show version number and exit.
-h, --help              Show this help information.  

3.3.1. Using the Messaging Channel

This sections provides an example of a message exchange between Oracle VM Manager and a running Oracle Linux virtual machine with Oracle VM Guest Additions installed. More information about the messaging utility can be found in Section 2.5, “Using Oracle VM Virtual Machine Messaging”.

Sending a message from the guest to Oracle VM Manager.

Using ovmd, you send information to your Oracle VM Manager using the following syntax:

# ovmd -p key1=value1

The message shows up in the Oracle VM Manager user interface, as a Virtual Machine API Incoming Message event for the virtual machine in question. When you expand the event, the description shows the key-value pair and the date and time when the information exchange took place.

The message from the guest can also be retrieved via the Oracle VM Managercommand line utility ovm_vmmessage. To do so, you query the key and the value is returned in the response:

# ./ovm_vmmessage -u admin -p password -h localhost -v MyVM02 -q key1 
Oracle VM VM Message utility 0.5.2. 
Connected. 
VM : 'MyVM02' has status :  Running. 
Querying for key 'key1. 
Query successful. 
Query for Key : 'key1' returned value 'value1'. 
Key set 7 minutes ago.

Sending a message from Oracle VM Manager to a virtual machine.

Using ovm_vmmessage, you send information to a virtual machine using the following syntax:

# ./ovm_vmmessage -u admin -p password -h localhost -v MyVM02 -k key2 -V value2 
Oracle VM VM Message utility 0.5.2. 
Connected. 
VM : 'MyVM02' has status :  Running. 
Sending message. 
Message sent successfully.

Using ovmd from within the guest, you can retrieve the message sent from Oracle VM Manager using the following syntax:

# ovmd --list
{"key1":"value1"}
{"key2":"value2"}

The ovmd --list command retrieves all messages, both sent and received. You can identify the specific message you are looking for by its key. To remove obsolete messages, use the following syntax:

# ovmd -r key1
# ovmd --list
{"key2":"value2"}

3.3.2. Displaying the Guest IP Address

When the Oracle VM Guest Additions are installed, the virtual machine IP address becomes visible in the Oracle VM Manager user interface, as part of the detailed virtual machine information.

This figure shows the guest IP address in the Networks & Storage information of the selected virtual machine.