From ea40607e26842ecde0fd5747091552511e476755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 12 Feb 2013 17:47:16 +0100 Subject: [PATCH] Feature #1739: All VMs are set to unk if the host poll fails --- src/im/InformationManagerDriver.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index 01565c58ab..4f44fa4a78 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -47,13 +47,15 @@ void InformationManagerDriver::protocol( string action; //stores the action result string result; - //stores the action id of the asociated HOSR + //stores the action id of the associated HOST int id; ostringstream ess; Host * host; + set vm_ids; + // Parse the driver message if ( is.good() ) @@ -96,6 +98,8 @@ void InformationManagerDriver::protocol( goto error_host; } + vm_ids = host->get_running_vms(); + if (result != "SUCCESS") { goto error_driver_info; @@ -114,7 +118,6 @@ void InformationManagerDriver::protocol( VectorAttribute* vatt; vector vm_att; vector::iterator it; - set vm_ids; getline (is, hinfo64); @@ -144,8 +147,6 @@ void InformationManagerDriver::protocol( host->remove_template_attribute("VM"); - vm_ids = host->get_running_vms(); - host->touch(true); hpool->update(host); @@ -208,8 +209,14 @@ void InformationManagerDriver::protocol( return; error_driver_info: - ess << "Error monitoring host " << id << " : " << is.str(); - goto error_common_info; + ess << "Error monitoring host " << id << " : " << is.str(); + + for (set::iterator it = vm_ids.begin(); it != vm_ids.end(); it++) + { + VirtualMachineManagerDriver::process_poll(*it, "STATE=d"); + } + + goto error_common_info; error_common_info: NebulaLog::log("InM",Log::ERROR,ess);