[CentOS-virt] How to pass messages from dom0 to domU??

Wed Jul 22 23:55:30 UTC 2009
Christopher G. Stach II <cgs at ldsys.net>

----- "David Knierim" <dknierim at gmail.com> wrote:

> I am adding code to my installation on dom0 (running CentOS 5.3) to
> monitor for hardware faults. If there is an issue, I want to propagate
> the status to all of the domUs (running CentOS 4.x or CentOS 5)
> running on the host.

How complicated do you want to get?  There are a couple simple ways, but they require some very basic coding:

1. Share a tiny block device as read-only with every concerned guest domain.  Write to the block device in dom0 and read from the block device periodically in domU.  Treat it as a semaphore, but remember that your reads in domU may be goofed up and you may end up going through two or more cycles before a complete read can occur.

2. Share a private virtual network segment with every connected guest domain.  Write a packet in dom0 and read in domU.  This has the benefit that you can later expand this to a VLAN or physical segment for cross-physical-host communication.  Make up whatever protocol you want if the network will only be used for this.  If you want to have some foresight, just use UDP on some unassigned port and then make up whatever protocol you want.  This isn't much different than just using SNMP SET, except your SNMP daemon won't be exposed to other networks.  That is probably better, anyway.

If you want more of a supported framework, you can go to NFS, OCFS2, or GFS.  The problem I see with this, for your simple use case, is that you are touching the kernel in dom0.  This adds risk to stability.

Christopher G. Stach II