Temporarily disable event-based VM state management at XS resource level. Wait to enable it when other changes in XS is ready
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bfb7835a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bfb7835a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bfb7835a Branch: refs/heads/master Commit: bfb7835a212f7f0afaf84cf826ba38feb87c81a3 Parents: e6e12e3 Author: Kelven Yang <kelv...@gmail.com> Authored: Fri Feb 7 15:50:46 2014 -0800 Committer: Kelven Yang <kelv...@gmail.com> Committed: Fri Feb 28 15:35:58 2014 -0800 ---------------------------------------------------------------------- .../xenserver/XenServerResourceNewBase.java | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bfb7835a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java index 1c97486..438a392 100644 --- a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java +++ b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java @@ -45,6 +45,26 @@ import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineName; +/** + * + * XenServerResourceNewBase is an abstract base class that encapsulates how + * CloudStack should interact with XenServer after a special XenServer + * 6.2 hotfix. From here on, every Resource for future versions of + * XenServer should use this as the base class. This base class lessens + * the amount of load CloudStack places on Xapi because it doesn't use + * polling as a means to collect data and figure out task completion. + * + * This base class differs from CitrixResourceBase in the following ways: + * - VM states are detected using Event.from instead of polling. This + * increases the number of threads CloudStack uses but the threads + * are mostly idle just waiting for events from XenServer. + * - stats are collected through the http interface rather than Xapi plugin. + * This change may be promoted to CitrixResourceBase as it's also possible + * in previous versions of XenServer. + * - Asynchronous task completion is done throught Event.from rather than + * polling. + * + */ public class XenServerResourceNewBase extends XenServer610Resource { private static final Logger s_logger = Logger.getLogger(XenServerResourceNewBase.class); protected VmEventListener _listener = null; @@ -62,7 +82,12 @@ public class XenServerResourceNewBase extends XenServer610Resource { Host.Record masterRecord = poolr.master.getRecord(conn); if (_host.uuid.equals(masterRecord.uuid)) { _listener = new VmEventListener(true); - _listener.start(); + + // + // TODO disable event listener for now. Wait until everything else is ready + // + + // _listener.start(); } else { _listener = new VmEventListener(false); }