[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] Refresh VM_guest_metrics objects when xapi restarts



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1257369764 0
# Node ID 55113722d48c9029add5ca584f400836a4088896
# Parent  1224932ff7ea4a8099ea5a48a7c7a2cc1d2a2e76
Refresh the VM_guest_metrics objects when xapi restarts.

This is important because:
1. if we add an updated tools .iso containing new guest PV drivers (say, as the 
result of a software update) then we wish to recompute the 
PV-drivers-up-to-date flag to signal that guests need updating
2. if we were offline then we may have missed arbitrary guest agent updates 
anyway

Without this, stale information can persist for quite a long time, especially 
since guest agents tend to suppress redundant updates.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 1224932ff7ea -r 55113722d48c ocaml/xapi/dbsync_slave.ml
--- a/ocaml/xapi/dbsync_slave.ml        Tue Nov 03 16:58:38 2009 +0000
+++ b/ocaml/xapi/dbsync_slave.ml        Wed Nov 04 21:22:44 2009 +0000
@@ -440,9 +440,14 @@
        set_db_state_and_domid vmref state dinfo.Xc.domid;
       end;
     (* Now sync devices *)
-      debug "syncing devices and registering vm for monitoring: %s" 
(uuid_from_dinfo dinfo);
-      let uuid = Uuid.uuid_of_int_array dinfo.Xc.handle in
+    debug "syncing devices and registering vm for monitoring: %s" 
(uuid_from_dinfo dinfo);
+    let uuid = Uuid.uuid_of_int_array dinfo.Xc.handle in
        sync_devices dinfo;
+       (* Update the VM's guest metrics since: (i) while we were offline we may
+          have missed an update; and (ii) if the tools .iso has been updated 
then
+          we wish to re-evaluate whether we believe the VMs have up-to-date
+          tools *)
+       Events.callback_guest_agent xal dinfo.Xc.domid;
        (* Now register with monitoring thread *)
 
       Monitor_rrds.load_rrd ~__context (Uuid.to_string uuid) false
1 file changed, 7 insertions(+), 2 deletions(-)
ocaml/xapi/dbsync_slave.ml |    9 +++++++--


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.