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.
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"}