WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Running scripts on domU create/shutdown?

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Running scripts on domU create/shutdown?
From: Steve Kemp <steve@xxxxxxxxxxxx>
Date: Mon, 5 Mar 2007 21:45:29 +0000
Delivery-date: Mon, 05 Mar 2007 13:44:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
Hi,

  I'm working on the early design stages of a multi-dom0 xen
 monitoring tool, (to replace my previous attempt "Argo").

  One thing that would be very useful for a monitoring tool
 would be the ability to run a script, or scripts, upon
 dom0 events:

    domU creation
    domU shutdown

  Ideally /etc/xen/events/domU-up.d/* + domU-down.d/* or
 similar.  (Running every executable the appropriate directory
 with a single argument of the domain name would be sufficient
 for my purposes.)

  I've managed to write simple behavior for this by hacking
 /etc/xen/scripts/vif-common.sh.  I can detect startup/shutdown
 by looking at the first command line argument.

  From there I can examine $XENBUS_PATH to get the ID of the
 domain which is being created/destroyed - however there
 isn't a simple mechanism that I've seen to get the domain
 name.

  So two questions:

    1.  Is there a simple method to get the domain name
       from the ID, short of parsing "xm list N"?

    2.  Would this kind of startup/shutdown hook be useful
       to others, and if so would a patch be applied?  (I'm
       happy to submit my code.)

Steve
-- 
http://www.steve.org.uk/

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users