Transforms Tip: VMWare host moves

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

If you use the VMWare ZenPack to monitor your VMWare servers and you have those servers configured to send traps to your Zenoss server, you can have Zenoss automatically model the servers whenever hosts are migrated. Whenever VMWare migrates a host it will send a vwmVmHBDetected trap from the hypervisor that is now running the host image, and a vwmVmHBLost trap from the host it migrated from.

The following transform will model the hypervisor for you and send the event(s) off to history so it doesn't alert anyone:

 # Re-model the device on this trap, a host has changed
 device.collectDevice()
 evt._action = "history"

To use this, Navigate to Event Classes -> Status -> VMWare, and create two new event class mappings: vmwVmHBDetected and vmwVmHBLost. For each one, those should be both the name (if desired) and the event class key. Set the transform to the code above for each of them. You may also want to use an example like "snmp trap vmwVmHBDetected" to identify the event class.

Zenoss-vmware-transform.png

Once you have the above in place, you should be able to migrate one of your VM hosts and see Zenoss model the involved hypervisors. You should also see the host you migrated disappear from the component list on the device it was migrated from, and appear on the device it was migrated to.