From 6ae0bc596a511f42da31753aaf727f59c3590670 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 18:26:36 -0700 Subject: [PATCH] try host.destroy after pool.eject --- .../xen/resource/CitrixResourceBase.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 0b93e2be58a..bf882387f68 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -6090,19 +6090,23 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR } } // eject from pool - Pool.eject(conn, host); + try { + Pool.eject(conn, host); + } catch (XenAPIException e) { + String msg = "Unable to eject host " + _host.uuid + " due to " + e.toString(); + s_logger.warn(msg); + host.destroy(conn); + } return new Answer(cmd); } catch (XenAPIException e) { - String msg = "Unable to eject host " + _host.uuid + " due to " + e.toString(); + String msg = "XenAPIException Unable to destroy host " + _host.uuid + " in xenserver database due to " + e.toString(); s_logger.warn(msg, e); return new Answer(cmd, false, msg); } catch (Exception e) { - s_logger.warn("Unable to eject host " + _host.uuid, e); - String msg = "Unable to eject host " + _host.uuid + " due to " + e.getMessage(); + String msg = "Exception Unable to destroy host " + _host.uuid + " in xenserver database due to " + e.getMessage(); s_logger.warn(msg, e); return new Answer(cmd, false, msg); - } - + } } protected class Nic {