2.8 Using Oracle VM Hostd For Metrics Messaging

2.8.1 Command Line Options
2.8.2 Example Usage
2.8.3 Using vm-dump-metrics To Retrieve Host Statistics Within a VM

The Oracle VM Utilities include tools that ensure that SAP applications are fully supported and certified to run on Oracle Linux guests running within a Oracle VM environment. These tools facilitate the communication of host-based statistics about the Oracle VM Server hosting a particular virtual machine, via the VM messaging facility provided by Oracle VM Manager, to the virtual machine itself.

Important

For this functionality to succeed, the guest virtual machine should be running Oracle Linux with the Oracle VM Guest Additions installed. See Chapter 3, Using the Oracle VM Guest Additions for more information.

Note

These are the only tools within the Oracle VM Utilities that are officially supported by Oracle.

These tools include ovm_vmhostd and the vm-dump-metrics script available in Patch 16269699 and above at:

http://www.oracle.com/technetwork/server-storage/vm/downloads/index.html

2.8.1 Command Line Options

The ovm_vmhostd has the following command line options:

  • -u user name of an Oracle VM Manager admin user (required)

  • -p password corresponding with the admin user name (required)

  • -h host name of the server running Oracle VM Manager (required)

  • -X use SSL to connect to Oracle VM Manager

  • -v Virtual Machine name

  • -U Virtual Machine UUID (optional alternative)

2.8.2 Example Usage

To run ovm_vmhostd on Oracle VM Manager you might run the following command:

# ./ovm_vmhostd -u admin -p MyPassword -h localhost -v myvm

From the example usage of the command, details of the underlying Oracle VM Server on which myvm is running are sent as messages via the Oracle VM Manager to the myvm virtual machine.

The ovm_vmhostd utility runs with daemon-like behaviour. It initially checks that the virtual machine is running, and then sends the server metrics as a message. It sleeps for 60 seconds and then sends a message updating the values for the original message. This behaviour continues until the process is killed. Typical output follows:

# ./ovm_vmhostd -u admin -p MyPassword -h localhost -v myvm
Oracle VM Hostd 0.6.3.
Connected.
Manager version : 3.2.1.516
VM : 'pvm1' has status :  Running.
VM: 'pvm1' is online, sending metrics.
.Sleeping 60 seconds.
.Sleeping 60 seconds.
.Sleeping 60 seconds.

2.8.3 Using vm-dump-metrics To Retrieve Host Statistics Within a VM

The vm-dump-metrics script can be copied to the guest virtual machine where the message is recieved. This script is a simple shell script that can output the Oracle VM Server host information in XML format. This XML can be consumed by a SAP application running within the virtual machine.

By default, the vm-dump-metrics script outputs data to STDOUT, but can be changed to output data to file by editing the OUTFILE variable at the beginning of the script.

The vm-dump-metrics script queries ovmd to obtain the message with the key vmhost. If no message is obtained, it exits with status 1. If a message is found, the script parses this message to populate the resulting XML. Typical XML output generated by the vm-dump-metrics script follows:

<metrics>
  <metric type='real64' context='host'>
    <name>TotalCPUTime</name>
    <value>2694.3596</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>PagedOutMemory</name>
    <value>0</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>PagedInMemory</name>
    <value>0</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>UsedVirtualMemory</name>
    <value>6747</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>FreeVirtualMemory</name>
    <value>9817</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>FreePhysicalMemory</name>
    <value>9817</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>MemoryAllocatedToVirtualServers</name>
    <value>6747</value>
  </metric>
  <metric type='uint32' context='host'>
    <name>NumberOfPhysicalCPUs</name>
    <value>4</value>
  </metric>
  <metric type='string' context='host'>
    <name>HostSystemInfo</name>
    <value>ovm3</value>
  </metric>
  <metric type='string' context='host'>
    <name>VirtProductInfo</name>
    <value>Oracle VM 3</value>
  </metric>
  <metric type='string' context='host'>
    <name>VirtualizationVendor</name>
    <value>Oracle Corporation</value>
  </metric>
  <metric type='uint64' context='host'>
    <name>Time</name>
    <value>1360606566774</value>
  </metric>
  <metric type='string' context='host'>
    <name>HostName</name>
    <value>ovm3</value>
  </metric>
  <metric type='uint64' context='vm' id='0' uuid='0004fb00-0006-0000-d72b-647e20a85939'>
    <name>PhysicalMemoryAllocatedToVirtualSystem</name>
    <value>1024</value>
  </metric>
  <metric type='uint64' context='vm' id='0' uuid='0004fb00-0006-0000-d72b-647e20a85939'>
    <name>ResourceMemoryLimit</name>
    <value>1024</value>
  </metric>
  <metric type='uint32' context='vm' id='0' uuid='0004fb00-0006-0000-d72b-647e20a85939'>
    <name>ResourceProcessorLimit</name>
    <value>1</value>
  </metric>
  <metric type='real64' context='vm' id='0' uuid='0004fb00-0006-0000-d72b-647e20a85939'>
    <name>TotalCPUTime</name>
    <value>2694.3596</value>
  </metric>
</metrics>

If you do not want to use the vm-dump-metrics script on your virtual machine, you can query ovmd directly and parse the output yourself:

# ovmd -g vmhost
com.sap.host.VirtualizationVendor=Oracle Corporation;com.sap.host.VirtProductInfo=Oracle VM 3;
com.sap.host.PagedInMemory=0;com.sap.host.PagedOutMemory=0;com.sap.host.PageRates=0;
com.sap.vm.uuid=0004fb0000060000d72b647e20a85939;com.sap.host.HostName=ovm3;
com.sap.host.HostSystemInfo=ovm3;com.sap.host.NumberOfPhysicalCPUs=4;com.sap.host.NumCPUs=4;
com.sap.host.TotalPhyMem=16383;com.sap.host.UsedVirtualMemory=6747;
com.sap.host.MemoryAllocatedToVirtualServers=6747;com.sap.host.FreeVirtualMemory=9817;
com.sap.host.FreePhysicalMemory=9817;com.sap.host.TotalCPUTime=381175.97;
com.sap.host.Time=1360606887997;com.sap.vm.PhysicalMemoryAllocatedToVirtualSystem=1024;
com.sap.vm.ResourceMemoryLimit=1024;com.sap.vm.TotalCPUTime=2696.2214;
com.sap.vm.ResourceProcessorLimit=1;