API to list planners and set the planner in Service offering

Conflicts:

        server/src/com/cloud/server/ManagementServerImpl.java
        setup/db/db/schema-410to420.sql


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

Branch: refs/heads/affinity_groups
Commit: a6d15dc650886161eb30cfef92297957f581919b
Parents: b9cf434
Author: Prachi Damle <pra...@cloud.com>
Authored: Fri Mar 29 00:15:23 2013 -0700
Committer: Prachi Damle <pra...@cloud.com>
Committed: Fri Mar 29 00:15:23 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/server/ManagementService.java    |    4 +-
 .../org/apache/cloudstack/api/ApiConstants.java    |    1 +
 .../admin/config/ListDeploymentPlannersCmd.java    |   71 ++++++++++++++
 .../admin/offering/CreateServiceOfferingCmd.java   |    7 ++
 client/tomcatconf/componentContext.xml.in          |   19 +++-
 .../cloud/configuration/ConfigurationManager.java  |    3 +-
 .../configuration/ConfigurationManagerImpl.java    |    6 +-
 .../src/com/cloud/server/ManagementServerImpl.java |   29 ++++++
 .../src/com/cloud/service/ServiceOfferingVO.java   |   74 +++++++++------
 .../cloud/vpc/MockConfigurationManagerImpl.java    |    2 +-
 setup/db/db/schema-410to420.sql                    |   68 +++++++++++++
 11 files changed, 245 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java 
b/api/src/com/cloud/server/ManagementService.java
index 1736da3..260b206 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -125,7 +125,7 @@ public interface ManagementService {
     /**
      * Searches for servers by the specified search criteria Can search by: 
"name", "type", "state", "dataCenterId",
      * "podId"
-     * 
+     *
      * @param cmd
      * @return List of Hosts
      */
@@ -381,4 +381,6 @@ public interface ManagementService {
      */
     List<? extends Capacity> listTopConsumedResources(ListCapacityCmd cmd);
 
+    List<String> listDeploymentPlanners();
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java 
b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 428e802..769882e 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -456,6 +456,7 @@ public class ApiConstants {
     public static final String RESERVED_IP_RANGE = "reservediprange";
     public static final String AFFINITY_GROUP_IDS = "affinitygroupids";
     public static final String AFFINITY_GROUP_NAMES = "affinitygroupnames";
+    public static final String DEPLOYMENT_PLANNER = "deploymentplanner";
 
     public enum HostDetails {
         all, capacity, events, stats, min;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
new file mode 100644
index 0000000..69004de
--- /dev/null
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
@@ -0,0 +1,71 @@
+// 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 org.apache.cloudstack.api.command.admin.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.response.DeploymentPlannersResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.log4j.Logger;
+
+@APICommand(name = "listDeploymentPlanners", description = "Lists all 
DeploymentPlanners available.", responseObject = 
DeploymentPlannersResponse.class)
+public class ListDeploymentPlannersCmd extends BaseListCmd {
+    public static final Logger s_logger = 
Logger.getLogger(ListDeploymentPlannersCmd.class.getName());
+
+    private static final String s_name = "listdeploymentplannersresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public void execute(){
+        List<String> planners = _mgr.listDeploymentPlanners();
+        ListResponse<DeploymentPlannersResponse> response = new 
ListResponse<DeploymentPlannersResponse>();
+        List<DeploymentPlannersResponse> plannerResponses = new 
ArrayList<DeploymentPlannersResponse>();
+
+        for (String planner : planners) {
+            DeploymentPlannersResponse plannerResponse = new 
DeploymentPlannersResponse();
+            plannerResponse.setName(planner);
+            plannerResponse.setObjectName("deploymentPlanner");
+            plannerResponses.add(plannerResponse);
+        }
+
+        response.setResponses(plannerResponses);
+        response.setResponseName(getCommandName());
+        this.setResponseObject(response);
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
index e915c48..74392cd 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
@@ -84,6 +84,9 @@ public class CreateServiceOfferingCmd extends BaseCmd {
     @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, 
description="data transfer rate in megabits per second allowed. Supported only 
for non-System offering and system offerings having \"domainrouter\" 
systemvmtype")
     private Integer networkRate;
 
+    @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, type = 
CommandType.STRING, description = "The deployment planner heuristics used to 
deploy a VM of this offering, default \"FirstFitPlanner\".")
+    private String deploymentPlanner;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -148,6 +151,10 @@ public class CreateServiceOfferingCmd extends BaseCmd {
         return networkRate;
     }
 
+    public String getDeploymentPlanner() {
+        return deploymentPlanner;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in 
b/client/tomcatconf/componentContext.xml.in
index d958dc8..2c7ddde 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -59,6 +59,7 @@
   <bean id="BaremetalPingPxeService" 
class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
   <bean id="BaremetalPxeManager" 
class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
   <bean id="affinityGroupServiceImpl" 
class="org.apache.cloudstack.affinity.AffinityGroupServiceImpl"/>
+  <bean id="DeploymentPlanningManager" 
class="com.cloud.deploy.DeploymentPlanningManagerImpl" />
    
   <!--
       Network Elements
@@ -214,19 +215,19 @@
   </bean>
 
   <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
-    <property name="name" value="First Fit"/>
+    <property name="name" value="FirstFitPlanner"/>
   </bean>
 
   <bean id="UserDispersingPlanner" 
class="com.cloud.deploy.UserDispersingPlanner">
-    <property name="name" value="UserDispersing"/>
+    <property name="name" value="UserDispersingPlanner"/>
   </bean>
   
   <bean id="UserConcentratedPodPlanner" 
class="com.cloud.deploy.UserConcentratedPodPlanner">
-    <property name="name" value="UserConcentratedPod"/>
+    <property name="name" value="UserConcentratedPodPlanner"/>
   </bean>
 
   <bean id="BareMetalPlanner" 
class="com.cloud.baremetal.manager.BareMetalPlanner">
-    <property name="name" value="BareMetal Fit"/>
+    <property name="name" value="BareMetalPlanner"/>
   </bean>
 
   <bean id="BaremetalPlannerSelector" 
class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
@@ -307,4 +308,14 @@
     <property name="name" value="BaremetalGuru"/>
   </bean>
   
+  
+     
+  <!--
+    Network Gurus
+  -->
+    <bean id="HostAntiAffinityProcessor" 
class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
+       <property name="name" value="HostAntiAffinityProcessor"/>
+       </bean>
+  
+  
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/server/src/com/cloud/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManager.java 
b/server/src/com/cloud/configuration/ConfigurationManager.java
index 20e9884..c5f65e9 100644
--- a/server/src/com/cloud/configuration/ConfigurationManager.java
+++ b/server/src/com/cloud/configuration/ConfigurationManager.java
@@ -78,10 +78,11 @@ public interface ConfigurationManager extends 
ConfigurationService, Manager {
      *            TODO
      * @param id
      * @param useVirtualNetwork
+     * @param deploymentPlanner
      * @return ID
      */
     ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, 
VirtualMachine.Type vm_typeType, String name, int cpu, int ramSize, int speed, 
String displayText, boolean localStorageRequired,
-            boolean offerHA, boolean limitResourceUse, boolean volatileVm, 
String tags, Long domainId, String hostTag, Integer networkRate);
+            boolean offerHA, boolean limitResourceUse, boolean volatileVm, 
String tags, Long domainId, String hostTag, Integer networkRate, String 
deploymentPlanner);
 
     /**
      * Creates a new disk offering

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 44d9e0d..051f3e6 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -1819,16 +1819,16 @@ public class ConfigurationManagerImpl extends 
ManagerBase implements Configurati
         }
 
         return createServiceOffering(userId, cmd.getIsSystem(), vmType, 
cmd.getServiceOfferingName(), cpuNumber.intValue(), memory.intValue(), 
cpuSpeed.intValue(), cmd.getDisplayText(),
-                localStorageRequired, offerHA, limitCpuUse, volatileVm, 
cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate());
+                localStorageRequired, offerHA, limitCpuUse, volatileVm, 
cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate(), 
cmd.getDeploymentPlanner());
     }
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_SERVICE_OFFERING_CREATE, 
eventDescription = "creating service offering")
     public ServiceOfferingVO createServiceOffering(long userId, boolean 
isSystem, VirtualMachine.Type vm_type, String name, int cpu, int ramSize, int 
speed, String displayText,
-            boolean localStorageRequired, boolean offerHA, boolean 
limitResourceUse, boolean volatileVm,  String tags, Long domainId, String 
hostTag, Integer networkRate) {
+            boolean localStorageRequired, boolean offerHA, boolean 
limitResourceUse, boolean volatileVm,  String tags, Long domainId, String 
hostTag, Integer networkRate, String deploymentPlanner) {
         tags = cleanupTags(tags);
         ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, 
speed, networkRate, null, offerHA, limitResourceUse, volatileVm, displayText, 
localStorageRequired, false, tags, isSystem, vm_type,
-                domainId, hostTag);
+                domainId, hostTag, deploymentPlanner);
 
         if ((offering = _serviceOfferingDao.persist(offering)) != null) {
             UserContext.current().setEventDetails("Service offering id=" + 
offering.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java 
b/server/src/com/cloud/server/ManagementServerImpl.java
index e80d48c..a0f4ba4 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -78,6 +78,10 @@ import org.apache.cloudstack.api.command.admin.vpc.*;
 import org.apache.cloudstack.api.command.admin.zone.*;
 import org.apache.cloudstack.api.command.user.account.*;
 import org.apache.cloudstack.api.command.user.address.*;
+import 
org.apache.cloudstack.api.command.user.affinitygroup.CreateAffinityGroupCmd;
+import 
org.apache.cloudstack.api.command.user.affinitygroup.DeleteAffinityGroupCmd;
+import 
org.apache.cloudstack.api.command.user.affinitygroup.ListAffinityGroupsCmd;
+import 
org.apache.cloudstack.api.command.user.affinitygroup.UpdateVMAffinityGroupCmd;
 import org.apache.cloudstack.api.command.user.autoscale.*;
 import org.apache.cloudstack.api.command.user.config.*;
 import org.apache.cloudstack.api.command.user.event.*;
@@ -157,6 +161,7 @@ import com.cloud.dc.dao.HostPodDao;
 import com.cloud.dc.dao.PodVlanMapDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.deploy.DataCenterDeployment;
+import com.cloud.deploy.DeploymentPlanner;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;
 import com.cloud.domain.DomainVO;
 import com.cloud.domain.dao.DomainDao;
@@ -425,6 +430,9 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
 
     @Inject List<UserAuthenticator> _userAuthenticators;
 
+    @Inject
+    protected List<DeploymentPlanner> _planners;
+
     @Inject ClusterManager _clusterMgr;
     private String _hashKey = null;
 
@@ -2165,6 +2173,17 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
         cmdList.add(CreateVMSnapshotCmd.class);
         cmdList.add(RevertToSnapshotCmd.class);
         cmdList.add(DeleteVMSnapshotCmd.class);
+        cmdList.add(AddIpToVmNicCmd.class);
+        cmdList.add(RemoveIpFromVmNicCmd.class);
+        cmdList.add(ListNicsCmd.class);
+        cmdList.add(ArchiveAlertsCmd.class);
+        cmdList.add(DeleteAlertsCmd.class);
+        cmdList.add(ArchiveEventsCmd.class);
+        cmdList.add(DeleteEventsCmd.class);
+        cmdList.add(CreateAffinityGroupCmd.class);
+        cmdList.add(DeleteAffinityGroupCmd.class);
+        cmdList.add(ListAffinityGroupsCmd.class);
+        cmdList.add(UpdateVMAffinityGroupCmd.class);
         return cmdList;
     }
 
@@ -3193,4 +3212,14 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
 
     }
 
+    @Override
+    public List<String> listDeploymentPlanners() {
+        List<String> plannersAvailable = new ArrayList<String>();
+        for (DeploymentPlanner planner : _planners) {
+            plannersAvailable.add(planner.getName());
+        }
+
+        return plannersAvailable;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/server/src/com/cloud/service/ServiceOfferingVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java 
b/server/src/com/cloud/service/ServiceOfferingVO.java
index 7be939c..40f817d 100755
--- a/server/src/com/cloud/service/ServiceOfferingVO.java
+++ b/server/src/com/cloud/service/ServiceOfferingVO.java
@@ -34,25 +34,25 @@ import com.cloud.vm.VirtualMachine;
 public class ServiceOfferingVO extends DiskOfferingVO implements 
ServiceOffering {
     @Column(name="cpu")
        private int cpu;
-    
+
     @Column(name="speed")
     private int speed;
-    
+
     @Column(name="ram_size")
        private int ramSize;
-    
+
     @Column(name="nw_rate")
     private Integer rateMbps;
-    
+
     @Column(name="mc_rate")
     private Integer multicastRateMbps;
-    
+
     @Column(name="ha_enabled")
     private boolean offerHA;
 
     @Column(name="limit_cpu_use")
-    private boolean limitCpuUse;    
-    
+    private boolean limitCpuUse;
+
     @Column(name="is_volatile")
     private boolean volatileVm;
 
@@ -64,10 +64,13 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
 
     @Column(name="vm_type")
     private String vm_type;
-    
+
     @Column(name="sort_key")
     int sortKey;
-    
+
+    @Column(name = "deployment_planner")
+    private String deploymentPlanner = "FirstFitPlanner";
+
     protected ServiceOfferingVO() {
         super();
     }
@@ -80,7 +83,7 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
         this.rateMbps = rateMbps;
         this.multicastRateMbps = multicastRateMbps;
         this.offerHA = offerHA;
-        this.limitCpuUse = false; 
+        this.limitCpuUse = false;
         this.volatileVm = false;
         this.default_use = defaultUse;
         this.vm_type = vm_type == null ? null : 
vm_type.toString().toLowerCase();
@@ -94,7 +97,7 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
         this.rateMbps = rateMbps;
         this.multicastRateMbps = multicastRateMbps;
         this.offerHA = offerHA;
-        this.limitCpuUse = limitCpuUse;  
+        this.limitCpuUse = limitCpuUse;
         this.volatileVm = volatileVm;
         this.vm_type = vm_type == null ? null : 
vm_type.toString().toLowerCase();
     }
@@ -102,31 +105,40 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
     public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, 
Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean 
limitResourceUse, boolean volatileVm, String displayText, boolean 
useLocalStorage, boolean recreatable, String tags, boolean systemUse, 
VirtualMachine.Type vm_type, Long domainId, String hostTag) {
         this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, 
limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, 
systemUse, vm_type, domainId);
         this.hostTag = hostTag;
-    }    
+    }
+
+    public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, 
Integer rateMbps, Integer multicastRateMbps,
+            boolean offerHA, boolean limitResourceUse, boolean volatileVm, 
String displayText, boolean useLocalStorage,
+            boolean recreatable, String tags, boolean systemUse, 
VirtualMachine.Type vm_type, Long domainId,
+            String hostTag, String deploymentPlanner) {
+        this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, 
limitResourceUse, volatileVm,
+                displayText, useLocalStorage, recreatable, tags, systemUse, 
vm_type, domainId, hostTag);
+        this.deploymentPlanner = deploymentPlanner;
+    }
 
     @Override
        public boolean getOfferHA() {
            return offerHA;
        }
-       
+
        public void setOfferHA(boolean offerHA) {
                this.offerHA = offerHA;
        }
 
-    @Override  
+    @Override
        public boolean getLimitCpuUse() {
            return limitCpuUse;
        }
-       
+
        public void setLimitResourceUse(boolean limitCpuUse) {
                this.limitCpuUse = limitCpuUse;
        }
-       
-       @Override 
+
+       @Override
     public boolean getDefaultUse() {
         return default_use;
     }
-       
+
        @Override
     @Transient
        public String[] getTagsArray() {
@@ -134,15 +146,15 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
            if (tags == null || tags.length() == 0) {
                return new String[0];
            }
-           
+
            return tags.split(",");
        }
-       
+
        @Override
        public int getCpu() {
            return cpu;
        }
-       
+
        public void setCpu(int cpu) {
                this.cpu = cpu;
        }
@@ -154,17 +166,17 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
        public void setRamSize(int ramSize) {
                this.ramSize = ramSize;
        }
-       
+
        @Override
        public int getSpeed() {
            return speed;
        }
-       
+
        @Override
        public int getRamSize() {
            return ramSize;
        }
-       
+
        public void setRateMbps(Integer rateMbps) {
                this.rateMbps = rateMbps;
        }
@@ -177,7 +189,7 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
        public void setMulticastRateMbps(Integer multicastRateMbps) {
                this.multicastRateMbps = multicastRateMbps;
        }
-       
+
        @Override
     public Integer getMulticastRateMbps() {
                return multicastRateMbps;
@@ -185,12 +197,12 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
 
        public void setHostTag(String hostTag) {
                this.hostTag = hostTag;
-       }       
-       
+       }
+
        public String getHostTag() {
                return hostTag;
        }
-       
+
        public String getSystemVmType(){
            return vm_type;
        }
@@ -202,10 +214,14 @@ public class ServiceOfferingVO extends DiskOfferingVO 
implements ServiceOffering
        public int getSortKey() {
                return sortKey;
        }
-       
+
     @Override
     public boolean getVolatileVm() {
         return volatileVm;
     }
 
+    public String getDeploymentPlanner() {
+        return deploymentPlanner;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java 
b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index d96e831..b0063fa 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -433,7 +433,7 @@ public class MockConfigurationManagerImpl extends 
ManagerBase implements Configu
      */
     @Override
     public ServiceOfferingVO createServiceOffering(long userId, boolean 
isSystem, Type vm_typeType, String name, int cpu, int ramSize, int speed, 
String displayText, boolean localStorageRequired, boolean offerHA,
-            boolean limitResourceUse, boolean volatileVm, String tags, Long 
domainId, String hostTag, Integer networkRate) {
+            boolean limitResourceUse, boolean volatileVm, String tags, Long 
domainId, String hostTag, Integer networkRate, String deploymentPlanner) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d15dc6/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 008112b..6e6eff7 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -133,5 +133,73 @@ CREATE TABLE `cloud`.`affinity_group_vm_map` (
   CONSTRAINT `fk_agvm__group_id` FOREIGN KEY(`affinity_group_id`) REFERENCES 
`affinity_group`(`id`)  
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+
+CREATE TABLE nic_secondary_ips (
+  `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT,
+  `uuid` varchar(40),
+  `vmId` bigint unsigned COMMENT 'vm instance id',
+  `nicId` bigint unsigned NOT NULL,
+  `ip4_address` char(40) COMMENT 'ip4 address',
+  `ip6_address` char(40) COMMENT 'ip6 address',
+  `network_id` bigint unsigned NOT NULL COMMENT 'network configuration id',
+  `created` datetime NOT NULL COMMENT 'date created',
+  `account_id` bigint unsigned NOT NULL COMMENT 'owner.  foreign key to   
account table',
+  `domain_id` bigint unsigned NOT NULL COMMENT 'the domain that the owner 
belongs to',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_nic_secondary_ip__vmId` FOREIGN KEY 
`fk_nic_secondary_ip__vmId`(`vmId`) REFERENCES `vm_instance`(`id`) ON DELETE 
CASCADE,
+   CONSTRAINT `fk_nic_secondary_ip__networks_id` FOREIGN KEY 
`fk_nic_secondary_ip__networks_id`(`network_id`) REFERENCES `networks`(`id`),
+   CONSTRAINT `uc_nic_secondary_ip__uuid` UNIQUE (`uuid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `cloud`.`nics` ADD COLUMN secondary_ip SMALLINT DEFAULT '0' 
COMMENT 'secondary ips configured for the nic';
+ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN dnat_vmip VARCHAR(40);
+
+ALTER TABLE `cloud`.`alert` ADD COLUMN `archived` tinyint(1) unsigned NOT NULL 
DEFAULT 0;
+ALTER TABLE `cloud`.`event` ADD COLUMN `archived` tinyint(1) unsigned NOT NULL 
DEFAULT 0;
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'management-server', 'alert.purge.interval', '86400', 'The interval (in 
seconds) to wait before running the alert purge thread');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'management-server', 'alert.purge.delay', '0', 'Alerts older than specified 
number days will be purged. Set this value to 0 to never delete alerts');
+
+DROP VIEW IF EXISTS `cloud`.`event_view`;
+CREATE VIEW `cloud`.`event_view` AS
+    select
+        event.id,
+        event.uuid,
+        event.type,
+        event.state,
+        event.description,
+        event.created,
+        event.level,
+        event.parameters,
+        event.start_id,
+        eve.uuid start_uuid,
+        event.user_id,
+        event.archived,
+        user.username user_name,
+        account.id account_id,
+        account.uuid account_uuid,
+        account.account_name account_name,
+        account.type account_type,
+        domain.id domain_id,
+        domain.uuid domain_uuid,
+        domain.name domain_name,
+        domain.path domain_path,
+        projects.id project_id,
+        projects.uuid project_uuid,
+        projects.name project_name
+    from
+        `cloud`.`event`
+            inner join
+        `cloud`.`account` ON event.account_id = account.id
+            inner join
+        `cloud`.`domain` ON event.domain_id = domain.id
+            inner join
+        `cloud`.`user` ON event.user_id = user.id
+            left join
+        `cloud`.`projects` ON projects.project_account_id = event.account_id
+            left join
+        `cloud`.`event` eve ON event.start_id = eve.id;
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `deployment_planner` 
varchar(255) NOT NULL DEFAULT 'FirstFitPlanner'  COMMENT 'Planner heuristics 
used to deploy a VM of this offering';
+
 -- Re-enable foreign key checking, at the end of the upgrade path
 SET foreign_key_checks = 1;

Reply via email to