From 2f4bf9bbe214bb84e138bb57fa354a0e3e7cefa8 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 20 Jan 2012 17:23:36 +0100 Subject: [PATCH] bug #1060: set VM to unknown when it cannot be monitoried --- src/vmm_mad/remotes/poll_ganglia.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vmm_mad/remotes/poll_ganglia.rb b/src/vmm_mad/remotes/poll_ganglia.rb index cac5400e74..94a74cb946 100755 --- a/src/vmm_mad/remotes/poll_ganglia.rb +++ b/src/vmm_mad/remotes/poll_ganglia.rb @@ -68,6 +68,12 @@ end doms_info=ganglia.get_vms_information dom_id=domain.split('-').last +# Unknown state when the VM is not found +if !doms_info || !(doms_info[domain] || doms_info[dom_id]) + puts "STATE=d" + exit(0) +end + # Get key one- or key from the hash dom_info=doms_info[domain] dom_info=doms_info[dom_id] if !dom_info