VMworld 2014/How to Monitor a Virtual Machine Without a Direct Network Connection

From Omnia
Jump to navigation Jump to search

How to Monitor a Virtual Machine Without a Direct Network Connection

GuestRPC - Host to Guest Communication

Option #1 - Hard-coded in VMX

Set before VM is powered on. Add key/value to VMX:

guestinfo.[key]=[value]

Guest:

vmtoolsd info-get guestinfo [key]

Option #2 - When VM is running

vmware-cmd [VMX_PATH] setguestinfo guestinfo.[KEY[ [VALUE]
vmware-cmd /..path../test.vmx setguestinfo guestinfo.provision.date `date +%h %d %Y"

Guest:

vmtoolsd --cmd info-set guestinfo.[key] [var]

GuestRPC:

  • private communication between guest and host
  • bidirectional communication over shared memory

Use Cases:

  • virtual machine status
  • vm applications state
  • vm application performance performance

How to Use:

  • Supported:
    • VMware Guest API
    • Native VMware Tools command line
  • Not Supported
    • Guest RPC .NET and Java Library

Applicaiton Monitoring Commands:

  • vmtoolsd --cmd GuestAppMonitor.Cmd.Enable
  • vmtoolsd --cmd GuestAppMonitor.Cmd.Disable
  • vmtoolsd --cmd GuestAppMonitor.Cmd.isEnabled
  • vmtoolsd --cmd GuestAppMonitor.Cmd.MarkActive
  • vmtoolsd --cmd GuestAppMonitor.Cmd.GetAppStatus

VMware Guest Tools:

vmtoolsd --cmd [RPC_COMMAND]
vmtoolsd --cmd info-set guestinfo.[key] [value]
vmtoolsd --cmd info-get guestinfo.[key]

PowerShell:

# VirtualMachine.config.extraConfig [OptionValue]
Param ( [param....
$format = ...
(get-vm -Name $VM | get-view).Config.ExtraConfig | where { $_.key.contains["guestinfo.vmworld" } | Format-Table -Property $format | Out-String

What is the message size limit? Pretty big - some ESX limit

Crazy things to try:

  • Encoding file transfer in XML between host and guest
  • Web Client application - monitor app or guest

Projects

  • VAM (Virtual Application Monitor) - modular and expandable open source networks and applications monitor