diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java index ccac8c341a5..98b9eab694b 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java @@ -531,13 +531,12 @@ public class XenServerConnectionPool { s_logger.debug(msg); throw new CloudRuntimeException(msg); } - Host host = null; synchronized (poolUuid.intern()) { // Let's see if it is an existing connection. mConn = getConnect(poolUuid); if (mConn != null){ try{ - host = Host.getByUuid(mConn, hostUuid); + Host.getByUuid(mConn, hostUuid); } catch (Types.SessionInvalid e) { s_logger.debug("Session thgrough ip " + mConn.getIp() + " is invalid for pool(" + poolUuid + ") due to " + e.toString()); try { @@ -636,39 +635,6 @@ public class XenServerConnectionPool { } } } - - if ( mConn != null ) { - if (s_managePool) { - try { - Map args = new HashMap(); - host.callPlugin(mConn, "vmops", "pingxenserver", args); - } catch (Types.CannotContactHost e ) { - if (s_logger.isDebugEnabled()) { - String msg = "Catch Exception: " + e.getClass().getName() + " Can't connect host " + ipAddress + " due to " + e.toString(); - s_logger.debug(msg); - } - PoolEmergencyResetMaster(ipAddress, mConn.getIp(), mConn.getUsername(), mConn.getPassword()); - } catch (Types.HostOffline e ) { - if (s_logger.isDebugEnabled()) { - String msg = "Catch Exception: " + e.getClass().getName() + " Host is offline " + ipAddress + " due to " + e.toString(); - s_logger.debug(msg); - } - PoolEmergencyResetMaster(ipAddress, mConn.getIp(), mConn.getUsername(), mConn.getPassword()); - } catch (Types.HostNotLive e ) { - String msg = "Catch Exception: " + e.getClass().getName() + " Host Not Live " + ipAddress + " due to " + e.toString(); - if (s_logger.isDebugEnabled()) { - s_logger.debug(msg); - } - PoolEmergencyResetMaster(ipAddress, mConn.getIp(), mConn.getUsername(), mConn.getPassword()); - } catch (Exception e) { - String msg = "Master can not talk to Slave " + hostUuid + " IP " + ipAddress; - if (s_logger.isDebugEnabled()) { - s_logger.debug(msg); - } - throw new CloudRuntimeException(msg); - } - } - } return mConn; } @@ -913,6 +879,24 @@ public class XenServerConnectionPool { } loginWithPassword(this, _username, _password, APIVersion.latest().toString()); method_params[0] = getSessionReference(); + } catch (Types.CannotContactHost e ) { + if (s_logger.isDebugEnabled()) { + String msg = "Cannot Contact Host for method: " + method_call + " due to " + e.toString(); + s_logger.debug(msg); + } + throw e; + } catch (Types.HostOffline e ) { + if (s_logger.isDebugEnabled()) { + String msg = "Host Offline for method: " + method_call + " due to " + e.toString(); + s_logger.debug(msg); + } + throw e; + } catch (Types.HostNotLive e ) { + if (s_logger.isDebugEnabled()) { + String msg = "Host is Not alive for method: " + method_call + " due to " + e.toString(); + s_logger.debug(msg); + } + throw e; } catch (XmlRpcClientException e) { s_logger.debug("XmlRpcClientException for method: " + method_call + " due to " + e.getMessage()); removeConnect(_poolUuid);