You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/04/25 00:42:51 UTC

[1/2] git commit: updated refs/heads/planner_reserve to 1959377

Updated Branches:
  refs/heads/planner_reserve a3aa28929 -> 1959377d3


Changes to the op_host_planner_reservation schema - removed unnescessray columns


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/526c0cc6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/526c0cc6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/526c0cc6

Branch: refs/heads/planner_reserve
Commit: 526c0cc6d5e7c6a6e513f61595e00f884bfedc1d
Parents: a3aa289
Author: Prachi Damle <pr...@cloud.com>
Authored: Wed Apr 24 15:39:24 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Wed Apr 24 15:39:24 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    3 +
 .../com/cloud/deploy/PlannerHostReservationVO.java |   60 +++++----------
 .../deploy/dao/PlannerHostReservationDao.java      |    2 +
 .../deploy/dao/PlannerHostReservationDaoImpl.java  |   23 ++++++
 setup/db/db/schema-410to420.sql                    |    7 +--
 5 files changed, 50 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526c0cc6/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 48c1ba9..a341f33 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -844,4 +844,7 @@
   <bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl">
   </bean>
   
+  <bean id="PlannerHostReservationDaoImpl" class="com.cloud.deploy.dao.PlannerHostReservationDaoImpl">
+  </bean>
+  
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526c0cc6/server/src/com/cloud/deploy/PlannerHostReservationVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/PlannerHostReservationVO.java b/server/src/com/cloud/deploy/PlannerHostReservationVO.java
index 47e1457..cf5f031 100644
--- a/server/src/com/cloud/deploy/PlannerHostReservationVO.java
+++ b/server/src/com/cloud/deploy/PlannerHostReservationVO.java
@@ -19,12 +19,16 @@ package com.cloud.deploy;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 import org.apache.cloudstack.api.InternalIdentity;
 
+import com.cloud.deploy.DeploymentPlanner.PlannerResourceUsage;
+
 @Entity
 @Table(name = "op_host_planner_reservation")
 public class PlannerHostReservationVO implements InternalIdentity {
@@ -45,29 +49,27 @@ public class PlannerHostReservationVO implements InternalIdentity {
     @Column(name="cluster_id")
     private Long clusterId;
 
-    @Column(name = "resource_type")
-    private short resourceType;
-
-    @Column(name = "domain_id")
-    private long domainId;
-
-    @Column(name = "account_id")
-    private long accountId;
-
-    @Column(name = "deployment_planner")
-    private String deploymentPlanner;
+    @Column(name = "resource_usage")
+    @Enumerated(EnumType.STRING)
+    private PlannerResourceUsage resourceUsage;
 
     public PlannerHostReservationVO() {
     }
 
-    public PlannerHostReservationVO(Long hostId, Long dataCenterId, Long podId, Long clusterId, short resourceType,
-            String planner) {
+    public PlannerHostReservationVO(Long hostId, Long dataCenterId, Long podId, Long clusterId) {
+        this.hostId = hostId;
+        this.dataCenterId = dataCenterId;
+        this.podId = podId;
+        this.clusterId = clusterId;
+    }
+
+    public PlannerHostReservationVO(Long hostId, Long dataCenterId, Long podId, Long clusterId,
+            PlannerResourceUsage resourceUsage) {
         this.hostId = hostId;
         this.dataCenterId = dataCenterId;
         this.podId = podId;
         this.clusterId = clusterId;
-        this.resourceType = resourceType;
-        this.deploymentPlanner = planner;
+        this.resourceUsage = resourceUsage;
     }
 
     @Override
@@ -104,32 +106,12 @@ public class PlannerHostReservationVO implements InternalIdentity {
         this.clusterId = new Long(clusterId);
     }
 
-    public short getResourceType() {
-        return resourceType;
-    }
-
-    public void setResourceType(short resourceType) {
-        this.resourceType = resourceType;
-    }
-
-    public String getDeploymentPlanner() {
-        return deploymentPlanner;
-    }
-
-    public long getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(long domainId) {
-        this.domainId = domainId;
-    }
-
-    public long getAccountId() {
-        return accountId;
+    public PlannerResourceUsage getResourceUsage() {
+        return resourceUsage;
     }
 
-    public void setAccountId(long accountId) {
-        this.accountId = accountId;
+    public void setResourceUsage(PlannerResourceUsage resourceType) {
+        this.resourceUsage = resourceType;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526c0cc6/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java b/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
index 112af95..71e235d 100644
--- a/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
+++ b/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
@@ -21,4 +21,6 @@ import com.cloud.utils.db.GenericDao;
 
 public interface PlannerHostReservationDao extends GenericDao<PlannerHostReservationVO, Long> {
 
+    PlannerHostReservationVO findByHostId(long hostId);
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526c0cc6/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java b/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
index ccda44b..7b12067 100644
--- a/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
+++ b/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
@@ -16,12 +16,35 @@
 // under the License.
 package com.cloud.deploy.dao;
 
+import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import com.cloud.deploy.PlannerHostReservationVO;
 import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
 
 @Local(value = { PlannerHostReservationDao.class })
 public class PlannerHostReservationDaoImpl extends GenericDaoBase<PlannerHostReservationVO, Long> implements
         PlannerHostReservationDao {
 
+    private SearchBuilder<PlannerHostReservationVO> _hostIdSearch;
+
+    public PlannerHostReservationDaoImpl() {
+
+    }
+
+    @PostConstruct
+    protected void init() {
+        _hostIdSearch = createSearchBuilder();
+        _hostIdSearch.and("hostId", _hostIdSearch.entity().getHostId(), SearchCriteria.Op.EQ);
+        _hostIdSearch.done();
+    }
+
+    @Override
+    public PlannerHostReservationVO findByHostId(long hostId) {
+        SearchCriteria<PlannerHostReservationVO> sc = _hostIdSearch.create();
+        sc.setParameters("hostId", hostId);
+        return findOneBy(sc);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526c0cc6/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index d63bdf1..4350b65 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -725,15 +725,10 @@ CREATE TABLE `cloud`.`op_host_planner_reservation` (
   `pod_id` bigint unsigned,
   `cluster_id` bigint unsigned,
   `host_id` bigint unsigned,
-  `account_id` bigint unsigned,
-  `domain_id` bigint unsigned,
-  `deployment_planner` varchar(255) COMMENT 'Name of the Planner',
-  `resource_type` int(1) unsigned NOT NULL COMMENT 'shared(0) Vs dedicated(1)',
+  `resource_usage` varchar(255) COMMENT 'Shared(between planners) Vs Dedicated (exclusive usage to a planner)',
   PRIMARY KEY  (`id`),
   INDEX `i_op_host_planner_reservation__host_type`(`host_id`, `resource_type`),
   CONSTRAINT `fk_planner_reservation__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_planner_reservation__account_id` FOREIGN KEY `fk_resource_count__account_id`(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_planner_reservation__domain_id` FOREIGN KEY `fk_resource_count__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_planner_reservation__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `cloud`.`data_center`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_planner_reservation__pod_id` FOREIGN KEY (`pod_id`) REFERENCES `cloud`.`host_pod_ref`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_planner_reservation__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cloud`.`cluster`(`id`) ON DELETE CASCADE


[2/2] git commit: updated refs/heads/planner_reserve to 1959377

Posted by pr...@apache.org.
Adding new DeploymentClusterPlanner interface


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1959377d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1959377d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1959377d

Branch: refs/heads/planner_reserve
Commit: 1959377d302eefb31320b023d292be3ce2ca775b
Parents: 526c0cc
Author: Prachi Damle <pr...@cloud.com>
Authored: Wed Apr 24 15:40:39 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Wed Apr 24 15:40:39 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/deploy/DeploymentClusterPlanner.java |   45 ++++
 api/src/com/cloud/deploy/DeploymentPlanner.java    |    6 +
 .../deploy/DeploymentPlanningManagerImpl.java      |  192 ++++++++++++++-
 server/src/com/cloud/vm/UserVmManagerImpl.java     |    4 -
 4 files changed, 233 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1959377d/api/src/com/cloud/deploy/DeploymentClusterPlanner.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/deploy/DeploymentClusterPlanner.java b/api/src/com/cloud/deploy/DeploymentClusterPlanner.java
new file mode 100644
index 0000000..4d8ee74
--- /dev/null
+++ b/api/src/com/cloud/deploy/DeploymentClusterPlanner.java
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.deploy;
+
+import java.util.List;
+import com.cloud.exception.InsufficientServerCapacityException;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+
+/**
+ */
+public interface DeploymentClusterPlanner extends DeploymentPlanner {
+    /**
+     * This is called to determine list of possible clusters where a virtual
+     * machine can be deployed.
+     *
+     * @param vm
+     *            virtual machine.
+     * @param plan
+     *            deployment plan that tells you where it's being deployed to.
+     * @param avoid
+     *            avoid these data centers, pods, clusters, or hosts.
+     * @return DeployDestination for that virtual machine.
+     */
+    List<Long> orderClusters(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan,
+            ExcludeList avoid) throws InsufficientServerCapacityException;
+
+
+    PlannerResourceUsage getResourceType();
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1959377d/api/src/com/cloud/deploy/DeploymentPlanner.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/deploy/DeploymentPlanner.java b/api/src/com/cloud/deploy/DeploymentPlanner.java
index 537dd31..a17fabe 100644
--- a/api/src/com/cloud/deploy/DeploymentPlanner.java
+++ b/api/src/com/cloud/deploy/DeploymentPlanner.java
@@ -35,6 +35,7 @@ import com.cloud.vm.VirtualMachineProfile;
 /**
  */
 public interface DeploymentPlanner extends Adapter {
+
     /**
      * plan is called to determine where a virtual machine should be running.
      *
@@ -46,6 +47,7 @@ public interface DeploymentPlanner extends Adapter {
      *            avoid these data centers, pods, clusters, or hosts.
      * @return DeployDestination for that virtual machine.
      */
+    @Deprecated
     DeployDestination plan(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException;
 
     /**
@@ -88,6 +90,10 @@ public interface DeploymentPlanner extends Adapter {
         userconcentratedpod_firstfit;
     }
 
+    public enum PlannerResourceUsage {
+        Shared, Dedicated;
+    }
+
     public static class ExcludeList {
         private Set<Long> _dcIds;
         private Set<Long> _podIds;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1959377d/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index c7162a2..e03ffb1 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -17,9 +17,11 @@
 package com.cloud.deploy;
 
 import java.util.List;
+import java.util.Map;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
+import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.affinity.AffinityGroupProcessor;
 import org.apache.cloudstack.affinity.AffinityGroupVMMapVO;
@@ -27,21 +29,44 @@ import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
 import org.apache.log4j.Logger;
 
+import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;
+import com.cloud.deploy.DeploymentPlanner.PlannerResourceUsage;
+import com.cloud.deploy.dao.PlannerHostReservationDao;
 import com.cloud.exception.AffinityConflictException;
+import com.cloud.exception.ConnectionException;
 import com.cloud.exception.InsufficientServerCapacityException;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.security.SecurityGroupVO;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.Transaction;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.Listener;
+import com.cloud.agent.api.AgentControlAnswer;
+import com.cloud.agent.api.AgentControlCommand;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupRoutingCommand;
 
 @Local(value = { DeploymentPlanningManager.class })
-public class DeploymentPlanningManagerImpl extends ManagerBase implements DeploymentPlanningManager, Manager {
+public class DeploymentPlanningManagerImpl extends ManagerBase implements DeploymentPlanningManager, Manager, Listener {
 
     private static final Logger s_logger = Logger.getLogger(DeploymentPlanningManagerImpl.class);
     @Inject
+    AgentManager _agentMgr;
+    @Inject
     protected UserVmDao _vmDao;
     @Inject
     protected VMInstanceDao _vmInstanceDao;
@@ -49,6 +74,10 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
     protected AffinityGroupDao _affinityGroupDao;
     @Inject
     protected AffinityGroupVMMapDao _affinityGroupVMMapDao;
+    @Inject
+    DataCenterDao _dcDao;
+    @Inject
+    PlannerHostReservationDao _plannerHostReserveDao;
 
     protected List<DeploymentPlanner> _planners;
     public List<DeploymentPlanner> getPlanners() {
@@ -88,19 +117,162 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
 
         // call planners
         DeployDestination dest = null;
-        for (DeploymentPlanner planner : _planners) {
-            if (planner.canHandle(vmProfile, plan, avoids)) {
-                dest = planner.plan(vmProfile, plan, avoids);
-            } else {
-                continue;
+        List<Long> clusterIds = null;
+
+        ServiceOffering offering = vmProfile.getServiceOffering();
+        if (offering != null && offering.getDeploymentPlanner() != null) {
+            DeploymentPlanner planner = ComponentContext.getComponent(offering.getDeploymentPlanner());
+            if (planner != null && planner.canHandle(vmProfile, plan, avoids)) {
+                while (true) {
+                    if (planner instanceof DeploymentClusterPlanner) {
+                        clusterIds = ((DeploymentClusterPlanner) planner).orderClusters(vmProfile, plan, avoids);
+                    } else {
+                        dest = planner.plan(vmProfile, plan, avoids);
+                    }
+
+                    if (dest != null) {
+                        long hostId = dest.getHost().getId();
+                        avoids.addHost(dest.getHost().getId());
+
+                        if (checkIfHostCanBeUsed(hostId, DeploymentPlanner.PlannerResourceUsage.Shared)) {
+                            // found destination
+                            return dest;
+                        } else {
+                            // find another host - seems some concurrent deployment picked it up for dedicated access
+                            continue;
+                        }
+                    } else if (clusterIds != null && !clusterIds.isEmpty()) {
+                        // planner refactoring. call allocators to list hosts
+
+                    } else {
+                        return null;
+                    }
+                }
             }
-            if (dest != null) {
-                avoids.addHost(dest.getHost().getId());
-                break;
+        }
+
+
+        return dest;
+    }
+
+    @DB
+    private boolean checkIfHostCanBeUsed(long hostId, PlannerResourceUsage resourceTypeRequired) {
+        // TODO Auto-generated method stub
+        // check if this host has been picked up by some other planner
+        // exclusively
+        // if planner can work with shared host, check if this host has
+        // been marked as 'shared'
+        // else if planner needs dedicated host,
+
+        PlannerHostReservationVO reservationEntry = _plannerHostReserveDao.findByHostId(hostId);
+        if (reservationEntry != null) {
+            long id = reservationEntry.getId();
+            PlannerResourceUsage hostResourceType = reservationEntry.getResourceUsage();
+
+            if (hostResourceType != null) {
+                if (hostResourceType == resourceTypeRequired) {
+                    return true;
+                } else {
+                    return false;
+                }
+            } else {
+                // reserve the host for required resourceType
+                // let us lock the reservation entry before updating.
+                final Transaction txn = Transaction.currentTxn();
+
+                try {
+                    txn.start();
+
+                    final PlannerHostReservationVO lockedEntry = _plannerHostReserveDao.lockRow(id, true);
+                    if (lockedEntry == null) {
+                        s_logger.error("Unable to lock the host entry for reservation, host: " + hostId);
+                        return false;
+                    }
+                    // check before updating
+                    if (lockedEntry.getResourceUsage() == null) {
+                        lockedEntry.setResourceUsage(resourceTypeRequired);
+                        _plannerHostReserveDao.persist(lockedEntry);
+                        return true;
+                    } else {
+                        // someone updated it earlier. check if we can still use it
+                        if (lockedEntry.getResourceUsage() == resourceTypeRequired) {
+                            return true;
+                        } else {
+                            return false;
+                        }
+                    }
+                } finally {
+                    txn.commit();
+                }
             }
 
         }
-        return dest;
+
+        return false;
+    }
+
+    @Override
+    public boolean processAnswers(long agentId, long seq, Answer[] answers) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean processCommands(long agentId, long seq, Command[] commands) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public AgentControlAnswer processControlCommand(long agentId, AgentControlCommand cmd) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void processConnect(HostVO host, StartupCommand cmd, boolean forRebalance) throws ConnectionException {
+        if (!(cmd instanceof StartupRoutingCommand)) {
+            return;
+        }
+
+        PlannerHostReservationVO reservationEntry = _plannerHostReserveDao.findByHostId(host.getId());
+        if (reservationEntry == null) {
+            // record the host in this table
+            PlannerHostReservationVO newHost = new PlannerHostReservationVO(host.getId(), host.getDataCenterId(),
+                    host.getPodId(), host.getClusterId());
+            _plannerHostReserveDao.persist(newHost);
+        }
+
+    }
+
+    @Override
+    public boolean processDisconnect(long agentId, Status state) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean isRecurring() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public int getTimeout() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    @Override
+    public boolean processTimeout(long agentId, long seq) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
+        _agentMgr.registerForHostEvents(this, true, false, true);
+        return super.configure(name, params);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1959377d/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 75568b4..bee5eee 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -83,7 +83,6 @@ import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.HostPodDao;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
-import com.cloud.deploy.DeployPlannerSelector;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;
 import com.cloud.domain.DomainVO;
 import com.cloud.domain.dao.DomainDao;
@@ -386,9 +385,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
     @Inject
     AffinityGroupDao _affinityGroupDao;
 
-    @Inject
-    List<DeployPlannerSelector> plannerSelectors;
-
     protected ScheduledExecutorService _executor = null;
     protected int _expungeInterval;
     protected int _expungeDelay;