You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/04/11 01:09:24 UTC

[01/50] git commit: updated refs/heads/internallb to ed0cb2f

Updated Branches:
  refs/heads/internallb 08521e416 -> ed0cb2f37


QuickCloud: also look for consoleproxy.properties using PropertiesUtil.
When executed with mvn exec:java, the path 'conf' is not on the classpath


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

Branch: refs/heads/internallb
Commit: af9f4d3e28c57fc0f7d01ee6a49a63e139e73702
Parents: d9aa53a
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Mar 26 10:06:46 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:34 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/consoleproxy/ConsoleProxy.java   |   16 +++++++++++++-
 1 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af9f4d3e/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
index b5c2989..2abce56 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxy.java
@@ -17,6 +17,8 @@
 package com.cloud.consoleproxy;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -34,6 +36,7 @@ import org.apache.commons.codec.binary.Base64;
 import org.apache.log4j.xml.DOMConfigurator;
 
 import com.cloud.consoleproxy.util.Logger;
+import com.cloud.utils.PropertiesUtil;
 import com.google.gson.Gson;
 import com.sun.net.httpserver.HttpServer;
 
@@ -282,8 +285,17 @@ public class ConsoleProxy {
         InputStream confs = ConsoleProxy.class.getResourceAsStream("/conf/consoleproxy.properties");
         Properties props = new Properties();
         if (confs == null) {
-            s_logger.info("Can't load consoleproxy.properties from classpath, will use default configuration");
-        } else {
+            final File file = PropertiesUtil.findConfigFile("consoleproxy.properties");
+            if (file == null)
+                s_logger.info("Can't load consoleproxy.properties from classpath, will use default configuration");
+            else
+                try {
+                    confs = new FileInputStream(file);
+                } catch (FileNotFoundException e) {
+                    s_logger.info("Ignoring file not found exception and using defaults");
+                }
+        } 
+        if (confs != null) {
             try {
                 props.load(confs);
                 


[11/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: when using SSVM, pass in the new name of the SS class (com.cloud -> org.apache.cloudstack)
QuickCloud : configuration moved to applicationContext.xml from componentContext.xml
QuickCloud: default to enabled state for devcloud zone
QuickCloud: environment.properties helps customize location of pid file


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

Branch: refs/heads/internallb
Commit: a8dcec5b3e330b6ac270dab47313c698241dd823
Parents: 12595cf
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Thu Apr 4 17:23:10 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 client/pom.xml                                     |    6 +-
 .../tomcatconf/quickCloudComponentContext.xml.in   |  336 ---------------
 .../secondary/SecondaryStorageManagerImpl.java     |    8 +-
 .../server/conf/environment.properties             |    2 +
 tools/devcloud/devcloud.cfg                        |    1 +
 5 files changed, 9 insertions(+), 344 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8dcec5b/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 3e27a4a..fbc0acd 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -468,9 +468,9 @@
               <target if="${quickcloud}">
                 <echo>quickcloud</echo>
                 <replaceregexp
-                  file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
-                  match="classpath:componentContext.xml"
-                  replace="classpath:quickCloudComponentContext.xml" byline="true" />
+                    file="${basedir}/target/generated-webapp/WEB-INF/classes/applicationContext.xml"
+                  match="com.cloud.consoleproxy.ConsoleProxyManagerImpl"
+                  replace="com.cloud.consoleproxy.StaticConsoleProxyManager" byline="true" />
               </target>
             </configuration>
           </execution>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8dcec5b/client/tomcatconf/quickCloudComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/quickCloudComponentContext.xml.in b/client/tomcatconf/quickCloudComponentContext.xml.in
deleted file mode 100644
index dbd3117..0000000
--- a/client/tomcatconf/quickCloudComponentContext.xml.in
+++ /dev/null
@@ -1,336 +0,0 @@
-<!--
-  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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-  xmlns:context="http://www.springframework.org/schema/context"
-  xmlns:tx="http://www.springframework.org/schema/tx" 
-  xmlns:aop="http://www.springframework.org/schema/aop"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-                      http://www.springframework.org/schema/tx 
-                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
-                      http://www.springframework.org/schema/aop
-                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-                      http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">                     
-
-
-  <!--
-      Compose a CloudStack deployment with selected components here
-  -->
-  <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
-  <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
-  <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
-  
-  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
-    <property name="UserAuthenticators">
-        <list>
-            <ref bean="MD5UserAuthenticator"/>
-            <ref bean="LDAPUserAuthenticator"/>
-        </list>
-    </property>
-  </bean>
- 
-  <bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
-    <property name="UserAuthenticators">
-        <list>
-            <ref bean="MD5UserAuthenticator"/>
-            <ref bean="LDAPUserAuthenticator"/>
-        </list>
-    </property>
-  </bean>
-   
-  <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
-  <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
-  <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl" />
-  <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl" />
-  <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
-  <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.StaticConsoleProxyManager" />
-  <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
-  <bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
-  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
-  <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
-
-  <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
-  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
-  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
-  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
-  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
-  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
-  <bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
-  <bean id="UcsBladeDao" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
-  <bean id="UcsManagerDao" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
-
-   
-  <!--
-      Network Elements
-  -->
-  <bean id="Ovs" class="com.cloud.network.element.OvsElement">
-    <property name="name" value="Ovs"/>
-  </bean>
-  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
-      <property name="name" value="BareMetalDhcp"/>
-  </bean>
-  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
-      <property name="name" value="BareMetalPxe"/>
-  </bean>
-  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
-      <property name="name" value="BareMetalUserdata"/>
-  </bean>
-  <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
-    <property name="name" value="SecurityGroupProvider"/>
-  </bean>
-  <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
-    <property name="name" value="VirtualRouter"/>
-  </bean>
-  <bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
-    <property name="name" value="VpcVirtualRouter"/>
-  </bean>
-  <!--
-  <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
-    <property name="name" value="NiciraNvp"/>
-  </bean>
-  -->
-  
-<!--
-  <bean id="BigSwitchVnsElementService" class="com.cloud.network.element.BigSwitchVnsElement">
-    <property name="name" value="BigSwitchVnsElementService"/>
-  </bean>
--->
-                   
-  <!--
-     Adapters
-  -->
-  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
-    <property name="name" value="FirstFitRouting"/>
-  </bean>
-  
-  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean>
-  
-  <!--
-    Storage pool allocators
-  -->
-
-  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
-    <property name="name" value="LocalStorage"/>
-  </bean>
-  <!--
-  <bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
-    <property name="name" value="Storage"/>
-  </bean>
-  -->
-
-  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
-    <property name="name" value="User First"/>
-  </bean>
-
-  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
-    <property name="name" value="Balance"/>
-  </bean>
-
-  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
-
-  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
-    <property name="name" value="Basic"/>
-  </bean>
-
-  <bean id="HypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean>
-
-  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" >
-    <property name="name" value="BareMetalTemplateAdapter"/>
-  </bean>
-
-  <!--
-    Authenticators
-  -->
-  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
-    <property name="name" value="MD5"/>
-  </bean>
-
-  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
-    <property name="name" value="LDAP"/>
-  </bean>
-
-  <!--
-    Investigators
-  -->
-  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
-    <property name="name" value="SimpleInvestigator"/>
-  </bean>
-
-  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
-    <property name="name" value="XenServerInvestigator"/>
-  </bean>
-  
-  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
-    <property name="name" value="PingInvestigator"/>
-  </bean>
-
-  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
-    <property name="name" value="ManagementIPSysVMInvestigator"/>
-  </bean>
-
-  <!--
-    Fencers
-  -->
-  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
-    <property name="name" value="XenServerFenceBuilder"/>
-  </bean>
-  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
-    <property name="name" value="KVMFenceBuilder"/>
-  </bean>
-  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
-    <property name="name" value="OvmFenceBuilder"/>
-  </bean>
-
-  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
-    <property name="name" value="XCP Agent"/>
-  </bean>
-
-  <!--
-  <bean id="SimulatorSecondaryStorageDiscoverer" class="com.cloud.resource.SimulatorSecondaryDiscoverer">
-    <property name="name" value="SecondaryStorage"/>
-  </bean>
-  -->
-
-  <bean id="SecondaryStorageDiscoverer" class="org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer">
-    <property name="name" value="SecondaryStorage"/>
-  </bean>
-
-  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
-    <property name="name" value="KVM Agent"/>
-  </bean>
-
-  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
-    <property name="name" value="Simulator Agent"/>
-  </bean>
-
-
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
-    <property name="name" value="Bare Metal Agent"/>
-  </bean>
-
-  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
-    <property name="name" value="SCVMMServer"/>
-  </bean>
-
-  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
-    <property name="name" value="Ovm Discover"/>
-  </bean>
-
-  <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
-    <property name="name" value="First Fit"/>
-  </bean>
-
-  <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
-    <property name="name" value="UserDispersing"/>
-  </bean>
-  
-  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
-    <property name="name" value="UserConcentratedPod"/>
-  </bean>
-
-  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
-    <property name="name" value="BareMetal Fit"/>
-  </bean>
-    
-  <bean id="BaremetalPlannerSelector" class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
-    <property name="name" value="BaremetalPlannerSelector"/>
-  </bean>
-
-  <bean id="HypervisorPlannerSelector" class="com.cloud.deploy.HypervisorVmPlannerSelector">
-    <property name="name" value="HypervisorPlannerSelector"/>
-  </bean>
-    
-   
-  <!--
-    Network Gurus
-  -->
-  <bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
-    <property name="name" value="StorageNetworkGuru"/>
-  </bean>
-  <bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
-    <property name="name" value="ExternalGuestNetworkGuru"/>
-  </bean>
-  <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
-    <property name="name" value="PublicNetworkGuru"/>
-  </bean>
-  <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
-    <property name="name" value="PodBasedNetworkGuru"/>
-  </bean>
-  <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
-    <property name="name" value="ControlNetworkGuru"/>
-  </bean>
-  <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
-    <property name="name" value="DirectNetworkGuru"/>
-  </bean>
-  <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
-    <property name="name" value="DirectPodBasedNetworkGuru"/>
-  </bean>
-  <bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
-    <property name="name" value="OvsGuestNetworkGuru"/>
-  </bean>
-  <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
-    <property name="name" value="PrivateNetworkGuru"/>
-  </bean>
-  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
-    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
-  </bean>
-  
-<!--  
-  <bean id="BigSwitchVnsGuestNetworkGuru" class=".BigSwitchVnsGuestNetworkGuru">
-    <property name="name" value="com.cloud.network.guru.BigSwitchVnsGuestNetworkGuru"/>
-  </bean>
--->
- 
-  <!--
-   Hypervisor Gurus
-  -->
-  <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
-    <property name="name" value="XenServerGuru"/>
-  </bean>
-  
-  <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
-    <property name="name" value="KVMGuru"/>
-  </bean>
-  
-  <bean id="HypervGuru" class="com.cloud.hypervisor.guru.HypervGuru">
-    <property name="name" value="HypervGuru"/>
-  </bean>
-
-  <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
-    <property name="name" value="OvmGuru"/>
-  </bean>
-  
-  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
-    <property name="name" value="SimulatorGuru"/>
-  </bean>
-
-  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
-    <property name="name" value="BaremetalGuru"/>
-  </bean>
-
-  <bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl">
-  </bean>
-  
-</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8dcec5b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index c94224b..d6d6fc0 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -30,8 +30,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -98,8 +96,8 @@ import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.SnapshotVO;
 import com.cloud.storage.Storage;
 import com.cloud.storage.VMTemplateHostVO;
-import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.dao.SnapshotDao;
 import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.storage.dao.VMTemplateDao;
@@ -1066,10 +1064,10 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
             	buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource");
             } else {
             	s_logger.debug("Telling the ssvm to load the NfsSecondaryStorageResource");
-                buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
+                buf.append(" resource=org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource");
             }
         } else {
-            buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
+            buf.append(" resource=org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource");
         }
         buf.append(" instance=SecStorage");
         buf.append(" sslcopy=").append(Boolean.toString(_useSSlCopy));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8dcec5b/services/console-proxy/server/conf/environment.properties
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/environment.properties b/services/console-proxy/server/conf/environment.properties
new file mode 100644
index 0000000..269acad
--- /dev/null
+++ b/services/console-proxy/server/conf/environment.properties
@@ -0,0 +1,2 @@
+paths.script=../../scripts/storage/secondary/
+paths.pid=.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8dcec5b/tools/devcloud/devcloud.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloud.cfg b/tools/devcloud/devcloud.cfg
index c41f8bc..e6ab71b 100644
--- a/tools/devcloud/devcloud.cfg
+++ b/tools/devcloud/devcloud.cfg
@@ -20,6 +20,7 @@
     "zones": [
         {
             "name": "DevCloud0", 
+            "enabled" : "True",
             "physical_networks": [
                 {
                     "broadcastdomainrange": "Zone", 


[48/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-772


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

Branch: refs/heads/internallb
Commit: af3e54b68415b52b0f57085c24aa308b2784306d
Parents: 46af2eb
Author: radhikap <ra...@citrix.com>
Authored: Wed Apr 10 22:02:22 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 docs/en-US/vmware-cluster-config-dvswitch.xml |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af3e54b6/docs/en-US/vmware-cluster-config-dvswitch.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/vmware-cluster-config-dvswitch.xml b/docs/en-US/vmware-cluster-config-dvswitch.xml
index dfbaca1..3468c1b 100644
--- a/docs/en-US/vmware-cluster-config-dvswitch.xml
+++ b/docs/en-US/vmware-cluster-config-dvswitch.xml
@@ -65,7 +65,7 @@
       Additionally, &PRODUCT; uses VDS for virtual network infrastructure if the value of
       vmware.use.dvswitch parameter is true and the value of vmware.use.nexus.dvswitch parameter is
       false.</para>
-    <para>&PRODUCT; supports configuring virtual networks in a deployment with a mix of Virtual
+    <para>&PRODUCT; supports orchestration of virtual networks in a deployment with a mix of Virtual
       Distributed Switch, Standard Virtual Switch and Nexus 1000v Virtual Switch. </para>
   </section>
   <section id="config-dvswitch">
@@ -101,8 +101,8 @@
           </row>
           <row>
             <entry><para>vCenter Host</para></entry>
-            <entry><para>Enter the host name or the IP address of the vCenter host where you have
-                deployed the Nexus virtual switch.</para></entry>
+            <entry><para>Enter the name or the IP address of the vCenter host where you have deployed the VMware
+                VDS.</para></entry>
           </row>
           <row>
             <entry><para>vCenter User name</para></entry>
@@ -132,7 +132,7 @@
           </row>
           <row>
             <entry><para>Public Traffic vSwitch Name</para></entry>
-            <entry><para>Specify a name to identify the switch.</para></entry>
+            <entry><para>Name of virtual switch to be used for the public traffic.</para></entry>
           </row>
           <row>
             <entry><para>Override Guest Traffic</para></entry>
@@ -148,18 +148,18 @@
           </row>
           <row>
             <entry><para>Guest Traffic vSwitch Name</para></entry>
-            <entry><para>Specify a name to identify the switch.</para></entry>
+            <entry><para>Name of virtual switch to be used for guest traffic.</para></entry>
           </row>
         </tbody>
       </tgroup>
     </informaltable>
   </section>
   <section id="vmware-dvswitch-remove">
-    <title>Removing Nexus Virtual Switch</title>
+    <title>Removing VMware Virtual Switch</title>
     <orderedlist>
       <listitem>
-        <para>In the vCenter datacenter that is served by the VMware dvSwitch, ensure that you
-          delete all the hosts in the corresponding cluster.</para>
+        <para>In the vCenter datacenter that is served by the VDS, ensure that you delete all the
+          hosts in the corresponding cluster.</para>
       </listitem>
       <listitem>
         <para>Log in with Admin permissions to the &PRODUCT; administrator UI.</para>


[37/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-809


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

Branch: refs/heads/internallb
Commit: 26cbbb04911ecd1682faa38bb44f650264aec955
Parents: 177ac57
Author: radhikap <ra...@citrix.com>
Authored: Tue Apr 9 13:32:08 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 docs/en-US/added-API-commands-4.2.xml |   38 ++++++++
 docs/en-US/multiple-ip-nic.xml        |  134 ++++++++++++++++++++++++++++
 docs/en-US/networks.xml               |    1 +
 docs/en-US/whats-new.xml              |    6 +-
 4 files changed, 178 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26cbbb04/docs/en-US/added-API-commands-4.2.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/added-API-commands-4.2.xml b/docs/en-US/added-API-commands-4.2.xml
new file mode 100644
index 0000000..3b765f2
--- /dev/null
+++ b/docs/en-US/added-API-commands-4.2.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+<!-- 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.
+-->
+<section id="added-API-commands-4.2">
+  <title>Added API Commands in 4.2</title>
+  <itemizedlist>
+    <listitem>
+      <para>addIpToNic (Adds an IP address to the NIC from the guest subnet. The request parameters
+        are: nicid, ipaddress)</para>
+    </listitem>
+    <listitem>
+      <para>removeIpFromNic (Removes the reserved IP for the NIC. The request parameters is:
+        id)</para>
+    </listitem>
+    <listitem>
+      <para>listNics (Lists the NIC details of the user VM; the API response also contains the
+        Secondary IP addresses of the NIC. The request parameters are: nicid,
+        virtualmachineid)</para>
+    </listitem>
+  </itemizedlist>
+</section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26cbbb04/docs/en-US/multiple-ip-nic.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/multiple-ip-nic.xml b/docs/en-US/multiple-ip-nic.xml
new file mode 100644
index 0000000..fb9a331
--- /dev/null
+++ b/docs/en-US/multiple-ip-nic.xml
@@ -0,0 +1,134 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+
+<!-- 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.
+-->
+<section id="multiple-ip-nic">
+  <title>Configuring Multiple IP Addresses on a Single NIC</title>
+  <para>&PRODUCT; now provides you the ability to associate multiple private IP addresses per NIC.
+    This feature is supported on all the network configurations&mdash;Basic, Advanced, and VPC.
+    Security Groups, Static NAT and Port forwarding services are supported on these additional IPs.
+    In addition to the primary IP, you can assign additional IPs to the guest VM NIC. Up to 256 IP
+    addresses are allowed per NIC.</para>
+  <para>As always, you can specify an IP from the guest subnet; if not specified, an IP is
+    automatically picked up from the guest subnet. You can view the IPs and associated NICs
+    for each VMs on the UI. You can apply NAT on these additional guest IPs by using firewall
+    configuration in the &PRODUCT; UI. You must specify the NIC to which the IP should be
+    associated.</para>
+  <para>This feature is supported on XenServer, KVM, and VMware hypervisors.</para>
+  <para>Some of the use cases are described below:</para>
+  <itemizedlist>
+    <listitem>
+      <para>Building network appliances: Network appliances, such as firewalls and load
+        balancers, generally work best when they have access to multiple IP addresses on the
+        network interface.</para>
+    </listitem>
+    <listitem>
+      <para>Moving private IP addresses between interfaces or instances. Applications that are
+        bound to specific IP addresses can be moved between instances. </para>
+    </listitem>
+    <listitem>
+      <para>Hosting multiple SSL Websites on a single instance. You can install multiple SSL
+        certificates on a single instance, each associated with a distinct IP address.</para>
+    </listitem>
+  </itemizedlist>
+  <section id="workflow-rn">
+    <title>Assigning Additional IPs to a VM</title>
+    <orderedlist>
+      <listitem>
+        <para>Log in to the &PRODUCT; UI.</para>
+      </listitem>
+      <listitem>
+        <para>In the left navigation bar, click Instances.</para>
+      </listitem>
+      <listitem>
+        <para>Click the name of the instance you want to work with.</para>
+      </listitem>
+      <listitem>
+        <para>In the Details tab, click NICs.</para>
+      </listitem>
+      <listitem>
+        <para>Click View All.</para>
+      </listitem>
+      <listitem>
+        <para>Click Acquire New IP, and click Yes in the confirmation dialog.</para>
+        <para>You are prompted for confirmation because, typically, IP addresses are a limited
+          resource. Within a few moments, the new IP address should appear with the state Allocated.
+          You can now use the IP address in Port Forwarding or StaticNAT rules.</para>
+      </listitem>
+    </orderedlist>
+  </section>
+  <section id="api-nic">
+    <title>API Changes</title>
+    <para>The following APIs have been added:</para>
+    <informaltable>
+      <tgroup cols="4" align="left" colsep="1" rowsep="1">
+        <thead>
+          <row>
+            <entry><para>Parameter Name</para></entry>
+            <entry><para>Description</para></entry>
+            <entry><para>Request Parameter</para></entry>
+            <entry><para>Response Parameter</para></entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry><para>addIpToNic</para></entry>
+            <entry><para>Adds an IP address to the NIC from the guest subnet.</para></entry>
+            <entry>
+              <para>nicid</para>
+              <para>(optional) ipaddress </para>
+            </entry>
+            <entry><para>nicid</para>
+              <para>ipaddress</para>
+              <para>networkid </para></entry>
+          </row>
+          <row>
+            <entry><para>removeIpFromNic</para></entry>
+            <entry><para>Removes the reserved IP for the NIC.</para></entry>
+            <entry>
+              <para>id</para>
+            </entry>
+            <entry><para>true</para>
+              <para>false</para></entry>
+          </row>
+          <row>
+            <entry><para>listNics</para></entry>
+            <entry><para>Lists the NIC details of the user VM; the API response also contains
+              the Secondary IP addresses of the NIC.</para></entry>
+            <entry>
+              <para>virtualmachineid</para>
+              <para>(optional) nicid</para>
+            </entry>
+            <entry><para>Lists the NIC details including secondary IP address </para></entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  </section>
+  <section id="caveats-rn">
+    <title>Port Forwarding and StaticNAT Services Changes</title>
+    <para>Because multiple IPs can be associated per NIC, you are allowed to select a desired IP for
+      the Port Forwarding and StaticNAT services. The default is the primary IP. To enable this
+      functionality, an extra optional parameter 'vmguestip' is added to the Port forwarding and
+      StaticNAT APIs (enableStaticNat, createIpForwardingRule) to indicate on what IP address NAT
+      need to be configured. If vmguestip is passed, NAT is configured on the specified private IP
+      of the VM. if not passed, NAT is configured on the primary IP of the VM.</para>
+  </section>
+</section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26cbbb04/docs/en-US/networks.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/networks.xml b/docs/en-US/networks.xml
index f877aa5..cb7493c 100644
--- a/docs/en-US/networks.xml
+++ b/docs/en-US/networks.xml
@@ -32,6 +32,7 @@
     xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <xi:include href="using-multiple-guest-networks.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <xi:include href="reserved-ip-addresses-non-csvms.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="multiple-ip-nic.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <xi:include href="security-groups.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <xi:include href="external-firewalls-and-load-balancers.xml"
     xmlns:xi="http://www.w3.org/2001/XInclude"/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26cbbb04/docs/en-US/whats-new.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/whats-new.xml b/docs/en-US/whats-new.xml
index 252f87d..295b532 100644
--- a/docs/en-US/whats-new.xml
+++ b/docs/en-US/whats-new.xml
@@ -21,7 +21,11 @@
 <chapter id="whats-new">
   <title>What's New in the API?</title>
   <para>The following describes any new major features of each &PRODUCT; version as it applies to
-    API usage.</para>
+  API usage.</para>
+  <section id="whats-new-in-api-4.2">
+    <title>What's New in the API for 4.2</title>
+    <xi:include href="added-API-commands-4.2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  </section>
   <section id="whats-new-in-api-4.1">
     <title>What's New in the API for 4.1</title>
     <xi:include href="add-remove-nic.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>


[31/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
maven+marvin: Fix up the activation property

activation property marvin.config will attempt to deploy a zone again on
running the marvin.test profile. This is unnecessary as marvin.setup
already finishes deploying a zone.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/internallb
Commit: 62cb02ec7690fb2d1bc6b59510957a8ea780e69e
Parents: bc70653
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Apr 10 16:15:50 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 setup/dev/basic.cfg  |    6 +++---
 setup/dev/local.cfg  |   44 ++++++++++++++++++++++++++++++++++++++++++++
 tools/marvin/pom.xml |   18 ++++--------------
 3 files changed, 51 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62cb02ec/setup/dev/basic.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/basic.cfg b/setup/dev/basic.cfg
index fb99b8b..3f56a3c 100644
--- a/setup/dev/basic.cfg
+++ b/setup/dev/basic.cfg
@@ -57,7 +57,7 @@
                             "startip": "60.147.41.2",
                             "endip": "60.147.41.254",
                             "netmask": "255.255.255.0",
-                            "gateway": "60.147.40.1"
+                            "gateway": "60.147.41.1"
                         }
                     ],
                     "netmask": "255.255.255.0",
@@ -102,11 +102,11 @@
     "logger": [
         {
             "name": "TestClient",
-            "file": "/var/log/testclient.log"
+            "file": "/tmp/testclient.log"
         },
         {
             "name": "TestCase",
-            "file": "/var/log/testcase.log"
+            "file": "/tmp/testcase.log"
         }
     ],
     "globalConfig": [

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62cb02ec/setup/dev/local.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/local.cfg b/setup/dev/local.cfg
new file mode 100644
index 0000000..ce956a5
--- /dev/null
+++ b/setup/dev/local.cfg
@@ -0,0 +1,44 @@
+# 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.
+
+{
+    "dbSvr": {
+        "dbSvr": "localhost",
+        "passwd": "cloud",
+        "db": "cloud",
+        "port": 3306,
+        "user": "cloud"
+    },
+    "logger": [
+        {
+            "name": "TestClient",
+            "file": "/tmp/testclient.log"
+        },
+        {
+            "name": "TestCase",
+            "file": "/tmp/testcase.log"
+        }
+    ],
+    "mgtSvr": [
+        {
+            "mgtSvrIp": "localhost",
+            "passwd": "password",
+            "user": "root",
+            "port": 8096
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62cb02ec/tools/marvin/pom.xml
----------------------------------------------------------------------
diff --git a/tools/marvin/pom.xml b/tools/marvin/pom.xml
index ce6ce38..c050566 100644
--- a/tools/marvin/pom.xml
+++ b/tools/marvin/pom.xml
@@ -157,12 +157,7 @@
       <id>marvin.setup</id>
       <properties>
         <marvin.config>${user.dir}/setup/dev/advanced.cfg</marvin.config>
-     </properties>
-      <activation>
-        <property>
-          <name>marvin.config</name>
-        </property>
-      </activation>
+      </properties>
       <build>
         <plugins>
           <plugin>
@@ -182,7 +177,7 @@
                   <arguments>
                     <argument>deployAndRun.py</argument>
                     <argument>-c</argument>
-                    <argument>${marvin.config}</argument>
+                    <argument>${user.dir}/${marvin.config}</argument>
                     <argument>-t</argument>
                     <argument>/tmp/t.log</argument>
                     <argument>-r</argument>
@@ -200,15 +195,10 @@
     <profile>
       <id>marvin.test</id>
       <properties>
-        <marvin.config>${user.dir}/setup/dev/advanced.cfg</marvin.config>
         <tag>simulator</tag>
         <test>test/integration/smoke</test>
+        <marvin.config>${user.dir}/setup/dev/advanced.cfg</marvin.config>
       </properties>
-      <activation>
-        <property>
-          <name>marvin.config</name>
-        </property>
-      </activation>
       <build>
         <plugins>
           <plugin>
@@ -228,7 +218,7 @@
                   <arguments>
                     <argument>--with-marvin</argument>
                     <argument>--marvin-config</argument>
-                    <argument>${marvin.config}</argument>
+                    <argument>${user.dir}/${marvin.config}</argument>
                     <argument>--load</argument>
                     <argument>-a</argument>
                     <argument>tags=${tag}</argument>


[20/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
1)use vmsnapshot.create.wait to control vmsnapshot timeout 2)remove global configuration vmsnapshot.expunge.interval and vmsnapshot.expunge.workers since vmsnapshot expunge is synchronous


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

Branch: refs/heads/internallb
Commit: 01fc4ffc24f9c01a9f60f2f68357685c687b500a
Parents: 7e1eda0
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Apr 10 11:30:16 2013 +0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:03 2013 -0700

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java           |    2 +-
 server/src/com/cloud/configuration/Config.java     |    4 +-
 .../cloud/vm/snapshot/VMSnapshotManagerImpl.java   |    5 ++
 setup/db/db/schema-40to410.sql                     |   29 --------------
 setup/db/db/schema-410to420.sql                    |   30 ++++++++++++++-
 5 files changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index c50f13c..4ef583a 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -6380,7 +6380,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         String guestOSType = cmd.getGuestOSType();
 
         boolean snapshotMemory = cmd.getTarget().getType() == VMSnapshot.Type.DiskAndMemory;
-        long timeout = 600;
+        long timeout = cmd.getWait();
 
         Connection conn = getConnection();
         VM vm = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 200943b..2137c00 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -397,9 +397,7 @@ public enum Config {
 	
 	// VMSnapshots
     VMSnapshotMax("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a vm", null),
-    VMSnapshotCreateWait("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.create.wait", "600", "In second, timeout for create vm snapshot", null),
-    VMSnapshotExpungeInterval("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.expunge.interval", "60", "The interval (in seconds) to wait before running the expunge thread.", null),
-    VMSnapshotExpungeWorkers("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.expunge.workers",  "1", "Number of workers performing expunge ", null),
+    VMSnapshotCreateWait("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.create.wait", "1800", "In second, timeout for create vm snapshot", null),
 
     CloudDnsName("Advanced", ManagementServer.class, String.class, "cloud.dns.name", "default", " DNS name of the cloud", null);
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index 638be6c..ffbbb82 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -120,6 +120,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
     @Inject DataStoreManager dataStoreMgr;
     @Inject ConfigurationDao _configDao;
     int _vmSnapshotMax;
+    int _wait;
     StateMachine2<VMSnapshot.State, VMSnapshot.Event, VMSnapshot> _vmSnapshottateMachine ;
 
     @Override
@@ -131,6 +132,9 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
         }
 
         _vmSnapshotMax = NumbersUtil.parseInt(_configDao.getValue("vmsnapshot.max"), VMSNAPSHOTMAX);
+        
+        String value = _configDao.getValue("vmsnapshot.create.wait");
+        _wait = NumbersUtil.parseInt(value, 1800);
 
         _vmSnapshottateMachine   = VMSnapshot.State.getStateMachine();
         return true;
@@ -361,6 +365,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
                 vmSnapshot.setParent(current.getId());
 
             CreateVMSnapshotCommand ccmd = new CreateVMSnapshotCommand(userVm.getInstanceName(),target ,volumeTOs, guestOS.getDisplayName(),userVm.getState());
+            ccmd.setWait(_wait);
             
             answer = (CreateVMSnapshotAnswer) sendToPool(hostId, ccmd);
             if (answer != null && answer.getResult()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index fc15b94..e2949d9 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -404,35 +404,6 @@ INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1,
 INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
 INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(), 'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
 INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(), 'netscaler','Response Time - microseconds', 'RESPTIME', now());
-CREATE TABLE `cloud`.`vm_snapshots` (
-  `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
-  `uuid` varchar(40) NOT NULL,
-  `name` varchar(255) NOT NULL,
-  `display_name` varchar(255) default NULL,
-  `description` varchar(255) default NULL,
-  `vm_id` bigint(20) unsigned NOT NULL,
-  `account_id` bigint(20) unsigned NOT NULL,
-  `domain_id` bigint(20) unsigned NOT NULL,
-  `vm_snapshot_type` varchar(32) default NULL,
-  `state` varchar(32) NOT NULL,
-  `parent` bigint unsigned default NULL,
-  `current` int(1) unsigned default NULL,
-  `update_count` bigint unsigned NOT NULL DEFAULT 0,
-  `updated` datetime default NULL,
-  `created` datetime default NULL,
-  `removed` datetime default NULL,
-  PRIMARY KEY  (`id`),
-  CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`),
-  INDEX `vm_snapshots_name` (`name`),
-  INDEX `vm_snapshots_vm_id` (`vm_id`),
-  INDEX `vm_snapshots_account_id` (`account_id`),
-  INDEX `vm_snapshots_display_name` (`display_name`),
-  INDEX `vm_snapshots_removed` (`removed`),
-  INDEX `vm_snapshots_parent` (`parent`),
-  CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`),
-  CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`),
-  CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE  `cloud`.`user_ipv6_address` (
   `id` bigint unsigned NOT NULL UNIQUE auto_increment,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 7932763..7bb230e 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -415,10 +415,38 @@ INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type,
 
 -- END: support for LXC
 
-
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address` varchar(40) COMMENT 'source ip address for the load balancer rule';
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address_network_id` bigint unsigned COMMENT 'the id of the network where source ip belongs to';
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `scheme` varchar(40) NOT NULL COMMENT 'load balancer scheme; can be Internal or Public';
 UPDATE `cloud`.`load_balancing_rules` SET `scheme`='Public';
 
 
+CREATE TABLE `cloud`.`vm_snapshots` (
+  `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
+  `uuid` varchar(40) NOT NULL,
+  `name` varchar(255) NOT NULL,
+  `display_name` varchar(255) default NULL,
+  `description` varchar(255) default NULL,
+  `vm_id` bigint(20) unsigned NOT NULL,
+  `account_id` bigint(20) unsigned NOT NULL,
+  `domain_id` bigint(20) unsigned NOT NULL,
+  `vm_snapshot_type` varchar(32) default NULL,
+  `state` varchar(32) NOT NULL,
+  `parent` bigint unsigned default NULL,
+  `current` int(1) unsigned default NULL,
+  `update_count` bigint unsigned NOT NULL DEFAULT 0,
+  `updated` datetime default NULL,
+  `created` datetime default NULL,
+  `removed` datetime default NULL,
+  PRIMARY KEY  (`id`),
+  CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`),
+  INDEX `vm_snapshots_name` (`name`),
+  INDEX `vm_snapshots_vm_id` (`vm_id`),
+  INDEX `vm_snapshots_account_id` (`account_id`),
+  INDEX `vm_snapshots_display_name` (`display_name`),
+  INDEX `vm_snapshots_removed` (`removed`),
+  INDEX `vm_snapshots_parent` (`parent`),
+  CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`),
+  CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`),
+  CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;


[40/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-772


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

Branch: refs/heads/internallb
Commit: 177ac575ff79d63d4bdcff440a27dcad55e4c1ef
Parents: 547d679
Author: radhikap <ra...@citrix.com>
Authored: Tue Apr 9 12:32:19 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 docs/en-US/Book_Info.xml                      |    2 +-
 docs/en-US/add-clusters-vsphere.xml           |  104 ++++-
 docs/en-US/images/add-cluster.png             |  Bin 46302 -> 35697 bytes
 docs/en-US/images/dvswitch-config.png         |  Bin 0 -> 41955 bytes
 docs/en-US/images/dvswitchconfig.png          |  Bin 0 -> 38642 bytes
 docs/en-US/vmware-cluster-config-dvswitch.xml |  193 ++++++++
 docs/en-US/vmware-install.xml                 |  511 +++++++++++++-------
 7 files changed, 614 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/Book_Info.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Book_Info.xml b/docs/en-US/Book_Info.xml
index c125ab8..0ab84c4 100644
--- a/docs/en-US/Book_Info.xml
+++ b/docs/en-US/Book_Info.xml
@@ -27,7 +27,7 @@
     <title>&PRODUCT; Guide</title>
     <subtitle>Revised August 9, 2012 10:48 pm Pacific</subtitle>
     <productname>Apache CloudStack</productname>
-    <productnumber>4.0.0-incubating</productnumber>
+    <productnumber>4.0.0</productnumber>
     <edition>1</edition>
     <pubsnumber></pubsnumber>
     <abstract>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/add-clusters-vsphere.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/add-clusters-vsphere.xml b/docs/en-US/add-clusters-vsphere.xml
index 6b2dff2..c3a0902 100644
--- a/docs/en-US/add-clusters-vsphere.xml
+++ b/docs/en-US/add-clusters-vsphere.xml
@@ -71,38 +71,106 @@
       <para>In Hypervisor, choose VMware.</para>
     </listitem>
     <listitem>
-      <para>Provide the following information in the dialog. The fields below make reference to
+      <para>Provide the following information in the dialog. The fields below make reference to the
         values from vCenter.</para>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="./images/add-cluster.png"/>
+        </imageobject>
+        <textobject>
+          <phrase>addcluster.png: add a cluster</phrase>
+        </textobject>
+      </mediaobject>
       <itemizedlist>
         <listitem>
-          <para>Cluster Name. Enter the name of the cluster you created in vCenter. For example,
-            "cloud.cluster.2.2.1"</para>
+          <para><emphasis role="bold">Cluster Name</emphasis>: Enter the name of the cluster you
+            created in vCenter. For example, "cloud.cluster.2.2.1"</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">vCenter Username</emphasis>: Enter the username that &PRODUCT;
+            should use to connect to vCenter. This user must have all the administrative
+            privileges.</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">CPU overcommit ratio</emphasis>: Enter the CPU overcommit
+            ratio for the cluster. The value you enter determines the CPU consumption of each VM in
+            the selected cluster. By increasing the over-provisioning ratio, more resource capacity
+            will be used. If no value is specified, the value is defaulted to 1, which implies no
+            over-provisioning is done.</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">RAM overcommit ratio</emphasis>: Enter the RAM overcommit
+            ratio for the cluster. The value you enter determines the memory consumption of each VM
+            in the selected cluster. By increasing the over-provisioning ratio, more resource
+            capacity will be used. If no value is specified, the value is defaulted to 1, which
+            implies no over-provisioning is done.</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">vCenter Host</emphasis>: Enter the hostname or IP address of
+            the vCenter server.</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">vCenter Password</emphasis>: Enter the password for the user
+            named above.</para>
+        </listitem>
+        <listitem>
+          <para><emphasis role="bold">vCenter Datacenter</emphasis>: Enter the vCenter datacenter
+            that the cluster is in. For example, "cloud.dc.VM".</para>
         </listitem>
         <listitem>
-          <para>vCenter Host. Enter the hostname or IP address of the vCenter server. </para>
+          <para><emphasis role="bold">Override Public Traffic</emphasis>: Enable this option to
+            override the zone-wide public traffic for the cluster you are creating.</para>
         </listitem>
         <listitem>
-          <para>vCenter Username. Enter the username that &PRODUCT; should use to connect to
-            vCenter. This user must have all administrative privileges.</para>
+          <para><emphasis role="bold">Public Traffic vSwitch Type</emphasis>: This option is
+            displayed only if you enable the Override Public Traffic option. Select a desirable
+            switch. If the vmware.use.dvswitch global parameter is true, the default option will be
+            VMware vNetwork Distributed Virtual Switch.</para>
+          <para>If you have enabled Nexus dvSwitch in the environment, the following parameters for
+            dvSwitch configuration are displayed:</para>
+          <itemizedlist>
+            <listitem>
+              <para>Nexus dvSwitch IP Address: The IP address of the Nexus VSM appliance.</para>
+            </listitem>
+            <listitem>
+              <para>Nexus dvSwitch Username: The username required to access the Nexus VSM
+                appliance.</para>
+            </listitem>
+            <listitem>
+              <para>Nexus dvSwitch Password: The password associated with the username specified
+                above.</para>
+            </listitem>
+          </itemizedlist>
         </listitem>
         <listitem>
-          <para>vCenter Password. Enter the password for the user named above</para>
+          <para><emphasis role="bold">Override Guest Traffic</emphasis>: Enable this option to
+            override the zone-wide guest traffic for the cluster you are creating.</para>
         </listitem>
         <listitem>
-          <para>vCenter Datacenter. Enter the vCenter datacenter that the cluster is in. For
-            example, "cloud.dc.VM".</para>
+          <para><emphasis role="bold">Guest Traffic vSwitch Type</emphasis>: This option is
+            displayed only if you enable the Override Guest Traffic option. Select a desirable
+            switch. </para>
+          <para>If the vmware.use.dvswitch global parameter is true, the default option will be
+            VMware vNetwork Distributed Virtual Switch.</para>
+          <para>If you have enabled Nexus dvSwitch in the environment, the following parameters for
+            dvSwitch configuration are displayed:</para>
+          <itemizedlist>
+            <listitem>
+              <para>Nexus dvSwitch IP Address: The IP address of the Nexus VSM appliance.</para>
+            </listitem>
+            <listitem>
+              <para>Nexus dvSwitch Username: The username required to access the Nexus VSM
+                appliance.</para>
+            </listitem>
+            <listitem>
+              <para>Nexus dvSwitch Password: The password associated with the username specified
+                above.</para>
+            </listitem>
+          </itemizedlist>
         </listitem>
         <listitem>
-          <mediaobject>
-            <imageobject>
-              <imagedata fileref="./images/add-cluster.png"/>
-            </imageobject>
-            <textobject>
-              <phrase>addcluster.png: add cluster</phrase>
-            </textobject>
-          </mediaobject>
           <para>There might be a slight delay while the cluster is provisioned. It will
-            automatically display in the UI</para>
+            automatically display in the UI.</para>
         </listitem>
       </itemizedlist>
     </listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/images/add-cluster.png
----------------------------------------------------------------------
diff --git a/docs/en-US/images/add-cluster.png b/docs/en-US/images/add-cluster.png
index 383f375..4b24ec7 100644
Binary files a/docs/en-US/images/add-cluster.png and b/docs/en-US/images/add-cluster.png differ

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/images/dvswitch-config.png
----------------------------------------------------------------------
diff --git a/docs/en-US/images/dvswitch-config.png b/docs/en-US/images/dvswitch-config.png
new file mode 100644
index 0000000..edce6e8
Binary files /dev/null and b/docs/en-US/images/dvswitch-config.png differ

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/images/dvswitchconfig.png
----------------------------------------------------------------------
diff --git a/docs/en-US/images/dvswitchconfig.png b/docs/en-US/images/dvswitchconfig.png
new file mode 100644
index 0000000..55b1ef7
Binary files /dev/null and b/docs/en-US/images/dvswitchconfig.png differ

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/vmware-cluster-config-dvswitch.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/vmware-cluster-config-dvswitch.xml b/docs/en-US/vmware-cluster-config-dvswitch.xml
new file mode 100644
index 0000000..dfbaca1
--- /dev/null
+++ b/docs/en-US/vmware-cluster-config-dvswitch.xml
@@ -0,0 +1,193 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+
+<!-- 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.
+-->
+<section id="vmware-cluster-config-dvswitch">
+  <title>Configuring a vSphere Cluster with VMware Distributed Virtual Switch</title>
+  <para>&PRODUCT;supports VMware vNetwork Distributed Switch (VDS) for virtual network configuration
+    in a VMware vSphere environment. This section helps you configure VMware VDS in a &PRODUCT;
+    deployment. Each vCenter server instance can support up to 128 VDS instances and each VDS
+    instance can manage up to 500 VMware hosts.</para>
+  <section id="about-dvswitch">
+    <title>About VMware Distributed Virtual Switch</title>
+    <para>VMware VDS is an aggregation of host-level virtual switches on a VMware vCenter server.
+      VDS abstracts the configuration of individual virtual switches that span across a large number
+      of hosts, and enables centralized provisioning, administration, and monitoring for your entire
+      datacenter from a centralized interface. In effect, a VDS acts as a single virtual switch at
+      the datacenter level and manages networking for a number of hosts in a datacenter from a
+      centralized VMware vCenter server. Each VDS maintains network runtime state for VMs as they
+      move across multiple hosts, enabling inline monitoring and centralized firewall services. A
+      VDS can be deployed with or without Virtual Standard Switch and a Nexus 1000V virtual
+      switch.</para>
+  </section>
+  <section id="prereq-dvswitch">
+    <title>Prerequisites and Guidelines</title>
+    <itemizedlist>
+      <listitem>
+        <para>Do not attempt to configure VDS by altering VMware traffic label when configuring
+          physical networks. This will only work for Standard Virtual Switch and should not be
+          distributed.</para>
+      </listitem>
+      <listitem>
+        <para>VMware VDS does not support multiple VDS per traffic type. If a user has many VDS
+          switches, only one can be used for Guest traffic and another one for Public
+          traffic.</para>
+      </listitem>
+      <listitem>
+        <para>Management and Storage network does not support VDS. Therefore, use Standard Switch
+          for these networks.</para>
+      </listitem>
+    </itemizedlist>
+  </section>
+  <section id="enable-dvswitch">
+    <title>Enabling Virtual Distributed Switch in &PRODUCT;</title>
+    <para>To make a &PRODUCT; deployment VDS enabled, set the vmware.use.dvswitch parameter to true
+      by using the Global Settings page in the &PRODUCT; UI and restart the Management Server.
+      Unless you enable the vmware.use.dvswitch parameter, you cannot see any UI options specific to
+      VDS, and &PRODUCT; ignores the VDS-specific parameters given in the AddClusterCmd API call.
+      Additionally, &PRODUCT; uses VDS for virtual network infrastructure if the value of
+      vmware.use.dvswitch parameter is true and the value of vmware.use.nexus.dvswitch parameter is
+      false.</para>
+    <para>&PRODUCT; supports configuring virtual networks in a deployment with a mix of Virtual
+      Distributed Switch, Standard Virtual Switch and Nexus 1000v Virtual Switch. </para>
+  </section>
+  <section id="config-dvswitch">
+    <title>Configuring Distributed Virtual Switch in &PRODUCT;</title>
+    <para>You can configure VDS by adding the necessary resources while a zone is created.</para>
+    <mediaobject>
+      <imageobject>
+        <imagedata fileref="./images/dvSwitch-config.png"/>
+      </imageobject>
+      <textobject>
+        <phrase>dvSwitchConfig.png: Configuring dvSwitch</phrase>
+      </textobject>
+    </mediaobject>
+    <para>Alternatively, you can create an additional cluster with VDS enabled in the existing zone.
+      Use the Add Cluster option. For information as given in <xref linkend="add-clusters-vsphere"
+      />.</para>
+    <para>In both these cases, you must specify the following parameters to configure VDS:</para>
+    <informaltable frame="all">
+      <tgroup cols="2" align="left" colsep="1" rowsep="1">
+        <colspec colname="c1"/>
+        <colspec colname="c2"/>
+        <thead>
+          <row>
+            <entry><para>Parameters</para></entry>
+            <entry><para>Description</para></entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry><para>Cluster Name</para></entry>
+            <entry><para>Enter the name of the cluster you created in vCenter. For example,
+                &quot;cloud.cluster&quot;.</para></entry>
+          </row>
+          <row>
+            <entry><para>vCenter Host</para></entry>
+            <entry><para>Enter the host name or the IP address of the vCenter host where you have
+                deployed the Nexus virtual switch.</para></entry>
+          </row>
+          <row>
+            <entry><para>vCenter User name</para></entry>
+            <entry><para>Enter the username that &PRODUCT; should use to connect to vCenter. This
+                user must have all administrative privileges.</para></entry>
+          </row>
+          <row>
+            <entry><para>vCenter Password</para></entry>
+            <entry><para>Enter the password for the user named above.</para></entry>
+          </row>
+          <row>
+            <entry><para>vCenter Datacenter</para></entry>
+            <entry><para>Enter the vCenter datacenter that the cluster is in. For example,
+                &quot;cloud.dc.VM&quot;.</para></entry>
+          </row>
+          <row>
+            <entry><para>Override Public Traffic</para></entry>
+            <entry><para>Enable this option to override the zone-wide public traffic for the cluster
+                you are creating. </para></entry>
+          </row>
+          <row>
+            <entry><para>Public Traffic vSwitch Type</para></entry>
+            <entry><para>This option is displayed only if you enable the Override Public Traffic
+                option. Select VMware vNetwork Distributed Virtual Switch. </para>
+              <para>If the vmware.use.dvswitch global parameter is true, the default option will be
+                VMware vNetwork Distributed Virtual Switch.</para></entry>
+          </row>
+          <row>
+            <entry><para>Public Traffic vSwitch Name</para></entry>
+            <entry><para>Specify a name to identify the switch.</para></entry>
+          </row>
+          <row>
+            <entry><para>Override Guest Traffic</para></entry>
+            <entry><para>Enable the option to override the zone-wide guest traffic for the cluster
+                you are creating.</para></entry>
+          </row>
+          <row>
+            <entry><para>Guest Traffic vSwitch Type</para></entry>
+            <entry><para>This option is displayed only if you enable the Override Guest Traffic
+                option. Select VMware vNetwork Distributed Virtual Switch. </para>
+              <para>If the vmware.use.dvswitch global parameter is true, the default option will be
+                VMware vNetwork Distributed Virtual Switch.</para></entry>
+          </row>
+          <row>
+            <entry><para>Guest Traffic vSwitch Name</para></entry>
+            <entry><para>Specify a name to identify the switch.</para></entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  </section>
+  <section id="vmware-dvswitch-remove">
+    <title>Removing Nexus Virtual Switch</title>
+    <orderedlist>
+      <listitem>
+        <para>In the vCenter datacenter that is served by the VMware dvSwitch, ensure that you
+          delete all the hosts in the corresponding cluster.</para>
+      </listitem>
+      <listitem>
+        <para>Log in with Admin permissions to the &PRODUCT; administrator UI.</para>
+      </listitem>
+      <listitem>
+        <para>In the left navigation bar, select Infrastructure.</para>
+      </listitem>
+      <listitem>
+        <para>In the Infrastructure page, click View all under Clusters.</para>
+      </listitem>
+      <listitem>
+        <para>Select the cluster where you want to remove the virtual switch.</para>
+      </listitem>
+      <listitem>
+        <para>In the VMware dvSwitch tab, click the name of the virtual switch.</para>
+      </listitem>
+      <listitem>
+        <para> In the Details page, click Delete VMware dvSwitch icon. <inlinemediaobject>
+            <imageobject>
+              <imagedata fileref="./images/delete-button.png"/>
+            </imageobject>
+            <textobject>
+              <phrase>DeleteButton.png: button to delete dvSwitch</phrase>
+            </textobject>
+          </inlinemediaobject>
+        </para>
+        <para>Click Yes in the confirmation dialog box.</para>
+      </listitem>
+    </orderedlist>
+  </section>
+</section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/177ac575/docs/en-US/vmware-install.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/vmware-install.xml b/docs/en-US/vmware-install.xml
index 467e135..fd88fc7 100644
--- a/docs/en-US/vmware-install.xml
+++ b/docs/en-US/vmware-install.xml
@@ -327,282 +327,439 @@ esxcfg-firewall -o 59000-60000,tcp,out,vncextras
         guide.</para>
     </section>
   </section>
-  <!--    <section id="vmware-vsphere-cluster-config-nexus-vswitch">
+  <section id="vmware-vsphere-cluster-config-nexus-vswitch">
     <title>Configuring a vSphere Cluster with Nexus 1000v Virtual Switch</title>
-    <para>&PRODUCT; supports Cisco Nexus 1000v dvSwitch (Distributed Virtual Switch) for virtual network configuration in a VMware vSphere environment. This section helps you configure a vSphere cluster with Nexus 1000v virtual switch in a VMware vCenter environment. For information on creating a vSphere cluster, see <xref linkend="vmware-install" /></para>
+    <para>&PRODUCT; supports Cisco Nexus 1000v dvSwitch (Distributed Virtual Switch) for virtual
+      network configuration in a VMware vSphere environment. This section helps you configure a
+      vSphere cluster with Nexus 1000v virtual switch in a VMware vCenter environment. For
+      information on creating a vSphere cluster, see <xref linkend="vmware-install"/></para>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-about">
-        <title>About Cisco Nexus 1000v Distributed Virtual Switch</title>
-        <para>The Cisco Nexus 1000V virtual switch is a software-based virtual machine access switch for VMware vSphere environments. It can span multiple hosts running VMware ESXi 4.0 and later. A Nexus virtual switch consists of two components: the Virtual Supervisor Module (VSM) and the Virtual Ethernet Module (VEM). The VSM is a virtual appliance that acts as the switch&apos;s supervisor. It controls multiple VEMs as a single network device. The VSM is installed independent of the VEM and is deployed in redundancy mode as pairs or as a standalone appliance.  The VEM is installed on each VMware ESXi server to provide packet-forwarding capability. It provides each virtual machine with dedicated switch ports. This VSM-VEM architecture is analogous to a physical Cisco switch&apos;s supervisor (standalone or configured in high-availability mode) and multiple linecards architecture.</para>
-        <para>Nexus 1000v switch uses vEthernet port profiles to simplify network provisioning for virtual machines. There are two types of port profiles: Ethernet port profile and vEthernet port profile. The Ethernet port profile is applied to the physical uplink ports-the NIC ports of the physical NIC adapter on an ESXi server. The vEthernet port profile is associated with the virtual NIC (vNIC) that is plumbed on a guest VM on the ESXi server.  The port profiles help the network administrators define network policies which can be reused for new virtual machines.  The Ethernet port profiles are created on the VSM and are represented as port groups on the vCenter server.</para>
+      <title>About Cisco Nexus 1000v Distributed Virtual Switch</title>
+      <para>The Cisco Nexus 1000V virtual switch is a software-based virtual machine access switch
+        for VMware vSphere environments. It can span multiple hosts running VMware ESXi 4.0 and
+        later. A Nexus virtual switch consists of two components: the Virtual Supervisor Module
+        (VSM) and the Virtual Ethernet Module (VEM). The VSM is a virtual appliance that acts as the
+        switch&apos;s supervisor. It controls multiple VEMs as a single network device. The VSM is
+        installed independent of the VEM and is deployed in redundancy mode as pairs or as a
+        standalone appliance. The VEM is installed on each VMware ESXi server to provide
+        packet-forwarding capability. It provides each virtual machine with dedicated switch ports.
+        This VSM-VEM architecture is analogous to a physical Cisco switch&apos;s supervisor
+        (standalone or configured in high-availability mode) and multiple linecards
+        architecture.</para>
+      <para>Nexus 1000v switch uses vEthernet port profiles to simplify network provisioning for
+        virtual machines. There are two types of port profiles: Ethernet port profile and vEthernet
+        port profile. The Ethernet port profile is applied to the physical uplink ports-the NIC
+        ports of the physical NIC adapter on an ESXi server. The vEthernet port profile is
+        associated with the virtual NIC (vNIC) that is plumbed on a guest VM on the ESXi server. The
+        port profiles help the network administrators define network policies which can be reused
+        for new virtual machines. The Ethernet port profiles are created on the VSM and are
+        represented as port groups on the vCenter server.</para>
     </section>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-prerequisite-guide">
-        <title>Prerequisites and Guidelines</title>
-        <para>This section discusses prerequisites and guidelines for using Nexus virtual switch in &PRODUCT;. Before configuring Nexus virtual switch, ensure that your system meets the following requirements:</para>
-        <itemizedlist>
-        <listitem><para>A cluster of servers (ESXi 4.1 or later) is configured in the vCenter.</para></listitem>
-        <listitem><para>Each cluster managed by &PRODUCT; is the only cluster in its vCenter datacenter.</para></listitem>
-        <listitem><para>A Cisco Nexus 1000v virtual switch is installed to serve the datacenter that contains the vCenter cluster. This ensures that &PRODUCT; doesn&apos;t have to deal with dynamic migration of virtual adapters or networks across other existing virtual switches. See <ulink url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_5_1/install_upgrade/vsm_vem/guide/n1000v_installupgrade.html">Cisco Nexus 1000V Installation and Upgrade Guide</ulink> for guidelines on how to install the Nexus 1000v VSM and VEM modules.</para></listitem>
-        <listitem><para>The Nexus 1000v VSM is not deployed on a vSphere host that is managed by &PRODUCT;.</para></listitem>
-        <listitem><para>When the maximum number of VEM modules per VSM instance is reached, an additional VSM instance is created before introducing any more ESXi hosts. The limit is 64 VEM modules for each VSM instance.</para></listitem>
-        <listitem><para>&PRODUCT; expects that the Management Network of the ESXi host is configured on the standard vSwitch and searches for it in the standard vSwitch. Therefore, ensure that you do not migrate the management network to Nexus 1000v virtual switch during configuration.</para></listitem>
-        <listitem><para>All information given in <xref linkend="vmware-vsphere-cluster-config-nexus-vswitch-preconfig" /></para></listitem>
-        </itemizedlist>
+      <title>Prerequisites and Guidelines</title>
+      <para>This section discusses prerequisites and guidelines for using Nexus virtual switch in
+        &PRODUCT;. Before configuring Nexus virtual switch, ensure that your system meets the
+        following requirements:</para>
+      <itemizedlist>
+        <listitem>
+          <para>A cluster of servers (ESXi 4.1 or later) is configured in the vCenter.</para>
+        </listitem>
+        <listitem>
+          <para>Each cluster managed by &PRODUCT; is the only cluster in its vCenter
+            datacenter.</para>
+        </listitem>
+        <listitem>
+          <para>A Cisco Nexus 1000v virtual switch is installed to serve the datacenter that
+            contains the vCenter cluster. This ensures that &PRODUCT; doesn&apos;t have to deal with
+            dynamic migration of virtual adapters or networks across other existing virtual
+            switches. See <ulink
+              url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_5_1/install_upgrade/vsm_vem/guide/n1000v_installupgrade.html"
+              >Cisco Nexus 1000V Installation and Upgrade Guide</ulink> for guidelines on how to
+            install the Nexus 1000v VSM and VEM modules.</para>
+        </listitem>
+        <listitem>
+          <para>The Nexus 1000v VSM is not deployed on a vSphere host that is managed by
+            &PRODUCT;.</para>
+        </listitem>
+        <listitem>
+          <para>When the maximum number of VEM modules per VSM instance is reached, an additional
+            VSM instance is created before introducing any more ESXi hosts. The limit is 64 VEM
+            modules for each VSM instance.</para>
+        </listitem>
+        <listitem>
+          <para>&PRODUCT; expects that the Management Network of the ESXi host is configured on the
+            standard vSwitch and searches for it in the standard vSwitch. Therefore, ensure that you
+            do not migrate the management network to Nexus 1000v virtual switch during
+            configuration.</para>
+        </listitem>
+        <listitem>
+          <para>All information given in <xref
+              linkend="vmware-vsphere-cluster-config-nexus-vswitch-preconfig"/></para>
+        </listitem>
+      </itemizedlist>
     </section>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-preconfig">
-        <title>Nexus 1000v Virtual Switch Preconfiguration</title>
-        <section id="vmware-vsphere-cluster-config-nexus-vswitch-preconfig-checklist">
+      <title>Nexus 1000v Virtual Switch Preconfiguration</title>
+      <section id="vmware-vsphere-cluster-config-nexus-vswitch-preconfig-checklist">
         <title>Preparation Checklist</title>
-        <para>For a smoother configuration of Nexus 1000v switch, gather the following information before you start:</para>
+        <para>For a smoother configuration of Nexus 1000v switch, gather the following information
+          before you start:</para>
         <itemizedlist>
-            <listitem><para>vCenter Credentials</para></listitem>
-            <listitem><para>Nexus 1000v VSM IP address</para></listitem>
-            <listitem><para>Nexus 1000v VSM Credentials</para></listitem>
-            <listitem><para>Ethernet port profile names</para></listitem>
+          <listitem>
+            <para>vCenter Credentials</para>
+          </listitem>
+          <listitem>
+            <para>Nexus 1000v VSM IP address</para>
+          </listitem>
+          <listitem>
+            <para>Nexus 1000v VSM Credentials</para>
+          </listitem>
+          <listitem>
+            <para>Ethernet port profile names</para>
+          </listitem>
         </itemizedlist>
         <section id="vmware-vsphere-cluster-config-nexus-vswitch-vcenter-credential-checklist">
-            <title>vCenter Credentials Checklist</title>
-            <para>You will need the following information about vCenter:</para>
-            <informaltable frame="all">
+          <title>vCenter Credentials Checklist</title>
+          <para>You will need the following information about vCenter:</para>
+          <informaltable frame="all">
             <tgroup cols="3" align="left" colsep="1" rowsep="1">
-                <colspec colname="c1" />
-                <colspec colname="c2" />
-                <colspec colname="c3" />
-                <thead>
+              <colspec colname="c1"/>
+              <colspec colname="c2"/>
+              <colspec colname="c3"/>
+              <thead>
                 <row>
-                    <entry><para>Nexus vSwitch Requirements</para></entry>
-                    <entry><para>Value</para></entry>
-                    <entry><para>Notes</para></entry>
+                  <entry><para>Nexus vSwitch Requirements</para></entry>
+                  <entry><para>Value</para></entry>
+                  <entry><para>Notes</para></entry>
                 </row>
-                </thead>
-                <tbody>
+              </thead>
+              <tbody>
                 <row>
-                    <entry><para>vCenter IP</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The IP address of the vCenter.</para></entry>
+                  <entry><para>vCenter IP</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The IP address of the vCenter.</para></entry>
                 </row>
                 <row>
-                    <entry><para>Secure HTTP Port Number</para></entry>
-                    <entry><para>443</para></entry>
-                    <entry><para>Port 443 is configured by default; however, you can change the port if needed.</para></entry>
+                  <entry><para>Secure HTTP Port Number</para></entry>
+                  <entry><para>443</para></entry>
+                  <entry><para>Port 443 is configured by default; however, you can change the port
+                      if needed.</para></entry>
                 </row>
                 <row>
-                    <entry><para>vCenter User ID</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The vCenter user with administrator-level privileges. The vCenter User ID is required when you configure the virtual switch in &PRODUCT;.</para></entry>
+                  <entry><para>vCenter User ID</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The vCenter user with administrator-level privileges. The vCenter
+                      User ID is required when you configure the virtual switch in
+                    &PRODUCT;.</para></entry>
                 </row>
                 <row>
-                    <entry><para>vCenter Password</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The password for the vCenter user specified above. The password for this vCenter user is required when you configure the switch in &PRODUCT;.</para></entry>
+                  <entry><para>vCenter Password</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The password for the vCenter user specified above. The password for
+                      this vCenter user is required when you configure the switch in
+                      &PRODUCT;.</para></entry>
                 </row>
-                </tbody>
+              </tbody>
             </tgroup>
-            </informaltable>
+          </informaltable>
         </section>
         <section id="vmware-vsphere-cluster-config-nexus-vswitch-net-config-checklist">
-            <title>Network Configuration Checklist</title>
-            <para>The following information specified in the Nexus Configure Networking screen is displayed in the Details tab of the Nexus dvSwitch in the &PRODUCT; UI:</para>
-            <informaltable frame="all">
+          <title>Network Configuration Checklist</title>
+          <para>The following information specified in the Nexus Configure Networking screen is
+            displayed in the Details tab of the Nexus dvSwitch in the &PRODUCT; UI:</para>
+          <informaltable frame="all">
             <tgroup cols="3" align="left" colsep="1" rowsep="1">
-                <colspec colname="c1" />
-                <colspec colname="c2" />
-                <colspec colname="c3" />
-                <thead>
+              <colspec colname="c1"/>
+              <colspec colname="c2"/>
+              <colspec colname="c3"/>
+              <thead>
                 <row>
-                    <entry><para>Network Requirements</para></entry>
-                    <entry><para>Value</para></entry>
-                    <entry><para>Notes</para></entry>
+                  <entry><para>Network Requirements</para></entry>
+                  <entry><para>Value</para></entry>
+                  <entry><para>Notes</para></entry>
                 </row>
-                </thead>
-                <tbody>
+              </thead>
+              <tbody>
                 <row>
-                    <entry><para>Control Port Group VLAN ID</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The VLAN ID of the Control Port Group. The control VLAN is used for communication between the VSM and the VEMs.</para></entry>
+                  <entry><para>Control Port Group VLAN ID</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The VLAN ID of the Control Port Group. The control VLAN is used for
+                      communication between the VSM and the VEMs.</para></entry>
                 </row>
                 <row>
-                    <entry><para>Management Port Group VLAN ID</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The VLAN ID of the Management Port Group. The management VLAN corresponds to the mgmt0 interface that is used to establish and maintain the connection between the VSM and VMware vCenter Server.</para></entry>
+                  <entry><para>Management Port Group VLAN ID</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The VLAN ID of the Management Port Group. The management VLAN
+                      corresponds to the mgmt0 interface that is used to establish and maintain the
+                      connection between the VSM and VMware vCenter Server.</para></entry>
                 </row>
                 <row>
-                    <entry><para>Packet Port Group VLAN ID</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The VLAN ID of the Packet Port Group. The packet VLAN forwards relevant data packets from the VEMs to the VSM.</para></entry>
+                  <entry><para>Packet Port Group VLAN ID</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The VLAN ID of the Packet Port Group. The packet VLAN forwards
+                      relevant data packets from the VEMs to the VSM.</para></entry>
                 </row>
-                </tbody>
+              </tbody>
             </tgroup>
-            </informaltable>
-            <note><para>The VLANs used for control, packet, and management port groups can be the same.</para></note>
-            <para>For more information, see <ulink url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_4_b/getting_started/configuration/guide/n1000v_gsg.pdf">Cisco Nexus 1000V Getting Started Guide</ulink>.</para>
+          </informaltable>
+          <note>
+            <para>The VLANs used for control, packet, and management port groups can be the
+              same.</para>
+          </note>
+          <para>For more information, see <ulink
+              url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_4_b/getting_started/configuration/guide/n1000v_gsg.pdf"
+              >Cisco Nexus 1000V Getting Started Guide</ulink>.</para>
         </section>
         <section id="vmware-vsphere-cluster-config-nexus-vswitch-vsm-config-checklist">
-            <title>VSM Configuration Checklist</title>
-            <para>You will need the following information about network configuration:</para>
-            <informaltable frame="all">
+          <title>VSM Configuration Checklist</title>
+          <para>You will need the following information about network configuration:</para>
+          <informaltable frame="all">
             <tgroup cols="3" align="left" colsep="1" rowsep="1">
-                <colspec colname="c1" />
-                <colspec colname="c2" />
-                <colspec colname="c3" />
-                <thead>
+              <colspec colname="c1"/>
+              <colspec colname="c2"/>
+              <colspec colname="c3"/>
+              <thead>
                 <row>
-                    <entry><para>VSM Configuration Parameters Value Notes</para></entry>
-                    <entry><para>Value</para></entry>
-                    <entry><para>Notes</para></entry>
+                  <entry><para>VSM Configuration Parameters Value Notes</para></entry>
+                  <entry><para>Value</para></entry>
+                  <entry><para>Notes</para></entry>
                 </row>
-                </thead>
-                <tbody>
+              </thead>
+              <tbody>
                 <row>
-                    <entry><para>Admin Name and Password</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>The admin name and password to connect to the VSM appliance. You must specify these credentials while configuring Nexus virtual switch.</para></entry>
+                  <entry><para>Admin Name and Password</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>The admin name and password to connect to the VSM appliance. You must
+                      specify these credentials while configuring Nexus virtual
+                    switch.</para></entry>
                 </row>
                 <row>
-                    <entry><para>Management IP Address</para></entry>
-                    <entry><para></para></entry>
-                    <entry><para>This is the IP address of the VSM appliance. This is the IP address you specify in the virtual switch IP Address field while configuting Nexus virtual switch.</para></entry>
+                  <entry><para>Management IP Address</para></entry>
+                  <entry><para/></entry>
+                  <entry><para>This is the IP address of the VSM appliance. This is the IP address
+                      you specify in the virtual switch IP Address field while configuting Nexus
+                      virtual switch.</para></entry>
                 </row>
                 <row>
-                    <entry><para>SSL</para></entry>
-                    <entry><para>Enable</para></entry>
-                    <entry><para>Always enable SSL. SSH is usually enabled by default during the VSM installation. However, check whether the SSH connection to the VSM is working, without which &PRODUCT; failes to connect to the VSM.</para></entry>
+                  <entry><para>SSL</para></entry>
+                  <entry><para>Enable</para></entry>
+                  <entry><para>Always enable SSL. SSH is usually enabled by default during the VSM
+                      installation. However, check whether the SSH connection to the VSM is working,
+                      without which &PRODUCT; failes to connect to the VSM.</para></entry>
                 </row>
-                </tbody>
+              </tbody>
             </tgroup>
-            </informaltable>
-        </section>
+          </informaltable>
         </section>
-        <section id="vmware-vsphere-cluster-config-nexus-vswitch-create-port-profile">
+      </section>
+      <section id="vmware-vsphere-cluster-config-nexus-vswitch-create-port-profile">
         <title>Creating a Port Profile</title>
         <itemizedlist>
-            <listitem>
-            <para>Whether you create a Basic or Advanced zone configuration, ensure that you always create an Ethernet port profile on the VSM after you install it and before you create the zone.</para>
+          <listitem>
+            <para>Whether you create a Basic or Advanced zone configuration, ensure that you always
+              create an Ethernet port profile on the VSM after you install it and before you create
+              the zone.</para>
             <itemizedlist>
-                <listitem><para>The Ethernet port profile created to represent the physical network or networks used by an Advanced zone configuration trunk all the VLANs including guest VLANs, the VLANs that serve the native VLAN, and the packet/control/data/management VLANs of the VSM.</para></listitem>
-                <listitem><para>The Ethernet port profile created for a Basic zone configuration does not trunk the guest VLANs because the guest VMs do not get their own VLANs provisioned on their network interfaces in a Basic zone.</para></listitem>
+              <listitem>
+                <para>The Ethernet port profile created to represent the physical network or
+                  networks used by an Advanced zone configuration trunk all the VLANs including
+                  guest VLANs, the VLANs that serve the native VLAN, and the
+                  packet/control/data/management VLANs of the VSM.</para>
+              </listitem>
+              <listitem>
+                <para>The Ethernet port profile created for a Basic zone configuration does not
+                  trunk the guest VLANs because the guest VMs do not get their own VLANs provisioned
+                  on their network interfaces in a Basic zone.</para>
+              </listitem>
             </itemizedlist>
-            </listitem>
-            <listitem><para>An Ethernet port profile configured on the Nexus 1000v virtual switch should not use in its set of system VLANs, or any of the VLANs configured or intended to be configured for use towards VMs or VM resources in the &PRODUCT; environment.</para></listitem>
-            <listitem><para>You do not have to create any vEthernet port profiles – &PRODUCT; does that during VM deployment.</para></listitem>
-            <listitem><para>Ensure that you create required port profiles to be used by &PRODUCT; for different traffic types of &PRODUCT;, such as Management traffic, Guest traffic, Storage traffic, and Public traffic. The physical networks configured during zone creation should have a one-to-one relation with the Ethernet port profiles.</para></listitem>
+          </listitem>
+          <listitem>
+            <para>An Ethernet port profile configured on the Nexus 1000v virtual switch should not
+              use in its set of system VLANs, or any of the VLANs configured or intended to be
+              configured for use towards VMs or VM resources in the &PRODUCT; environment.</para>
+          </listitem>
+          <listitem>
+            <para>You do not have to create any vEthernet port profiles – &PRODUCT; does that during
+              VM deployment.</para>
+          </listitem>
+          <listitem>
+            <para>Ensure that you create required port profiles to be used by &PRODUCT; for
+              different traffic types of &PRODUCT;, such as Management traffic, Guest traffic,
+              Storage traffic, and Public traffic. The physical networks configured during zone
+              creation should have a one-to-one relation with the Ethernet port profiles.</para>
+          </listitem>
         </itemizedlist>
         <mediaobject>
-            <imageobject>
+          <imageobject>
             <imagedata fileref="./images/vmware-nexus-port-profile.png"/>
-            </imageobject>
-            <textobject>
+          </imageobject>
+          <textobject>
             <phrase>vsphereclient.png: vSphere client</phrase>
-            </textobject>
+          </textobject>
         </mediaobject>
-        <para>For information on creating a port profile, see <ulink url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_4_a/port_profile/configuration/guide/n1000v_port_profile.html">Cisco Nexus 1000V Port Profile Configuration Guide</ulink>.</para>
-        </section>
-        <section id="vmware-vsphere-cluster-config-nexus-vswitch-assign-nic-adapters">
+        <para>For information on creating a port profile, see <ulink
+            url="http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_2_1_s_v_1_4_a/port_profile/configuration/guide/n1000v_port_profile.html"
+            >Cisco Nexus 1000V Port Profile Configuration Guide</ulink>.</para>
+      </section>
+      <section id="vmware-vsphere-cluster-config-nexus-vswitch-assign-nic-adapters">
         <title>Assigning Physical NIC Adapters</title>
-        <para>Assign ESXi host&apos;s physical NIC adapters, which correspond to each physical network, to the port profiles. In each ESXi host that is part of the vCenter cluster, observe the physical networks assigned to each port profile and note down the names of the port profile for future use. This mapping information helps you when configuring physical networks during the zone configuration on &PRODUCT;. These Ethernet port profile names are later specified as VMware Traffic Labels for different traffic types when configuring physical networks during the zone configuration. For more information on configuring physical networks, see <xref linkend="vmware-vsphere-cluster-config-nexus-vswitch" />.</para>
-        </section>
-        <section id="vmware-vsphere-cluster-config-nexus-vswitch-add-vlan-range">
+        <para>Assign ESXi host&apos;s physical NIC adapters, which correspond to each physical
+          network, to the port profiles. In each ESXi host that is part of the vCenter cluster,
+          observe the physical networks assigned to each port profile and note down the names of the
+          port profile for future use. This mapping information helps you when configuring physical
+          networks during the zone configuration on &PRODUCT;. These Ethernet port profile names are
+          later specified as VMware Traffic Labels for different traffic types when configuring
+          physical networks during the zone configuration. For more information on configuring
+          physical networks, see <xref linkend="vmware-vsphere-cluster-config-nexus-vswitch"
+          />.</para>
+      </section>
+      <section id="vmware-vsphere-cluster-config-nexus-vswitch-add-vlan-range">
         <title>Adding VLAN Ranges</title>
-        <para>Determine the public VLAN, System VLAN, and Guest VLANs to be used by the &PRODUCT;. Ensure that you add them to the port profile database. Corresponding to each physical network, add the VLAN range to port profiles. In the VSM command prompt, run the switchport trunk allowed vlan&lt;range&gt; command to add the VLAN ranges to the port profile.</para>
+        <para>Determine the public VLAN, System VLAN, and Guest VLANs to be used by the &PRODUCT;.
+          Ensure that you add them to the port profile database. Corresponding to each physical
+          network, add the VLAN range to port profiles. In the VSM command prompt, run the
+          switchport trunk allowed vlan&lt;range&gt; command to add the VLAN ranges to the port
+          profile.</para>
         <para>For example:</para>
         <programlisting>switchport trunk allowed vlan 1,140-147,196-203</programlisting>
         <para>In this example, the allowed VLANs added are 1, 140-147, and 196-203</para>
-        <para>You must also add all the public and private VLANs or VLAN ranges to the switch. This range is the VLAN range you specify in your zone.</para>
-        <note><para>Before you run the vlan command, ensure that the configuration mode is enabled in Nexus 1000v virtual switch.</para></note>
+        <para>You must also add all the public and private VLANs or VLAN ranges to the switch. This
+          range is the VLAN range you specify in your zone.</para>
+        <note>
+          <para>Before you run the vlan command, ensure that the configuration mode is enabled in
+            Nexus 1000v virtual switch.</para>
+        </note>
         <para>For example:</para>
         <para>If you want the VLAN 200 to be used on the switch, run the following command:</para>
         <programlisting>vlan 200</programlisting>
-        <para>If you want the VLAN range 1350-1750 to be used on the switch, run the following command:</para>
+        <para>If you want the VLAN range 1350-1750 to be used on the switch, run the following
+          command:</para>
         <programlisting>vlan 1350-1750</programlisting>
         <para>Refer to Cisco Nexus 1000V Command Reference of specific product version.</para>
-        </section>
+      </section>
     </section>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-enable">
-        <title>Enabling Nexus Virtual Switch in &PRODUCT;</title>
-        <para>To make a &PRODUCT; deployment Nexus enabled, you must set the vmware.use.nexus.vswitch parameter true by using the Global Settings page in the &PRODUCT; UI. Unless this parameter is set to &quot;true&quot; and restart the management server, you cannot see any UI options specific to Nexus virtual switch, and &PRODUCT; ignores the Nexus virtual switch specific parameters specified in the AddTrafficTypeCmd, UpdateTrafficTypeCmd, and AddClusterCmd API calls.</para>
-        <para>Unless the &PRODUCT; global parameter &quot;vmware.use.nexus.vswitch&quot; is set to &quot;true&quot;, &PRODUCT; by default uses VMware standard vSwitch for virtual network infrastructure. In this release, &PRODUCT; doesn’t support configuring virtual networks in a deployment with a mix of standard vSwitch and Nexus 1000v virtual switch. The deployment can have either standard vSwitch or Nexus 1000v virtual switch.</para>
+      <title>Enabling Nexus Virtual Switch in &PRODUCT;</title>
+      <para>To make a &PRODUCT; deployment Nexus enabled, you must set the vmware.use.nexus.vswitch
+        parameter true by using the Global Settings page in the &PRODUCT; UI. Unless this parameter
+        is set to &quot;true&quot; and restart the management server, you cannot see any UI options
+        specific to Nexus virtual switch, and &PRODUCT; ignores the Nexus virtual switch specific
+        parameters specified in the AddTrafficTypeCmd, UpdateTrafficTypeCmd, and AddClusterCmd API
+        calls.</para>
+      <para>Unless the &PRODUCT; global parameter &quot;vmware.use.nexus.vswitch&quot; is set to
+        &quot;true&quot;, &PRODUCT; by default uses VMware standard vSwitch for virtual network
+        infrastructure. In this release, &PRODUCT; doesn’t support configuring virtual networks in a
+        deployment with a mix of standard vSwitch and Nexus 1000v virtual switch. The deployment can
+        have either standard vSwitch or Nexus 1000v virtual switch.</para>
     </section>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-config">
-        <title>Configuring Nexus 1000v Virtual Switch in &PRODUCT;</title>
-        <para>You can configure Nexus dvSwitch by adding the necessary resources while the zone is being created.</para>
-        <mediaobject>
+      <title>Configuring Nexus 1000v Virtual Switch in &PRODUCT;</title>
+      <para>You can configure Nexus dvSwitch by adding the necessary resources while the zone is
+        being created.</para>
+      <mediaobject>
         <imageobject>
-            <imagedata fileref="./images/vmware-nexus-add-cluster.png"/>
+          <imagedata fileref="./images/vmware-nexus-add-cluster.png"/>
         </imageobject>
         <textobject>
-            <phrase>vsphereclient.png: vSphere client</phrase>
+          <phrase>vsphereclient.png: vSphere client</phrase>
         </textobject>
-        </mediaobject>
-        <para>After the zone is created, if you want to create an additional cluster along with Nexus 1000v virtual switch in the existing zone, use the Add Cluster option. For information on creating a cluster, see <xref linkend="add-clusters-vsphere" />.</para>
-        <para>In both these cases, you must specify the following parameters to configure Nexus virtual switch:</para>
-        <informaltable frame="all">
+      </mediaobject>
+      <para>After the zone is created, if you want to create an additional cluster along with Nexus
+        1000v virtual switch in the existing zone, use the Add Cluster option. For information on
+        creating a cluster, see <xref linkend="add-clusters-vsphere"/>.</para>
+      <para>In both these cases, you must specify the following parameters to configure Nexus
+        virtual switch:</para>
+      <informaltable frame="all">
         <tgroup cols="2" align="left" colsep="1" rowsep="1">
-            <colspec colname="c1" />
-            <colspec colname="c2" />
-            <thead>
+          <colspec colname="c1"/>
+          <colspec colname="c2"/>
+          <thead>
             <row>
-                <entry><para>Parameters</para></entry>
-                <entry><para>Description</para></entry>
+              <entry><para>Parameters</para></entry>
+              <entry><para>Description</para></entry>
             </row>
-            </thead>
-            <tbody>
+          </thead>
+          <tbody>
             <row>
-                <entry><para>Cluster Name</para></entry>
-                <entry><para>Enter the name of the cluster you created in vCenter.  For example, &quot;cloud.cluster&quot;.</para></entry>
+              <entry><para>Cluster Name</para></entry>
+              <entry><para>Enter the name of the cluster you created in vCenter. For example,
+                  &quot;cloud.cluster&quot;.</para></entry>
             </row>
             <row>
-                <entry><para>vCenter Host</para></entry>
-                <entry><para>Enter the host name or the IP address of the vCenter host where you have deployed the Nexus virtual switch.</para></entry>
+              <entry><para>vCenter Host</para></entry>
+              <entry><para>Enter the host name or the IP address of the vCenter host where you have
+                  deployed the Nexus virtual switch.</para></entry>
             </row>
             <row>
-                <entry><para>vCenter User name</para></entry>
-                <entry><para>Enter the username that &PRODUCT; should use to connect to vCenter.  This user must have all administrative privileges.</para></entry>
+              <entry><para>vCenter User name</para></entry>
+              <entry><para>Enter the username that &PRODUCT; should use to connect to vCenter. This
+                  user must have all administrative privileges.</para></entry>
             </row>
             <row>
-                <entry><para>vCenter Password</para></entry>
-                <entry><para>Enter the password for the user named above.</para></entry>
+              <entry><para>vCenter Password</para></entry>
+              <entry><para>Enter the password for the user named above.</para></entry>
             </row>
             <row>
-                <entry><para>vCenter Datacenter</para></entry>
-                <entry><para>Enter the vCenter datacenter that the cluster is in.  For example, &quot;cloud.dc.VM&quot;.</para></entry>
+              <entry><para>vCenter Datacenter</para></entry>
+              <entry><para>Enter the vCenter datacenter that the cluster is in. For example,
+                  &quot;cloud.dc.VM&quot;.</para></entry>
             </row>
             <row>
-                <entry><para>Nexus dvSwitch IP Address</para></entry>
-                <entry><para>The IP address of the VSM component of the Nexus 1000v virtual switch.</para></entry>
+              <entry><para>Nexus dvSwitch IP Address</para></entry>
+              <entry><para>The IP address of the VSM component of the Nexus 1000v virtual
+                  switch.</para></entry>
             </row>
             <row>
-                <entry><para>Nexus dvSwitch Username</para></entry>
-                <entry><para>The admin name to connect to the VSM appliance.</para></entry>
+              <entry><para>Nexus dvSwitch Username</para></entry>
+              <entry><para>The admin name to connect to the VSM appliance.</para></entry>
             </row>
             <row>
-                <entry><para>Nexus dvSwitch Password</para></entry>
-                <entry><para>The corresponding password for the admin user specified above.</para></entry>
+              <entry><para>Nexus dvSwitch Password</para></entry>
+              <entry><para>The corresponding password for the admin user specified
+                above.</para></entry>
             </row>
-            </tbody>
+          </tbody>
         </tgroup>
-        </informaltable>
+      </informaltable>
     </section>
     <section id="vmware-vsphere-cluster-config-nexus-vswitch-remove">
-        <title>Removing Nexus Virtual Switch</title>
-        <orderedlist>
-        <listitem><para>In the vCenter datacenter that is served by the Nexus virtual switch, ensure that you delete all the hosts in the corresponding cluster.</para></listitem>
-        <listitem><para>Log in with Admin permissions to the &PRODUCT; administrator UI.</para></listitem>
-        <listitem><para>In the left navigation bar, select Infrastructure.</para></listitem>
-        <listitem><para>In the Infrastructure page, click View all under Clusters.</para></listitem>
-        <listitem><para>Select the cluster where you want to remove the virtual switch.</para></listitem>
-        <listitem><para>In the dvSwitch tab, click the name of the virtual switch.</para></listitem>
+      <title>Removing Nexus Virtual Switch</title>
+      <orderedlist>
+        <listitem>
+          <para>In the vCenter datacenter that is served by the Nexus virtual switch, ensure that
+            you delete all the hosts in the corresponding cluster.</para>
+        </listitem>
+        <listitem>
+          <para>Log in with Admin permissions to the &PRODUCT; administrator UI.</para>
+        </listitem>
+        <listitem>
+          <para>In the left navigation bar, select Infrastructure.</para>
+        </listitem>
         <listitem>
-            <para>
-            In the Details page, click Delete Nexus dvSwitch icon.
-            <inlinemediaobject>
-                <imageobject><imagedata fileref="./images/delete-button.png" /></imageobject>
-                <textobject><phrase>DeleteButton.png: button to delete dvSwitch</phrase></textobject>
+          <para>In the Infrastructure page, click View all under Clusters.</para>
+        </listitem>
+        <listitem>
+          <para>Select the cluster where you want to remove the virtual switch.</para>
+        </listitem>
+        <listitem>
+          <para>In the dvSwitch tab, click the name of the virtual switch.</para>
+        </listitem>
+        <listitem>
+          <para> In the Details page, click Delete Nexus dvSwitch icon. <inlinemediaobject>
+              <imageobject>
+                <imagedata fileref="./images/delete-button.png"/>
+              </imageobject>
+              <textobject>
+                <phrase>DeleteButton.png: button to delete dvSwitch</phrase>
+              </textobject>
             </inlinemediaobject>
-            </para>
-            <para>Click Yes in the confirmation dialog box.</para>
+          </para>
+          <para>Click Yes in the confirmation dialog box.</para>
         </listitem>
-        </orderedlist>
-    </section> 
-</section> -->
+      </orderedlist>
+    </section>
+  </section>
+  <xi:include href="vmware-cluster-config-dvswitch.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <section id="vmware-vsphere-iscsi-storage-preparation">
     <title>Storage Preparation for vSphere (iSCSI only)</title>
     <para>Use of iSCSI requires preparatory work in vCenter. You must add an iSCSI target and create


[13/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1675: VMSnapshot: ListVMSnapshotsCmd should not display Domain ID in the Error Message

Description:
	Replace domain db id by uuid in exception message.

Signed-off-by: Mice Xia <mi...@tcloudcomputing.com>


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

Branch: refs/heads/internallb
Commit: 7e1eda0de2fdb3a3c8e2cbcf7f5c9dc5a3400b7b
Parents: 595f070
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Wed Mar 27 09:33:00 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/user/AccountManagerImpl.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e1eda0d/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 9736aa1..bc93df8 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -2138,7 +2138,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
     permittedAccounts, Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject,
             boolean listAll, boolean forProjectInvitation) {
         Long domainId = domainIdRecursiveListProject.first();
-
         if (domainId != null) {
             Domain domain = _domainDao.findById(domainId);
             if (domain == null) {
@@ -2154,10 +2153,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
             }
 
             Account userAccount = null;
+            Domain domain = null;
             if (domainId != null) {
                 userAccount = _accountDao.findActiveAccount(accountName, domainId);
+                domain = _domainDao.findById(domainId);
             } else {
                 userAccount = _accountDao.findActiveAccount(accountName, caller.getDomainId());
+                domain = _domainDao.findById(caller.getDomainId());
             }
 
             if (userAccount != null) {
@@ -2165,7 +2167,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
                 //check permissions
                 permittedAccounts.add(userAccount.getId());
             } else {
-                throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domainId);
+                throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid());
             }
         }
 


[26/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-797: Removing cmds CreatePrivateNetworkCmd and DestroyConsoleProxyCmd

Removed as per Kishan. We still don't know if we want to keep:
ListRecurringSnapshotScheduleCmd.java

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 888b0600fecf2fad649cfdf001d2b86fd789a93c
Parents: 5b86a8e
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 13:21:24 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../api/commands/CreatePrivateNetworkCmd.java      |  197 ---------------
 .../cloud/api/commands/DestroyConsoleProxyCmd.java |   85 -------
 2 files changed, 0 insertions(+), 282 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888b0600/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java b/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
deleted file mode 100644
index 2b63c64..0000000
--- a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
+++ /dev/null
@@ -1,197 +0,0 @@
-// 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.api.commands;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseAsyncCreateCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.cloudstack.api.response.NetworkResponse;
-import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
-import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
-
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.network.Network;
-import com.cloud.user.UserContext;
-
-//@APICommand(description="Creates a private network", responseObject=NetworkResponse.class)
-public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreatePrivateNetworkCmd.class.getName());
-
-    private static final String s_name = "createnetworkresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the network")
-    private String name;
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the network")
-    private String displayText;
-
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
-            required=true, description="the Physical Network ID the network belongs to")
-    private Long physicalNetworkId;
-
-    @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway of the network")
-    private String gateway;
-
-    @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask of the network")
-    private String netmask;
-
-    @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address in the network IP range")
-    private String startIp;
-
-    @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address in the network IP" +
-            " range. If not specified, will be defaulted to startIP")
-    private String endIp;
-
-    @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, required=true, description="the ID or VID of the network")
-    private String vlan;
-
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the network")
-    private String accountName;
-
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
-            description="an optional project for the ssh key")
-    private Long projectId;
-
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
-            description="domain ID of the account owning a network")
-    private Long domainId;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getGateway() {
-        return gateway;
-    }
-
-    public String getVlan() {
-        return vlan;
-    }
-
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public String getNetmask() {
-        return netmask;
-    }
-
-    public String getStartIp() {
-        return startIp;
-    }
-
-    public String getNetworkName() {
-        return name;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    public String getEndIp() {
-        return endIp;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        Network result = null;
-        try {
-            result = _networkService.createPrivateNetwork(getNetworkName(), getDisplayText(), getPhysicalNetworkId(), getVlan(),
-                    getStartIp(), getEndIp(), getGateway(), getNetmask(), getEntityOwnerId(), null);
-        } catch (InsufficientCapacityException ex){
-            s_logger.info(ex);
-            s_logger.trace(ex);
-            throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
-        } catch (ConcurrentOperationException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
-        }
-
-        if (result != null) {
-            this.setEntityId(result.getId());
-            this.setEntityUuid(result.getUuid());
-        } else {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a Private network");
-        }
-    }
-
-    @Override
-    public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{
-        Network result = _networkService.getNetwork(getEntityId());
-        if (result != null) {
-            NetworkResponse response = _responseGenerator.createNetworkResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create private network");
-        }
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
-        if (accountId == null) {
-            return UserContext.current().getCaller().getId();
-        }
-        return accountId;
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_NETWORK_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "creating private network";
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888b0600/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
deleted file mode 100644
index f3210ce..0000000
--- a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// 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.api.commands;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.log4j.Logger;
-
-import com.cloud.event.EventTypes;
-import com.cloud.exception.UnsupportedServiceException;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-//@APICommand(description="Destroys console proxy", responseObject=SuccessResponse.class)
-public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
-
-    private static final String s_name = "destroyconsoleproxyresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="console proxy ID")
-    private Long id;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = (Account)UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_PROXY_DESTROY;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "destroying console proxy: " + getId();
-    }
-
-    @Override
-    public void execute(){
-        throw new UnsupportedServiceException("Use destroySystemVm API instead");
-    }
-}


[27/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1867: Export both ova and vmdk systemvm appliances for VMWare

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 5b86a8e0ba6a8dc47407faf50b989d73b6118fc9
Parents: 1e2370d
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 13:05:54 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 tools/appliance/build.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b86a8e0/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index f1ee4a6..c39d38a 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -81,7 +81,10 @@ rm raw.img
 bzip2 $appliance-$build_date-$branch-kvm.qcow2
 echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
 
-# Export for VMWare vSphere
+# Export both ova and vmdk for VMWare
+vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-vmware.vmdk --format VMDK
+bzip2 $appliance-$build_date-$branch-vmware.vmdk
+echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.vmdk.bz2"
 vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ova
 echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova"
 


[15/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
More work on Release Notes


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

Branch: refs/heads/internallb
Commit: 3890591bf8fee19119e7eaa1628df2901b380d0e
Parents: 5d98490
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Tue Apr 9 19:36:43 2013 -0500
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 docs/en-US/Release_Notes.xml |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3890591b/docs/en-US/Release_Notes.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml
index 00cbc49..4535fd8 100644
--- a/docs/en-US/Release_Notes.xml
+++ b/docs/en-US/Release_Notes.xml
@@ -48,15 +48,15 @@ under the License.
                 </listitem>
                 <listitem>
                     <para>Stop your management server or servers. Run this on all management server hosts:</para>
-                    <programlisting># service cloud-management stop</programlisting>
+                    <programlisting><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
                 <listitem>
                     <para>Make a backup of your MySQL database. If you run into any issues or need to roll back the upgrade, this will assist in debugging or restoring your existing environment. You'll be prompted for your password.</para>
-                    <programlisting># mysqldump -u root -p cloud &gt; cloudstack-backup.sql</programlisting>
+                    <programlisting><prompt>#</prompt> mysqldump -u root -p cloud &gt; cloudstack-backup.sql</programlisting>
                 </listitem>
                 <listitem>
                     <para>Whether you're upgrading a Red Hat/CentOS based system or Ubuntu based system, you're going to need to stop the CloudStack management server before proceeding.</para>
-                    <programlisting language="Bash"># service cloud-management stop</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
                 <listitem>
                     <para>If you have made changes to <filename>/etc/cloud/management/components.xml</filename>, you'll need to carry these over manually to the new file, <filename>/etc/cloudstack/management/componentContext.xml</filename>. This is not done automatically. (If you're unsure, we recommend making a backup of the original <filename>components.xml</filename> to be on the safe side.</para>
@@ -114,7 +114,7 @@ db.awsapi.port=
                     </orderedlist>
                 </listitem>
                 <listitem id="upgrade-rpm-packages">
-                    <para>###</para> 
+                    <para>The package names have changed between 4.0 and 4.1, so upgrading the packages won't happen automatically with a <command>yum update</command></para> 
                 </listitem>
             </orderedlist>
         </section>
@@ -220,11 +220,11 @@ db.awsapi.port=
                 </listitem>
                 <listitem id="stopping-usage-servers">
                     <para>Stop all Usage Servers if running. Run this on all Usage Server hosts.</para>
-                    <programlisting># service cloud-usage stop</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-usage stop</programlisting>
                 </listitem>
                 <listitem>
                     <para>Stop the Management Servers. Run this on all Management Server hosts.</para>
-                    <programlisting># service cloud-management stop</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
                 <listitem>
                     <para>On the MySQL master, take a backup of the MySQL databases. We recommend performing
@@ -288,7 +288,7 @@ db.awsapi.port=
                 <listitem>
                     <para>Start the first Management Server. Do not start any other Management Server nodes
                         yet.</para>
-                    <programlisting># service cloud-management start</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-management start</programlisting>
                     <para>Wait until the databases are upgraded. Ensure that the database upgrade is complete.
                         After confirmation, start the other Management Servers one at a time by running the same
                         command on each node.</para>
@@ -669,7 +669,7 @@ db.awsapi.port=
                 </listitem>
                 <listitem>
                     <para>Stop the Management Servers. Run this on all Management Server hosts.</para>
-                    <programlisting># service cloud-management stop</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
                 <listitem>
                     <para>On the MySQL master, take a backup of the MySQL databases. We recommend performing
@@ -780,7 +780,7 @@ db.awsapi.port=
                 <listitem>
                     <para>Start the first Management Server. Do not start any other Management Server nodes
                         yet.</para>
-                    <programlisting># service cloud-management start</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-management start</programlisting>
                     <para>Wait until the databases are upgraded. Ensure that the database upgrade is complete.
                         You should see a message like "Complete! Done." After confirmation, start the other
                         Management Servers one at a time by running the same command on each node.</para>
@@ -788,7 +788,7 @@ db.awsapi.port=
                 <listitem>
                     <para>Start all Usage Servers (if they were running on your previous version). Perform
                         this on each Usage Server host.</para>
-                    <programlisting># service cloud-usage start</programlisting>
+                    <programlisting language="Bash"><prompt>#</prompt> service cloud-usage start</programlisting>
                 </listitem>
                 <listitem>
                     <para>(KVM only) Additional steps are required for each KVM host. These steps will not


[07/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: move devcloud configuration into pom profile for exec:java
Also ignore agent.properties in RAT since
a. they are trivial
b. they are modified by the java code (stripping the license)

QuickCloud: proper path for log.home

QuickCloud: proper path for secstorage.sh


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

Branch: refs/heads/internallb
Commit: 92a42d9b18d7751f4c83c0a37bb345d4d903f388
Parents: a8dcec5
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Apr 5 14:25:44 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 pom.xml                                            |    4 ++
 .../console-proxy/server/conf/agent.properties     |   17 --------
 services/console-proxy/server/pom.xml              |    3 +
 .../console-proxy/server/scripts/consoleproxy.sh   |    2 +-
 .../console-proxy/server/scripts/secstorage.sh     |   33 +++++++++++++++
 services/secondary-storage/conf/agent.properties   |    9 +----
 services/secondary-storage/pom.xml                 |    8 ++++
 services/secondary-storage/scripts/secstorage.sh   |   33 ---------------
 8 files changed, 50 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6208124..dbc3907 100644
--- a/pom.xml
+++ b/pom.xml
@@ -317,6 +317,10 @@
               <exclude>deps/XenServerJava/Makefile</exclude>
               <exclude>dist/console-proxy/js/jquery.js</exclude>
               <exclude>scripts/vm/systemvm/id_rsa.cloud</exclude>
+              <exclude>services/console-proxy/server/conf/agent.properties</exclude>
+              <exclude>services/console-proxy/server/conf/environment.properties</exclude>
+              <exclude>services/secondary-storage/conf/agent.properties</exclude>
+              <exclude>services/secondary-storage/conf/environment.properties</exclude>
               <exclude>tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf</exclude>
               <exclude>tools/appliance/definitions/devcloud/*</exclude>
               <exclude>tools/appliance/definitions/systemvmtemplate/*</exclude>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/console-proxy/server/conf/agent.properties
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/agent.properties b/services/console-proxy/server/conf/agent.properties
index 4e217f2..246cb1c 100644
--- a/services/console-proxy/server/conf/agent.properties
+++ b/services/console-proxy/server/conf/agent.properties
@@ -1,19 +1,2 @@
-# 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.
-
 instance=ConsoleProxy
 resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/console-proxy/server/pom.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/pom.xml b/services/console-proxy/server/pom.xml
index 3d149a5..3ac5d59 100644
--- a/services/console-proxy/server/pom.xml
+++ b/services/console-proxy/server/pom.xml
@@ -280,11 +280,14 @@
             <argument>zone=1</argument>
             <argument>pod=1</argument>
             <argument>host=192.168.56.1</argument>
+            <argument>guid=ConsoleProxy.1</argument>
           </arguments>
           <systemProperties>
             <systemProperty>
               <key>javax.net.ssl.trustStore</key>
               <value>certs/realhostip.keystore</value>
+              <key>log.home</key>
+              <value>${PWD}/</value>
             </systemProperty>
           </systemProperties>
         </configuration>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/console-proxy/server/scripts/consoleproxy.sh
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/scripts/consoleproxy.sh b/services/console-proxy/server/scripts/consoleproxy.sh
index 4a6acde..294d597 100755
--- a/services/console-proxy/server/scripts/consoleproxy.sh
+++ b/services/console-proxy/server/scripts/consoleproxy.sh
@@ -28,6 +28,6 @@ do
 done
 keyvalues=
 #LOGHOME=/var/log/cloud/
-LOGHOME=$PWD
+LOGHOME=$PWD/
 
 java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -cp $CP com.cloud.agent.AgentShell $keyvalues $@

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/console-proxy/server/scripts/secstorage.sh
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/scripts/secstorage.sh b/services/console-proxy/server/scripts/secstorage.sh
new file mode 100755
index 0000000..b45afc2
--- /dev/null
+++ b/services/console-proxy/server/scripts/secstorage.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# 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.
+
+
+
+#runs the secondary storage service as a standalone server
+#i.e., not in the system vm
+
+CP=./:./conf
+for file in *.jar
+do
+  CP=${CP}:$file
+done
+keyvalues=
+#LOGHOME=/var/log/cloud/
+LOGHOME=$PWD/
+
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -cp $CP com.cloud.agent.AgentShell $keyvalues $@

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/secondary-storage/conf/agent.properties
----------------------------------------------------------------------
diff --git a/services/secondary-storage/conf/agent.properties b/services/secondary-storage/conf/agent.properties
index 554007f..aab82b6 100644
--- a/services/secondary-storage/conf/agent.properties
+++ b/services/secondary-storage/conf/agent.properties
@@ -1,9 +1,2 @@
-#mount.path=~/secondary-storage
-eth1ip=192.168.56.1
-name=192.168.56.10
-eth2ip=192.168.56.10
+#mount.path=~/secondary-storage/
 resource=org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource
-piddir=.
-instance=SecondaryStorage
-developer=true
-secondary.storage.vm=false

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/secondary-storage/pom.xml
----------------------------------------------------------------------
diff --git a/services/secondary-storage/pom.xml b/services/secondary-storage/pom.xml
index 0577084..2c8a1d0 100644
--- a/services/secondary-storage/pom.xml
+++ b/services/secondary-storage/pom.xml
@@ -81,11 +81,19 @@
             <argument>zone=1</argument>
             <argument>pod=1</argument>
             <argument>host=192.168.56.1</argument>
+            <argument>name=192.168.56.10</argument>
+            <argument>eth1ip=192.168.56.10</argument>
+            <argument>eth2ip=192.168.56.10</argument>
+            <argument>guid=SecondaryStorage.1</argument>
+            <argument>secondary.storage.vm=false</argument>
+            <argument>instance=Secondary</argument>
           </arguments>
           <systemProperties>
             <systemProperty>
               <key>javax.net.ssl.trustStore</key>
               <value>certs/realhostip.keystore</value>
+              <key>log.home</key>
+              <value>${PWD}/</value>
             </systemProperty>
           </systemProperties>
         </configuration>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92a42d9b/services/secondary-storage/scripts/secstorage.sh
----------------------------------------------------------------------
diff --git a/services/secondary-storage/scripts/secstorage.sh b/services/secondary-storage/scripts/secstorage.sh
deleted file mode 100755
index 9afc521..0000000
--- a/services/secondary-storage/scripts/secstorage.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# 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.
-
-
-
-#runs the secondary storage service as a standalone server
-#i.e., not in the system vm
-
-CP=./:./conf
-for file in *.jar
-do
-  CP=${CP}:$file
-done
-keyvalues=
-#LOGHOME=/var/log/cloud/
-LOGHOME=$PWD
-
-java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -cp $CP com.cloud.agent.AgentShell $keyvalues $@


[25/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
adding error handling mechanism to scale up vm functionality


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

Branch: refs/heads/internallb
Commit: 1e2370def480ba5c3591512d3f0bea4abdd5a3be
Parents: cbc2d3a
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed Apr 10 11:43:59 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e2370de/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 80c1634..1c4c38c 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1084,7 +1084,7 @@
             label:'scaleUp VM',
             action: function(args) {
               $.ajax({
-                url: createURL("scaleVirtualMachine&id=" + args.context.instances[0].id),
+                url: createURL("scaleVirtualMachine&id=" + args.context.instances[0].id + "&serviceofferingid=" + args.context.instances[0].serviceofferingid),
                 dataType: "json",
                 async: true,
                 success: function(json) {
@@ -1101,7 +1101,11 @@
                      }
                     }
                   );
+                },
+                 error:function(json){
+                     args.response.error(parseXMLHttpResponse(json));
                 }
+
               });
             },
             messages: {


[12/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: launch scripts for secondary storage and console proxy outside system vm

QuickCloud: remove stuff added by the daemon


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

Branch: refs/heads/internallb
Commit: 12595cf9df729cc0fa43ec3f5e0a9e80e77cca1a
Parents: 60a1916
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Wed Mar 27 16:49:56 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 services/console-proxy/server/scripts/_run.sh      |    3 +-
 .../console-proxy/server/scripts/consoleproxy.sh   |   33 +++++++++++++++
 services/secondary-storage/conf/agent.properties   |    4 +-
 services/secondary-storage/scripts/_run.sh         |    3 +-
 services/secondary-storage/scripts/secstorage.sh   |   33 +++++++++++++++
 5 files changed, 71 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12595cf9/services/console-proxy/server/scripts/_run.sh
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/scripts/_run.sh b/services/console-proxy/server/scripts/_run.sh
index e408378..bd06346 100755
--- a/services/console-proxy/server/scripts/_run.sh
+++ b/services/console-proxy/server/scripts/_run.sh
@@ -35,6 +35,7 @@ do
   CP=${CP}:$file
 done
 keyvalues=
+LOGHOME=/var/log/cloud/
 
 CMDLINE=$(cat /var/cache/cloud/cmdline)
 
@@ -60,4 +61,4 @@ then
   maxmem=$eightypcnt
 fi
 
-java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12595cf9/services/console-proxy/server/scripts/consoleproxy.sh
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/scripts/consoleproxy.sh b/services/console-proxy/server/scripts/consoleproxy.sh
new file mode 100755
index 0000000..4a6acde
--- /dev/null
+++ b/services/console-proxy/server/scripts/consoleproxy.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# 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.
+
+
+
+#runs the console proxy as a standalone server
+#i.e., not in the system vm
+
+CP=./:./conf
+for file in *.jar
+do
+  CP=${CP}:$file
+done
+keyvalues=
+#LOGHOME=/var/log/cloud/
+LOGHOME=$PWD
+
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -cp $CP com.cloud.agent.AgentShell $keyvalues $@

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12595cf9/services/secondary-storage/conf/agent.properties
----------------------------------------------------------------------
diff --git a/services/secondary-storage/conf/agent.properties b/services/secondary-storage/conf/agent.properties
index 4a25cbd..554007f 100644
--- a/services/secondary-storage/conf/agent.properties
+++ b/services/secondary-storage/conf/agent.properties
@@ -1,6 +1,4 @@
-#Storage
-#Sun Mar 24 22:52:35 PDT 2013
-mount.path=/Users/chiradeep/secondary-storage
+#mount.path=~/secondary-storage
 eth1ip=192.168.56.1
 name=192.168.56.10
 eth2ip=192.168.56.10

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12595cf9/services/secondary-storage/scripts/_run.sh
----------------------------------------------------------------------
diff --git a/services/secondary-storage/scripts/_run.sh b/services/secondary-storage/scripts/_run.sh
index e408378..cb9624c 100755
--- a/services/secondary-storage/scripts/_run.sh
+++ b/services/secondary-storage/scripts/_run.sh
@@ -36,6 +36,7 @@ do
 done
 keyvalues=
 
+LOGHOME=/var/log/cloud/
 CMDLINE=$(cat /var/cache/cloud/cmdline)
 
 #CMDLINE="graphical utf8 eth0ip=0.0.0.0 eth0mask=255.255.255.0 eth1ip=192.168.140.40 eth1mask=255.255.255.0 eth2ip=172.24.0.50 eth2mask=255.255.0.0 gateway=172.24.0.1 dns1=72.52.126.11 template=domP dns2=72.52.126.12 host=192.168.1.142 port=8250 mgmtcidr=192.168.1.0/24 localgw=192.168.140.1 zone=5 pod=5"
@@ -60,4 +61,4 @@ then
   maxmem=$eightypcnt
 fi
 
-java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12595cf9/services/secondary-storage/scripts/secstorage.sh
----------------------------------------------------------------------
diff --git a/services/secondary-storage/scripts/secstorage.sh b/services/secondary-storage/scripts/secstorage.sh
new file mode 100755
index 0000000..9afc521
--- /dev/null
+++ b/services/secondary-storage/scripts/secstorage.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# 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.
+
+
+
+#runs the secondary storage service as a standalone server
+#i.e., not in the system vm
+
+CP=./:./conf
+for file in *.jar
+do
+  CP=${CP}:$file
+done
+keyvalues=
+#LOGHOME=/var/log/cloud/
+LOGHOME=$PWD
+
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -cp $CP com.cloud.agent.AgentShell $keyvalues $@


[28/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Refactoring the code in network.js to remove the disabling of egress and load balancers tab


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

Branch: refs/heads/internallb
Commit: 2dbaf8ac9eb3c50bf0e6f0ca4d6e59e594ef852c
Parents: 888b060
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed Apr 10 13:59:55 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js |  398 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 397 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2dbaf8ac/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 6f6a073..6c31192 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -924,7 +924,7 @@
               }
 
               if (isVPC || isAdvancedSGZone || hasSRXFirewall) {
-                hiddenTabs.push('egressRules');
+                 hiddenTabs.push('egressRules');
                }
               
               return hiddenTabs;
@@ -1108,6 +1108,401 @@
 										}
 									});			
                 }
+              },
+                 
+              egressRules: {
+                title: 'label.egress.rules',
+                custom: function(args) {
+                  var context = args.context;
+
+                  return $('<div>').multiEdit({
+                    context: context,
+                    noSelect: true,
+                    noHeaderActionsColumn: true,
+                    fields: {
+                      'cidrlist': { edit: true, label: 'label.cidr.list', isOptional: true },
+                      'protocol': {
+                        label: 'label.protocol',
+                        select: function(args) {
+                          args.$select.change(function() {
+                            var $inputs = args.$form.find('th, td');
+                            var $icmpFields = $inputs.filter(function() {
+                              var name = $(this).attr('rel');
+
+                              return $.inArray(name, [
+                                'icmptype',
+                                'icmpcode'
+                              ]) > -1;
+                            });
+                            var $otherFields = $inputs.filter(function() {
+                              var name = $(this).attr('rel');
+
+                              return name != 'cidrlist' &&
+                                name != 'icmptype' &&
+                                name != 'icmpcode' &&
+                                name != 'protocol' &&
+                                name != 'add-rule';
+                            });
+
+                            if ($(this).val() == 'icmp') {
+                              $icmpFields.show();
+                              $otherFields.hide();
+                            } else if ($(this).val() == 'all') {
+                              $icmpFields.hide();
+                              $otherFields.hide();
+                            } else {
+                              $icmpFields.hide();
+                              $otherFields.show();
+                            }
+                          });
+                       
+                            args.response.success({
+                            data: [
+                              { name: 'tcp', description: 'TCP' },
+                              { name: 'udp', description: 'UDP' },
+                              { name: 'icmp', description: 'ICMP' },
+                              { name: 'all', description: 'All' }
+                            ]
+                          });
+                        }
+                      },
+                      'startport': { edit: true, label: 'label.start.port', isOptional: true },
+                      'endport': { edit: true, label: 'label.end.port', isOptional: true },
+                      'icmptype': { edit: true, label: 'ICMP.type', isHidden: true, isOptional: true },
+                      'icmpcode': { edit: true, label: 'ICMP.code', isHidden: true, isOptional: true },
+                      'add-rule': {
+                        label: 'label.add',
+                        addButton: true
+                      }
+                    },
+                    add: {
+                      label: 'label.add',
+                      action: function(args) {
+                        var data = {
+                          protocol: args.data.protocol,
+                          cidrlist: args.data.cidrlist,
+                          networkid: args.context.networks[0].id
+                        };
+
+                        if (args.data.icmptype && args.data.icmpcode) { // ICMP
+                          $.extend(data, {
+                            icmptype: args.data.icmptype,
+                            icmpcode: args.data.icmpcode
+                          });
+                        } else { // TCP/UDP
+                          $.extend(data, {
+                            startport: args.data.startport,
+                            endport: args.data.endport
+                          });
+                        }
+
+                        $.ajax({
+                          url: createURL('createEgressFirewallRule'),
+                          data: data,
+                          dataType: 'json',
+                          async: true,
+                          success: function(json) {
+                            var jobId = json.createegressfirewallruleresponse.jobid;
+
+                            args.response.success({
+                              _custom: {
+                                jobId: jobId
+                              },
+                              notification: {
+                                label: 'label.add.egress.rule',
+                                poll: pollAsyncJobResult
+                              }
+                            });
+                          },
+                          error: function(json) {
+                            args.response.error(parseXMLHttpResponse(json));
+                          }
+                        });
+                      }
+                    },
+                    actions: {
+                      destroy: {
+                        label: 'label.remove.rule',
+                        action: function(args) {
+                          $.ajax({
+                            url: createURL('deleteEgressFirewallRule'),
+                            data: {
+                              id: args.context.multiRule[0].id
+                            },
+                            dataType: 'json',
+                            async: true,
+                            success: function(data) {
+                              var jobID = data.deleteegressfirewallruleresponse.jobid;
+
+                              args.response.success({
+                                _custom: {
+                                  jobId: jobID
+                                },
+                                notification: {
+                                  label: 'label.remove.egress.rule',
+                                  poll: pollAsyncJobResult
+                                }
+                              });
+                            },
+                            error: function(json) {
+                              args.response.error(parseXMLHttpResponse(json));
+                            }
+                          });
+                        }
+                      }
+                    },
+                    ignoreEmptyFields: true,
+                    dataProvider: function(args) {
+                      $.ajax({
+                        url: createURL('listEgressFirewallRules'),
+                        data: {
+                          listAll: true,
+                          networkid: args.context.networks[0].id
+                        },
+                        dataType: 'json',
+                        async: true,
+                        success: function(json) {
+                          var response = json.listegressfirewallrulesresponse.firewallrule ?
+                                json.listegressfirewallrulesresponse.firewallrule : [];
+
+                          args.response.success({
+                            data: $.map(response, function(rule) {
+                              if (rule.protocol == 'all') {
+                                $.extend(rule, {
+                                  startport: 'All',
+                                  endport: 'All'
+                                });
+                              } else if (rule.protocol == 'tcp' || rule.protocol == 'udp') {
+                                if (!rule.startport) {
+                                  rule.startport = ' ';
+                                }
+
+                                if (!rule.endport) {
+                                  rule.endport = ' ';
+                                }
+                              }
+
+                              return rule;
+                            })
+                          });
+                        }
+                       });
+                    }
+                  });
+                }
+              },
+
+               addloadBalancer: { // EIP/ELB Basic zone: Add Load Balancer tab in network detailView
+                title: 'label.add.load.balancer',
+                custom: function(args) {
+                  var context = args.context;
+
+                  return $('<div>').addClass('loadBalancer').multiEdit(
+                    {
+                      context: context,
+                      listView: $.extend(true, {}, cloudStack.sections.instances, {
+                        listView: {
+                          filters: false,
+
+                          dataProvider: function(args) {
+                            var data = {
+                              page: args.page,
+                              pageSize: pageSize,
+                                                                                                                        domainid: g_domainid,
+                              account: g_account,
+                              networkid: args.context.networks[0].id,
+                              listAll: true
+                            };
+
+                            $.ajax({
+                              url: createURL('listVirtualMachines'),
+                              data: data,
+                              dataType: 'json',
+                              async: true,
+                              success: function(data) {
+                                args.response.success({
+                                  data: $.grep(
+                                    data.listvirtualmachinesresponse.virtualmachine ?
+                                      data.listvirtualmachinesresponse.virtualmachine : [],
+                                    function(instance) {
+                                          var nonAutoScale=0;
+                                          if(instance.displayname == null)
+                                              nonAutoScale = 1;
+                                            else{
+                                          if( instance.displayname.match(/AutoScale-LB-/)==null)
+                                             nonAutoScale =1;
+                                          else {
+                                             if(instance.displayname.match(/AutoScale-LB-/).length)
+                                               nonAutoScale =0;
+                                             }
+                                          }
+                                      var isActiveState= $.inArray(instance.state, ['Destroyed','Expunging']) == -1;
+                                      return nonAutoScale && isActiveState;
+                                    }
+                                  )
+                                });
+                               },
+                              error: function(data) {
+                                args.response.error(parseXMLHttpResponse(data));
+                              }
+                            });
+                          }
+                        }
+                      }),
+                      multipleAdd: true,
+                      fields: {
+                        'name': { edit: true, label: 'label.name' },
+                        'publicport': { edit: true, label: 'label.public.port' },
+                        'privateport': { edit: true, label: 'label.private.port' },
+                        'algorithm': {
+                          label: 'label.algorithm',
+                          select: function(args) {
+                            args.response.success({
+                              data: [
+                                { name: 'roundrobin', description: _l('label.round.robin') },
+                                { name: 'leastconn', description: _l('label.least.connections') },
+                                { name: 'source', description: _l('label.source') }
+                              ]
+                            });
+                          }
+                        },
+                        'sticky': {
+                          label: 'label.stickiness',
+                          custom: {
+                            buttonLabel: 'label.configure',
+                            action: cloudStack.lbStickyPolicy.dialog()
+                          }
+                        },
+                        'autoScale': {
+                          label: 'AutoScale',
+                          custom: {
+                            requireValidation: true,
+                            buttonLabel: 'label.configure',
+                            action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
+                          }
+                        },
+                        'add-vm': {
+                          label: 'label.add.vms',
+                          addButton: true
+                        }
+                      },
+
+                      add: {  //basic zone - elastic IP - Add Load Balancer tab - Add VMs button
+                        label: 'label.add.vms',
+                        action: function(args) {
+                            var data = {
+                            algorithm: args.data.algorithm,
+                            name: args.data.name,
+                            privateport: args.data.privateport,
+                            publicport: args.data.publicport,
+                                                                                                                openfirewall: false,
+                                                                                                                domainid: g_domainid,
+                                                                                                                account: g_account
+                          };
+
+                                                                                                        if('vpc' in args.context) { //from VPC section
+                                                                                                                if(args.data.tier == null) {                                                         
+                                                                                                                        args.response.error('Tier is required');
+                                                                                                                        return;
+                                                                                                                }
+                                                                                                                $.extend(data, {
+                                                                                                                        networkid: args.data.tier
+                                                                                                                });
+                                                                                                        }
+                                                                                                        else {  //from Guest Network section
+                                                                                                                $.extend(data, {
+                                                                                                                        networkid: args.context.networks[0].id
+                                                                                                                });
+                                                                                                        }
+
+                          var stickyData = $.extend(true, {}, args.data.sticky);
+
+                          $.ajax({
+                            url: createURL('createLoadBalancerRule'),
+                            data: data,
+                            dataType: 'json',
+                            async: true,
+                            success: function(data) {
+                              var itemData = args.itemData;
+                              //var jobID = data.createloadbalancerruleresponse.jobid; //CS-16964: use jobid from assignToLoadBalancerRule instead of createLoadBalancerRule
+
+                              $.ajax({
+                                url: createURL('assignToLoadBalancerRule'),
+                                data: {
+                                  id: data.createloadbalancerruleresponse.id,
+                                  virtualmachineids: $.map(itemData, function(elem) {
+                                    return elem.id;
+                                  }).join(',')
+                                },
+                                dataType: 'json',
+                                async: true,
+                                success: function(data) {
+                                  var jobID = data.assigntoloadbalancerruleresponse.jobid; //CS-16964: use jobid from assignToLoadBalancerRule instead of createLoadBalancerRule
+                                   var lbCreationComplete = false;
+
+                                  args.response.success({
+                                    _custom: {
+                                      jobId: jobID
+                                    },
+                                    notification: {
+                                      label: 'label.add.load.balancer',
+                                      poll: function(args) {
+                                        var complete = args.complete;
+                                        var error = args.error;
+
+                                        pollAsyncJobResult({
+                                          _custom: args._custom,
+                                          complete: function(args) {
+                                            if (lbCreationComplete) {
+                                              return;
+                                            }
+
+                                            lbCreationComplete = true;
+                                            cloudStack.dialog.notice({
+                                              message: _l('message.add.load.balancer.under.ip') +
+                                                args.data.loadbalancer.publicip
+                                            });
+
+                                            if (stickyData &&
+                                                stickyData.methodname &&
+                                                stickyData.methodname != 'None') {
+                                              cloudStack.lbStickyPolicy.actions.add(
+                                                args.data.loadbalancer.id,
+                                                stickyData,
+                                                complete, // Complete
+                                                complete // Error
+                                              );
+                                            } else {
+                                              complete();
+                                            }
+                                          },
+                                          error: error
+                                        });
+                                      }
+                                    }
+                                  });
+                                },
+                                error: function(data) {
+                                  args.response.error(parseXMLHttpResponse(data));
+                                }
+                              });
+                            },
+                            error: function(data) {
+                              args.response.error(parseXMLHttpResponse(data));
+                            }
+                          });
+                        }
+                      },
+
+
+                      dataProvider: function(args) {
+                        args.response.success({ //no LB listing in AddLoadBalancer tab
+                          data: []
+                        });
+                      }
+                    }             
+                   );                
+                }
               }
             }
           }
@@ -2783,6 +3178,7 @@
                         }
                       }
                     },
+  
                     itemActions: {
                       add: {
                         label: 'label.add.vms.to.lb',


[39/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Permute partition space such as it succeeds during partitioning

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 547d679b6a944ef1e04e6e8f3ccba81a54a13d4c
Parents: dc1bcd8
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 17:04:51 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg       |    8 ++++----
 .../definitions/systemvmtemplate64/preseed.cfg     |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/547d679b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index 4050498..cafb9c3 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -130,7 +130,7 @@ d-i partman-auto/choose_recipe select atomic
 
 d-i partman-auto/expert_recipe string                         \
       boot-root ::                                            \
-              40 50 100 ext4                                  \
+              30 50 100 ext4                                  \
                       $primary{ } $bootable{ }                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
@@ -141,12 +141,12 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
               .                                               \
-              60 100 200 ext4                                 \
+              50 100 200 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              950 20 1100 ext4                                \
+              850 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -166,7 +166,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \
               .                                               \
-              64 512 300% linux-swap                          \
+              50 512 300% linux-swap                          \
                       method{ swap } format{ }                \
               .
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/547d679b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index 4050498..cafb9c3 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -130,7 +130,7 @@ d-i partman-auto/choose_recipe select atomic
 
 d-i partman-auto/expert_recipe string                         \
       boot-root ::                                            \
-              40 50 100 ext4                                  \
+              30 50 100 ext4                                  \
                       $primary{ } $bootable{ }                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
@@ -141,12 +141,12 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
               .                                               \
-              60 100 200 ext4                                 \
+              50 100 200 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              950 20 1100 ext4                                \
+              850 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -166,7 +166,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \
               .                                               \
-              64 512 300% linux-swap                          \
+              50 512 300% linux-swap                          \
                       method{ swap } format{ }                \
               .
 


[21/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
use hypervisor capabilities to control if vm snapshot is enabled for hypervisors


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

Branch: refs/heads/internallb
Commit: a6555017addd472b720b608fca202d2b8c7467c8
Parents: 01fc4ff
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Apr 10 11:34:39 2013 +0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:03 2013 -0700

----------------------------------------------------------------------
 .../cloud/hypervisor/HypervisorCapabilitiesVO.java |   13 +++++++++-
 .../hypervisor/dao/HypervisorCapabilitiesDao.java  |    2 +
 .../dao/HypervisorCapabilitiesDaoImpl.java         |    7 +++++
 .../cloud/vm/snapshot/VMSnapshotManagerImpl.java   |    8 +++++-
 .../cloud/vm/snapshot/VMSnapshotManagerTest.java   |   20 +++++++++++++-
 setup/db/db/schema-410to420.sql                    |    4 +++
 6 files changed, 50 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java b/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java
index b525a2d..fafc0a3 100644
--- a/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java
+++ b/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java
@@ -62,6 +62,9 @@ public class HypervisorCapabilitiesVO implements HypervisorCapabilities {
     @Column(name="max_hosts_per_cluster")
     private Integer maxHostsPerCluster;
 
+    @Column(name="vm_snapshot_enabled")
+    private Boolean vmSnapshotEnabled;
+    
     protected HypervisorCapabilitiesVO() {
     	this.uuid = UUID.randomUUID().toString();
     }
@@ -169,7 +172,15 @@ public class HypervisorCapabilitiesVO implements HypervisorCapabilities {
         this.maxHostsPerCluster = maxHostsPerCluster;
     }
 
-    @Override
+	public Boolean getVmSnapshotEnabled() {
+		return vmSnapshotEnabled;
+	}
+
+	public void setVmSnapshotEnabled(Boolean vmSnapshotEnabled) {
+		this.vmSnapshotEnabled = vmSnapshotEnabled;
+	}
+
+	@Override
     public boolean equals(Object obj) {
         if (obj instanceof HypervisorCapabilitiesVO) {
             return ((HypervisorCapabilitiesVO)obj).getId() == this.getId();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDao.java b/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDao.java
index 0fe0b53..1fdc03a 100644
--- a/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDao.java
+++ b/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDao.java
@@ -33,4 +33,6 @@ public interface HypervisorCapabilitiesDao extends GenericDao<HypervisorCapabili
     Integer getMaxDataVolumesLimit(HypervisorType hypervisorType, String hypervisorVersion);
 
     Integer getMaxHostsPerCluster(HypervisorType hypervisorType, String hypervisorVersion);
+    
+    Boolean isVmSnapshotEnabled(HypervisorType hypervisorType, String hypervisorVersion);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java b/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
index 759803e..b5e17ee 100644
--- a/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
+++ b/server/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
@@ -95,4 +95,11 @@ public class HypervisorCapabilitiesDaoImpl extends GenericDaoBase<HypervisorCapa
         HypervisorCapabilitiesVO result = getCapabilities(hypervisorType, hypervisorVersion);
         return result.getMaxHostsPerCluster();
     }
+
+	@Override
+	public Boolean isVmSnapshotEnabled(HypervisorType hypervisorType,
+			String hypervisorVersion) {
+		HypervisorCapabilitiesVO result = getCapabilities(hypervisorType, hypervisorVersion);
+		return result.getVmSnapshotEnabled();
+	}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index ffbbb82..8687163 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -59,6 +59,7 @@ import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao;
 import com.cloud.hypervisor.HypervisorGuruManager;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.storage.GuestOSVO;
@@ -119,6 +120,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
     @Inject VirtualMachineManager _itMgr;
     @Inject DataStoreManager dataStoreMgr;
     @Inject ConfigurationDao _configDao;
+    @Inject HypervisorCapabilitiesDao _hypervisorCapabilitiesDao;
     int _vmSnapshotMax;
     int _wait;
     StateMachine2<VMSnapshot.State, VMSnapshot.Event, VMSnapshot> _vmSnapshottateMachine ;
@@ -244,7 +246,11 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
         if (userVmVo == null) {
             throw new InvalidParameterValueException("Creating VM snapshot failed due to VM:" + vmId + " is a system VM or does not exist");
         }
-        
+
+        // check hypervisor capabilities
+        if(!_hypervisorCapabilitiesDao.isVmSnapshotEnabled(userVmVo.getHypervisorType(), "default"))
+        	throw new InvalidParameterValueException("VM snapshot is not enabled for hypervisor type: " + userVmVo.getHypervisorType());
+
         // parameter length check
         if(vsDisplayName != null && vsDisplayName.length()>255)
             throw new InvalidParameterValueException("Creating VM snapshot failed due to length of VM snapshot vsDisplayName should not exceed 255");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java b/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java
index 576c95b..41c9d12 100644
--- a/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java
+++ b/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java
@@ -27,6 +27,8 @@ import static org.mockito.Mockito.when;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -36,6 +38,7 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 
+import com.amazonaws.services.ec2.model.HypervisorType;
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CreateVMSnapshotAnswer;
@@ -47,7 +50,9 @@ import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.OperationTimedoutException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor;
 import com.cloud.hypervisor.HypervisorGuruManager;
+import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao;
 import com.cloud.storage.GuestOSVO;
 import com.cloud.storage.Snapshot;
 import com.cloud.storage.SnapshotVO;
@@ -88,6 +93,7 @@ public class VMSnapshotManagerTest {
     @Mock SnapshotDao _snapshotDao;
     @Mock VirtualMachineManager _itMgr;
     @Mock ConfigurationDao _configDao;
+    @Mock HypervisorCapabilitiesDao _hypervisorCapabilitiesDao;
     int _vmSnapshotMax = 10;
 
     private static long TEST_VM_ID = 3L;
@@ -105,6 +111,7 @@ public class VMSnapshotManagerTest {
         _vmSnapshotMgr._accountMgr = _accountMgr;
         _vmSnapshotMgr._snapshotDao = _snapshotDao;
         _vmSnapshotMgr._guestOSDao = _guestOSDao;
+        _vmSnapshotMgr._hypervisorCapabilitiesDao = _hypervisorCapabilitiesDao;
 
         doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class),
                 any(Boolean.class), any(ControlledEntity.class));
@@ -114,7 +121,8 @@ public class VMSnapshotManagerTest {
         when(_userVMDao.findById(anyLong())).thenReturn(vmMock);
         when(_vmSnapshotDao.findByName(anyLong(), anyString())).thenReturn(null);
         when(_vmSnapshotDao.findByVm(anyLong())).thenReturn(new ArrayList<VMSnapshotVO>());
-
+        when(_hypervisorCapabilitiesDao.isVmSnapshotEnabled(Hypervisor.HypervisorType.XenServer, "default")).thenReturn(true);
+        
         List<VolumeVO> mockVolumeList = new ArrayList<VolumeVO>();
         mockVolumeList.add(volumeMock);
         when(volumeMock.getInstanceId()).thenReturn(TEST_VM_ID);
@@ -122,7 +130,7 @@ public class VMSnapshotManagerTest {
 
         when(vmMock.getInstanceName()).thenReturn("i-3-VM-TEST");
         when(vmMock.getState()).thenReturn(State.Running);
-
+        when(vmMock.getHypervisorType()).thenReturn(Hypervisor.HypervisorType.XenServer);
         when(_guestOSDao.findById(anyLong())).thenReturn(mock(GuestOSVO.class));
     }
 
@@ -133,6 +141,14 @@ public class VMSnapshotManagerTest {
         _vmSnapshotMgr.allocVMSnapshot(TEST_VM_ID,"","",true);
     }
 
+    // hypervisorCapabilities not expected case
+    @Test(expected=InvalidParameterValueException.class)
+    public void testAllocVMSnapshotF6() throws ResourceAllocationException{
+        when(vmMock.getHypervisorType()).thenReturn(Hypervisor.HypervisorType.Ovm);
+        when(_hypervisorCapabilitiesDao.isVmSnapshotEnabled(Hypervisor.HypervisorType.Ovm, "default")).thenReturn(false);
+        _vmSnapshotMgr.allocVMSnapshot(TEST_VM_ID,"","",true);
+    }
+    
     // vm state not in [running, stopped] case
     @Test(expected=InvalidParameterValueException.class)
     public void testAllocVMSnapshotF2() throws ResourceAllocationException{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6555017/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 7bb230e..7bc6d56 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -450,3 +450,7 @@ CREATE TABLE `cloud`.`vm_snapshots` (
   CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`),
   CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `vm_snapshot_enabled` tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Whether VM snapshot is supported by hypervisor';
+UPDATE `cloud`.`hypervisor_capabilities` SET `vm_snapshot_enabled`=1 WHERE `hypervisor_type` in ('VMware', 'XenServer');
+


[45/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Remove some non-oss dependencies we don't use anymore


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

Branch: refs/heads/internallb
Commit: edbb030dbccbdd50d8a02f12039feec704b0adf7
Parents: 8289590
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Apr 10 16:33:23 2013 +0200
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 deps/install-non-oss.sh |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edbb030d/deps/install-non-oss.sh
----------------------------------------------------------------------
diff --git a/deps/install-non-oss.sh b/deps/install-non-oss.sh
index 74575a8..0bf8e48 100755
--- a/deps/install-non-oss.sh
+++ b/deps/install-non-oss.sh
@@ -17,7 +17,6 @@
 # under the License.
 
 mvn install:install-file -Dfile=cloud-iControl.jar      -DgroupId=com.cloud.com.f5     -DartifactId=icontrol        -Dversion=1.0   -Dpackaging=jar
-mvn install:install-file -Dfile=cloud-netscaler.jar     -DgroupId=com.cloud.com.citrix -DartifactId=netscaler       -Dversion=1.0   -Dpackaging=jar
 mvn install:install-file -Dfile=cloud-netscaler-sdx.jar -DgroupId=com.cloud.com.citrix -DartifactId=netscaler-sdx   -Dversion=1.0   -Dpackaging=jar
 
 # From http://support.netapp.com/  (not available online, contact your support representative)
@@ -25,18 +24,6 @@ mvn install:install-file -Dfile=cloud-netscaler-sdx.jar -DgroupId=com.cloud.com.
 if [ -e cloud-manageontap.jar ]; then mv cloud-manageontap.jar manageontap.jar;  fi
 mvn install:install-file -Dfile=manageontap.jar   -DgroupId=com.cloud.com.netapp -DartifactId=manageontap     -Dversion=4.0   -Dpackaging=jar
 
-# From https://my.vmware.com/group/vmware/get-download?downloadGroup=VSDK41
-# Version: 4.1, Release-date: 2010-07-13, Build: 257238 
-if [ -e vmware-apputils.jar ]; then mv vmware-apputils.jar  apputils.jar;  fi
-if [ -e vmware-vim.jar ];      then mv vmware-vim.jar       vim.jar;       fi
-if [ -e vmware-vim25.jar ];    then mv vmware-vim25.jar     vim25.jar;     fi
-mvn install:install-file -Dfile=vim25.jar        -DgroupId=com.cloud.com.vmware -DartifactId=vmware-vim25    -Dversion=4.1   -Dpackaging=jar
-mvn install:install-file -Dfile=apputils.jar     -DgroupId=com.cloud.com.vmware -DartifactId=vmware-apputils -Dversion=4.1   -Dpackaging=jar
-mvn install:install-file -Dfile=vim.jar          -DgroupId=com.cloud.com.vmware -DartifactId=vmware-vim      -Dversion=4.1   -Dpackaging=jar
-
-#
 # From https://my.vmware.com/group/vmware/get-download?downloadGroup=VSP510-WEBSDK-510
 # Version: 5.1, Release-date: 2012-09-10, Build: 774886
 mvn install:install-file -Dfile=vim25_51.jar        -DgroupId=com.cloud.com.vmware -DartifactId=vmware-vim25    -Dversion=5.1   -Dpackaging=jar
-
-


[10/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: allow specification of network offering name in datacenter config. The deployDatacenter python script will use this to pick the network offering during creation of the default network in a basic zone


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

Branch: refs/heads/internallb
Commit: 7fb8b0412f6b2a0378d4eeafdf4e543c00d685d3
Parents: cddb729
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Mar 26 14:11:36 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 tools/devcloud/quickcloud.cfg           |    1 +
 tools/marvin/marvin/deployDataCenter.py |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7fb8b041/tools/devcloud/quickcloud.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/quickcloud.cfg b/tools/devcloud/quickcloud.cfg
index 0e1fb4f..a2613d2 100644
--- a/tools/devcloud/quickcloud.cfg
+++ b/tools/devcloud/quickcloud.cfg
@@ -54,6 +54,7 @@
             "securitygroupenabled": "true", 
             "localstorageenabled": "true",
             "networktype": "Basic", 
+            "networkofferingname": "QuickCloudNoServices", 
             "pods": [
                 {
                     "endip": "192.168.56.220", 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7fb8b041/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 42bc5f9..d365395 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -299,10 +299,11 @@ class deployDataCenters():
 
             if zone.networktype == "Basic":
                 listnetworkoffering = listNetworkOfferings.listNetworkOfferingsCmd()
-                
                 listnetworkoffering.name = "DefaultSharedNetscalerEIPandELBNetworkOffering" \
                         if len(filter(lambda x : x.typ == 'Public', zone.physical_networks[0].traffictypes)) > 0 \
                         else "DefaultSharedNetworkOfferingWithSGService"
+                if zone.networkofferingname  is not None:
+                   listnetworkoffering.name = zone.networkofferingname 
 
                 listnetworkofferingresponse = \
                 self.apiClient.listNetworkOfferings(listnetworkoffering)


[44/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Fixed the issue - VM deployment for local service offering for Root and with data disk(shared), was deploying data disk to local disk too. Currently there is no way to let the planner know multiple pool information, hence letting the planner search for a pool always during VM deployment.


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

Branch: refs/heads/internallb
Commit: c9f42eb32e5cf97ae736df11312fda6a4706833d
Parents: 9d0ba2b
Author: Prachi Damle <pr...@cloud.com>
Authored: Wed Apr 10 10:46:53 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 .../cloud/entity/api/VMEntityManagerImpl.java      |    2 +-
 server/src/com/cloud/deploy/FirstFitPlanner.java   |   39 ++++++++-------
 2 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9f42eb3/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index 8b9b100..0359db9 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -207,7 +207,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
         }
         
         DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vmReservation.getPodId(), vmReservation.getClusterId(),
-                vmReservation.getHostId(), poolId , null);
+                vmReservation.getHostId(), null , null);
         
         VMInstanceVO vmDeployed = _itMgr.start(vm, params, _userDao.findById(new Long(caller)), _accountDao.findById(vm.getAccountId()), plan);
         

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9f42eb3/server/src/com/cloud/deploy/FirstFitPlanner.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java
index 012d160..2dffe70 100755
--- a/server/src/com/cloud/deploy/FirstFitPlanner.java
+++ b/server/src/com/cloud/deploy/FirstFitPlanner.java
@@ -102,7 +102,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     @Inject protected StorageManager _storageMgr;
     @Inject DataStoreManager dataStoreMgr;
     @Inject protected ClusterDetailsDao _clusterDetailsDao;
-    
+
     protected List<StoragePoolAllocator> _storagePoolAllocators;
     public List<StoragePoolAllocator> getStoragePoolAllocators() {
 		return _storagePoolAllocators;
@@ -157,7 +157,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
         if(plan.getHostId() != null && haVmTag == null){
             Long hostIdSpecified = plan.getHostId();
             if (s_logger.isDebugEnabled()){
-                s_logger.debug("DeploymentPlan has host_id specified, making no checks on this host, looks like admin test: "+hostIdSpecified);
+                s_logger.debug("DeploymentPlan has host_id specified, choosing this host and making no checks on this host: "
+                        + hostIdSpecified);
             }
             HostVO host = _hostDao.findById(hostIdSpecified);
             if (s_logger.isDebugEnabled()) {
@@ -407,9 +408,9 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     }
 
     /**
-     * This method should reorder the given list of Cluster Ids by applying any necessary heuristic 
+     * This method should reorder the given list of Cluster Ids by applying any necessary heuristic
      * for this planner
-     * For FirstFitPlanner there is no specific heuristic to be applied 
+     * For FirstFitPlanner there is no specific heuristic to be applied
      * other than the capacity based ordering which is done by default.
      * @return List<Long> ordered list of Cluster Ids
      */
@@ -419,9 +420,9 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     }
 
     /**
-     * This method should reorder the given list of Pod Ids by applying any necessary heuristic 
+     * This method should reorder the given list of Pod Ids by applying any necessary heuristic
      * for this planner
-     * For FirstFitPlanner there is no specific heuristic to be applied 
+     * For FirstFitPlanner there is no specific heuristic to be applied
      * other than the capacity based ordering which is done by default.
      * @return List<Long> ordered list of Pod Ids
      */
@@ -443,7 +444,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     private List<Long> listDisabledPods(long zoneId){
         List<Long> disabledPods = _podDao.listDisabledPods(zoneId);
         return disabledPods;
-    }    
+    }
 
     private Map<Short,Float> getCapacityThresholdMap(){
         // Lets build this real time so that the admin wont have to restart MS if he changes these values
@@ -461,9 +462,9 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     }
 
     private List<Short> getCapacitiesForCheckingThreshold(){
-        List<Short> capacityList = new ArrayList<Short>();    	
+        List<Short> capacityList = new ArrayList<Short>();
         capacityList.add(Capacity.CAPACITY_TYPE_CPU);
-        capacityList.add(Capacity.CAPACITY_TYPE_MEMORY);    	
+        capacityList.add(Capacity.CAPACITY_TYPE_MEMORY);
         return capacityList;
     }
 
@@ -479,7 +480,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
 
         // 	For each capacity get the cluster list crossing the threshold and remove it from the clusterList that will be used for vm allocation.
         for(short capacity : capacityList){
-        	
+
         	if (clusterListForVmAllocation == null || clusterListForVmAllocation.size() == 0){
            		return;
            	}
@@ -492,17 +493,17 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
                         capacityThresholdMap.get(capacity), ram_requested );
             }
 
-           	
+
            	if (clustersCrossingThreshold != null && clustersCrossingThreshold.size() != 0){
                	// addToAvoid Set
            		avoid.addClusterList(clustersCrossingThreshold);
            		// Remove clusters crossing disabled threshold
                	clusterListForVmAllocation.removeAll(clustersCrossingThreshold);
-               	
+
            		s_logger.debug("Cannot allocate cluster list " + clustersCrossingThreshold.toString() + " for vm creation since their allocated percentage" +
            				" crosses the disable capacity threshold: " + capacityThresholdMap.get(capacity) + " for capacity Type : " + capacity + ", skipping these clusters");
            	}
-           	           	           	
+
         }
     }
 
@@ -652,7 +653,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
             public int compare(Volume v1, Volume v2) {
                 if(v1.getSize() < v2.getSize())
                     return 1;
-                else 
+                else
                     return -1;
             }
         });
@@ -749,7 +750,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
                 }else{
                     pool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(plan.getPoolId());
                 }
-                
+
                 if(!pool.isInMaintenance()){
                     if(!avoid.shouldAvoid(pool)){
                         long exstPoolDcId = pool.getDataCenterId();
@@ -781,13 +782,13 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
             if(!isRootAdmin(plan.getReservationContext())){
                 if(!isEnabledForAllocation(plan.getDataCenterId(), plan.getPodId(), plan.getClusterId())){
                     if(s_logger.isDebugEnabled()){
-                        s_logger.debug("Cannot allocate new storagepool for this volume in this cluster, allocation state is disabled");                    
+                        s_logger.debug("Cannot allocate new storagepool for this volume in this cluster, allocation state is disabled");
                         s_logger.debug("Cannot deploy to this specified plan, allocation state is disabled, returning.");
                     }
-                    //Cannot find suitable storage pools under this cluster for this volume since allocation_state is disabled. 
+                    //Cannot find suitable storage pools under this cluster for this volume since allocation_state is disabled.
                     //- remove any suitable pools found for other volumes.
                     //All volumes should get suitable pools under this cluster; else we cant use this cluster.
-                    suitableVolumeStoragePools.clear();                
+                    suitableVolumeStoragePools.clear();
                     break;
                 }
             }
@@ -877,7 +878,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
         super.configure(name, params);
         _allocationAlgorithm = _configDao.getValue(Config.VmAllocationAlgorithm.key());
         return true;
-    }    
+    }
 
     private boolean isEnabledForAllocation(long zoneId, Long podId, Long clusterId){
         // Check if the zone exists in the system


[05/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: sanitize logs for normal running of agents outside systemvm


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

Branch: refs/heads/internallb
Commit: dbf3f9027928c6a0235156ce868b06ac9af4a01d
Parents: 5e72291
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Apr 5 14:11:05 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 .../consoleproxy/ConsoleProxyResource.java         |    4 +-
 .../src/com/cloud/resource/ServerResourceBase.java |    2 +-
 .../AgentBasedConsoleProxyManager.java.orig        |  298 +++++++++++++++
 .../PremiumSecondaryStorageManagerImpl.java        |    6 +-
 .../storage/download/DownloadMonitorImpl.java      |   11 +-
 .../secondary/SecondaryStorageManagerImpl.java     |    2 +-
 .../resource/NfsSecondaryStorageResource.java      |    6 +-
 utils/src/com/cloud/utils/nio/NioClient.java       |    3 +-
 utils/src/com/cloud/utils/nio/NioConnection.java   |    2 +-
 9 files changed, 320 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
index 516430b..991764c 100644
--- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
+++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
@@ -235,14 +235,14 @@ public class ConsoleProxyResource extends ServerResourceBase implements
         if (_eth1ip != null) {
             params.put("private.network.device", "eth1");
         } else {
-            s_logger.warn("WARNING: eth1ip parameter is not found!");
+            s_logger.info("eth1ip parameter has not been configured, assuming that we are not inside a system vm");
         }
 
         String eth2ip = (String) params.get("eth2ip");
         if (eth2ip != null) {
             params.put("public.network.device", "eth2");
         } else {
-            s_logger.warn("WARNING: eth2ip parameter is not found!");
+            s_logger.info("eth2ip parameter is not found, assuming that we are not inside a system vm");
         }
 
         super.configure(name, params);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/core/src/com/cloud/resource/ServerResourceBase.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/resource/ServerResourceBase.java b/core/src/com/cloud/resource/ServerResourceBase.java
index 9449b05..e381fcb 100755
--- a/core/src/com/cloud/resource/ServerResourceBase.java
+++ b/core/src/com/cloud/resource/ServerResourceBase.java
@@ -80,7 +80,7 @@ public abstract class ServerResourceBase implements ServerResource {
         _storageNic2 = getNetworkInterface(storageNic2);
         
         if (_privateNic == null) {
-            s_logger.error("Nics are not configured!");
+            s_logger.warn("Nics are not specified in properties file/db, will try to autodiscover");
 
 			Enumeration<NetworkInterface> nics = null;
             try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
new file mode 100755
index 0000000..134d59d
--- /dev/null
+++ b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
@@ -0,0 +1,298 @@
+// 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.consoleproxy;
+
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.api.GetVncPortAnswer;
+import com.cloud.agent.api.GetVncPortCommand;
+import com.cloud.agent.api.StartupProxyCommand;
+import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.info.ConsoleProxyInfo;
+import com.cloud.keystore.KeystoreManager;
+import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.component.ManagerBase;
+import com.cloud.vm.ConsoleProxyVO;
+import com.cloud.vm.UserVmVO;
+import com.cloud.vm.VMInstanceVO;
+import com.cloud.vm.VirtualMachineManager;
+import com.cloud.vm.dao.ConsoleProxyDao;
+import com.cloud.vm.dao.UserVmDao;
+import com.cloud.vm.dao.VMInstanceDao;
+
+@Local(value = { ConsoleProxyManager.class })
+public class AgentBasedConsoleProxyManager extends ManagerBase implements ConsoleProxyManager {
+    private static final Logger s_logger = Logger.getLogger(AgentBasedConsoleProxyManager.class);
+
+    @Inject
+    protected HostDao _hostDao;
+    @Inject
+    protected UserVmDao _userVmDao;
+    private String _instance;
+    protected String _consoleProxyUrlDomain;
+    @Inject
+    private VMInstanceDao _instanceDao;
+    private ConsoleProxyListener _listener;
+    protected int _consoleProxyUrlPort = ConsoleProxyManager.DEFAULT_PROXY_URL_PORT;
+    protected int _consoleProxyPort = ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT;
+    protected boolean _sslEnabled = false;
+    @Inject
+    AgentManager _agentMgr;
+    @Inject
+    VirtualMachineManager _itMgr;
+    @Inject
+    protected ConsoleProxyDao _cpDao;
+    @Inject
+    protected KeystoreManager _ksMgr;
+
+    @Inject ConfigurationDao _configDao;
+
+    public class AgentBasedAgentHook extends AgentHookBase {
+
+        public AgentBasedAgentHook(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao,
+                KeystoreManager ksMgr, AgentManager agentMgr) {
+            super(instanceDao, hostDao, cfgDao, ksMgr, agentMgr);
+        }
+
+        @Override
+        protected HostVO findConsoleProxyHost(StartupProxyCommand cmd) {
+            return _hostDao.findByGuid(cmd.getGuid());
+        }
+
+    }
+
+    public int getVncPort(VMInstanceVO vm) {
+        if (vm.getHostId() == null) {
+            return -1;
+        }
+        GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getHostName()));
+        return (answer == null || !answer.getResult()) ? -1 : answer.getPort();
+    }
+
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+
+        if (s_logger.isInfoEnabled()) {
+            s_logger.info("Start configuring AgentBasedConsoleProxyManager");
+        }
+
+        Map<String, String> configs = _configDao.getConfiguration("management-server", params);
+        String value = configs.get("consoleproxy.url.port");
+        if (value != null) {
+            _consoleProxyUrlPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_URL_PORT);
+        }
+
+        value = configs.get("consoleproxy.port");
+        if (value != null) {
+            _consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
+        }
+
+        value = configs.get("consoleproxy.sslEnabled");
+        if (value != null && value.equalsIgnoreCase("true")) {
+            _sslEnabled = true;
+        }
+
+        _instance = configs.get("instance.name");
+
+        _consoleProxyUrlDomain = configs.get("consoleproxy.url.domain");
+
+        _listener =
+                new ConsoleProxyListener(new AgentBasedAgentHook(_instanceDao, _hostDao, _configDao, _ksMgr, _agentMgr));
+        _agentMgr.registerForHostEvents(_listener, true, true, false);
+
+        if (s_logger.isInfoEnabled()) {
+            s_logger.info("AgentBasedConsoleProxyManager has been configured. SSL enabled: " + _sslEnabled);
+        }
+        return true;
+    }
+
+    HostVO findHost(VMInstanceVO vm) {
+        return _hostDao.findById(vm.getHostId());
+    }
+
+    @Override
+    public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
+        UserVmVO userVm = _userVmDao.findById(userVmId);
+        if (userVm == null) {
+            s_logger.warn("User VM " + userVmId + " no longer exists, return a null proxy for user vm:" + userVmId);
+            return null;
+        }
+
+        HostVO host = findHost(userVm);
+        if (host != null) {
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Assign embedded console proxy running at " + host.getName() + " to user vm " + userVmId + " with public IP "
+                        + host.getPublicIpAddress());
+            }
+
+            // only private IP, public IP, host id have meaningful values, rest
+            // of all are place-holder values
+            String publicIp = host.getPublicIpAddress();
+            if (publicIp == null) {
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("Host " + host.getName() + "/" + host.getPrivateIpAddress()
+                            + " does not have public interface, we will return its private IP for cosole proxy.");
+                }
+                publicIp = host.getPrivateIpAddress();
+            }
+
+            int urlPort = _consoleProxyUrlPort;
+
+            if (host.getProxyPort() != null && host.getProxyPort().intValue() > 0) {
+                urlPort = host.getProxyPort().intValue();
+            }
+
+            return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort, _consoleProxyUrlDomain);
+        } else {
+            s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
+        }
+        return null;
+    }
+
+
+
+
+    @Override
+    public ConsoleProxyVO startProxy(long proxyVmId) {
+        return null;
+    }
+
+    @Override
+    public boolean destroyProxy(long proxyVmId) {
+        return false;
+    }
+
+    @Override
+    public boolean rebootProxy(long proxyVmId) {
+        return false;
+    }
+
+    @Override
+    public boolean stopProxy(long proxyVmId) {
+        return false;
+    }
+
+    @Override
+    public void setManagementState(ConsoleProxyManagementState state) {
+    }
+
+    @Override
+    public ConsoleProxyManagementState getManagementState() {
+        return null;
+    }
+
+    @Override
+    public void resumeLastManagementState() {
+    }
+
+    @Override
+    public String getName() {
+        return _name;
+    }
+<<<<<<< HEAD
+
+    @Override
+    public Long convertToId(String vmName) {
+        if (!VirtualMachineName.isValidConsoleProxyName(vmName, _instance)) {
+            return null;
+        }
+        return VirtualMachineName.getConsoleProxyId(vmName);
+    }
+
+    @Override
+    public ConsoleProxyVO findByName(String name) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public ConsoleProxyVO findById(long id) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public ConsoleProxyVO persist(ConsoleProxyVO vm) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean finalizeVirtualMachineProfile(VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean finalizeStart(VirtualMachineProfile<ConsoleProxyVO> profile, long hostId, Commands cmds, ReservationContext context) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public void finalizeStop(VirtualMachineProfile<ConsoleProxyVO> profile, StopAnswer answer) {
+        // TODO Auto-generated method stub
+    }
+
+    @Override 
+    public void finalizeExpunge(ConsoleProxyVO proxy) {
+    }
+
+    @Override
+    public boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm,
+            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException,
+            InsufficientCapacityException {
+        //not supported
+        throw new UnsupportedOperationException("Plug nic is not supported for vm of type " + vm.getType());
+    }
+
+
+    @Override
+    public boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm,
+            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {
+        //not supported
+        throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
+    }
+
+    @Override
+    public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
+    }
+}
+=======
+}
+>>>>>>> QuickCloud: refactor to avoid copy paste of authentication and startup code

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java b/server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java
index 73015c1..8658113 100755
--- a/server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java
@@ -25,8 +25,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Command;
 import com.cloud.configuration.Config;
@@ -90,6 +88,10 @@ public class PremiumSecondaryStorageManagerImpl extends SecondaryStorageManagerI
     @Override
 	public Pair<AfterScanAction, Object> scanPool(Long pool) {
 		long dataCenterId = pool.longValue();
+        if (!isSecondaryStorageVmRequired(dataCenterId)) {
+            return new Pair<AfterScanAction, Object>(AfterScanAction.nop, null);
+        }
+
 		Date cutTime = new Date(DateUtil.currentGMTTime().getTime() - _maxExecutionTimeMs);
 
 		_cmdExecLogDao.expungeExpiredRecords(cutTime);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
index cfb92d5..5d7a210 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -851,7 +851,7 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
                 TemplateInfo tmpltInfo = templateInfos.remove(uniqueName);
                 toBeDownloaded.remove(tmplt);
                 if (tmpltHost != null) {
-                    s_logger.info("Template Sync found " + uniqueName + " already in the template host table");
+                    s_logger.info("Template Sync found " + tmplt.getName() + " already in the template host table");
                     if (tmpltHost.getDownloadState() != Status.DOWNLOADED) {
                         tmpltHost.setErrorString("");
                     }
@@ -911,10 +911,12 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
                 continue;
             }
             if (tmpltHost != null && tmpltHost.getDownloadState() != Status.DOWNLOADED) {
-                s_logger.info("Template Sync did not find " + uniqueName + " ready on server " + sserverId + ", will request download to start/resume shortly");
+                s_logger.info("Template Sync did not find " + tmplt.getName() + " ready on server " + sserverId
+                        + ", will request download to start/resume shortly");
 
             } else if (tmpltHost == null) {
-                s_logger.info("Template Sync did not find " + uniqueName + " on the server " + sserverId + ", will request download shortly");
+                s_logger.info("Template Sync did not find " + tmplt.getName() + " on the server " + sserverId
+                        + ", will request download shortly");
                 VMTemplateHostVO templtHost = new VMTemplateHostVO(sserverId, tmplt.getId(), new Date(), 0, Status.NOT_DOWNLOADED, null, null, null, null, tmplt.getUrl());
                 _vmTemplateHostDao.persist(templtHost);
                 VMTemplateZoneVO tmpltZoneVO = _vmTemplateZoneDao.findByZoneTemplate(zoneId, tmplt.getId());
@@ -964,6 +966,9 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
                     }
                     s_logger.debug("Template " + tmplt.getName() + " needs to be downloaded to " + ssHost.getName());
                     downloadTemplateToStorage(tmplt, ssHost);
+                } else {
+                    s_logger.info("Skipping download of template " + tmplt.getName() + " since we don't have any "
+                            + tmplt.getHypervisorType() + " hypervisors");
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index d6d6fc0..3cf9a7e 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -472,7 +472,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
 
     }
 
-    private boolean isSecondaryStorageVmRequired(long dcId) {
+    protected boolean isSecondaryStorageVmRequired(long dcId) {
         DataCenterVO dc = _dcDao.findById(dcId);
         _dcDao.loadDetails(dc);
         String ssvmReq = dc.getDetail(ZoneConfig.EnableSecStorageVm.key());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 6bcf98e..1176d76 100755
--- a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -1464,7 +1464,7 @@ SecondaryStorageResource {
         if (_eth1ip != null) { //can only happen inside service vm
             params.put("private.network.device", "eth1");
         } else {
-            s_logger.warn("Wait, what's going on? eth1ip is null!!");
+            s_logger.warn("eth1ip parameter has not been configured, assuming that we are not inside a system vm");
         }
         String eth2ip = (String) params.get("eth2ip");
         if (eth2ip != null) {
@@ -1479,8 +1479,8 @@ SecondaryStorageResource {
         }
 
         _storageIp = (String) params.get("storageip");
-        if (_storageIp == null) {
-            s_logger.warn("Wait, there is no storageip in /proc/cmdline, something wrong!");
+        if (_storageIp == null && _inSystemVM) {
+            s_logger.warn("There is no storageip in /proc/cmdline, something wrong!");
         }
         _storageNetmask = (String) params.get("storagenetmask");
         _storageGateway = (String) params.get("storagegateway");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/utils/src/com/cloud/utils/nio/NioClient.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/nio/NioClient.java b/utils/src/com/cloud/utils/nio/NioClient.java
index 1e2aa52..8d12f93 100755
--- a/utils/src/com/cloud/utils/nio/NioClient.java
+++ b/utils/src/com/cloud/utils/nio/NioClient.java
@@ -22,8 +22,8 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 
-import javax.net.ssl.SSLEngine;
 import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLEngine;
 
 import org.apache.log4j.Logger;
 
@@ -78,6 +78,7 @@ public class NioClient extends NioConnection {
 
         	Link.doHandshake(sch, sslEngine, true);
         	s_logger.info("SSL: Handshake done");
+            s_logger.info("Connected to " + _host + ":" + _port);
         } catch (Exception e) {
         	_selector.close();
         	throw new IOException("SSL: Fail to init SSL! " + e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbf3f902/utils/src/com/cloud/utils/nio/NioConnection.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/nio/NioConnection.java b/utils/src/com/cloud/utils/nio/NioConnection.java
index 50e6a88..07c2bea 100755
--- a/utils/src/com/cloud/utils/nio/NioConnection.java
+++ b/utils/src/com/cloud/utils/nio/NioConnection.java
@@ -107,7 +107,7 @@ public abstract class NioConnection implements Runnable {
     		try {
     			init();
     		} catch (ConnectException e) {
-    			s_logger.error("Unable to connect to remote");
+                s_logger.warn("Unable to connect to remote: is there a server running on port " + _port);
     			return;
     		} catch (IOException e) {
     			s_logger.error("Unable to initialize the threads.", e);


[38/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Feed more disk space to /usr

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: dc1bcd8f4c683605da3df85449e4ecc7adaccfc5
Parents: dd67564
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 16:47:33 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg       |    6 +++---
 .../definitions/systemvmtemplate64/preseed.cfg     |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc1bcd8f/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index 5d699c8..4050498 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              200 40 400 ext4                                 \
+              250 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,12 +146,12 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              750 20 1100 ext4                                \
+              950 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
               .                                               \
-              400 40 500 ext4                                 \
+              300 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc1bcd8f/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index 5d699c8..4050498 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              200 40 400 ext4                                 \
+              250 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,12 +146,12 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              750 20 1100 ext4                                \
+              950 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
               .                                               \
-              400 40 500 ext4                                 \
+              300 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \


[43/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1837: Documenting additional upgrade steps.


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

Branch: refs/heads/internallb
Commit: 46af2eb616a871f19cd33193f0d9740639687c01
Parents: edbb030
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Wed Apr 10 10:43:01 2013 -0500
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 docs/en-US/Release_Notes.xml |   70 ++++++++++++++++++++++++++----------
 1 files changed, 50 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/46af2eb6/docs/en-US/Release_Notes.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml
index 4535fd8..b8c5c01 100644
--- a/docs/en-US/Release_Notes.xml
+++ b/docs/en-US/Release_Notes.xml
@@ -33,7 +33,7 @@ under the License.
         <para>If you run into any issues during upgrades, please feel free to ask questions on users@apache.cloudstack.org or dev@apache.cloudstack.org.</para>
         <section id="upgrade-from-4.0-to-4.1">
             <title>Upgrade from 4.0.x to 4.1.0</title>
-            <para>This section will guide you from Apache CloudStack 4.0.x versions (4.0.0-incubating, 4.0.1-incubating, and 4.0.2) to &PRODUCT; 4.1.0.</para>
+            <para>This section will guide you from Apache CloudStack 4.0.x versions to &PRODUCT; 4.1.0.</para>
             <para>Any steps that are hypervisor-specific will be called out with a note.</para>
             <warning><title>Package Structure Changes</title>
                 <para>The package structure for &PRODUCT; has changed significantly since the 4.0.x releases. If you've compiled your own packages, you'll notice that the package names and the number of packages has changed. This is <emphasis>not</emphasis> a bug.</para>
@@ -51,6 +51,10 @@ under the License.
                     <programlisting><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
                 <listitem>
+                    <para>If you are running a usage server or usage servers, stop those as well:</para>
+                    <programlisting><prompt>#</prompt> service cloud-usage stop</programlisting>
+                </listitem>
+                <listitem>
                     <para>Make a backup of your MySQL database. If you run into any issues or need to roll back the upgrade, this will assist in debugging or restoring your existing environment. You'll be prompted for your password.</para>
                     <programlisting><prompt>#</prompt> mysqldump -u root -p cloud &gt; cloudstack-backup.sql</programlisting>
                 </listitem>
@@ -61,19 +65,6 @@ under the License.
                 <listitem>
                     <para>If you have made changes to <filename>/etc/cloud/management/components.xml</filename>, you'll need to carry these over manually to the new file, <filename>/etc/cloudstack/management/componentContext.xml</filename>. This is not done automatically. (If you're unsure, we recommend making a backup of the original <filename>components.xml</filename> to be on the safe side.</para>
                 </listitem>
-                <listitem>
-                    <note><title>For AWS API Users Only</title>
-                        <para>This step is only necessary if you're using the AWS APIs with &PRODUCT;. If not, you can skip this step.</para>
-                    </note>
-                    <para>The file <filename>/etc/cloud/management/db.properties</filename> will be carried over to <filename>etc/cloudstack/management/db.properties</filename>, but the parameters for the AWS API are <emphasis>not</emphasis> carried over. You'll need to add these parameters to the new file manually:</para>
-                    <programlisting language="Bash">
-db.awsapi.username=
-db.awsapi.password=
-db.awsapi.host=
-db.awsapi.port=
-                    </programlisting>
-                    <para>For the AWS API queries to work, you'll need to copy those over to <filename>/etc/cloudstack/management/db.properties</filename> (with the values you have currently).</para>
-                </listitem>
                 <listitem id="upgrade-deb-packages">
                     <para>If you are using Ubuntu, follow this procedure to upgrade your packages. If not, skip to step <xref linkend="upgrade-rpm-packages" />.</para> 
                     <note><title>Community Packages</title>
@@ -110,12 +101,51 @@ db.awsapi.port=
                         </listitem>
                         <listitem>
                             <para>Restart the agent:</para>
+                            <programlisting language="Bash">
+service cloud-agent stop
+killall jsvc
+service cloudstack-agent start
+                            </programlisting>
                         </listitem>
+                        <listitem>
+                            <para>During the upgrade, <filename>log4j-cloud.xml</filename> was simply copied over, so the logs will continue to be added to <filename>/var/log/cloud/agent/agent.log</filename>. There's nothing <emphasis>wrong</emphasis> with this, but if you prefer to be consistent, you can change this by copying over the sample configuration file:</para>
+                            <programlisting language="Bash">
+cd /etc/cloudstack/agent
+mv log4j-cloud.xml.dpkg-dist log4j-cloud.xml
+service cloudstack-agent restart
+                            </programlisting>
+                        </listitem>
+                        <listitem>
+                            <para>Once the agent is running, you can uninstall the old cloud-* packages from your system:</para>
+                            <programlisting language="Bash">sudo dpkg --purge cloud-agent</programlisting>
+                        </listitem> 
                     </orderedlist>
                 </listitem>
                 <listitem id="upgrade-rpm-packages">
                     <para>The package names have changed between 4.0 and 4.1, so upgrading the packages won't happen automatically with a <command>yum update</command></para> 
                 </listitem>
+                <listitem id="restart-system-vms">
+                    <para>Once you've upgraded the packages on your management servers, you'll need to restart the system VMs. Make sure port 8096 is open <!-- [FIXME, where?] --> to do this.</para>
+                    <para>There is a script that will do this for you, all you need to do is run the script and supply the IP address for your MySQL instance and your MySQL credentials:</para>
+                    <programlisting language="Bash"><prompt>#</prompt> nohup cloudstack-sysvmadm -d <replaceable>IP address</replaceable> -u cloud -p -a &gt; sysvm.log 2&gt;&amp;1 &amp;</programlisting>
+                    <para>You can monitor the log for progress. The process of restarting the system VMs can take an hour or more.</para>
+                    <programlisting language="Bash"><prompt>#</prompt> tail -f sysvm.log</programlisting>
+                    <para>The output to <filename>sysvm.log</filename> will look something like this:</para>
+                    <programlisting language="Bash">
+Stopping and starting 1 secondary storage vm(s)...
+Done stopping and starting secondary storage vm(s)
+Stopping and starting 1 console proxy vm(s)...
+Done stopping and starting console proxy vm(s).
+Stopping and starting 4 running routing vm(s)...
+Done restarting router(s).
+                    </programlisting>
+                </listitem>
+                <listitem>
+                    <note><title>For Xen Hosts: Copy vhd-utils</title>
+                        <para>This step is only for CloudStack installs that are using Xen hosts.</para>
+                    </note>
+                    <para>Copy the file <filename>vhd-utils</filename> to <filename>/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver</filename>.</para>
+                </listitem> 
             </orderedlist>
         </section>
         <section id="upgrade-from-3.0.2-to-4.0">
@@ -856,12 +886,12 @@ db.awsapi.port=
                             <programlisting><prompt>#</prompt> <command>tail</command> -f <filename>sysvm.log</filename></programlisting>
                             <para>The content should be like the following:</para>
                             <programlisting>
-                                Stopping and starting 1 secondary storage vm(s)...
-                                Done stopping and starting secondary storage vm(s)
-                                Stopping and starting 1 console proxy vm(s)...
-                                Done stopping and starting console proxy vm(s).
-                                Stopping and starting 4 running routing vm(s)...
-                                Done restarting router(s).
+Stopping and starting 1 secondary storage vm(s)...
+Done stopping and starting secondary storage vm(s)
+Stopping and starting 1 console proxy vm(s)...
+Done stopping and starting console proxy vm(s).
+Stopping and starting 4 running routing vm(s)...
+Done restarting router(s).
                             </programlisting>
                         </listitem>
                     </orderedlist>


[23/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Make more room in /usr, installing vmwaretools takes 'em all

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: dd67564aec32130d37bb711d9d1a36c55e7ff510
Parents: 62cb02e
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 16:23:21 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/postinstall.sh    |    1 +
 .../definitions/systemvmtemplate/preseed.cfg       |    4 ++--
 .../definitions/systemvmtemplate64/postinstall.sh  |    1 +
 .../definitions/systemvmtemplate64/preseed.cfg     |    4 ++--
 4 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd67564a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index bf593b6..c0a7e87 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -67,6 +67,7 @@ install_packages() {
   # uncomment for opensource vmware tool:
   #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  df -h
   PREVDIR=$PWD
   cd /opt
   wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd67564a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index aa75e13..5d699c8 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              300 40 500 ext4                                 \
+              200 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              650 30 1000 ext4                                \
+              750 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd67564a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
index bf593b6..c0a7e87 100644
--- a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
@@ -67,6 +67,7 @@ install_packages() {
   # uncomment for opensource vmware tool:
   #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  df -h
   PREVDIR=$PWD
   cd /opt
   wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd67564a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index aa75e13..5d699c8 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              300 40 500 ext4                                 \
+              200 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              650 30 1000 ext4                                \
+              750 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \


[47/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-779 Egress firewall rules support for Juniper SRX


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

Branch: refs/heads/internallb
Commit: 61b4c5c7227a653547dc6895601daa98a30bb6da
Parents: c9f42eb
Author: Jayapal <ja...@citrix.com>
Authored: Wed Apr 10 18:04:02 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/to/FirewallRuleTO.java |    6 +
 .../element/JuniperSRXExternalFirewallElement.java |    2 +-
 .../cloud/network/resource/JuniperSrxResource.java |  322 +++++++++++----
 scripts/network/juniper/application-add.xml        |    2 +-
 scripts/network/juniper/security-policy-add.xml    |    4 +-
 .../network/ExternalFirewallDeviceManagerImpl.java |   12 +-
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |   60 +++
 7 files changed, 328 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
index 7f77936..f296aa4 100644
--- a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
@@ -23,6 +23,7 @@ import org.apache.cloudstack.api.InternalIdentity;
 
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.State;
+import com.cloud.network.rules.FirewallRule.TrafficType;
 import com.cloud.utils.net.NetUtils;
 
 /**
@@ -109,6 +110,11 @@ public class FirewallRuleTO implements InternalIdentity {
         this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), revokeState, alreadyAdded, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
     }
 
+    public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType) {
+        this(rule.getId(), guestVlanTag, null, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(), rule.getSourceCidrList(), rule.getIcmpType(), rule.getIcmpCode());
+        this.trafficType = trafficType;
+    }
+
     public FirewallRule.TrafficType getTrafficType(){
         return trafficType;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
index af0912a..64b0f5a 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
@@ -274,7 +274,7 @@ PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer, Junip
         firewallCapabilities.put(Capability.SupportedProtocols, "tcp,udp,icmp");
         firewallCapabilities.put(Capability.MultipleIps, "true");
         firewallCapabilities.put(Capability.TrafficStatistics, "per public ip");
-        firewallCapabilities.put(Capability.SupportedTrafficDirection, "ingress");
+        firewallCapabilities.put(Capability.SupportedTrafficDirection, "ingress, egress");
         capabilities.put(Service.Firewall, firewallCapabilities);
 
         // Disabling VPN for Juniper in Acton as it 1) Was never tested 2) probably just doesn't work

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
index 8482168..a0068c3 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
@@ -303,7 +303,7 @@ public class JuniperSrxResource implements ServerResource {
     }
 
     private enum Protocol {
-        tcp, udp, icmp, any;
+        tcp, udp, icmp, all, any;
     }
 
     private enum RuleMatchCondition {
@@ -320,7 +320,8 @@ public class JuniperSrxResource implements ServerResource {
     private enum SecurityPolicyType {
         STATIC_NAT("staticnat"),
         DESTINATION_NAT("destnat"),
-        VPN("vpn");
+        VPN("vpn"),
+        SECURITYPOLICY_EGRESS("egress");
 
         private String identifier;
 
@@ -776,6 +777,43 @@ public class JuniperSrxResource implements ServerResource {
         s_logger.debug(msg);
     }
 
+    private Map<String, ArrayList<FirewallRuleTO>> getActiveFirewallEgressRules(FirewallRuleTO[] allRules) {
+        Map<String, ArrayList<FirewallRuleTO>> activeRules = new HashMap<String, ArrayList<FirewallRuleTO>>();
+
+        for (FirewallRuleTO rule : allRules) {
+            String guestVlan;
+            guestVlan = rule.getSrcVlanTag();
+
+            ArrayList<FirewallRuleTO> activeRulesForNetwork = activeRules.get(guestVlan);
+
+            if (activeRulesForNetwork == null) {
+                activeRulesForNetwork = new ArrayList<FirewallRuleTO>();
+            }
+
+            if (!rule.revoked() || rule.isAlreadyAdded()) {
+                activeRulesForNetwork.add(rule);
+            }
+
+            activeRules.put(guestVlan, activeRulesForNetwork);
+        }
+
+        return activeRules;
+    }
+
+    private List<String> extractCidrs(List<FirewallRuleTO> rules) throws ExecutionException {
+        List<String> allCidrs = new ArrayList<String>();
+        List<String> cidrs = new ArrayList<String>();
+
+        for (FirewallRuleTO rule : rules) {
+            cidrs = (rule.getSourceCidrList());
+            for (String cidr: cidrs) {
+                if (!allCidrs.contains(cidr)) {
+                    allCidrs.add(cidr);
+                }
+            }
+        }
+        return allCidrs;
+    }
 
     /* security policies */
     private synchronized Answer execute(SetFirewallRulesCommand cmd) {
@@ -787,24 +825,39 @@ public class JuniperSrxResource implements ServerResource {
         FirewallRuleTO[] rules = cmd.getRules();
         try {
             openConfiguration();
+            if (rules[0].getTrafficType() == FirewallRule.TrafficType.Egress) {
+                Map<String, ArrayList<FirewallRuleTO>> activeRules = getActiveFirewallEgressRules(rules);
+                Set<String> guestVlans = activeRules.keySet();
+                List<String> cidrs = new ArrayList();
 
-            for (FirewallRuleTO rule : rules) {
-                int startPort = 0, endPort = 0;
-                if (rule.getSrcPortRange() != null) {
-                    startPort = rule.getSrcPortRange()[0];
-                    endPort = rule.getSrcPortRange()[1];
+                for (String guestVlan : guestVlans) {
+                    List<FirewallRuleTO> activeRulesForGuestNw = activeRules.get(guestVlan);
+
+                    removeEgressSecurityPolicyAndApplications(SecurityPolicyType.SECURITYPOLICY_EGRESS, guestVlan, extractCidrs(activeRulesForGuestNw));
+                    if (activeRulesForGuestNw.size() > 0) {
+                        addEgressSecurityPolicyAndApplications(SecurityPolicyType.SECURITYPOLICY_EGRESS, guestVlan, extractApplications(activeRulesForGuestNw), extractCidrs(activeRulesForGuestNw));
+                    }
                 }
-                FirewallFilterTerm term = new FirewallFilterTerm(genIpIdentifier(rule.getSrcIp()) + "-" + String.valueOf(rule.getId()), rule.getSourceCidrList(), 
-                        rule.getSrcIp(), rule.getProtocol(), startPort, endPort,
-                        rule.getIcmpType(), rule.getIcmpCode(), genIpIdentifier(rule.getSrcIp()) + _usageFilterIPInput.getCounterIdentifier());
-                if (!rule.revoked()) {
-                    manageFirewallFilter(SrxCommand.ADD, term, _publicZoneInputFilterName);
-                } else {
-                    manageFirewallFilter(SrxCommand.DELETE, term, _publicZoneInputFilterName);
+                commitConfiguration();
+            } else {
+                for (FirewallRuleTO rule : rules) {
+                    int startPort = 0, endPort = 0;
+                    if (rule.getSrcPortRange() != null) {
+                        startPort = rule.getSrcPortRange()[0];
+                        endPort = rule.getSrcPortRange()[1];
+                        FirewallFilterTerm term = new FirewallFilterTerm(genIpIdentifier(rule.getSrcIp()) + "-" + String.valueOf(rule.getId()), rule.getSourceCidrList(),
+                                rule.getSrcIp(), rule.getProtocol(), startPort, endPort,
+                                rule.getIcmpType(), rule.getIcmpCode(), genIpIdentifier(rule.getSrcIp()) + _usageFilterIPInput.getCounterIdentifier());
+                        if (!rule.revoked()) {
+                            manageFirewallFilter(SrxCommand.ADD, term, _publicZoneInputFilterName);
+                        } else {
+                            manageFirewallFilter(SrxCommand.DELETE, term, _publicZoneInputFilterName);
+                        }
+                    }
+                    commitConfiguration();
                 }
             }
                 
-            commitConfiguration();
             return new Answer(cmd);
         } catch (ExecutionException e) {
             s_logger.error(e);
@@ -992,7 +1045,7 @@ public class JuniperSrxResource implements ServerResource {
 		
 		// Delete all security policies
 		for (String securityPolicyName : getVpnObjectNames(SrxXml.SECURITY_POLICY_GETALL, accountId)) {
-			manageSecurityPolicy(SecurityPolicyType.VPN, SrxCommand.DELETE, accountId, null, null, null, securityPolicyName);
+            manageSecurityPolicy(SecurityPolicyType.VPN, SrxCommand.DELETE, accountId, null, null, null, null, securityPolicyName);
 		}
 		
 		// Delete all address book entries 
@@ -1064,7 +1117,7 @@ public class JuniperSrxResource implements ServerResource {
     			manageAddressBookEntry(srxCmd, _privateZone , guestNetworkCidr, ipsecVpnName);
     			
     			// Security policy
-    			manageSecurityPolicy(SecurityPolicyType.VPN, srxCmd, null, null, guestNetworkCidr, null, ipsecVpnName);
+                manageSecurityPolicy(SecurityPolicyType.VPN, srxCmd, null, null, guestNetworkCidr, null, null, ipsecVpnName);
     		}
     		
     		commitConfiguration();
@@ -2455,38 +2508,44 @@ public class JuniperSrxResource implements ServerResource {
      * Applications
      */
 
-    private String genApplicationName(Protocol protocol, int startPort, int endPort) {
+    private String genApplicationName(SecurityPolicyType type, Protocol protocol, int startPort, int endPort) {
         if (protocol.equals(Protocol.any)) {
             return Protocol.any.toString();
         } else {
-            return genObjectName(protocol.toString(), String.valueOf(startPort), String.valueOf(endPort));
+            if (type.equals(SecurityPolicyType.SECURITYPOLICY_EGRESS)) {
+                return genObjectName(type.getIdentifier(), protocol.toString(), String.valueOf(startPort), String.valueOf(endPort));
+            } else {
+                return genObjectName(protocol.toString(), String.valueOf(startPort), String.valueOf(endPort));
+            }
         }
     }
 
-    private Object[] parseApplicationName(String applicationName) throws ExecutionException {
+    private Object[] parseApplicationName(SecurityPolicyType type, String applicationName) throws ExecutionException {
         String errorMsg = "Invalid application: " + applicationName;
         String[] applicationComponents = applicationName.split("-");
 
         Protocol protocol;
         Integer startPort;
         Integer endPort;
+        int offset = 0;
         try {
-            protocol = getProtocol(applicationComponents[0]);			
-            startPort = Integer.parseInt(applicationComponents[1]);
-            endPort = Integer.parseInt(applicationComponents[2]);
-        } catch (Exception e) {
+            offset = type.equals(SecurityPolicyType.SECURITYPOLICY_EGRESS) ? 1 : 0;
+            protocol = getProtocol(applicationComponents[offset + 0]);
+            startPort = Integer.parseInt(applicationComponents[offset + 1]);
+            endPort = Integer.parseInt(applicationComponents[offset + 2]);
+            } catch (Exception e) {
             throw new ExecutionException(errorMsg);
         }
 
         return new Object[]{protocol, startPort, endPort};
     }
 
-    private boolean manageApplication(SrxCommand command, Protocol protocol, int startPort, int endPort) throws ExecutionException {
+    private boolean manageApplication(SecurityPolicyType type, SrxCommand command, Protocol protocol, int startPort, int endPort) throws ExecutionException {
         if (protocol.equals(Protocol.any)) {
             return true;
         }
 
-        String applicationName = genApplicationName(protocol, startPort, endPort);
+        String applicationName = genApplicationName(type, protocol, startPort, endPort);
         String xml;
 
         switch (command) {
@@ -2498,23 +2557,28 @@ public class JuniperSrxResource implements ServerResource {
             return sendRequestAndCheckResponse(command, xml, "name", applicationName);
 
         case ADD:
-            if (manageApplication(SrxCommand.CHECK_IF_EXISTS, protocol, startPort, endPort)) {
+            if (manageApplication(type, SrxCommand.CHECK_IF_EXISTS, protocol, startPort, endPort)) {
                 return true;
             }
-
+            String icmpOrDestPort;
             xml = SrxXml.APPLICATION_ADD.getXml();
             xml = replaceXmlValue(xml, "name", applicationName);
             xml = replaceXmlValue(xml, "protocol", protocol.toString());
-
-            String destPort;
-            if (startPort == endPort) {
-                destPort = String.valueOf(startPort);
+            if (protocol.toString() == Protocol.icmp.toString()) {
+                icmpOrDestPort = "<icmp-type>" + startPort + "</icmp-type>";
+                icmpOrDestPort += "<icmp-code>" + endPort + "</icmp-code>";
             } else {
-                destPort = startPort + "-" + endPort;
-            }
+                String destPort;
 
-            xml = replaceXmlValue(xml, "dest-port", destPort);
+                if (startPort == endPort) {
+                    destPort = String.valueOf(startPort);
+                } else {
+                    destPort = startPort + "-" + endPort;
+                }
+                icmpOrDestPort = "<destination-port>" + destPort + "</destination-port>";
+            }
 
+            xml = replaceXmlValue(xml, "dest-port-icmp", icmpOrDestPort);
             if (!sendRequestAndCheckResponse(command, xml)) {
                 throw new ExecutionException("Failed to add application " + applicationName);
             } else {
@@ -2522,7 +2586,7 @@ public class JuniperSrxResource implements ServerResource {
             }
 
         case DELETE:
-            if (!manageApplication(SrxCommand.CHECK_IF_EXISTS, protocol, startPort, endPort)) {
+            if (!manageApplication(type, SrxCommand.CHECK_IF_EXISTS, protocol, startPort, endPort)) {
                 return true;
             }
 
@@ -2543,13 +2607,13 @@ public class JuniperSrxResource implements ServerResource {
 
     }
 
-    private List<String> getUnusedApplications(List<String> applications) throws ExecutionException {
+    private List<String> getUnusedApplications(List<String> applications, String fromZone, String toZone) throws ExecutionException {
         List<String> unusedApplications = new ArrayList<String>();
 
         // Check if any of the applications are unused by existing security policies
         String xml = SrxXml.SECURITY_POLICY_GETALL.getXml();
-        xml = replaceXmlValue(xml, "from-zone", _publicZone);
-        xml = replaceXmlValue(xml, "to-zone", _privateZone);
+        xml = replaceXmlValue(xml, "from-zone", fromZone);
+        xml = replaceXmlValue(xml, "to-zone", toZone);
         String allPolicies = sendRequest(xml);
 
         for (String application : applications) {
@@ -2560,10 +2624,7 @@ public class JuniperSrxResource implements ServerResource {
 
         return unusedApplications;
     }
-    
-    private List<String> getApplicationsForSecurityPolicy(SecurityPolicyType type, String privateIp) throws ExecutionException {
-        String fromZone = _publicZone;
-        String toZone = _privateZone;
+    private List<String> getApplicationsForSecurityPolicy(SecurityPolicyType type, String privateIp, String fromZone, String toZone) throws ExecutionException {
         String policyName = genSecurityPolicyName(type, null, null, fromZone, toZone, privateIp);
         String xml = SrxXml.SECURITY_POLICY_GETONE.getXml();
         xml = setDelete(xml, false);
@@ -2591,8 +2652,31 @@ public class JuniperSrxResource implements ServerResource {
         for (FirewallRuleTO rule : rules) {
             Object[] application = new Object[3];
             application[0] = getProtocol(rule.getProtocol());
-            application[1] = rule.getSrcPortRange()[0];
-            application[2] = rule.getSrcPortRange()[1];
+            if (application[0] == Protocol.icmp) {
+                if (rule.getIcmpType() == -1) {
+                    application[1] = 255;
+                } else {
+                    application[1] = rule.getIcmpType();
+                }
+
+                if (rule.getIcmpCode() == -1) {
+                    application[2] = 255;
+                } else {
+                    application[2] = rule.getIcmpCode();
+                }
+            } else if (application[0] == Protocol.tcp || application[0] == Protocol.udp) {
+                if (rule.getSrcPortRange() != null) {
+                    application[1] = rule.getSrcPortRange()[0];
+                    application[2] = rule.getSrcPortRange()[1];
+                } else {
+                    application[1] = 0;
+                    application[2] = 65535;
+                }
+            } else if (application[0] == Protocol.all) {
+                application[1] = 0;
+                application[2] = 65535;
+            }
+
             applications.add(application);
         }
 
@@ -2611,16 +2695,20 @@ public class JuniperSrxResource implements ServerResource {
         }    		    
     }
 
-    private boolean manageSecurityPolicy(SecurityPolicyType type, SrxCommand command, Long accountId, String username, String privateIp, List<String> applicationNames, String ipsecVpnName) throws ExecutionException {
+    private boolean manageSecurityPolicy(SecurityPolicyType type, SrxCommand command, Long accountId, String username, String privateIp, List<String> applicationNames, List<String> cidrs, String ipsecVpnName) throws ExecutionException {
         String fromZone = _publicZone;
         String toZone = _privateZone;
         
         String securityPolicyName;
-        String addressBookEntryName;
-        
+        String addressBookEntryName = null;
+
         if (type.equals(SecurityPolicyType.VPN) && ipsecVpnName != null) {
-        	securityPolicyName = ipsecVpnName;
-        	addressBookEntryName = ipsecVpnName;
+            securityPolicyName = ipsecVpnName;
+            addressBookEntryName = ipsecVpnName;
+        } else if (type.equals(SecurityPolicyType.SECURITYPOLICY_EGRESS)) {
+            fromZone = _privateZone;
+            toZone = _publicZone;
+            securityPolicyName = genSecurityPolicyName(type, accountId, username, fromZone, toZone, privateIp);
         } else {
         	securityPolicyName = genSecurityPolicyName(type, accountId, username, fromZone, toZone, privateIp);
             addressBookEntryName = genAddressBookEntryName(privateIp);
@@ -2661,17 +2749,38 @@ public class JuniperSrxResource implements ServerResource {
             return false;
 
         case ADD:
-            if (!manageAddressBookEntry(SrxCommand.CHECK_IF_EXISTS, toZone, privateIp, ipsecVpnName)) {
-                throw new ExecutionException("No address book entry for policy: " + securityPolicyName);
+            if (!type.equals(SecurityPolicyType.SECURITYPOLICY_EGRESS)) {
+                if (!manageAddressBookEntry(SrxCommand.CHECK_IF_EXISTS, toZone, privateIp, addressBookEntryName)) {
+                    throw new ExecutionException("No address book entry for policy: " + securityPolicyName);
+                }
+            }
+
+            String srcAddrs = "";
+            String dstAddrs = "";
+            xml = SrxXml.SECURITY_POLICY_ADD.getXml();
+            xml = replaceXmlValue(xml, "policy-name", securityPolicyName);
+            if (type.equals(SecurityPolicyType.SECURITYPOLICY_EGRESS)) {
+                xml = replaceXmlValue(xml, "from-zone", _privateZone);
+                xml = replaceXmlValue(xml, "to-zone", _publicZone);
+                if (cidrs == null) {
+                    srcAddrs = "<source-address>any</source-address>";
+                } else {
+                    for (String cidr : cidrs) {
+                        srcAddrs += "<source-address>" + genAddressBookEntryName(cidr) + "</source-address>";
+                    }
+                }
+                xml = replaceXmlValue(xml, "src-address", srcAddrs);
+                dstAddrs = "<destination-address>any</destination-address>";
+                xml = replaceXmlValue(xml, "dst-address", dstAddrs);
+            } else {
+                xml = replaceXmlValue(xml, "from-zone", fromZone);
+                xml = replaceXmlValue(xml, "to-zone", toZone);
+                srcAddrs = "<source-address>any</source-address>";
+                xml = replaceXmlValue(xml, "src-address", srcAddrs);
+                dstAddrs = "<destination-address>" + addressBookEntryName + "</destination-address>";
+                xml = replaceXmlValue(xml, "dst-address", dstAddrs);
             }
 
-            xml = SrxXml.SECURITY_POLICY_ADD.getXml();            	            	
-            xml = replaceXmlValue(xml, "from-zone", fromZone);
-            xml = replaceXmlValue(xml, "to-zone", toZone);            
-            xml = replaceXmlValue(xml, "policy-name", securityPolicyName);            
-            xml = replaceXmlValue(xml, "src-address", "any");    
-            xml = replaceXmlValue(xml, "dest-address", addressBookEntryName);
-            
             if (type.equals(SecurityPolicyType.VPN) && ipsecVpnName != null) {
             	xml = replaceXmlValue(xml, "tunnel", "<tunnel><ipsec-vpn>" + ipsecVpnName + "</ipsec-vpn></tunnel>");
             } else {      	
@@ -2679,7 +2788,7 @@ public class JuniperSrxResource implements ServerResource {
             }
                         
             String applications;
-            if (applicationNames == null) {
+            if (applicationNames == null || applicationNames.size() == 0) {
             	applications = "<application>any</application>";
             } else {
             	applications = "";
@@ -2697,11 +2806,11 @@ public class JuniperSrxResource implements ServerResource {
             }
 
         case DELETE:
-            if (!manageSecurityPolicy(type, SrxCommand.CHECK_IF_EXISTS, null, null, privateIp, applicationNames, ipsecVpnName)) {
+            if (!manageSecurityPolicy(type, SrxCommand.CHECK_IF_EXISTS, null, null, privateIp, applicationNames, cidrs, ipsecVpnName)) {
                 return true;
             }
 
-            if (manageSecurityPolicy(type, SrxCommand.CHECK_IF_IN_USE, null, null, privateIp, applicationNames, ipsecVpnName)) {
+            if (manageSecurityPolicy(type, SrxCommand.CHECK_IF_IN_USE, null, null, privateIp, applicationNames, cidrs, ipsecVpnName)) {
                 return true;
             }
 
@@ -2757,42 +2866,77 @@ public class JuniperSrxResource implements ServerResource {
             int startPort = application[1] != null ? ((Integer) application[1]) : -1;
             int endPort = application[2] != null ? ((Integer) application[2]) : -1;
 
-            String applicationName = genApplicationName(protocol, startPort, endPort);
+            String applicationName = genApplicationName(type, protocol, startPort, endPort);
             if (!applicationNames.contains(applicationName)) {
                 applicationNames.add(applicationName);
             }
 
-            manageApplication(SrxCommand.ADD, protocol, startPort, endPort);
+            manageApplication(type, SrxCommand.ADD, protocol, startPort, endPort);
         }
 
         // Add a new security policy
-        manageSecurityPolicy(type, SrxCommand.ADD, null, null, privateIp, applicationNames, null);
+        manageSecurityPolicy(type, SrxCommand.ADD, null, null, privateIp, applicationNames, null, null);
 
         return true;
     }
 
     private boolean removeSecurityPolicyAndApplications(SecurityPolicyType type, String privateIp) throws ExecutionException {
-        if (!manageSecurityPolicy(type, SrxCommand.CHECK_IF_EXISTS, null, null, privateIp, null, null)) {
+        if (!manageSecurityPolicy(type, SrxCommand.CHECK_IF_EXISTS, null, null, privateIp, null,null, null)) {
             return true;
         }
 
-        if (manageSecurityPolicy(type, SrxCommand.CHECK_IF_IN_USE, null, null, privateIp, null, null)) {
+        if (manageSecurityPolicy(type, SrxCommand.CHECK_IF_IN_USE, null, null, privateIp, null, null, null)) {
             return true;
         }
 
         // Get a list of applications for this security policy
-        List<String> applications = getApplicationsForSecurityPolicy(type, privateIp);
+        List<String> applications = getApplicationsForSecurityPolicy(type, privateIp, _publicZone, _privateZone);
+
+        // Remove the security policy
+        manageSecurityPolicy(type, SrxCommand.DELETE, null, null, privateIp, null, null, null);
+
+        // Remove any applications for the removed security policy that are no longer in use
+        List<String> unusedApplications = getUnusedApplications(applications, _publicZone, _privateZone);
+        for (String application : unusedApplications) {
+            Object[] applicationComponents;
+
+            try {
+                applicationComponents = parseApplicationName(type, application);
+            } catch (ExecutionException e) {
+                s_logger.error("Found an invalid application: " + application + ". Not attempting to clean up.");
+                continue;
+            }
+
+            Protocol protocol = (Protocol) applicationComponents[0];
+            Integer startPort = (Integer) applicationComponents[1];
+            Integer endPort = (Integer) applicationComponents[2];
+            manageApplication(type, SrxCommand.DELETE, protocol, startPort, endPort);
+        }
+
+        return true;
+    }
+
+
+    private boolean removeEgressSecurityPolicyAndApplications(SecurityPolicyType type, String guestVlan, List <String> cidrs) throws ExecutionException {
+        if (!manageSecurityPolicy(type, SrxCommand.CHECK_IF_EXISTS, null, null, guestVlan, null, cidrs, null)) {
+            return true;
+        }
+        // Get a list of applications for this security policy
+        List<String> applications;
+        applications = getApplicationsForSecurityPolicy(type, guestVlan, _privateZone, _publicZone);
 
-        // Remove the security policy 
-        manageSecurityPolicy(type, SrxCommand.DELETE, null, null, privateIp, null, null);
+        // Remove the security policy even if it is in use
+        manageSecurityPolicy(type, SrxCommand.DELETE, null, null, guestVlan, null, cidrs, null);
 
         // Remove any applications for the removed security policy that are no longer in use
-        List<String> unusedApplications = getUnusedApplications(applications);
+        List<String> unusedApplications;
+        unusedApplications = getUnusedApplications(applications, _privateZone, _publicZone);
+
         for (String application : unusedApplications) {
             Object[] applicationComponents;
 
             try {
-                applicationComponents = parseApplicationName(application);
+                applicationComponents = parseApplicationName(type, application);
             } catch (ExecutionException e) {
                 s_logger.error("Found an invalid application: " + application + ". Not attempting to clean up.");
                 continue;
@@ -2800,13 +2944,43 @@ public class JuniperSrxResource implements ServerResource {
 
             Protocol protocol = (Protocol) applicationComponents[0];
             Integer startPort = (Integer) applicationComponents[1];
-            Integer endPort = (Integer) applicationComponents[2];			
-            manageApplication(SrxCommand.DELETE, protocol, startPort, endPort);	
+            Integer endPort = (Integer) applicationComponents[2];
+            manageApplication(type, SrxCommand.DELETE, protocol, startPort, endPort);
         }
+        for (String cidr: cidrs) {
+            manageAddressBookEntry(SrxCommand.DELETE, _publicZone, cidr, null);
+            }
 
         return true;
     }
 
+    private boolean addEgressSecurityPolicyAndApplications(SecurityPolicyType type, String guestVlan, List<Object[]> applications, List <String> cidrs) throws ExecutionException {
+        // Add all necessary applications
+        List<String> applicationNames = new ArrayList<String>();
+        for (Object[] application : applications) {
+            Protocol protocol = (Protocol) application[0];
+            if (!protocol.equals(Protocol.all)) {
+                int startPort = application[1] != null ? ((Integer) application[1]) : 0;
+                int endPort = application[2] != null ? ((Integer) application[2]) : 65535;
+
+                String applicationName = genApplicationName(type, protocol, startPort, endPort);
+                if (!applicationNames.contains(applicationName)) {
+                    applicationNames.add(applicationName);
+                }
+                manageApplication(type, SrxCommand.ADD, protocol, startPort, endPort);
+            }
+        }
+
+        for (String cidr: cidrs) {
+            manageAddressBookEntry(SrxCommand.ADD, _privateZone, cidr, null);
+            }
+
+        // Add a new security policy
+        manageSecurityPolicy(type, SrxCommand.ADD, null, null, guestVlan, applicationNames, cidrs, null);
+        s_logger.debug("Added Egress firewall rule for guest network " + guestVlan);
+        return true;
+    }
+
     /*
      * Filter terms
      */

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/scripts/network/juniper/application-add.xml
----------------------------------------------------------------------
diff --git a/scripts/network/juniper/application-add.xml b/scripts/network/juniper/application-add.xml
index 6603850..177329a 100644
--- a/scripts/network/juniper/application-add.xml
+++ b/scripts/network/juniper/application-add.xml
@@ -23,7 +23,7 @@ under the License.
 <application>           
 <name>%name%</name>     
 <protocol>%protocol%</protocol>    
-<destination-port>%dest-port%</destination-port>        
+%dest-port-icmp%
 </application>   
 </applications>
 </configuration>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/scripts/network/juniper/security-policy-add.xml
----------------------------------------------------------------------
diff --git a/scripts/network/juniper/security-policy-add.xml b/scripts/network/juniper/security-policy-add.xml
index 632a17d..595e026 100644
--- a/scripts/network/juniper/security-policy-add.xml
+++ b/scripts/network/juniper/security-policy-add.xml
@@ -27,8 +27,8 @@ under the License.
 <policy>
 <name>%policy-name%</name>
 <match>
-<source-address>%src-address%</source-address>
-<destination-address>%dest-address%</destination-address>
+%src-address%
+%dst-address%
 %applications%
 </match>
 <then>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
index 1fc32d0..c2038e5 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
@@ -1,3 +1,4 @@
+
 // 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
@@ -541,8 +542,15 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) {
                 _fwRulesDao.loadSourceCidrs((FirewallRuleVO)rule);
             }
-            IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());
-            FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, sourceIp.getAddress().addr());
+            FirewallRuleTO ruleTO;
+            if (rule.getPurpose() == Purpose.Firewall && rule.getTrafficType() == FirewallRule.TrafficType.Egress) {
+                String guestVlanTag = network.getBroadcastUri().getHost();
+                String guestCidr = network.getCidr();
+                ruleTO = new FirewallRuleTO(rule, guestVlanTag, rule.getTrafficType());
+            } else {
+                IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());
+                ruleTO = new FirewallRuleTO(rule, null, sourceIp.getAddress().addr());
+            }
             rulesTO.add(ruleTO);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61b4c5c7/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
index f39038f..b43e494 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -65,6 +65,7 @@ public class Upgrade410to420 implements DbUpgrade {
         updateSystemVmTemplates(conn);
         updateCluster_details(conn);
         updatePrimaryStore(conn);
+        addEgressFwRulesForSRXGuestNw(conn);
     }
 	
 	private void updateSystemVmTemplates(Connection conn) {
@@ -305,4 +306,63 @@ public class Upgrade410to420 implements DbUpgrade {
             }
         }
     }
+    private void addEgressFwRulesForSRXGuestNw(Connection conn) {
+        PreparedStatement pstmt = null;
+        ResultSet rs = null;
+        ResultSet rsId = null;
+        ResultSet rsNw = null;
+        try {
+            pstmt = conn.prepareStatement("select network_id FROM `cloud`.`ntwk_service_map` where service='Firewall' and provider='JuniperSRX' ");
+            rs = pstmt.executeQuery();
+            while (rs.next()) {
+                long netId = rs.getLong(1);
+                //checking for Isolated OR Virtual
+                pstmt = conn.prepareStatement("select account_id, domain_id FROM `cloud`.`networks` where (guest_type='Isolated' OR guest_type='Virtual') and traffic_type='Guest' and vpc_id is NULL and (state='implemented' OR state='Shutdown') and id=? ");
+                pstmt.setLong(1, netId);
+                s_logger.debug("Getting account_id, domain_id from networks table: " + pstmt);
+                rsNw = pstmt.executeQuery();
+
+                if(rsNw.next()) {
+                    long accountId = rsNw.getLong(1);
+                    long domainId = rsNw.getLong(2);
+
+                    //Add new rule for the existing networks
+                    s_logger.debug("Adding default egress firewall rule for network " + netId);
+                    pstmt = conn.prepareStatement("INSERT INTO firewall_rules (uuid, state, protocol, purpose, account_id, domain_id, network_id, xid, created,  traffic_type) VALUES (?, 'Active', 'all', 'Firewall', ?, ?, ?, ?, now(), 'Egress')");
+                    pstmt.setString(1, UUID.randomUUID().toString());
+                    pstmt.setLong(2, accountId);
+                    pstmt.setLong(3, domainId);
+                    pstmt.setLong(4, netId);
+                    pstmt.setString(5, UUID.randomUUID().toString());
+                    s_logger.debug("Inserting default egress firewall rule " + pstmt);
+                    pstmt.executeUpdate();
+
+                    pstmt = conn.prepareStatement("select id from firewall_rules where protocol='all' and network_id=?");
+                    pstmt.setLong(1, netId);
+                    rsId = pstmt.executeQuery();
+
+                    long firewallRuleId;
+                    if(rsId.next()) {
+                        firewallRuleId = rsId.getLong(1);
+                        pstmt = conn.prepareStatement("insert into firewall_rules_cidrs (firewall_rule_id,source_cidr) values (?, '0.0.0.0/0')");
+                        pstmt.setLong(1, firewallRuleId);
+                        s_logger.debug("Inserting rule for cidr 0.0.0.0/0 for the new Firewall rule id=" + firewallRuleId + " with statement " + pstmt);
+                        pstmt.executeUpdate();
+                    }
+                }
+            }
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (pstmt != null) {
+                    pstmt.close();
+                }
+            } catch (SQLException e) {
+            }
+        }
+    }
 }


[34/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: only build-essential needed to build vmtools

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 4304d8460efdb3356f33467f4b88a3cacbaa3079
Parents: fd57bf1
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 18:04:17 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/postinstall.sh    |    4 ++--
 .../definitions/systemvmtemplate64/postinstall.sh  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4304d846/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index c0a7e87..0395f38 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -66,7 +66,7 @@ install_packages() {
   # vmware tools
   # uncomment for opensource vmware tool:
   #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
-  apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
   df -h
   PREVDIR=$PWD
   cd /opt
@@ -77,7 +77,7 @@ install_packages() {
   ./vmware-install.pl -d
   cd $PREV
   rm -fr /opt/vmware-tools-distrib
-  apt-get -q -y --force-yes purge build-essential gcc
+  apt-get -q -y --force-yes purge build-essential
 }
 
 setup_accounts() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4304d846/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
index c0a7e87..0395f38 100644
--- a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
@@ -66,7 +66,7 @@ install_packages() {
   # vmware tools
   # uncomment for opensource vmware tool:
   #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
-  apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
   df -h
   PREVDIR=$PWD
   cd /opt
@@ -77,7 +77,7 @@ install_packages() {
   ./vmware-install.pl -d
   cd $PREV
   rm -fr /opt/vmware-tools-distrib
-  apt-get -q -y --force-yes purge build-essential gcc
+  apt-get -q -y --force-yes purge build-essential
 }
 
 setup_accounts() {


[02/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: copy authorization code from ConsoleProxyManagerImpl

QuickCloud: refactor to avoid copy paste of authentication and startup code


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

Branch: refs/heads/internallb
Commit: d9aa53ab966a3cb5274e813424dde711c7493dd3
Parents: 526da6f
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Mar 26 10:05:06 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:34 2013 -0700

----------------------------------------------------------------------
 .../AgentBasedConsoleProxyManager.java             |  184 +-------
 .../src/com/cloud/consoleproxy/AgentHookBase.java  |  266 +++++++++++
 .../consoleproxy/ConsoleProxyManagerImpl.java      |  362 ++++++---------
 .../consoleproxy/StaticConsoleProxyManager.java    |   84 +++-
 4 files changed, 489 insertions(+), 407 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9aa53ab/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
index 6f8575d..ff6e64e 100755
--- a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
@@ -23,48 +23,28 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
-import com.cloud.agent.api.AgentControlAnswer;
-import com.cloud.agent.api.ConsoleAccessAuthenticationAnswer;
-import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
-import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
 import com.cloud.agent.api.GetVncPortAnswer;
 import com.cloud.agent.api.GetVncPortCommand;
-import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupProxyCommand;
-import com.cloud.agent.api.StopAnswer;
-import com.cloud.agent.api.to.NicTO;
-import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.agent.manager.Commands;
 import com.cloud.configuration.dao.ConfigurationDao;
-import com.cloud.deploy.DeployDestination;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.host.HostVO;
-import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.info.ConsoleProxyInfo;
-import com.cloud.network.Network;
+import com.cloud.keystore.KeystoreManager;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.ConsoleProxyVO;
-import com.cloud.vm.ReservationContext;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachineGuru;
 import com.cloud.vm.VirtualMachineManager;
-import com.cloud.vm.VirtualMachineName;
-import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.ConsoleProxyDao;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value = { ConsoleProxyManager.class })
-public class AgentBasedConsoleProxyManager extends ManagerBase implements ConsoleProxyManager, VirtualMachineGuru<ConsoleProxyVO>, AgentHook {
+public class AgentBasedConsoleProxyManager extends ManagerBase implements ConsoleProxyManager {
     private static final Logger s_logger = Logger.getLogger(AgentBasedConsoleProxyManager.class);
 
     @Inject
@@ -85,9 +65,25 @@ public class AgentBasedConsoleProxyManager extends ManagerBase implements Consol
     VirtualMachineManager _itMgr;
     @Inject
     protected ConsoleProxyDao _cpDao;
+    @Inject
+    protected KeystoreManager _ksMgr;
 
     @Inject ConfigurationDao _configDao;
 
+    public class AgentBasedAgentHook extends AgentHookBase {
+
+        public AgentBasedAgentHook(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao,
+                KeystoreManager ksMgr, AgentManager agentMgr) {
+            super(instanceDao, hostDao, cfgDao, ksMgr, agentMgr);
+        }
+
+        @Override
+        protected HostVO findConsoleProxyHost(StartupProxyCommand cmd) {
+            return _hostDao.findByGuid(cmd.getGuid());
+        }
+
+    }
+
     public int getVncPort(VMInstanceVO vm) {
         if (vm.getHostId() == null) {
             return -1;
@@ -123,11 +119,10 @@ public class AgentBasedConsoleProxyManager extends ManagerBase implements Consol
 
         _consoleProxyUrlDomain = configs.get("consoleproxy.url.domain");
 
-        _listener = new ConsoleProxyListener(this);
+        _listener =
+                new ConsoleProxyListener(new AgentBasedAgentHook(_instanceDao, _hostDao, _configDao, _ksMgr, _agentMgr));
         _agentMgr.registerForHostEvents(_listener, true, true, false);
 
-        _itMgr.registerGuru(VirtualMachine.Type.ConsoleProxy, this);
-
         if (s_logger.isInfoEnabled()) {
             s_logger.info("AgentBasedConsoleProxyManager has been configured. SSL enabled: " + _sslEnabled);
         }
@@ -177,64 +172,8 @@ public class AgentBasedConsoleProxyManager extends ManagerBase implements Consol
         return null;
     }
 
-    @Override
-    public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
-    }
-
-    @Override
-    public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd) {
-        long vmId = 0;
-
-        if (cmd.getVmId() != null && cmd.getVmId().isEmpty()) {
-            if (s_logger.isTraceEnabled()) {
-                s_logger.trace("Invalid vm id sent from proxy(happens when proxy session has terminated)");
-            }
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        try {
-            vmId = Long.parseLong(cmd.getVmId());
-        } catch (NumberFormatException e) {
-            s_logger.error("Invalid vm id " + cmd.getVmId() + " sent from console access authentication", e);
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        // TODO authentication channel between console proxy VM and management
-        // server needs to be secured,
-        // the data is now being sent through private network, but this is
-        // apparently not enough
-        VMInstanceVO vm = _instanceDao.findById(vmId);
-        if (vm == null) {
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        if (vm.getHostId() == null) {
-            s_logger.warn("VM " + vmId + " lost host info, failed authentication request");
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        HostVO host = _hostDao.findById(vm.getHostId());
-        if (host == null) {
-            s_logger.warn("VM " + vmId + "'s host does not exist, fail authentication request");
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
 
-        String sid = cmd.getSid();
-        if (sid == null || !sid.equals(vm.getVncPassword())) {
-            s_logger.warn("sid " + sid + " in url does not match stored sid " + vm.getVncPassword());
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
 
-        return new ConsoleAccessAuthenticationAnswer(cmd, true);
-    }
-
-    @Override
-    public void onAgentConnect(HostVO host, StartupCommand cmd) {
-    }
-
-    @Override
-    public void onAgentDisconnect(long agentId, Status state) {
-    }
 
     @Override
     public ConsoleProxyVO startProxy(long proxyVmId) {
@@ -270,90 +209,7 @@ public class AgentBasedConsoleProxyManager extends ManagerBase implements Consol
     }
 
     @Override
-    public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd) {
-    }
-
-    @Override
     public String getName() {
         return _name;
     }
-
-    @Override
-    public Long convertToId(String vmName) {
-        if (!VirtualMachineName.isValidConsoleProxyName(vmName, _instance)) {
-            return null;
-        }
-        return VirtualMachineName.getConsoleProxyId(vmName);
-    }
-
-    @Override
-    public ConsoleProxyVO findByName(String name) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public ConsoleProxyVO findById(long id) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public ConsoleProxyVO persist(ConsoleProxyVO vm) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean finalizeVirtualMachineProfile(VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeStart(VirtualMachineProfile<ConsoleProxyVO> profile, long hostId, Commands cmds, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public void finalizeStop(VirtualMachineProfile<ConsoleProxyVO> profile, StopAnswer answer) {
-        // TODO Auto-generated method stub
-    }
-
-    @Override 
-    public void finalizeExpunge(ConsoleProxyVO proxy) {
-    }
-
-    @Override
-    public boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm,
-            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException,
-            InsufficientCapacityException {
-        //not supported
-        throw new UnsupportedOperationException("Plug nic is not supported for vm of type " + vm.getType());
-    }
-
-
-    @Override
-    public boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm,
-            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {
-        //not supported
-        throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
-    }
-
-    @Override
-    public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9aa53ab/server/src/com/cloud/consoleproxy/AgentHookBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentHookBase.java b/server/src/com/cloud/consoleproxy/AgentHookBase.java
new file mode 100644
index 0000000..b969f6d
--- /dev/null
+++ b/server/src/com/cloud/consoleproxy/AgentHookBase.java
@@ -0,0 +1,266 @@
+// 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.consoleproxy;
+
+import java.util.Date;
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.api.AgentControlAnswer;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.ConsoleAccessAuthenticationAnswer;
+import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
+import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
+import com.cloud.agent.api.GetVncPortAnswer;
+import com.cloud.agent.api.GetVncPortCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupProxyCommand;
+import com.cloud.agent.api.proxy.StartConsoleProxyAgentHttpHandlerCommand;
+import com.cloud.configuration.Config;
+import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.exception.AgentUnavailableException;
+import com.cloud.exception.OperationTimedoutException;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status;
+import com.cloud.host.dao.HostDao;
+import com.cloud.keystore.KeystoreManager;
+import com.cloud.servlet.ConsoleProxyServlet;
+import com.cloud.utils.Ternary;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.dao.VMInstanceDao;
+
+/**
+ * Utility class to manage interactions with agent-based console access
+ * Extracted from ConsoleProxyManagerImpl so that other console proxy managers
+ * can reuse
+ */
+public abstract class AgentHookBase implements AgentHook {
+    private static final Logger s_logger = Logger.getLogger(AgentHookBase.class);
+
+    VMInstanceDao _instanceDao;
+    HostDao _hostDao;
+    ConfigurationDao _configDao;
+    AgentManager _agentMgr;
+    KeystoreManager _ksMgr;
+    final Random _random = new Random(System.currentTimeMillis());
+    private String _hashKey;
+
+
+    public AgentHookBase(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao, KeystoreManager ksMgr,
+            AgentManager agentMgr) {
+        this._instanceDao = instanceDao;
+        this._hostDao = hostDao;
+        this._agentMgr = agentMgr;
+        this._configDao = cfgDao;
+        this._ksMgr = ksMgr;
+    }
+
+    public String getHashKey() {
+        // although we may have race condition here, database transaction
+        // serialization should give us the same key
+        if (_hashKey == null) {
+            _hashKey =
+                    _configDao.getValueAndInitIfNotExist(Config.HashKey.key(), Config.HashKey.getCategory(), UUID
+                            .randomUUID().toString());
+        }
+        return _hashKey;
+    }
+
+    public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd) {
+        Long vmId = null;
+
+        String ticketInUrl = cmd.getTicket();
+        if (ticketInUrl == null) {
+            s_logger.error("Access ticket could not be found, you could be running an old version of console proxy. vmId: "
+                    + cmd.getVmId());
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        if (s_logger.isDebugEnabled()) {
+            s_logger.debug("Console authentication. Ticket in url for " + cmd.getHost() + ":" + cmd.getPort() + "-"
+                    + cmd.getVmId() + " is " + ticketInUrl);
+        }
+
+        if (!cmd.isReauthenticating()) {
+            String ticket =
+                    ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId());
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Console authentication. Ticket in 1 minute boundary for " + cmd.getHost() + ":"
+                        + cmd.getPort() + "-" + cmd.getVmId() + " is " + ticket);
+            }
+
+            if (!ticket.equals(ticketInUrl)) {
+                Date now = new Date();
+                // considering of minute round-up
+                String minuteEarlyTicket =
+                        ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId(),
+                                new Date(now.getTime() - 60 * 1000));
+
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("Console authentication. Ticket in 2-minute boundary for " + cmd.getHost() + ":"
+                            + cmd.getPort() + "-" + cmd.getVmId() + " is " + minuteEarlyTicket);
+                }
+
+                if (!minuteEarlyTicket.equals(ticketInUrl)) {
+                    s_logger.error("Access ticket expired or has been modified. vmId: " + cmd.getVmId()
+                            + "ticket in URL: " + ticketInUrl + ", tickets to check against: " + ticket + ","
+                            + minuteEarlyTicket);
+                    return new ConsoleAccessAuthenticationAnswer(cmd, false);
+                }
+            }
+        }
+
+        if (cmd.getVmId() != null && cmd.getVmId().isEmpty()) {
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Invalid vm id sent from proxy(happens when proxy session has terminated)");
+            }
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        VirtualMachine vm = _instanceDao.findByUuid(cmd.getVmId());
+        if (vm == null) {
+            vm = _instanceDao.findById(Long.parseLong(cmd.getVmId()));
+        }
+        if (vm == null) {
+            s_logger.error("Invalid vm id " + cmd.getVmId() + " sent from console access authentication");
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        if (vm.getHostId() == null) {
+            s_logger.warn("VM " + vmId + " lost host info, failed authentication request");
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        HostVO host = _hostDao.findById(vm.getHostId());
+        if (host == null) {
+            s_logger.warn("VM " + vmId + "'s host does not exist, fail authentication request");
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        String sid = cmd.getSid();
+        if (sid == null || !sid.equals(vm.getVncPassword())) {
+            s_logger.warn("sid " + sid + " in url does not match stored sid " + vm.getVncPassword());
+            return new ConsoleAccessAuthenticationAnswer(cmd, false);
+        }
+
+        if (cmd.isReauthenticating()) {
+            ConsoleAccessAuthenticationAnswer authenticationAnswer = new ConsoleAccessAuthenticationAnswer(cmd, true);
+            authenticationAnswer.setReauthenticating(true);
+
+            s_logger.info("Re-authentication request, ask host " + vm.getHostId() + " for new console info");
+            GetVncPortAnswer answer =
+                    (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(),
+                            new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
+
+            if (answer != null && answer.getResult()) {
+                Ternary<String, String, String> parsedHostInfo = ConsoleProxyServlet.parseHostInfo(answer.getAddress());
+
+                if (parsedHostInfo.second() != null && parsedHostInfo.third() != null) {
+
+                    s_logger.info("Re-authentication result. vm: " + vm.getId() + ", tunnel url: "
+                            + parsedHostInfo.second() + ", tunnel session: " + parsedHostInfo.third());
+
+                    authenticationAnswer.setTunnelUrl(parsedHostInfo.second());
+                    authenticationAnswer.setTunnelSession(parsedHostInfo.third());
+                } else {
+                    s_logger.info("Re-authentication result. vm: " + vm.getId() + ", host address: "
+                            + parsedHostInfo.first() + ", port: " + answer.getPort());
+
+                    authenticationAnswer.setHost(parsedHostInfo.first());
+                    authenticationAnswer.setPort(answer.getPort());
+                }
+            } else {
+                s_logger.warn("Re-authentication request failed");
+
+                authenticationAnswer.setSuccess(false);
+            }
+
+            return authenticationAnswer;
+        }
+
+        return new ConsoleAccessAuthenticationAnswer(cmd, true);
+    }
+
+    public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd) {
+        StartConsoleProxyAgentHttpHandlerCommand cmd = null;
+        if (_configDao.isPremium()) {
+            String storePassword = String.valueOf(_random.nextLong());
+            byte[] ksBits =
+                    _ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME, ConsoleProxyManager.CERTIFICATE_NAME,
+                            storePassword);
+
+            assert (ksBits != null);
+            if (ksBits == null) {
+                s_logger.error("Could not find and construct a valid SSL certificate");
+            }
+            cmd = new StartConsoleProxyAgentHttpHandlerCommand(ksBits, storePassword);
+            cmd.setEncryptorPassword(getHashKey());
+        } else {
+            cmd = new StartConsoleProxyAgentHttpHandlerCommand();
+            cmd.setEncryptorPassword(getHashKey());
+        }
+
+        try {
+
+            HostVO consoleProxyHost = findConsoleProxyHost(startupCmd);
+
+            assert (consoleProxyHost != null);
+
+            Answer answer = _agentMgr.send(consoleProxyHost.getId(), cmd);
+            if (answer == null || !answer.getResult()) {
+                s_logger.error("Console proxy agent reported that it failed to execute http handling startup command");
+            } else {
+                s_logger.info("Successfully sent out command to start HTTP handling in console proxy agent");
+            }
+        } catch (AgentUnavailableException e) {
+            s_logger.error("Unable to send http handling startup command to the console proxy resource for proxy:"
+                    + startupCmd.getProxyVmId(), e);
+        } catch (OperationTimedoutException e) {
+            s_logger.error(
+                    "Unable to send http handling startup command(time out) to the console proxy resource for proxy:"
+                            + startupCmd.getProxyVmId(), e);
+        } catch (OutOfMemoryError e) {
+            s_logger.error("Unrecoverable OutOfMemory Error, exit and let it be re-launched");
+            System.exit(1);
+        } catch (Exception e) {
+            s_logger.error(
+                    "Unexpected exception when sending http handling startup command(time out) to the console proxy resource for proxy:"
+                            + startupCmd.getProxyVmId(), e);
+        }
+    }
+
+    protected abstract HostVO findConsoleProxyHost(StartupProxyCommand cmd);
+
+    @Override
+    public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
+        // no-op since we do not auto-scale
+    }
+
+    @Override
+    public void onAgentConnect(HostVO host, StartupCommand cmd) {
+        // no-op
+    }
+
+    @Override
+    public void onAgentDisconnect(long agentId, Status state) {
+        // no-op since we do not autoscale
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9aa53ab/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index fc4fc6e..9740d28 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -23,7 +23,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Random;
 import java.util.UUID;
 
 import javax.ejb.Local;
@@ -35,13 +34,8 @@ import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
-import com.cloud.agent.api.AgentControlAnswer;
 import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.ConsoleAccessAuthenticationAnswer;
-import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
 import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
-import com.cloud.agent.api.GetVncPortAnswer;
-import com.cloud.agent.api.GetVncPortCommand;
 import com.cloud.agent.api.RebootCommand;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupProxyCommand;
@@ -49,7 +43,6 @@ import com.cloud.agent.api.StopAnswer;
 import com.cloud.agent.api.check.CheckSshAnswer;
 import com.cloud.agent.api.check.CheckSshCommand;
 import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer;
-import com.cloud.agent.api.proxy.StartConsoleProxyAgentHttpHandlerCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.agent.manager.Commands;
@@ -66,10 +59,8 @@ 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.exception.AgentUnavailableException;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.OperationTimedoutException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
 import com.cloud.host.Host;
@@ -106,7 +97,6 @@ import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
-import com.cloud.servlet.ConsoleProxyServlet;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePoolStatus;
 import com.cloud.storage.VMTemplateHostVO;
@@ -123,7 +113,6 @@ import com.cloud.user.UserContext;
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
-import com.cloud.utils.Ternary;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GlobalLock;
@@ -167,7 +156,7 @@ import com.google.gson.GsonBuilder;
 //
 @Local(value = { ConsoleProxyManager.class, ConsoleProxyService.class })
 public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager,
-        AgentHook, VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
+        VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
     private static final Logger s_logger = Logger.getLogger(ConsoleProxyManagerImpl.class);
 
     private static final int DEFAULT_CAPACITY_SCAN_INTERVAL = 30000; // 30 seconds
@@ -455,7 +444,131 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
     private KeystoreDao _ksDao;
     @Inject
     private KeystoreManager _ksMgr;
-    private final Random _random = new Random(System.currentTimeMillis());
+
+    public class VmBasedAgentHook extends AgentHookBase {
+
+        public VmBasedAgentHook(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao,
+                KeystoreManager ksMgr, AgentManager agentMgr) {
+            super(instanceDao, hostDao, cfgDao, ksMgr, agentMgr);
+        }
+
+        @Override
+        public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
+            if (cmd.getLoadInfo() == null) {
+                return;
+            }
+
+            ConsoleProxyStatus status = null;
+            try {
+                GsonBuilder gb = new GsonBuilder();
+                gb.setVersion(1.3);
+                Gson gson = gb.create();
+                status = gson.fromJson(cmd.getLoadInfo(), ConsoleProxyStatus.class);
+            } catch (Throwable e) {
+                s_logger.warn("Unable to parse load info from proxy, proxy vm id : " + cmd.getProxyVmId() + ", info : " + cmd.getLoadInfo());
+            }
+
+            if (status != null) {
+                int count = 0;
+                if (status.getConnections() != null) {
+                    count = status.getConnections().length;
+                }
+
+                byte[] details = null;
+                if (cmd.getLoadInfo() != null) {
+                    details = cmd.getLoadInfo().getBytes(Charset.forName("US-ASCII"));
+                }
+                _consoleProxyDao.update(cmd.getProxyVmId(), count, DateUtil.currentGMTTime(), details);
+            } else {
+                if (s_logger.isTraceEnabled()) {
+                    s_logger.trace("Unable to get console proxy load info, id : " + cmd.getProxyVmId());
+                }
+
+                _consoleProxyDao.update(cmd.getProxyVmId(), 0, DateUtil.currentGMTTime(), null);
+            }
+        }
+
+        @Override
+        public void onAgentConnect(HostVO host, StartupCommand cmd) {
+            // no-op
+        }
+
+        @Override
+        public void onAgentDisconnect(long agentId, com.cloud.host.Status state) {
+
+            if (state == com.cloud.host.Status.Alert || state == com.cloud.host.Status.Disconnected) {
+                // be it either in alert or in disconnected state, the agent
+                // process
+                // may be gone in the VM,
+                // we will be reacting to stop the corresponding VM and let the
+                // scan
+                // process to
+                HostVO host = _hostDao.findById(agentId);
+                if (host.getType() == Type.ConsoleProxy) {
+                    String name = host.getName();
+                    if (s_logger.isInfoEnabled()) {
+                        s_logger.info("Console proxy agent disconnected, proxy: " + name);
+                    }
+                    if (name != null && name.startsWith("v-")) {
+                        String[] tokens = name.split("-");
+                        long proxyVmId = 0;
+                        try {
+                            proxyVmId = Long.parseLong(tokens[1]);
+                        } catch (NumberFormatException e) {
+                            s_logger.error("Unexpected exception " + e.getMessage(), e);
+                            return;
+                        }
+
+                        final ConsoleProxyVO proxy = _consoleProxyDao.findById(proxyVmId);
+                        if (proxy != null) {
+
+                            // Disable this feature for now, as it conflicts
+                            // with
+                            // the case of allowing user to reboot console proxy
+                            // when rebooting happens, we will receive
+                            // disconnect
+                            // here and we can't enter into stopping process,
+                            // as when the rebooted one comes up, it will kick
+                            // off a
+                            // newly started one and trigger the process
+                            // continue on forever
+
+                            /*
+                             * _capacityScanScheduler.execute(new Runnable() {
+                             * public void run() { if(s_logger.isInfoEnabled())
+                             * s_logger.info("Stop console proxy " +
+                             * proxy.getName() +
+                             * " VM because of that the agent running inside it has disconnected"
+                             * ); stopProxy(proxy.getId()); } });
+                             */
+                        } else {
+                            if (s_logger.isInfoEnabled()) {
+                                s_logger.info("Console proxy agent disconnected but corresponding console proxy VM no longer exists in DB, proxy: "
+                                        + name);
+                            }
+                        }
+                    } else {
+                        assert (false) : "Invalid console proxy name: " + name;
+                    }
+                }
+            }
+
+        }
+
+        @Override
+        protected HostVO findConsoleProxyHost(StartupProxyCommand startupCmd) {
+            long proxyVmId = startupCmd.getProxyVmId();
+            ConsoleProxyVO consoleProxy = _consoleProxyDao.findById(proxyVmId);
+            if (consoleProxy == null) {
+                s_logger.info("Proxy " + proxyVmId + " is no longer in DB, skip sending startup command");
+                return null;
+            }
+
+            assert (consoleProxy != null);
+            return findConsoleProxyHostByName(consoleProxy.getHostName());
+        }
+
+    }
 
     @Override
     public ConsoleProxyInfo assignProxy(final long dataCenterId, final long vmId) {
@@ -847,181 +960,9 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
         }
     }
 
-    @Override
-    public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
-        if (cmd.getLoadInfo() == null) {
-            return;
-        }
-
-        ConsoleProxyStatus status = null;
-        try {
-            GsonBuilder gb = new GsonBuilder();
-            gb.setVersion(1.3);
-            Gson gson = gb.create();
-            status = gson.fromJson(cmd.getLoadInfo(), ConsoleProxyStatus.class);
-        } catch (Throwable e) {
-            s_logger.warn("Unable to parse load info from proxy, proxy vm id : " + cmd.getProxyVmId() + ", info : " + cmd.getLoadInfo());
-        }
-
-        if (status != null) {
-            int count = 0;
-            if (status.getConnections() != null) {
-                count = status.getConnections().length;
-            }
-
-            byte[] details = null;
-            if (cmd.getLoadInfo() != null) {
-                details = cmd.getLoadInfo().getBytes(Charset.forName("US-ASCII"));
-            }
-            _consoleProxyDao.update(cmd.getProxyVmId(), count, DateUtil.currentGMTTime(), details);
-        } else {
-            if (s_logger.isTraceEnabled()) {
-                s_logger.trace("Unable to get console proxy load info, id : " + cmd.getProxyVmId());
-            }
 
-            _consoleProxyDao.update(cmd.getProxyVmId(), 0, DateUtil.currentGMTTime(), null);
-        }
-    }
 
-    @Override
-    public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd) {
-        Long vmId = null;
-
-        String ticketInUrl = cmd.getTicket();
-        if (ticketInUrl == null) {
-            s_logger.error("Access ticket could not be found, you could be running an old version of console proxy. vmId: " + cmd.getVmId());
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Console authentication. Ticket in url for " + cmd.getHost() + ":" + cmd.getPort() + "-" + cmd.getVmId() + " is " + ticketInUrl);
-        }
-
-        if(!cmd.isReauthenticating()) {
-            String ticket = ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId());
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Console authentication. Ticket in 1 minute boundary for " + cmd.getHost() + ":" + cmd.getPort() + "-" + cmd.getVmId() + " is " + ticket);
-            }
-
-            if (!ticket.equals(ticketInUrl)) {
-                Date now = new Date();
-                // considering of minute round-up
-                String minuteEarlyTicket = ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId(), new Date(now.getTime() - 60 * 1000));
-
-                if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Console authentication. Ticket in 2-minute boundary for " + cmd.getHost() + ":" + cmd.getPort() + "-" + cmd.getVmId() + " is " + minuteEarlyTicket);
-                }
-
-                if (!minuteEarlyTicket.equals(ticketInUrl)) {
-                    s_logger.error("Access ticket expired or has been modified. vmId: " + cmd.getVmId() + "ticket in URL: " + ticketInUrl + ", tickets to check against: " + ticket + ","
-                            + minuteEarlyTicket);
-                    return new ConsoleAccessAuthenticationAnswer(cmd, false);
-                }
-            }
-        }
-
-        if (cmd.getVmId() != null && cmd.getVmId().isEmpty()) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Invalid vm id sent from proxy(happens when proxy session has terminated)");
-            }
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        VirtualMachine vm = _instanceDao.findByUuid(cmd.getVmId());
-        if (vm == null) {
-            vm = _instanceDao.findById(Long.parseLong(cmd.getVmId()));
-        }
-        if (vm == null) {
-            s_logger.error("Invalid vm id " + cmd.getVmId() + " sent from console access authentication");
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        if (vm.getHostId() == null) {
-            s_logger.warn("VM " + vmId + " lost host info, failed authentication request");
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        HostVO host = _hostDao.findById(vm.getHostId());
-        if (host == null) {
-            s_logger.warn("VM " + vmId + "'s host does not exist, fail authentication request");
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        String sid = cmd.getSid();
-        if (sid == null || !sid.equals(vm.getVncPassword())) {
-            s_logger.warn("sid " + sid + " in url does not match stored sid " + vm.getVncPassword());
-            return new ConsoleAccessAuthenticationAnswer(cmd, false);
-        }
-
-        if(cmd.isReauthenticating()) {
-            ConsoleAccessAuthenticationAnswer authenticationAnswer = new ConsoleAccessAuthenticationAnswer(cmd, true);
-            authenticationAnswer.setReauthenticating(true);
-
-            s_logger.info("Re-authentication request, ask host " + vm.getHostId() + " for new console info");
-            GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new 
-                    GetVncPortCommand(vm.getId(), vm.getInstanceName()));
-
-            if (answer != null && answer.getResult()) {
-                Ternary<String, String, String> parsedHostInfo = ConsoleProxyServlet.parseHostInfo(answer.getAddress());
-
-                if(parsedHostInfo.second() != null  && parsedHostInfo.third() != null) {
-
-                    s_logger.info("Re-authentication result. vm: " + vm.getId() + ", tunnel url: " + parsedHostInfo.second()
-                            + ", tunnel session: " + parsedHostInfo.third());
-
-                    authenticationAnswer.setTunnelUrl(parsedHostInfo.second());
-                    authenticationAnswer.setTunnelSession(parsedHostInfo.third());
-                } else {
-                    s_logger.info("Re-authentication result. vm: " + vm.getId() + ", host address: " + parsedHostInfo.first()
-                            + ", port: " + answer.getPort());
-
-                    authenticationAnswer.setHost(parsedHostInfo.first());
-                    authenticationAnswer.setPort(answer.getPort());
-                }
-            } else {
-                s_logger.warn("Re-authentication request failed");
-
-                authenticationAnswer.setSuccess(false);
-            }
-
-            return authenticationAnswer;
-        }
-
-        return new ConsoleAccessAuthenticationAnswer(cmd, true);
-    }
-
-    @Override
-    public void onAgentConnect(HostVO host, StartupCommand cmd) {
-        // if (host.getType() == Type.ConsoleProxy) {
-        // // TODO we can use this event to mark the proxy is up and
-        // // functioning instead of
-        // // pinging the console proxy VM command port
-        // //
-        // // for now, just log a message
-        // if (s_logger.isInfoEnabled()) {
-        // s_logger.info("Console proxy agent is connected. proxy: " + host.getName());
-        // }
-        //
-        // /* update public/private ip address */
-        // if (_IpAllocator != null && _IpAllocator.exteralIpAddressAllocatorEnabled()) {
-        // try {
-        // ConsoleProxyVO console = findConsoleProxyByHost(host);
-        // if (console == null) {
-        // s_logger.debug("Can't find console proxy ");
-        // return;
-        // }
-        // console.setPrivateIpAddress(cmd.getPrivateIpAddress());
-        // console.setPublicIpAddress(cmd.getPublicIpAddress());
-        // console.setPublicNetmask(cmd.getPublicNetmask());
-        // _consoleProxyDao.persist(console);
-        // } catch (NumberFormatException e) {
-        // }
-        // }
-        // }
-    }
-
-    @Override
-    public void onAgentDisconnect(long agentId, com.cloud.host.Status state) {
+    public void handleAgentDisconnect(long agentId, com.cloud.host.Status state) {
         if (state == com.cloud.host.Status.Alert || state == com.cloud.host.Status.Disconnected) {
             // be it either in alert or in disconnected state, the agent process
             // may be gone in the VM,
@@ -1496,7 +1437,9 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
         value = agentMgrConfigs.get("port");
         _mgmt_port = NumbersUtil.parseInt(value, 8250);
 
-        _listener = new ConsoleProxyListener(this);
+        _listener =
+                new ConsoleProxyListener(new VmBasedAgentHook(_instanceDao, _hostDao, _configDao, _ksMgr,
+                        _agentMgr));
         _agentMgr.registerForHostEvents(_listener, true, true, false);
 
         _itMgr.registerGuru(VirtualMachine.Type.ConsoleProxy, this);
@@ -1719,52 +1662,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
         _consoleProxyDao.update(proxy.getId(), proxy);
     }
 
-    @Override
-    public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd) {
-        StartConsoleProxyAgentHttpHandlerCommand cmd = null;
-        if (_configDao.isPremium()) {
-            String storePassword = String.valueOf(_random.nextLong());
-            byte[] ksBits = _ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME, ConsoleProxyManager.CERTIFICATE_NAME, storePassword);
-
-            assert (ksBits != null);
-            if (ksBits == null) {
-                s_logger.error("Could not find and construct a valid SSL certificate");
-            }
-            cmd = new StartConsoleProxyAgentHttpHandlerCommand(ksBits, storePassword);
-            cmd.setEncryptorPassword(getHashKey());
-        } else {
-            cmd = new StartConsoleProxyAgentHttpHandlerCommand();
-            cmd.setEncryptorPassword(getHashKey());
-        }
-
-        try {
-            long proxyVmId = startupCmd.getProxyVmId();
-            ConsoleProxyVO consoleProxy = _consoleProxyDao.findById(proxyVmId);
-            if (consoleProxy == null) {
-                s_logger.info("Proxy " + proxyVmId + " is no longer in DB, skip sending startup command");
-                return;
-            }
-
-            assert (consoleProxy != null);
-            HostVO consoleProxyHost = findConsoleProxyHostByName(consoleProxy.getHostName());
 
-            Answer answer = _agentMgr.send(consoleProxyHost.getId(), cmd);
-            if (answer == null || !answer.getResult()) {
-                s_logger.error("Console proxy agent reported that it failed to execute http handling startup command");
-            } else {
-                s_logger.info("Successfully sent out command to start HTTP handling in console proxy agent");
-            }
-        } catch (AgentUnavailableException e) {
-            s_logger.error("Unable to send http handling startup command to the console proxy resource for proxy:" + startupCmd.getProxyVmId(), e);
-        } catch (OperationTimedoutException e) {
-            s_logger.error("Unable to send http handling startup command(time out) to the console proxy resource for proxy:" + startupCmd.getProxyVmId(), e);
-        } catch (OutOfMemoryError e) {
-            s_logger.error("Unrecoverable OutOfMemory Error, exit and let it be re-launched");
-            System.exit(1);
-        } catch (Exception e) {
-            s_logger.error("Unexpected exception when sending http handling startup command(time out) to the console proxy resource for proxy:" + startupCmd.getProxyVmId(), e);
-        }
-    }
 
     @Override
     public ConsoleProxyVO persist(ConsoleProxyVO proxy) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9aa53ab/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
index 3ba98a9..7b59a6b 100755
--- a/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
@@ -16,29 +16,59 @@
 // under the License.
 package com.cloud.consoleproxy;
 
+
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.springframework.stereotype.Component;
+import org.apache.log4j.Logger;
 
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupProxyCommand;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.host.Host.Type;
 import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
 import com.cloud.info.ConsoleProxyInfo;
+import com.cloud.keystore.KeystoreDao;
+import com.cloud.keystore.KeystoreManager;
 import com.cloud.resource.ResourceManager;
+import com.cloud.resource.ResourceStateAdapter;
+import com.cloud.resource.ServerResource;
+import com.cloud.resource.UnableDeleteHostException;
+import com.cloud.utils.NumbersUtil;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.dao.ConsoleProxyDao;
+import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value={ConsoleProxyManager.class})
-public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager implements ConsoleProxyManager {
-    String _ip = null;
-    @Inject ConsoleProxyDao _proxyDao;
-    @Inject ResourceManager _resourceMgr;
-    @Inject ConfigurationDao _configDao;
+public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager implements ConsoleProxyManager,
+        ResourceStateAdapter {
+    private static final Logger s_logger = Logger.getLogger(StaticConsoleProxyManager.class);
+
+    @Inject
+    ConsoleProxyDao _proxyDao;
+    @Inject
+    ResourceManager _resourceMgr;
+    @Inject
+    ConfigurationDao _configDao;
+    @Inject
+    private VMInstanceDao _instanceDao;
+    @Inject
+    KeystoreDao _ksDao;
+    @Inject
+    private KeystoreManager _ksMgr;
+    @Inject
+    private HostDao _hostDao;
+    private final Random _random = new Random(System.currentTimeMillis());
+    private String _hashKey;
+    private String _ip = null;
+
+
 
     @Override
     protected HostVO findHost(VMInstanceVO vm) {
@@ -50,20 +80,52 @@ public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager imp
 
     @Override
     public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
-        return new ConsoleProxyInfo(false, _ip, _consoleProxyPort, _consoleProxyUrlPort, _consoleProxyUrlDomain);
+        return new ConsoleProxyInfo(_sslEnabled, _ip, _consoleProxyPort, _consoleProxyUrlPort, _consoleProxyUrlDomain);
     }
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
         super.configure(name, params);
-
-        Map<String, String> dbParams = _configDao.getConfiguration("ManagementServer", params);
-
-        _ip = dbParams.get("public.ip");
+        _ip = _configDao.getValue("consoleproxy.static.publicIp");
         if (_ip == null) {
             _ip = "127.0.0.1";
         }
 
+
+        String value = (String) params.get("consoleproxy.sslEnabled");
+        if (value != null && value.equalsIgnoreCase("true")) {
+            _sslEnabled = true;
+        }
+        int defaultPort = 8088;
+        if (_sslEnabled)
+            defaultPort = 8443;
+        _consoleProxyUrlPort = NumbersUtil.parseInt(_configDao.getValue("consoleproxy.static.port"), defaultPort);
+
+        _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
+
         return true;
     }
+
+    @Override
+    public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) {
+        if (!(cmd[0] instanceof StartupProxyCommand)) {
+            return null;
+        }
+
+        host.setType(com.cloud.host.Host.Type.ConsoleProxy);
+        return host;
+    }
+
+    @Override
+    public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource,
+            Map<String, String> details, List<String> hostTags) {
+        return null;
+    }
+
+    @Override
+    public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage)
+            throws UnableDeleteHostException {
+        return null;
+    }
+
 }


[22/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
add API version for vm snapshot related API commands


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

Branch: refs/heads/internallb
Commit: cbc2d3a9134ebee3a429350a25643b93ae0eea9d
Parents: a655501
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Apr 10 12:53:25 2013 +0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:03 2013 -0700

----------------------------------------------------------------------
 .../user/vmsnapshot/CreateVMSnapshotCmd.java       |    2 +-
 .../user/vmsnapshot/DeleteVMSnapshotCmd.java       |    2 +-
 .../command/user/vmsnapshot/ListVMSnapshotCmd.java |    2 +-
 .../user/vmsnapshot/RevertToSnapshotCmd.java       |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc2d3a9/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
index f0dbf16..aa9feb8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
@@ -34,7 +34,7 @@ import com.cloud.user.UserContext;
 import com.cloud.uservm.UserVm;
 import com.cloud.vm.snapshot.VMSnapshot;
 
-@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class)
+@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class, since="4.2.0")
 public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
 
     public static final Logger s_logger = Logger

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc2d3a9/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
index a2b2c08..bda84c8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
@@ -32,7 +32,7 @@ import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 import com.cloud.vm.snapshot.VMSnapshot;
 
-@APICommand(name="deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class)
+@APICommand(name="deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class, since="4.2.0")
 public class DeleteVMSnapshotCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger
             .getLogger(DeleteVMSnapshotCmd.class.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc2d3a9/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java
index 936d348..82fb9e5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java
@@ -30,7 +30,7 @@ import org.apache.cloudstack.api.response.VMSnapshotResponse;
 
 import com.cloud.vm.snapshot.VMSnapshot;
 
-@APICommand(name="listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class)
+@APICommand(name="listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class, since="4.2.0")
 public class ListVMSnapshotCmd extends BaseListTaggedResourcesCmd {
 
     private static final String s_name = "listvmsnapshotresponse";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc2d3a9/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToSnapshotCmd.java
index d7b4599..ea7bf60 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToSnapshotCmd.java
@@ -37,7 +37,7 @@ import com.cloud.user.UserContext;
 import com.cloud.uservm.UserVm;
 import com.cloud.vm.snapshot.VMSnapshot;
 
-@APICommand(name = "revertToSnapshot",description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class)
+@APICommand(name = "revertToSnapshot",description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since="4.2.0")
 public class RevertToSnapshotCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger
             .getLogger(RevertToSnapshotCmd.class.getName());


[49/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Send only \n rather than \r\n to agent socket when sending cmdline
to system VMS

BUG-ID: CLOUDSTACK-1732
Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1365622030 -0600


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

Branch: refs/heads/internallb
Commit: c4411af1a9eca555f53ad57265ebc54cc7f3aa8c
Parents: 489e6f4
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Wed Apr 10 13:27:10 2013 -0600
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 scripts/vm/hypervisor/kvm/patchviasocket.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c4411af1/scripts/vm/hypervisor/kvm/patchviasocket.pl
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/kvm/patchviasocket.pl b/scripts/vm/hypervisor/kvm/patchviasocket.pl
index 443d6e4..7bcd245 100644
--- a/scripts/vm/hypervisor/kvm/patchviasocket.pl
+++ b/scripts/vm/hypervisor/kvm/patchviasocket.pl
@@ -53,6 +53,6 @@ my $msg = "pubkey:" . $key . "\ncmdline:" . $cmdline;
 
 my $socket = IO::Socket::UNIX->new(Peer=>$sockfile,Type=>SOCK_STREAM)
     or die "ERROR: unable to connect to $sockfile - $^E\n";
-print $socket "$msg\r\n";
+print $socket "$msg\n";
 close $socket;
 


[09/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: add a network offering without any services
This can be used to avoid starting up a virtual router simply for the purposes of offering dhcp and dns services
With the QuickCloudNoServices offering, no virtual router will be started up and the vm instance will not get a CloudStack-assigned IP address.
Instead, the VM will simply get whatever IP address is offered by an DHCP service that happens to be running in the same network


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

Branch: refs/heads/internallb
Commit: cddb729cbaaba004c375c918beb975f9b4d22652
Parents: af9f4d3
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Mar 26 13:36:04 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/offering/NetworkOffering.java    |    1 +
 .../src/com/cloud/network/NetworkManagerImpl.java  |   16 +++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cddb729c/api/src/com/cloud/offering/NetworkOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java
index 8cb8299..bd14acd 100644
--- a/api/src/com/cloud/offering/NetworkOffering.java
+++ b/api/src/com/cloud/offering/NetworkOffering.java
@@ -46,6 +46,7 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
     public final static String SystemPrivateGatewayNetworkOffering = "System-Private-Gateway-Network-Offering";
 
     public final static String DefaultSharedNetworkOfferingWithSGService = "DefaultSharedNetworkOfferingWithSGService";
+    public final static String QuickCloudNoServices = "QuickCloudNoServices";
     public final static String DefaultIsolatedNetworkOfferingWithSourceNatService = "DefaultIsolatedNetworkOfferingWithSourceNatService";
     public final static String OvsIsolatedNetworkOfferingWithSourceNatService = "OvsIsolatedNetworkOfferingWithSourceNatService";
     public final static String DefaultSharedNetworkOffering = "DefaultSharedNetworkOffering";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cddb729c/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index e5c7fd9..85d0d9e 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -969,9 +969,21 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         // diff between offering #1 and #2 - securityGroup is enabled for the first, and disabled for the third
 
         NetworkOfferingVO offering = null;
+        if (_networkOfferingDao.findByUniqueName(NetworkOffering.QuickCloudNoServices) == null) {
+            offering =
+                    _configMgr.createNetworkOffering(NetworkOffering.QuickCloudNoServices,
+                            "Offering for QuickCloud with no services", TrafficType.Guest, null, true,
+                            Availability.Optional, null, new HashMap<Network.Service, Set<Network.Provider>>(), true,
+                            Network.GuestType.Shared, false, null, true, null, true, false);
+            offering.setState(NetworkOffering.State.Enabled);
+            _networkOfferingDao.update(offering.getId(), offering);
+        }
         if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOfferingWithSGService) == null) {
-            offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOfferingWithSGService, "Offering for Shared Security group enabled networks", TrafficType.Guest, null,
-                    true, Availability.Optional, null, defaultSharedNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, true, null, true, false);
+            offering =
+                    _configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOfferingWithSGService,
+                            "Offering for Shared Security group enabled networks", TrafficType.Guest, null, true,
+                            Availability.Optional, null, defaultSharedNetworkOfferingProviders, true,
+                            Network.GuestType.Shared, false, null, true, null, true, false);
             offering.setState(NetworkOffering.State.Enabled);
             _networkOfferingDao.update(offering.getId(), offering);
         }


[36/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Detect if we are root based on the effective uid instead of the username. Allows sysadmins to specifiy their own username if they want.


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

Branch: refs/heads/internallb
Commit: 828959086c6e06aa1cd3cc16cae7ec36caf86d60
Parents: dac10ad
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Apr 10 14:57:56 2013 +0200
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 scripts/vm/systemvm/injectkeys.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82895908/scripts/vm/systemvm/injectkeys.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh
index 49adfb3..c17a3c6 100755
--- a/scripts/vm/systemvm/injectkeys.sh
+++ b/scripts/vm/systemvm/injectkeys.sh
@@ -69,9 +69,9 @@ copy_priv_key() {
   return $?
 }
 
-if [[ `whoami` == cloud* ]]
+if [[ "$EUID" -ne 0  ]]
 then
-   SUDO=$SUDO
+   SUDO="sudo "
 fi
 
 $SUDO mkdir -p $MOUNTPATH


[03/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: Remove reference to unused code
QuickCloud: remove some dead code in ConsoleProxyManager


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

Branch: refs/heads/internallb
Commit: 526da6fdd7803d5cc36cb42228daa981c8e82dbb
Parents: 254e576
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Mon Mar 25 12:13:51 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:34 2013 -0700

----------------------------------------------------------------------
 .../cloud/api/commands/DestroyConsoleProxyCmd.java |   12 +------
 .../cloud/consoleproxy/ConsoleProxyService.java    |   23 ---------------
 api/src/org/apache/cloudstack/api/BaseCmd.java     |    2 -
 .../cloud/consoleproxy/ConsoleProxyManager.java    |   17 +----------
 .../consoleproxy/ConsoleProxyManagerImpl.java      |   20 ++-----------
 .../cloud/consoleproxy/ConsoleProxyService.java    |    9 ++++++
 6 files changed, 15 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
index 829283e..f3210ce 100644
--- a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
+++ b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
@@ -17,14 +17,12 @@
 package com.cloud.api.commands;
 
 import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
+import com.cloud.exception.UnsupportedServiceException;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
@@ -82,12 +80,6 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
 
     @Override
     public void execute(){
-        boolean result = _consoleProxyService.destroyConsoleProxy(this);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy console proxy");
-        }
+        throw new UnsupportedServiceException("Use destroySystemVm API instead");
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/api/src/com/cloud/consoleproxy/ConsoleProxyService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/consoleproxy/ConsoleProxyService.java b/api/src/com/cloud/consoleproxy/ConsoleProxyService.java
deleted file mode 100644
index c347e0b..0000000
--- a/api/src/com/cloud/consoleproxy/ConsoleProxyService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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.consoleproxy;
-
-import com.cloud.api.commands.DestroyConsoleProxyCmd;
-
-public interface ConsoleProxyService {
-    boolean destroyConsoleProxy(DestroyConsoleProxyCmd cmd);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index 91c681d..41f085e 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -33,7 +33,6 @@ import org.apache.cloudstack.usage.UsageService;
 import org.apache.log4j.Logger;
 
 import com.cloud.configuration.ConfigurationService;
-import com.cloud.consoleproxy.ConsoleProxyService;
 import com.cloud.dao.EntityManager;
 import com.cloud.domain.Domain;
 import com.cloud.exception.ConcurrentOperationException;
@@ -111,7 +110,6 @@ public abstract class BaseCmd {
     @Inject public TemplateService _templateService;
     @Inject public SecurityGroupService _securityGroupService;
     @Inject public SnapshotService _snapshotService;
-    @Inject public ConsoleProxyService _consoleProxyService;
     @Inject public VpcVirtualNetworkApplianceService _routerService;
     @Inject public ResponseGenerator _responseGenerator;
     @Inject public EntityManager _entityMgr;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
index 6ebf3bc..faec513 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
@@ -16,17 +16,9 @@
 // under the License.
 package com.cloud.consoleproxy;
 
-import com.cloud.agent.api.AgentControlAnswer;
-import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
-import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
-import com.cloud.agent.api.StartupCommand;
-import com.cloud.host.HostVO;
-import com.cloud.host.Status;
-import com.cloud.host.Host.Type;
-import com.cloud.info.ConsoleProxyInfo;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.ConsoleProxyVO;
-public interface ConsoleProxyManager extends Manager {
+public interface ConsoleProxyManager extends Manager, ConsoleProxyService {
 	
 	public static final int DEFAULT_PROXY_CAPACITY = 50;
 	public static final int DEFAULT_STANDBY_CAPACITY = 10;
@@ -45,16 +37,9 @@ public interface ConsoleProxyManager extends Manager {
     public ConsoleProxyManagementState getManagementState();
     public void resumeLastManagementState();
 	
-	public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId);
-	
 	public ConsoleProxyVO startProxy(long proxyVmId);
 	public boolean stopProxy(long proxyVmId);
 	public boolean rebootProxy(long proxyVmId);
 	public boolean destroyProxy(long proxyVmId);
-
-	public void onLoadReport(ConsoleProxyLoadReportCommand cmd);
-	public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd);
 	
-    public void onAgentConnect(HostVO host, StartupCommand cmd);
-	public void onAgentDisconnect(long agentId, Status state);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 1edd869..fc4fc6e 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -30,7 +30,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.log4j.Logger;
@@ -54,7 +53,6 @@ import com.cloud.agent.api.proxy.StartConsoleProxyAgentHttpHandlerCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.agent.manager.Commands;
-import com.cloud.api.commands.DestroyConsoleProxyCmd;
 import com.cloud.certificate.dao.CertificateDao;
 import com.cloud.cluster.ClusterManager;
 import com.cloud.configuration.Config;
@@ -71,7 +69,6 @@ import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.OperationTimedoutException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
@@ -113,8 +110,8 @@ import com.cloud.servlet.ConsoleProxyServlet;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePoolStatus;
 import com.cloud.storage.VMTemplateHostVO;
-import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.dao.DiskOfferingDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VMTemplateHostDao;
@@ -127,7 +124,6 @@ import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GlobalLock;
@@ -170,7 +166,8 @@ import com.google.gson.GsonBuilder;
 // because sooner or later, it will be driven into Running state
 //
 @Local(value = { ConsoleProxyManager.class, ConsoleProxyService.class })
-public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager, ConsoleProxyService, AgentHook, VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
+public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager,
+        AgentHook, VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
     private static final Logger s_logger = Logger.getLogger(ConsoleProxyManagerImpl.class);
 
     private static final int DEFAULT_CAPACITY_SCAN_INTERVAL = 30000; // 30 seconds
@@ -1549,18 +1546,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
         return true;
     }
 
-    @Override
-    public boolean destroyConsoleProxy(DestroyConsoleProxyCmd cmd) throws ServerApiException {
-        Long proxyId = cmd.getId();
 
-        // verify parameters
-        ConsoleProxyVO proxy = _consoleProxyDao.findById(proxyId);
-        if (proxy == null) {
-            throw new InvalidParameterValueException("unable to find a console proxy with id " + proxyId);
-        }
-
-        return destroyProxy(proxyId);
-    }
 
     protected ConsoleProxyManagerImpl() {
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526da6fd/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyService.java b/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
new file mode 100644
index 0000000..e43e5c3
--- /dev/null
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
@@ -0,0 +1,9 @@
+package com.cloud.consoleproxy;
+
+import com.cloud.info.ConsoleProxyInfo;
+
+public interface ConsoleProxyService {
+
+    public abstract ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId);
+
+}
\ No newline at end of file


[16/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1974: cloudstack UI - Infrastructure menu - zone detail - public traffic type - IP Ranges tab - add action filter.


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

Branch: refs/heads/internallb
Commit: 56a1facb9d6fedb867c712a1b3992ca182199ec6
Parents: 5516a5a
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Apr 9 17:15:55 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/56a1facb/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index d89f6b6..f74711d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -565,6 +565,14 @@
                         });
                       }
                     },
+										actionPreFilter: function(args) {										  
+											var actionsToShow = ['destroy'];											
+											if(args.context.multiRule[0].domain == 'ROOT' && args.context.multiRule[0].account.account == 'system')  
+											  actionsToShow.push('addAccount');
+											else
+											  actionsToShow.push('releaseFromAccount');											
+											return actionsToShow;
+										},
                     actions: {
                       destroy: {
                         label: 'label.remove.ip.range',
@@ -588,7 +596,7 @@
                             }
                           });
                         }
-                      },
+                      },											
 											/*
 											releaseFromAccount: {
                         label: 'Release from Account',
@@ -643,7 +651,10 @@
 												},												
 												action: function(args) {                          							
 												  var data = {
-														id: args.context.multiRule[0].id
+														id: args.context.multiRule[0].id,
+														zoneid: args.context.multiRule[0].zoneid,
+														domainid: args.data.domainid,
+														account: args.data.account
 													};												
                           $.ajax({
                             url: createURL('dedicatePublicIpRange'),
@@ -663,8 +674,8 @@
                             }
                           });
                         }
-											}
-											*/
+											}	
+                      */											
                     },
                     dataProvider: function(args) {
                       $.ajax({


[35/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Install open-vm-tools, vmwaretools alternative

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: dac10ad1245cb8953f84e3766668989aff45580a
Parents: 4304d84
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 18:10:03 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/postinstall.sh    |    3 +--
 .../definitions/systemvmtemplate64/postinstall.sh  |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dac10ad1/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index 0395f38..176c93f 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -64,8 +64,7 @@ install_packages() {
   apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
 
   # vmware tools
-  # uncomment for opensource vmware tool:
-  #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
+  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
   df -h
   PREVDIR=$PWD

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dac10ad1/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
index 0395f38..176c93f 100644
--- a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
@@ -64,8 +64,7 @@ install_packages() {
   apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
 
   # vmware tools
-  # uncomment for opensource vmware tool:
-  #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
+  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
   df -h
   PREVDIR=$PWD


[29/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Fix systemvm's preseed to give more space for /usr

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 18b8d1acc28916dda577c5a23aa752dfd6f0b600
Parents: 9beccfd
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 16:03:46 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg       |    6 +++---
 .../definitions/systemvmtemplate64/preseed.cfg     |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18b8d1ac/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index ac9edd3..aa75e13 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              400 40 500 ext4                                 \
+              300 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              500 30 1000 ext4                                \
+              650 30 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -156,7 +156,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              500 60 1000 ext4                                \
+              450 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18b8d1ac/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index ac9edd3..aa75e13 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              400 40 500 ext4                                 \
+              300 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              500 30 1000 ext4                                \
+              650 30 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -156,7 +156,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              500 60 1000 ext4                                \
+              450 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \


[30/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1867: Install vmwaretools while buildling systemvms

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: bc7065349bde0821c412c859004d25a22b0ceed5
Parents: 18b8d1a
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 16:06:06 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/postinstall.sh    |   17 +++++++++++++-
 .../definitions/systemvmtemplate64/postinstall.sh  |   17 +++++++++++++-
 2 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc706534/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index 5d529de..bf593b6 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -50,8 +50,6 @@ install_packages() {
   echo "openswan openswan/install_x509_certificate seen true" | debconf-set-selections
   apt-get --no-install-recommends -q -y --force-yes install openswan
 
-  # vmware tools
-  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   # xenstore utils
   apt-get --no-install-recommends -q -y --force-yes install xenstore-utils libxenstore3.0
   # keepalived and conntrackd for redundant router
@@ -64,6 +62,21 @@ install_packages() {
   echo "iptables-persistent iptables-persistent/autosave_v4 boolean true" | debconf-set-selections
   echo "iptables-persistent iptables-persistent/autosave_v6 boolean true" | debconf-set-selections
   apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
+
+  # vmware tools
+  # uncomment for opensource vmware tool:
+  #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
+  apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  PREVDIR=$PWD
+  cd /opt
+  wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
+  tar xzf VMwareTools-9.2.1-818201.tar.gz
+  rm VMwareTools-*.tar.gz
+  cd vmware-tools-distrib
+  ./vmware-install.pl -d
+  cd $PREV
+  rm -fr /opt/vmware-tools-distrib
+  apt-get -q -y --force-yes purge build-essential gcc
 }
 
 setup_accounts() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc706534/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
index 5d529de..bf593b6 100644
--- a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
@@ -50,8 +50,6 @@ install_packages() {
   echo "openswan openswan/install_x509_certificate seen true" | debconf-set-selections
   apt-get --no-install-recommends -q -y --force-yes install openswan
 
-  # vmware tools
-  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   # xenstore utils
   apt-get --no-install-recommends -q -y --force-yes install xenstore-utils libxenstore3.0
   # keepalived and conntrackd for redundant router
@@ -64,6 +62,21 @@ install_packages() {
   echo "iptables-persistent iptables-persistent/autosave_v4 boolean true" | debconf-set-selections
   echo "iptables-persistent iptables-persistent/autosave_v6 boolean true" | debconf-set-selections
   apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
+
+  # vmware tools
+  # uncomment for opensource vmware tool:
+  #   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
+  apt-get --no-install-recommends -q -y --force-yes install build-essential gcc linux-headers-`uname -r`
+  PREVDIR=$PWD
+  cd /opt
+  wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
+  tar xzf VMwareTools-9.2.1-818201.tar.gz
+  rm VMwareTools-*.tar.gz
+  cd vmware-tools-distrib
+  ./vmware-install.pl -d
+  cd $PREV
+  rm -fr /opt/vmware-tools-distrib
+  apt-get -q -y --force-yes purge build-essential gcc
 }
 
 setup_accounts() {


[24/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1862 Added vm ip address info in the list PF rules response

Signed-off-by: Abhinandan Prateek <ap...@apache.org>


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

Branch: refs/heads/internallb
Commit: 9beccfdb5db5de75362b1cada5844f168631db81
Parents: 2dbaf8a
Author: Jayapal <ja...@citrix.com>
Authored: Wed Apr 10 12:19:06 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../api/response/FirewallRuleResponse.java         |   12 ++++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9beccfdb/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
index 08722ae..787410a 100644
--- a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
@@ -71,6 +71,18 @@ public class FirewallRuleResponse extends BaseResponse {
     @SerializedName(ApiConstants.TAGS)  @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class)
     private List<ResourceTagResponse> tags;
 
+    @SerializedName(ApiConstants.VM_GUEST_IP) @Param(description="the vm ip address for the port forwarding rule")
+    private String destNatVmIp;
+
+
+    public String getDestNatVmIp() {
+        return destNatVmIp;
+    }
+
+    public void setDestNatVmIp(String destNatVmIp) {
+        this.destNatVmIp = destNatVmIp;
+    }
+
 
     @Override
     public String getObjectId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9beccfdb/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 724a511..993e374 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -971,6 +971,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         response.setPublicIpAddress(ip.getAddress().addr());
 
         if (ip != null && fwRule.getDestinationIpAddress() != null) {
+            response.setDestNatVmIp(fwRule.getDestinationIpAddress().toString());
             UserVm vm = ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId());
             if (vm != null) {
                 response.setVirtualMachineId(vm.getUuid());


[46/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Fix preseed, sum of partitions should be 2000M

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 489e6f40ea919a13f2a7750250a79da5b4effa79
Parents: 767478c
Author: Rohit Yadav <bh...@apache.org>
Authored: Thu Apr 11 00:08:35 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg       |    6 +++---
 .../definitions/systemvmtemplate64/preseed.cfg     |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/489e6f40/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index 79349f6..6996565 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              700 20 1100 ext4                                \
+              650 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -156,7 +156,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              500 60 1000 ext4                                \
+              450 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \
@@ -166,7 +166,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \
               .                                               \
-              50 512 300% linux-swap                          \
+              70 512 300% linux-swap                          \
                       method{ swap } format{ }                \
               .
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/489e6f40/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index 79349f6..6996565 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              700 20 1100 ext4                                \
+              650 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -156,7 +156,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              500 60 1000 ext4                                \
+              450 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \
@@ -166,7 +166,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \
               .                                               \
-              50 512 300% linux-swap                          \
+              70 512 300% linux-swap                          \
                       method{ swap } format{ }                \
               .
 


[08/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: option to build with componentContext tailored for quickcloud
For now it replaces ConsoleProxyManagerImpl with StaticConsoleProxyManager
Usage: mvn install -Dquickcloud

QuickCloud: rename deploy profile

QuickCloud: remove cyclic dependency introduced in nonoss build by moving SecondaryStorageDiscoverer into services
However with this fix, developers will be unable to run 'PremiumSecondaryStorageResource' (for VMWare installations) using mvn exec:java.
Instead they will have to use the exploded archive from systemvm.zip


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

Branch: refs/heads/internallb
Commit: 60a1916fed1971cdb91b85854e31dbf859230db8
Parents: 7fb8b04
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Mar 26 16:40:19 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 client/pom.xml                                     |   16 +
 .../tomcatconf/quickCloudComponentContext.xml.in   |  336 +++++++++++++++
 plugins/hypervisors/simulator/pom.xml              |    5 +
 .../resource/SimulatorSecondaryDiscoverer.java     |    3 +-
 plugins/hypervisors/vmware/pom.xml                 |    5 +
 server/pom.xml                                     |    5 -
 .../secondary/SecondaryStorageDiscoverer.java      |  322 --------------
 services/console-proxy/server/pom.xml              |   10 +-
 services/secondary-storage/pom.xml                 |   28 +-
 .../resource/SecondaryStorageDiscoverer.java       |  320 ++++++++++++++
 tools/devcloud/pom.xml                             |    4 +-
 11 files changed, 695 insertions(+), 359 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 70924bc..3e27a4a 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -458,6 +458,22 @@
               </target>
             </configuration>
           </execution>
+          <execution>
+            <id>process-quickcloud-spring-context</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target if="${quickcloud}">
+                <echo>quickcloud</echo>
+                <replaceregexp
+                  file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
+                  match="classpath:componentContext.xml"
+                  replace="classpath:quickCloudComponentContext.xml" byline="true" />
+              </target>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <!-- there are the jasypt libs requires by some of the python scripts -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/client/tomcatconf/quickCloudComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/quickCloudComponentContext.xml.in b/client/tomcatconf/quickCloudComponentContext.xml.in
new file mode 100644
index 0000000..dbd3117
--- /dev/null
+++ b/client/tomcatconf/quickCloudComponentContext.xml.in
@@ -0,0 +1,336 @@
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx" 
+  xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/tx 
+                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+                      http://www.springframework.org/schema/aop
+                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">                     
+
+
+  <!--
+      Compose a CloudStack deployment with selected components here
+  -->
+  <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
+  <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
+  <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
+  
+  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
+    <property name="UserAuthenticators">
+        <list>
+            <ref bean="MD5UserAuthenticator"/>
+            <ref bean="LDAPUserAuthenticator"/>
+        </list>
+    </property>
+  </bean>
+ 
+  <bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
+    <property name="UserAuthenticators">
+        <list>
+            <ref bean="MD5UserAuthenticator"/>
+            <ref bean="LDAPUserAuthenticator"/>
+        </list>
+    </property>
+  </bean>
+   
+  <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
+  <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
+  <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl" />
+  <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl" />
+  <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
+  <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.StaticConsoleProxyManager" />
+  <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
+  <bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
+  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
+  <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
+
+  <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
+  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
+  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
+  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
+  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
+  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
+  <bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
+  <bean id="UcsBladeDao" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
+  <bean id="UcsManagerDao" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
+
+   
+  <!--
+      Network Elements
+  -->
+  <bean id="Ovs" class="com.cloud.network.element.OvsElement">
+    <property name="name" value="Ovs"/>
+  </bean>
+  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
+      <property name="name" value="BareMetalDhcp"/>
+  </bean>
+  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
+      <property name="name" value="BareMetalPxe"/>
+  </bean>
+  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
+      <property name="name" value="BareMetalUserdata"/>
+  </bean>
+  <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
+    <property name="name" value="SecurityGroupProvider"/>
+  </bean>
+  <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
+    <property name="name" value="VirtualRouter"/>
+  </bean>
+  <bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
+    <property name="name" value="VpcVirtualRouter"/>
+  </bean>
+  <!--
+  <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
+    <property name="name" value="NiciraNvp"/>
+  </bean>
+  -->
+  
+<!--
+  <bean id="BigSwitchVnsElementService" class="com.cloud.network.element.BigSwitchVnsElement">
+    <property name="name" value="BigSwitchVnsElementService"/>
+  </bean>
+-->
+                   
+  <!--
+     Adapters
+  -->
+  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
+    <property name="name" value="FirstFitRouting"/>
+  </bean>
+  
+  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
+    <property name="name" value="HypervisorAdapter"/>
+  </bean>
+  
+  <!--
+    Storage pool allocators
+  -->
+
+  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
+    <property name="name" value="LocalStorage"/>
+  </bean>
+  <!--
+  <bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
+    <property name="name" value="Storage"/>
+  </bean>
+  -->
+
+  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
+    <property name="name" value="User First"/>
+  </bean>
+
+  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
+    <property name="name" value="Balance"/>
+  </bean>
+
+  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
+
+  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
+    <property name="name" value="Basic"/>
+  </bean>
+
+  <bean id="HypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
+    <property name="name" value="HypervisorAdapter"/>
+  </bean>
+
+  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" >
+    <property name="name" value="BareMetalTemplateAdapter"/>
+  </bean>
+
+  <!--
+    Authenticators
+  -->
+  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
+    <property name="name" value="MD5"/>
+  </bean>
+
+  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
+    <property name="name" value="LDAP"/>
+  </bean>
+
+  <!--
+    Investigators
+  -->
+  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
+    <property name="name" value="SimpleInvestigator"/>
+  </bean>
+
+  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
+    <property name="name" value="XenServerInvestigator"/>
+  </bean>
+  
+  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
+    <property name="name" value="PingInvestigator"/>
+  </bean>
+
+  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
+    <property name="name" value="ManagementIPSysVMInvestigator"/>
+  </bean>
+
+  <!--
+    Fencers
+  -->
+  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
+    <property name="name" value="XenServerFenceBuilder"/>
+  </bean>
+  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
+    <property name="name" value="KVMFenceBuilder"/>
+  </bean>
+  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
+    <property name="name" value="OvmFenceBuilder"/>
+  </bean>
+
+  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
+    <property name="name" value="XCP Agent"/>
+  </bean>
+
+  <!--
+  <bean id="SimulatorSecondaryStorageDiscoverer" class="com.cloud.resource.SimulatorSecondaryDiscoverer">
+    <property name="name" value="SecondaryStorage"/>
+  </bean>
+  -->
+
+  <bean id="SecondaryStorageDiscoverer" class="org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer">
+    <property name="name" value="SecondaryStorage"/>
+  </bean>
+
+  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
+    <property name="name" value="KVM Agent"/>
+  </bean>
+
+  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
+    <property name="name" value="Simulator Agent"/>
+  </bean>
+
+
+  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
+    <property name="name" value="Bare Metal Agent"/>
+  </bean>
+
+  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
+    <property name="name" value="SCVMMServer"/>
+  </bean>
+
+  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
+    <property name="name" value="Ovm Discover"/>
+  </bean>
+
+  <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
+    <property name="name" value="First Fit"/>
+  </bean>
+
+  <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
+    <property name="name" value="UserDispersing"/>
+  </bean>
+  
+  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
+    <property name="name" value="UserConcentratedPod"/>
+  </bean>
+
+  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
+    <property name="name" value="BareMetal Fit"/>
+  </bean>
+    
+  <bean id="BaremetalPlannerSelector" class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
+    <property name="name" value="BaremetalPlannerSelector"/>
+  </bean>
+
+  <bean id="HypervisorPlannerSelector" class="com.cloud.deploy.HypervisorVmPlannerSelector">
+    <property name="name" value="HypervisorPlannerSelector"/>
+  </bean>
+    
+   
+  <!--
+    Network Gurus
+  -->
+  <bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
+    <property name="name" value="StorageNetworkGuru"/>
+  </bean>
+  <bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
+    <property name="name" value="ExternalGuestNetworkGuru"/>
+  </bean>
+  <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
+    <property name="name" value="PublicNetworkGuru"/>
+  </bean>
+  <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
+    <property name="name" value="PodBasedNetworkGuru"/>
+  </bean>
+  <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
+    <property name="name" value="ControlNetworkGuru"/>
+  </bean>
+  <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
+    <property name="name" value="DirectNetworkGuru"/>
+  </bean>
+  <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
+    <property name="name" value="DirectPodBasedNetworkGuru"/>
+  </bean>
+  <bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
+    <property name="name" value="OvsGuestNetworkGuru"/>
+  </bean>
+  <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
+    <property name="name" value="PrivateNetworkGuru"/>
+  </bean>
+  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
+    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
+  </bean>
+  
+<!--  
+  <bean id="BigSwitchVnsGuestNetworkGuru" class=".BigSwitchVnsGuestNetworkGuru">
+    <property name="name" value="com.cloud.network.guru.BigSwitchVnsGuestNetworkGuru"/>
+  </bean>
+-->
+ 
+  <!--
+   Hypervisor Gurus
+  -->
+  <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
+    <property name="name" value="XenServerGuru"/>
+  </bean>
+  
+  <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
+    <property name="name" value="KVMGuru"/>
+  </bean>
+  
+  <bean id="HypervGuru" class="com.cloud.hypervisor.guru.HypervGuru">
+    <property name="name" value="HypervGuru"/>
+  </bean>
+
+  <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
+    <property name="name" value="OvmGuru"/>
+  </bean>
+  
+  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
+    <property name="name" value="SimulatorGuru"/>
+  </bean>
+
+  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
+    <property name="name" value="BaremetalGuru"/>
+  </bean>
+
+  <bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl">
+  </bean>
+  
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/plugins/hypervisors/simulator/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/pom.xml b/plugins/hypervisors/simulator/pom.xml
index ff1664a..e4ca927 100644
--- a/plugins/hypervisors/simulator/pom.xml
+++ b/plugins/hypervisors/simulator/pom.xml
@@ -40,5 +40,10 @@
       <artifactId>cloud-utils</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-secondary-storage</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
index 3a8cf17..c121fba 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
@@ -24,6 +24,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer;
 import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
@@ -40,9 +41,7 @@ import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.storage.SnapshotVO;
 import com.cloud.storage.dao.SnapshotDao;
-import com.cloud.storage.secondary.SecondaryStorageDiscoverer;
 import com.cloud.utils.exception.CloudRuntimeException;
-import org.springframework.stereotype.Component;
 
 
 @Local(value=Discoverer.class)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/plugins/hypervisors/vmware/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/pom.xml b/plugins/hypervisors/vmware/pom.xml
index 468e0a5..d65ef64 100644
--- a/plugins/hypervisors/vmware/pom.xml
+++ b/plugins/hypervisors/vmware/pom.xml
@@ -33,6 +33,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-secondary-storage</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>com.cloud.com.vmware</groupId>
       <artifactId>vmware-vim25</artifactId>
       <version>${cs.vmware.api.version}</version>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 8a6a10c..a397195 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -32,11 +32,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-secondary-storage</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>${cs.servlet.version}</version>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java b/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
deleted file mode 100755
index 6e66e0d..0000000
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
+++ /dev/null
@@ -1,322 +0,0 @@
-// 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.storage.secondary;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.storage.resource.LocalSecondaryStorageResource;
-import org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource;
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.AgentManager;
-import com.cloud.configuration.dao.ConfigurationDao;
-import com.cloud.host.HostVO;
-import com.cloud.host.Status.Event;
-import com.cloud.host.dao.HostDao;
-import com.cloud.hypervisor.Hypervisor;
-import com.cloud.resource.Discoverer;
-import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ServerResource;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.storage.VMTemplateZoneVO;
-import com.cloud.storage.dao.VMTemplateDao;
-import com.cloud.storage.dao.VMTemplateHostDao;
-import com.cloud.storage.dao.VMTemplateZoneDao;
-import com.cloud.storage.resource.DummySecondaryStorageResource;
-import com.cloud.utils.component.ComponentContext;
-import com.cloud.utils.net.NfsUtils;
-import com.cloud.utils.script.Script;
-
-/**
- * SecondaryStorageDiscoverer is used to discover secondary
- * storage servers and make sure everything it can do is
- * correct.
- */
-@Local(value=Discoverer.class)
-public class SecondaryStorageDiscoverer extends DiscovererBase implements Discoverer {
-    private static final Logger s_logger = Logger.getLogger(SecondaryStorageDiscoverer.class);
-    
-    long _timeout = 2 * 60 * 1000; // 2 minutes
-    String _mountParent;
-    boolean _useServiceVM = false;
-    
-    Random _random = new Random(System.currentTimeMillis());
-    @Inject
-    protected HostDao _hostDao = null;
-    @Inject
-    protected VMTemplateDao _tmpltDao = null;
-    @Inject
-    protected VMTemplateHostDao _vmTemplateHostDao = null;
-    @Inject
-    protected VMTemplateZoneDao _vmTemplateZoneDao = null;
-    @Inject
-    protected VMTemplateDao _vmTemplateDao = null;
-    @Inject
-    protected ConfigurationDao _configDao = null;
-    @Inject
-    protected AgentManager _agentMgr = null;
-    
-    protected SecondaryStorageDiscoverer() {
-    }
-    
-    @Override
-    public Map<? extends ServerResource, Map<String, String>> find(long dcId, Long podId, Long clusterId, URI uri, String username, String password, List<String> hostTags) {
-        if (!uri.getScheme().equalsIgnoreCase("nfs") && !uri.getScheme().equalsIgnoreCase("file")
-                && !uri.getScheme().equalsIgnoreCase("iso") && !uri.getScheme().equalsIgnoreCase("dummy")) {
-            s_logger.debug("It's not NFS or file or ISO, so not a secondary storage server: " + uri.toString());
-            return null;
-        }
-
-        if (uri.getScheme().equalsIgnoreCase("nfs") || uri.getScheme().equalsIgnoreCase("iso")) {
-            return createNfsSecondaryStorageResource(dcId, podId, uri);
-        } else if (uri.getScheme().equalsIgnoreCase("file")) {
-            return createLocalSecondaryStorageResource(dcId, podId, uri);
-        } else if (uri.getScheme().equalsIgnoreCase("dummy")) {
-            return createDummySecondaryStorageResource(dcId, podId, uri);
-        } else {
-            return null;
-        }
-    }
-    
-    protected Map<? extends ServerResource, Map<String, String>> createNfsSecondaryStorageResource(long dcId, Long podId, URI uri) {
-        
-    	if (_useServiceVM) {
-    	    return createDummySecondaryStorageResource(dcId, podId, uri);
-    	}
-        String mountStr = NfsUtils.uri2Mount(uri);
-        
-        Script script = new Script(true, "mount", _timeout, s_logger);
-        String mntPoint = null;
-        File file = null;
-        do {
-            mntPoint = _mountParent + File.separator + Integer.toHexString(_random.nextInt(Integer.MAX_VALUE));
-            file = new File(mntPoint);
-        } while (file.exists());
-                
-        if (!file.mkdirs()) {
-            s_logger.warn("Unable to make directory: " + mntPoint);
-            return null;
-        }
-        
-        script.add(mountStr, mntPoint);
-        String result = script.execute();
-        if (result != null && !result.contains("already mounted")) {
-            s_logger.warn("Unable to mount " + uri.toString() + " due to " + result);
-            file.delete();
-            return null;
-        }
-        
-        script = new Script(true, "umount", 0, s_logger);
-        script.add(mntPoint);
-        script.execute();
-        
-        file.delete();
-        
-        Map<NfsSecondaryStorageResource, Map<String, String>> srs = new HashMap<NfsSecondaryStorageResource, Map<String, String>>();
-        
-        NfsSecondaryStorageResource storage;
-        if(_configDao.isPremium()) {
-            Class<?> impl;
-            String name = "com.cloud.storage.resource.PremiumSecondaryStorageResource";
-            try {
-                impl = Class.forName(name);
-                final Constructor<?> constructor = impl.getDeclaredConstructor();
-                constructor.setAccessible(true);
-                storage = (NfsSecondaryStorageResource)constructor.newInstance();
-            } catch (final ClassNotFoundException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to ClassNotFoundException");
-            	return null;
-            } catch (final SecurityException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to SecurityException");
-            	return null;
-            } catch (final NoSuchMethodException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to NoSuchMethodException");
-            	return null;
-            } catch (final IllegalArgumentException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to IllegalArgumentException");
-            	return null;
-            } catch (final InstantiationException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to InstantiationException");
-            	return null;
-            } catch (final IllegalAccessException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to IllegalAccessException");
-            	return null;
-            } catch (final InvocationTargetException e) {
-            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to InvocationTargetException");
-            	return null;
-            }
-        } else {
-        	storage = new NfsSecondaryStorageResource();
-        }
-        
-        Map<String, String> details = new HashMap<String, String>();
-        details.put("mount.path", mountStr);
-        details.put("orig.url", uri.toString());
-        details.put("mount.parent", _mountParent);
-        
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.putAll(details);
-        params.put("zone", Long.toString(dcId));
-        if (podId != null) {
-            params.put("pod", podId.toString());
-        }
-        params.put("guid", uri.toString());
-        params.put("secondary.storage.vm", "false");
-        params.put("max.template.iso.size", _configDao.getValue("max.template.iso.size"));
-        
-        try {
-            storage.configure("Storage", params);
-        } catch (ConfigurationException e) {
-            s_logger.warn("Unable to configure the storage ", e);
-            return null;
-        }
-        srs.put(storage, details);
-        
-        return srs;
-    }
-    
-    protected Map<? extends ServerResource, Map<String, String>> createLocalSecondaryStorageResource(long dcId, Long podId, URI uri) {
-        Map<LocalSecondaryStorageResource, Map<String, String>> srs = new HashMap<LocalSecondaryStorageResource, Map<String, String>>();
-        
-        LocalSecondaryStorageResource storage = new LocalSecondaryStorageResource();
-        storage = ComponentContext.inject(storage);
-        
-        Map<String, String> details = new HashMap<String, String>();
-        
-        File file = new File(uri);
-        details.put("mount.path", file.getAbsolutePath());
-        details.put("orig.url", uri.toString());
-        
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.putAll(details);
-        params.put("zone", Long.toString(dcId));
-        if (podId != null) {
-            params.put("pod", podId.toString());
-        }
-        params.put("guid", uri.toString());
-        
-        try {
-            storage.configure("Storage", params);
-        } catch (ConfigurationException e) {
-            s_logger.warn("Unable to configure the storage ", e);
-            return null;
-        }
-        srs.put(storage, details);
-        
-        return srs;
-    }
-    
-    protected Map<ServerResource, Map<String, String>> createDummySecondaryStorageResource(long dcId, Long podId, URI uri) {
-        Map<ServerResource, Map<String, String>> srs = new HashMap<ServerResource, Map<String, String>>();
-        
-        DummySecondaryStorageResource storage = new DummySecondaryStorageResource(_useServiceVM);
-        storage = ComponentContext.inject(storage);
-        
-        Map<String, String> details = new HashMap<String, String>();
-        
-        details.put("mount.path", uri.toString());
-        details.put("orig.url", uri.toString());
-        
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.putAll(details);
-        params.put("zone", Long.toString(dcId));
-        if (podId != null) {
-            params.put("pod", podId.toString());
-        }
-        params.put("guid", uri.toString());
-        
-        try {
-            storage.configure("Storage", params);
-        } catch (ConfigurationException e) {
-            s_logger.warn("Unable to configure the storage ", e);
-            return null;
-        }
-        srs.put(storage, details);
-        
-        return srs;
-    }
-    
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        super.configure(name, params);
-        
-        _mountParent = _params.get("mount.parent");
-        if (_mountParent == null) {
-            _mountParent = "/mnt";
-        }
-        
-        String useServiceVM = _params.get("secondary.storage.vm");
-        if ("true".equalsIgnoreCase(useServiceVM)){
-        	_useServiceVM = true;
-        }
-        return true;
-    }
-    
-    @Override
-	public boolean matchHypervisor(String hypervisor) {
-        if( hypervisor.equals("SecondaryStorage")) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-	public Hypervisor.HypervisorType getHypervisorType() {
-    	return Hypervisor.HypervisorType.None;
-    }
-    
-	@Override
-	public void postDiscovery(List<HostVO> hosts, long msId) {
-		if (_useServiceVM) {
-			for (HostVO h: hosts) {
-				_agentMgr.agentStatusTransitTo(h, Event.AgentDisconnected, msId);
-			}
-		}
-		for (HostVO h: hosts) {
-			associateTemplatesToZone(h.getId(), h.getDataCenterId());
-		}
-		
-	}
-	
-    private void associateTemplatesToZone(long hostId, long dcId){
-    	VMTemplateZoneVO tmpltZone;
-
-    	List<VMTemplateVO> allTemplates = _vmTemplateDao.listAll();
-    	for (VMTemplateVO vt: allTemplates){
-    		if (vt.isCrossZones()) {
-    			tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId());
-    			if (tmpltZone == null) {
-    				VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date());
-    				_vmTemplateZoneDao.persist(vmTemplateZone);
-    			}
-    		}
-    	}
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/services/console-proxy/server/pom.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/pom.xml b/services/console-proxy/server/pom.xml
index fd7b964..3d149a5 100644
--- a/services/console-proxy/server/pom.xml
+++ b/services/console-proxy/server/pom.xml
@@ -57,6 +57,11 @@
       <version>${project.version}</version>
       <type>pom</type>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-secondary-storage</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
   <build>
     <defaultGoal>install</defaultGoal>
@@ -256,11 +261,6 @@
     </profile>
     <profile>
       <id>quickcloud</id>
-      <activation>
-        <property>
-          <name>quickcloud</name>
-        </property>
-      </activation>
       <build>
       <plugins>
       <plugin>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/services/secondary-storage/pom.xml
----------------------------------------------------------------------
diff --git a/services/secondary-storage/pom.xml b/services/secondary-storage/pom.xml
index d8dbf1d..0577084 100644
--- a/services/secondary-storage/pom.xml
+++ b/services/secondary-storage/pom.xml
@@ -54,6 +54,11 @@
       <version>${project.version}</version>
       <type>pom</type>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-server</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
   <build>
     <defaultGoal>install</defaultGoal>
@@ -87,27 +92,4 @@
       </plugin>
     </plugins>
   </build>
-  <profiles>
-    <profile>
-      <id>vmware</id>
-      <activation>
-        <property>
-          <name>nonoss</name>
-        </property>
-      </activation>
-        <dependencies>
-            <dependency>
-                <groupId>org.apache.cloudstack</groupId>
-                <artifactId>cloud-plugin-hypervisor-vmware</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.cloudstack</groupId>
-                <artifactId>cloud-vmware-base</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-        </dependencies>
-    </profile>
-  </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/services/secondary-storage/src/org/apache/cloudstack/storage/resource/SecondaryStorageDiscoverer.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/SecondaryStorageDiscoverer.java b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/SecondaryStorageDiscoverer.java
new file mode 100755
index 0000000..d3af792
--- /dev/null
+++ b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/SecondaryStorageDiscoverer.java
@@ -0,0 +1,320 @@
+// 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.storage.resource;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status.Event;
+import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.resource.Discoverer;
+import com.cloud.resource.DiscovererBase;
+import com.cloud.resource.ServerResource;
+import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.VMTemplateZoneVO;
+import com.cloud.storage.dao.VMTemplateDao;
+import com.cloud.storage.dao.VMTemplateHostDao;
+import com.cloud.storage.dao.VMTemplateZoneDao;
+import com.cloud.storage.resource.DummySecondaryStorageResource;
+import com.cloud.utils.component.ComponentContext;
+import com.cloud.utils.net.NfsUtils;
+import com.cloud.utils.script.Script;
+
+/**
+ * SecondaryStorageDiscoverer is used to discover secondary
+ * storage servers and make sure everything it can do is
+ * correct.
+ */
+@Local(value=Discoverer.class)
+public class SecondaryStorageDiscoverer extends DiscovererBase implements Discoverer {
+    private static final Logger s_logger = Logger.getLogger(SecondaryStorageDiscoverer.class);
+    
+    long _timeout = 2 * 60 * 1000; // 2 minutes
+    String _mountParent;
+    boolean _useServiceVM = false;
+    
+    Random _random = new Random(System.currentTimeMillis());
+    @Inject
+    protected HostDao _hostDao = null;
+    @Inject
+    protected VMTemplateDao _tmpltDao = null;
+    @Inject
+    protected VMTemplateHostDao _vmTemplateHostDao = null;
+    @Inject
+    protected VMTemplateZoneDao _vmTemplateZoneDao = null;
+    @Inject
+    protected VMTemplateDao _vmTemplateDao = null;
+    @Inject
+    protected ConfigurationDao _configDao = null;
+    @Inject
+    protected AgentManager _agentMgr = null;
+    
+    protected SecondaryStorageDiscoverer() {
+    }
+    
+    @Override
+    public Map<? extends ServerResource, Map<String, String>> find(long dcId, Long podId, Long clusterId, URI uri, String username, String password, List<String> hostTags) {
+        if (!uri.getScheme().equalsIgnoreCase("nfs") && !uri.getScheme().equalsIgnoreCase("file")
+                && !uri.getScheme().equalsIgnoreCase("iso") && !uri.getScheme().equalsIgnoreCase("dummy")) {
+            s_logger.debug("It's not NFS or file or ISO, so not a secondary storage server: " + uri.toString());
+            return null;
+        }
+
+        if (uri.getScheme().equalsIgnoreCase("nfs") || uri.getScheme().equalsIgnoreCase("iso")) {
+            return createNfsSecondaryStorageResource(dcId, podId, uri);
+        } else if (uri.getScheme().equalsIgnoreCase("file")) {
+            return createLocalSecondaryStorageResource(dcId, podId, uri);
+        } else if (uri.getScheme().equalsIgnoreCase("dummy")) {
+            return createDummySecondaryStorageResource(dcId, podId, uri);
+        } else {
+            return null;
+        }
+    }
+    
+    protected Map<? extends ServerResource, Map<String, String>> createNfsSecondaryStorageResource(long dcId, Long podId, URI uri) {
+        
+    	if (_useServiceVM) {
+    	    return createDummySecondaryStorageResource(dcId, podId, uri);
+    	}
+        String mountStr = NfsUtils.uri2Mount(uri);
+        
+        Script script = new Script(true, "mount", _timeout, s_logger);
+        String mntPoint = null;
+        File file = null;
+        do {
+            mntPoint = _mountParent + File.separator + Integer.toHexString(_random.nextInt(Integer.MAX_VALUE));
+            file = new File(mntPoint);
+        } while (file.exists());
+                
+        if (!file.mkdirs()) {
+            s_logger.warn("Unable to make directory: " + mntPoint);
+            return null;
+        }
+        
+        script.add(mountStr, mntPoint);
+        String result = script.execute();
+        if (result != null && !result.contains("already mounted")) {
+            s_logger.warn("Unable to mount " + uri.toString() + " due to " + result);
+            file.delete();
+            return null;
+        }
+        
+        script = new Script(true, "umount", 0, s_logger);
+        script.add(mntPoint);
+        script.execute();
+        
+        file.delete();
+        
+        Map<NfsSecondaryStorageResource, Map<String, String>> srs = new HashMap<NfsSecondaryStorageResource, Map<String, String>>();
+        
+        NfsSecondaryStorageResource storage;
+        if(_configDao.isPremium()) {
+            Class<?> impl;
+            String name = "com.cloud.storage.resource.PremiumSecondaryStorageResource";
+            try {
+                impl = Class.forName(name);
+                final Constructor<?> constructor = impl.getDeclaredConstructor();
+                constructor.setAccessible(true);
+                storage = (NfsSecondaryStorageResource)constructor.newInstance();
+            } catch (final ClassNotFoundException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to ClassNotFoundException");
+            	return null;
+            } catch (final SecurityException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to SecurityException");
+            	return null;
+            } catch (final NoSuchMethodException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to NoSuchMethodException");
+            	return null;
+            } catch (final IllegalArgumentException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to IllegalArgumentException");
+            	return null;
+            } catch (final InstantiationException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to InstantiationException");
+            	return null;
+            } catch (final IllegalAccessException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to IllegalAccessException");
+            	return null;
+            } catch (final InvocationTargetException e) {
+            	s_logger.error("Unable to load com.cloud.storage.resource.PremiumSecondaryStorageResource due to InvocationTargetException");
+            	return null;
+            }
+        } else {
+        	storage = new NfsSecondaryStorageResource();
+        }
+        
+        Map<String, String> details = new HashMap<String, String>();
+        details.put("mount.path", mountStr);
+        details.put("orig.url", uri.toString());
+        details.put("mount.parent", _mountParent);
+        
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.putAll(details);
+        params.put("zone", Long.toString(dcId));
+        if (podId != null) {
+            params.put("pod", podId.toString());
+        }
+        params.put("guid", uri.toString());
+        params.put("secondary.storage.vm", "false");
+        params.put("max.template.iso.size", _configDao.getValue("max.template.iso.size"));
+        
+        try {
+            storage.configure("Storage", params);
+        } catch (ConfigurationException e) {
+            s_logger.warn("Unable to configure the storage ", e);
+            return null;
+        }
+        srs.put(storage, details);
+        
+        return srs;
+    }
+    
+    protected Map<? extends ServerResource, Map<String, String>> createLocalSecondaryStorageResource(long dcId, Long podId, URI uri) {
+        Map<LocalSecondaryStorageResource, Map<String, String>> srs = new HashMap<LocalSecondaryStorageResource, Map<String, String>>();
+        
+        LocalSecondaryStorageResource storage = new LocalSecondaryStorageResource();
+        storage = ComponentContext.inject(storage);
+        
+        Map<String, String> details = new HashMap<String, String>();
+        
+        File file = new File(uri);
+        details.put("mount.path", file.getAbsolutePath());
+        details.put("orig.url", uri.toString());
+        
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.putAll(details);
+        params.put("zone", Long.toString(dcId));
+        if (podId != null) {
+            params.put("pod", podId.toString());
+        }
+        params.put("guid", uri.toString());
+        
+        try {
+            storage.configure("Storage", params);
+        } catch (ConfigurationException e) {
+            s_logger.warn("Unable to configure the storage ", e);
+            return null;
+        }
+        srs.put(storage, details);
+        
+        return srs;
+    }
+    
+    protected Map<ServerResource, Map<String, String>> createDummySecondaryStorageResource(long dcId, Long podId, URI uri) {
+        Map<ServerResource, Map<String, String>> srs = new HashMap<ServerResource, Map<String, String>>();
+        
+        DummySecondaryStorageResource storage = new DummySecondaryStorageResource(_useServiceVM);
+        storage = ComponentContext.inject(storage);
+        
+        Map<String, String> details = new HashMap<String, String>();
+        
+        details.put("mount.path", uri.toString());
+        details.put("orig.url", uri.toString());
+        
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.putAll(details);
+        params.put("zone", Long.toString(dcId));
+        if (podId != null) {
+            params.put("pod", podId.toString());
+        }
+        params.put("guid", uri.toString());
+        
+        try {
+            storage.configure("Storage", params);
+        } catch (ConfigurationException e) {
+            s_logger.warn("Unable to configure the storage ", e);
+            return null;
+        }
+        srs.put(storage, details);
+        
+        return srs;
+    }
+    
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        super.configure(name, params);
+        
+        _mountParent = _params.get("mount.parent");
+        if (_mountParent == null) {
+            _mountParent = "/mnt";
+        }
+        
+        String useServiceVM = _params.get("secondary.storage.vm");
+        if ("true".equalsIgnoreCase(useServiceVM)){
+        	_useServiceVM = true;
+        }
+        return true;
+    }
+    
+    @Override
+	public boolean matchHypervisor(String hypervisor) {
+        if( hypervisor.equals("SecondaryStorage")) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+	public Hypervisor.HypervisorType getHypervisorType() {
+    	return Hypervisor.HypervisorType.None;
+    }
+    
+	@Override
+	public void postDiscovery(List<HostVO> hosts, long msId) {
+		if (_useServiceVM) {
+			for (HostVO h: hosts) {
+				_agentMgr.agentStatusTransitTo(h, Event.AgentDisconnected, msId);
+			}
+		}
+		for (HostVO h: hosts) {
+			associateTemplatesToZone(h.getId(), h.getDataCenterId());
+		}
+		
+	}
+	
+    private void associateTemplatesToZone(long hostId, long dcId){
+    	VMTemplateZoneVO tmpltZone;
+
+    	List<VMTemplateVO> allTemplates = _vmTemplateDao.listAll();
+    	for (VMTemplateVO vt: allTemplates){
+    		if (vt.isCrossZones()) {
+    			tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId());
+    			if (tmpltZone == null) {
+    				VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date());
+    				_vmTemplateZoneDao.persist(vmTemplateZone);
+    			}
+    		}
+    	}
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60a1916f/tools/devcloud/pom.xml
----------------------------------------------------------------------
diff --git a/tools/devcloud/pom.xml b/tools/devcloud/pom.xml
index d32d84b..93029e1 100644
--- a/tools/devcloud/pom.xml
+++ b/tools/devcloud/pom.xml
@@ -143,10 +143,10 @@
       </build>
     </profile>
     <profile>
-      <id>quicksvr</id>
+      <id>quickcloud</id>
       <activation>
         <property>
-          <name>quicksvr</name>
+          <name>quickcloud</name>
         </property>
       </activation>
       <build> 


[32/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-809


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

Branch: refs/heads/internallb
Commit: 4fb3d268743bc5ea5a855872134eef21a1a8b054
Parents: 26cbbb0
Author: radhikap <ra...@citrix.com>
Authored: Wed Apr 10 17:24:50 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 docs/en-US/added-API-commands-4.2.xml |   19 ++++---
 docs/en-US/multiple-ip-nic.xml        |   79 ++++++---------------------
 2 files changed, 30 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4fb3d268/docs/en-US/added-API-commands-4.2.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/added-API-commands-4.2.xml b/docs/en-US/added-API-commands-4.2.xml
index 3b765f2..4bec148 100644
--- a/docs/en-US/added-API-commands-4.2.xml
+++ b/docs/en-US/added-API-commands-4.2.xml
@@ -22,17 +22,22 @@
   <title>Added API Commands in 4.2</title>
   <itemizedlist>
     <listitem>
-      <para>addIpToNic (Adds an IP address to the NIC from the guest subnet. The request parameters
-        are: nicid, ipaddress)</para>
+      <para>addIpToNic </para>
+      <para>Adds an IP address to the NIC from the guest subnet. The request parameters are: nicid,
+        ipaddress.</para>
+      <para>The response parameters are: nicid, ipaddress, networkid </para>
     </listitem>
     <listitem>
-      <para>removeIpFromNic (Removes the reserved IP for the NIC. The request parameters is:
-        id)</para>
+      <para>removeIpFromNic</para>
+      <para> Removes the reserved IP for the NIC. The request parameters is: id.</para>
+      <para>The response parameters are: true, false</para>
     </listitem>
     <listitem>
-      <para>listNics (Lists the NIC details of the user VM; the API response also contains the
-        Secondary IP addresses of the NIC. The request parameters are: nicid,
-        virtualmachineid)</para>
+      <para>listNics</para>
+      <para>Lists the NIC details of the user VM; the API response also contains the Secondary IP
+        addresses of the NIC. The request parameters are: nicid, virtualmachineid.</para>
+      <para>The response parameters are: id, ipaddress, secondaryips, gateway, netmask, macaddr,
+        broadcasturi, isolationuri, isdefault,</para>
     </listitem>
   </itemizedlist>
 </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4fb3d268/docs/en-US/multiple-ip-nic.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/multiple-ip-nic.xml b/docs/en-US/multiple-ip-nic.xml
index fb9a331..561ba07 100644
--- a/docs/en-US/multiple-ip-nic.xml
+++ b/docs/en-US/multiple-ip-nic.xml
@@ -21,27 +21,32 @@
 -->
 <section id="multiple-ip-nic">
   <title>Configuring Multiple IP Addresses on a Single NIC</title>
-  <para>&PRODUCT; now provides you the ability to associate multiple private IP addresses per NIC.
-    This feature is supported on all the network configurations&mdash;Basic, Advanced, and VPC.
-    Security Groups, Static NAT and Port forwarding services are supported on these additional IPs.
-    In addition to the primary IP, you can assign additional IPs to the guest VM NIC. Up to 256 IP
-    addresses are allowed per NIC.</para>
+  <para>&PRODUCT; now provides you the ability to associate multiple private IP addresses per guest
+    VM NIC. This feature is supported on all the network configurations&mdash;Basic, Advanced, and
+    VPC. Security Groups, Static NAT and Port forwarding services are supported on these additional
+    IPs. In addition to the primary IP, you can assign additional IPs to the guest VM NIC. Up to 256
+    IP addresses are allowed per NIC.</para>
   <para>As always, you can specify an IP from the guest subnet; if not specified, an IP is
-    automatically picked up from the guest subnet. You can view the IPs and associated NICs
-    for each VMs on the UI. You can apply NAT on these additional guest IPs by using firewall
+    automatically picked up from the guest VM subnet. You can view the IPs associated with for each
+    guest VM NICs on the UI. You can apply NAT on these additional guest IPs by using firewall
     configuration in the &PRODUCT; UI. You must specify the NIC to which the IP should be
     associated.</para>
   <para>This feature is supported on XenServer, KVM, and VMware hypervisors.</para>
+  <note>
+    <para>You need to configure the secondary IP address on the guest VM. &PRODUCT; will
+      not configure the acquired IP address on the VM. Ensure that you assign IPs to NIC each
+      time the VM reboots.</para>
+  </note>
   <para>Some of the use cases are described below:</para>
   <itemizedlist>
     <listitem>
-      <para>Building network appliances: Network appliances, such as firewalls and load
-        balancers, generally work best when they have access to multiple IP addresses on the
-        network interface.</para>
+      <para>Building network appliances: Network appliances, such as firewalls and load balancers,
+        generally work best when they have access to multiple IP addresses on the network
+        interface.</para>
     </listitem>
     <listitem>
-      <para>Moving private IP addresses between interfaces or instances. Applications that are
-        bound to specific IP addresses can be moved between instances. </para>
+      <para>Moving private IP addresses between interfaces or instances. Applications that are bound
+        to specific IP addresses can be moved between instances. </para>
     </listitem>
     <listitem>
       <para>Hosting multiple SSL Websites on a single instance. You can install multiple SSL
@@ -74,55 +79,7 @@
       </listitem>
     </orderedlist>
   </section>
-  <section id="api-nic">
-    <title>API Changes</title>
-    <para>The following APIs have been added:</para>
-    <informaltable>
-      <tgroup cols="4" align="left" colsep="1" rowsep="1">
-        <thead>
-          <row>
-            <entry><para>Parameter Name</para></entry>
-            <entry><para>Description</para></entry>
-            <entry><para>Request Parameter</para></entry>
-            <entry><para>Response Parameter</para></entry>
-          </row>
-        </thead>
-        <tbody>
-          <row>
-            <entry><para>addIpToNic</para></entry>
-            <entry><para>Adds an IP address to the NIC from the guest subnet.</para></entry>
-            <entry>
-              <para>nicid</para>
-              <para>(optional) ipaddress </para>
-            </entry>
-            <entry><para>nicid</para>
-              <para>ipaddress</para>
-              <para>networkid </para></entry>
-          </row>
-          <row>
-            <entry><para>removeIpFromNic</para></entry>
-            <entry><para>Removes the reserved IP for the NIC.</para></entry>
-            <entry>
-              <para>id</para>
-            </entry>
-            <entry><para>true</para>
-              <para>false</para></entry>
-          </row>
-          <row>
-            <entry><para>listNics</para></entry>
-            <entry><para>Lists the NIC details of the user VM; the API response also contains
-              the Secondary IP addresses of the NIC.</para></entry>
-            <entry>
-              <para>virtualmachineid</para>
-              <para>(optional) nicid</para>
-            </entry>
-            <entry><para>Lists the NIC details including secondary IP address </para></entry>
-          </row>
-        </tbody>
-      </tgroup>
-    </informaltable>
-  </section>
-  <section id="caveats-rn">
+   <section id="caveats">
     <title>Port Forwarding and StaticNAT Services Changes</title>
     <para>Because multiple IPs can be associated per NIC, you are allowed to select a desired IP for
       the Port Forwarding and StaticNAT services. The default is the primary IP. To enable this


[19/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Apply patch https://reviews.apache.org/r/10137/


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

Branch: refs/heads/internallb
Commit: 5d984905b5bbf2ed04192933918fc61ad20644e0
Parents: 56a1fac
Author: Kelven Yang <ke...@gmail.com>
Authored: Tue Apr 9 17:16:14 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/guru/VMwareGuru.java  |    5 +--
 server/src/com/cloud/vm/UserVmManagerImpl.java     |   21 ++++++++++----
 setup/db/db/schema-410to420.sql                    |    9 ++++++
 .../vmware/util/VmwareGuestOsMapper.java           |    5 +++
 4 files changed, 31 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d984905/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index bb7c297..2014697 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -135,10 +135,9 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru {
         if (!(vm.getVirtualMachine() instanceof DomainRouterVO || vm.getVirtualMachine() instanceof ConsoleProxyVO 
             || vm.getVirtualMachine() instanceof SecondaryStorageVmVO)){
             // user vm
-            if (diskDeviceType != null){
-                details.remove(VmDetailConstants.ROOK_DISK_CONTROLLER);
+            if (diskDeviceType == null){
+		    details.put(VmDetailConstants.ROOK_DISK_CONTROLLER, _vmwareMgr.getRootDiskController());
             }
-            details.put(VmDetailConstants.ROOK_DISK_CONTROLLER, _vmwareMgr.getRootDiskController());
         }
         
         to.setDetails(details);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d984905/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 646cf92..1c3764a 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2485,6 +2485,21 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
             _vmCloneSettingDao.persist(vmCloneSettingVO);
         }
 
+        long guestOSId = template.getGuestOSId();
+        GuestOSVO guestOS = _guestOSDao.findById(guestOSId);
+        long guestOSCategoryId = guestOS.getCategoryId();
+        GuestOSCategoryVO guestOSCategory = _guestOSCategoryDao.findById(guestOSCategoryId);
+
+
+        // If hypervisor is vSphere and OS is OS X, set special settings.
+        if (hypervisorType.equals(HypervisorType.VMware)) {
+            if (guestOS.getDisplayName().toLowerCase().contains("apple mac os")){
+                vm.setDetail("smc.present", "TRUE");
+                vm.setDetail(VmDetailConstants.ROOK_DISK_CONTROLLER, "scsi");
+                vm.setDetail("firmware", "efi");
+                s_logger.info("guestOS is OSX : overwrite root disk controller to scsi, use smc and efi");
+            }
+       }
 
         _vmDao.persist(vm);
         _vmDao.saveDetails(vm);
@@ -2492,12 +2507,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
         s_logger.debug("Allocating in the DB for vm");
         DataCenterDeployment plan = new DataCenterDeployment(zone.getId());
 
-
-        long guestOSId = template.getGuestOSId();
-        GuestOSVO guestOS = _guestOSDao.findById(guestOSId);
-        long guestOSCategoryId = guestOS.getCategoryId();
-        GuestOSCategoryVO guestOSCategory = _guestOSCategoryDao.findById(guestOSCategoryId);
-
         List<String> computeTags = new ArrayList<String>();
         computeTags.add(offering.getHostTag());
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d984905/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index d6050f1..7932763 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -124,6 +124,15 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 (64 bit)', 209);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 Server (64 bit)', 210);
 
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (211, UUID(), 7, 'Apple Mac OS X 10.6 (32 bits)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (212, UUID(), 7, 'Apple Mac OS X 10.6 (64 bits)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (213, UUID(), 7, 'Apple Mac OS X 10.7 (32 bits)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (214, UUID(), 7, 'Apple Mac OS X 10.7 (64 bits)');
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Apple Mac OS X 10.6 (32 bits)', 211);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Apple Mac OS X 10.6 (64 bits)', 212);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Apple Mac OS X 10.7 (32 bits)', 213);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Apple Mac OS X 10.7 (64 bits)', 214);
+
 CREATE TABLE `cloud`.`user_vm_clone_setting` (
   `vm_id` bigint unsigned NOT NULL COMMENT 'guest VM id',
   `clone_type` varchar(10) NOT NULL COMMENT 'Full or Linked Clone (applicable to VMs on ESX)',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d984905/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
index 04b4d8e..c76ce84 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
@@ -62,6 +62,11 @@ public class VmwareGuestOsMapper {
         s_mapper.put("Windows 8 (64 bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_64_GUEST);
         s_mapper.put("Windows 8 Server (64 bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_SERVER_64_GUEST);
 
+                s_mapper.put("Apple Mac OS X 10.6 (32 bits)", VirtualMachineGuestOsIdentifier.DARWIN_10_GUEST);
+                s_mapper.put("Apple Mac OS X 10.6 (64 bits)", VirtualMachineGuestOsIdentifier.DARWIN_10_64_GUEST);
+                s_mapper.put("Apple Mac OS X 10.7 (32 bits)", VirtualMachineGuestOsIdentifier.DARWIN_11_GUEST);
+                s_mapper.put("Apple Mac OS X 10.7 (64 bits)", VirtualMachineGuestOsIdentifier.DARWIN_11_64_GUEST);
+
 		s_mapper.put("Open Enterprise Server", VirtualMachineGuestOsIdentifier.OES_GUEST);
 
 		s_mapper.put("Asianux 3(32-bit)", VirtualMachineGuestOsIdentifier.ASIANUX_3_GUEST);


[41/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
CLOUDSTACK-1867: Comment vmware-tools installation, use open-vm-tools

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: 9d0ba2b54fd05d192a934ff0755cb976da0e1caf
Parents: af3e54b
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 23:10:29 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/postinstall.sh    |   27 ++++++++-------
 .../definitions/systemvmtemplate/preseed.cfg       |    8 ++--
 .../definitions/systemvmtemplate64/postinstall.sh  |   27 ++++++++-------
 .../definitions/systemvmtemplate64/preseed.cfg     |    8 ++--
 4 files changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0ba2b5/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index 176c93f..ae8f1ad 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -65,18 +65,19 @@ install_packages() {
 
   # vmware tools
   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
-  apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
-  df -h
-  PREVDIR=$PWD
-  cd /opt
-  wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
-  tar xzf VMwareTools-9.2.1-818201.tar.gz
-  rm VMwareTools-*.tar.gz
-  cd vmware-tools-distrib
-  ./vmware-install.pl -d
-  cd $PREV
-  rm -fr /opt/vmware-tools-distrib
-  apt-get -q -y --force-yes purge build-essential
+  # commented installaion of vmware-tools  as we are using the opensource open-vm-tools:
+  # apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
+  # df -h
+  # PREVDIR=$PWD
+  # cd /opt
+  # wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
+  # tar xzf VMwareTools-9.2.1-818201.tar.gz
+  # rm VMwareTools-*.tar.gz
+  # cd vmware-tools-distrib
+  # ./vmware-install.pl -d
+  # cd $PREV
+  # rm -fr /opt/vmware-tools-distrib
+  # apt-get -q -y --force-yes purge build-essential
 }
 
 setup_accounts() {
@@ -184,7 +185,7 @@ configure_services() {
   snapshot_url="https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=snapshot;h=HEAD;sf=tgz"
   snapshot_dir="/opt/cloudstack*"
   cd /opt
-  wget $snapshot_url -O cloudstack.tar.gz
+  wget --no-check-certificate $snapshot_url -O cloudstack.tar.gz
   tar -zxvf cloudstack.tar.gz
   cp -rv $snapshot_dir/patches/systemvm/debian/config/* /
   cp -rv $snapshot_dir/patches/systemvm/debian/vpn/* /

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0ba2b5/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index d456256..79349f6 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              250 40 400 ext4                                 \
+              300 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,17 +146,17 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              900 20 1100 ext4                                \
+              700 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
               .                                               \
-              300 40 500 ext4                                 \
+              400 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              450 60 1000 ext4                                \
+              500 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0ba2b5/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
index 176c93f..ae8f1ad 100644
--- a/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate64/postinstall.sh
@@ -65,18 +65,19 @@ install_packages() {
 
   # vmware tools
   apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
-  apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
-  df -h
-  PREVDIR=$PWD
-  cd /opt
-  wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
-  tar xzf VMwareTools-9.2.1-818201.tar.gz
-  rm VMwareTools-*.tar.gz
-  cd vmware-tools-distrib
-  ./vmware-install.pl -d
-  cd $PREV
-  rm -fr /opt/vmware-tools-distrib
-  apt-get -q -y --force-yes purge build-essential
+  # commented installaion of vmware-tools  as we are using the opensource open-vm-tools:
+  # apt-get --no-install-recommends -q -y --force-yes install build-essential linux-headers-`uname -r`
+  # df -h
+  # PREVDIR=$PWD
+  # cd /opt
+  # wget http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
+  # tar xzf VMwareTools-9.2.1-818201.tar.gz
+  # rm VMwareTools-*.tar.gz
+  # cd vmware-tools-distrib
+  # ./vmware-install.pl -d
+  # cd $PREV
+  # rm -fr /opt/vmware-tools-distrib
+  # apt-get -q -y --force-yes purge build-essential
 }
 
 setup_accounts() {
@@ -184,7 +185,7 @@ configure_services() {
   snapshot_url="https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=snapshot;h=HEAD;sf=tgz"
   snapshot_dir="/opt/cloudstack*"
   cd /opt
-  wget $snapshot_url -O cloudstack.tar.gz
+  wget --no-check-certificate $snapshot_url -O cloudstack.tar.gz
   tar -zxvf cloudstack.tar.gz
   cp -rv $snapshot_dir/patches/systemvm/debian/config/* /
   cp -rv $snapshot_dir/patches/systemvm/debian/vpn/* /

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0ba2b5/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index d456256..79349f6 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -136,7 +136,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /boot }                     \
               .                                               \
-              250 40 400 ext4                                 \
+              300 40 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ / }                         \
@@ -146,17 +146,17 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              900 20 1100 ext4                                \
+              700 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
               .                                               \
-              300 40 500 ext4                                 \
+              400 40 500 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /opt }                      \
               .                                               \
-              450 60 1000 ext4                                \
+              500 60 1000 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \


[50/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
InternalLB:

1) Added new set of Interfaces - including the new VO - for the internal load balancer
2) DB change - added source_ip_address/source_ip_address_network_id/scheme (Internal/Public) fields to the load_balancer table


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

Branch: refs/heads/internallb
Commit: ed0cb2f37b696079b91cfa767efb57c4bebd85bf
Parents: c4411af
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Apr 4 09:26:21 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 16:04:10 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java        |    4 ++--
 .../CreateApplicationLoadBalancerCmd.java          |    3 +--
 .../DeleteApplicationLoadBalancerCmd.java          |    2 +-
 server/src/com/cloud/network/NetworkModelImpl.java |    9 ++-------
 .../network/lb/LoadBalancingRulesManagerImpl.java  |    1 -
 setup/db/db/schema-410to420.sql                    |    7 +++++++
 6 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index 6842ebb..a74888d 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -263,7 +263,7 @@ public interface NetworkModel {
     boolean isProviderEnabledInZone(long zoneId, String provider);
 
     Nic getPlaceholderNicForRouter(Network network, Long podId);
-    
-    IpAddress getPublicIpAddress(String ipAddress, long zoneId);
+        
+    IpAddress getPublicIpAddress(String ipAddress, long networkId);
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
index 54b3f83..3a30438 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
@@ -223,8 +223,7 @@ public class CreateApplicationLoadBalancerCmd extends BaseAsyncCreateCmd {
     @Override
     public void create() {
         try {
-            
-            ApplicationLoadBalancerRule result = _appLbService.createApplicationLoadBalancer(getName(), getDescription(), getScheme(),
+        ApplicationLoadBalancerRule result = _appLbService.createApplicationLoadBalancer(getName(), getDescription(), getScheme(),
                     getSourceIpNetworkId(), getSourceIp(), getSourcePort(), getInstancePort(), getAlgorithm(), getNetworkId(), getEntityOwnerId());
             this.setEntityId(result.getId());
             this.setEntityUuid(result.getUuid());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
index ffd44ca..1ce5897 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
@@ -32,7 +32,7 @@ import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.user.UserContext;
 
-@APICommand(name = "deleteLoadBalancer", description="Deletes a load balancer", responseObject=SuccessResponse.class, since="4.2.0")
+@APICommand(name = "deleteLoadBalancer", description="Deletes a load balancer", responseObject=SuccessResponse.class)
 public class DeleteApplicationLoadBalancerCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteApplicationLoadBalancerCmd.class.getName());
     private static final String s_name = "deleteloadbalancerresponse";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index 0a82e09..d7108db 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -2035,12 +2035,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     }
     
     @Override
-    public IpAddress getPublicIpAddress(String ipAddress, long zoneId) {
-        List<? extends Network> networks = _networksDao.listByZoneAndTrafficType(zoneId, TrafficType.Public);
-        if (networks.isEmpty() || networks.size() > 1) {
-            throw new CloudRuntimeException("Can't find public network in the zone specified");
-        }
-        
-        return _ipAddressDao.findByIpAndSourceNetworkId(networks.get(0).getId(), ipAddress);
+    public IpAddress getPublicIpAddress(String ipAddress, long networkId) {
+        return _ipAddressDao.findByIpAndSourceNetworkId(networkId, ipAddress);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 0a9c5b6..e4f3e07 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1387,7 +1387,6 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
             ex.addProxyObject(ipAddr, sourceIpId, "sourceIpId");
             throw ex;
         }
-        
         NetworkVO network = _networkDao.findById(networkId);
         // verify that lb service is supported by the network
         if (!_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed0cb2f3/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 7bc6d56..e8f7603 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -454,3 +454,10 @@ CREATE TABLE `cloud`.`vm_snapshots` (
 ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `vm_snapshot_enabled` tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Whether VM snapshot is supported by hypervisor';
 UPDATE `cloud`.`hypervisor_capabilities` SET `vm_snapshot_enabled`=1 WHERE `hypervisor_type` in ('VMware', 'XenServer');
 
+
+ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address` varchar(40) COMMENT 'source ip address for the load balancer rule';
+ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address_network_id` varchar(40) COMMENT 'the UUID of the network where source ip belongs to';
+ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `scheme` varchar(40) NOT NULL COMMENT 'load balancer scheme; can be Internal or Public';
+UPDATE `cloud`.`load_balancing_rules` SET `scheme`='Public';
+
+


[42/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
In system vm, wait for interface to be available before configuring gateway.
Previous patch to this only did so for system vms with a $3 interface, usually
eth2. System VMs that only provide DNS wouldn't get a gateway, for example.

BUG-ID: CLOUDSTACK-1565
Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1365617851 -0600


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

Branch: refs/heads/internallb
Commit: 767478cba4c3eff2a9b1cb937af0337553d82862
Parents: 61b4c5c
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Wed Apr 10 12:17:31 2013 -0600
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:06 2013 -0700

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config    |   54 ++++++++-------
 1 files changed, 30 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/767478cb/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
index 514c0b0..3faa1bd 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -386,33 +386,39 @@ setup_common() {
   ip route delete default
   if [ "$RROUTER" != "1" ]
   then
-      if [ -z "$3" ]
+    gwdev=$3
+    if [ -z "$gwdev" ]
+    then
+      gwdev="eth0"
+    fi
+
+    timer=0
+    #default route add fails if we run before interface configured with ip
+    log_it "checking that $gwdev has IP before setting default route to $GW"
+    echo "checking that $gwdev has IP before setting default route to $GW"
+    while true
+    do
+      ip=$(ifconfig $gwdev | grep "inet addr:" | awk '{print $2}' | awk -F: '{print $2}')
+      if [ -z $ip ] 
       then
-          ip route add default via $GW dev eth0
+	      sleep 1;
+	      #waiting for the interface to setup with ip
+              log_it "waiting for $gwdev interface setup with ip"
+	      echo "waiting for $gwdev interface setup with ip"
       else
-	  timer=0
-	  #default route add fails if we run before interface configured with ip
-	  while true
-	  do
-      	      ip=$(ifconfig $3 | grep "inet addr:" | awk '{print $2}' | awk -F: '{print $2}')
-	      if [ -z $ip ] 
-	      then
-		      sleep 1;
-		      #waiting for the interface to setup with ip
-		      echo "waiting for $3 interface setup with ip"
-	      else
-         	      ip route add default via $GW dev $3
-		      break
-	      fi
-	      
-	      if [ $timer -gt 5 ] 
-	      then
-	          echo "interface $3 is not set up with ip... configuring default route failed"
-		  break
-	  fi
-	  timer=`expr $timer + 1`
-	 done
+              ip route add default via $GW dev $gwdev
+	      break
       fi
+
+      if [ $timer -gt 15 ] 
+      then
+          log_it  "interface $gwdev is not set up with ip... configuring default route failed";
+          echo "interface $gwdev is not set up with ip... configuring default route failed"
+	  break
+      fi
+      timer=`expr $timer + 1`
+    done
+      
   fi
  
   # a hacking way to activate vSwitch under VMware


[06/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: we moved the SecondaryStorageDiscoverer from the com.cloud package to the org.apache.cloudstack package
QuickCloud: fix license issue
QuickCloud: use a different activation for deploying quickcloud
Otherwise marvin gets invoked during mvn install -Dquickcloud


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

Branch: refs/heads/internallb
Commit: 5e72291f88ee08084618430ea8a2547c96b795a0
Parents: 92a42d9
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Apr 5 11:52:52 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:35 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    2 +-
 .../cloud/consoleproxy/ConsoleProxyService.java    |   16 +++++++++++++++
 tools/devcloud/pom.xml                             |    4 +-
 3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e72291f/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index f08d8f8..9fa3234 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -507,7 +507,7 @@
     <property name="name" value="XCP Agent"/>
   </bean>
 
-  <bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
+  <bean id="SecondaryStorageDiscoverer" class="org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer">
     <property name="name" value="SecondaryStorage"/>
   </bean>
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e72291f/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyService.java b/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
index e43e5c3..fd00f56 100644
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyService.java
@@ -1,3 +1,19 @@
+// 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.consoleproxy;
 
 import com.cloud.info.ConsoleProxyInfo;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e72291f/tools/devcloud/pom.xml
----------------------------------------------------------------------
diff --git a/tools/devcloud/pom.xml b/tools/devcloud/pom.xml
index 93029e1..ba4cc46 100644
--- a/tools/devcloud/pom.xml
+++ b/tools/devcloud/pom.xml
@@ -146,7 +146,7 @@
       <id>quickcloud</id>
       <activation>
         <property>
-          <name>quickcloud</name>
+          <name>deployquick</name>
         </property>
       </activation>
       <build> 
@@ -157,7 +157,7 @@
         <version>1.2.1</version>
         <executions>
           <execution>
-            <phase>package</phase>
+            <phase>integration-test</phase>
             <goals>
               <goal>exec</goal>
             </goals>


[14/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
Fixed typos

Signed-off-by: Joe Brockmeier <jz...@zonker.net>


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

Branch: refs/heads/internallb
Commit: 595f070348cea97803db36cf998b5fd8125cb2e6
Parents: 3890591
Author: Pascal Borreli <pa...@borreli.com>
Authored: Tue Apr 9 22:01:26 2013 +0000
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 docs/en-US/added-API-commands.xml                  |    2 +-
 docs/en-US/aws-ec2-introduction.xml                |    2 +-
 docs/en-US/building-documentation.xml              |    2 +-
 docs/en-US/building-marvin.xml                     |    2 +-
 docs/en-US/building-translation.xml                |    2 +-
 ...change-console-proxy-ssl-certificate-domain.xml |    2 +-
 docs/en-US/citrix-xenserver-installation.xml       |    2 +-
 docs/en-US/configure-package-repository.xml        |    2 +-
 docs/en-US/configure-vpn.xml                       |    2 +-
 docs/en-US/console-proxy.xml                       |    2 +-
 docs/en-US/hypervisor-host-install-libvirt.xml     |    2 +-
 ...hypervisor-host-install-network-openvswitch.xml |    2 +-
 docs/en-US/hypervisor-host-install-network.xml     |    4 ++--
 .../en-US/management-server-install-prepare-os.xml |    2 +-
 docs/en-US/management-server-lb.xml                |    2 +-
 docs/en-US/minimum-system-requirements.xml         |    2 +-
 docs/en-US/translating-documentation.xml           |    2 +-
 docs/en-US/using-sshkeys.xml                       |    2 +-
 docs/en-US/vmware-requirements.xml                 |    2 +-
 docs/en-US/writing-new-documentation.xml           |    4 ++--
 20 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/added-API-commands.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/added-API-commands.xml b/docs/en-US/added-API-commands.xml
index 208aac2..99635de 100644
--- a/docs/en-US/added-API-commands.xml
+++ b/docs/en-US/added-API-commands.xml
@@ -87,7 +87,7 @@
           <entry><para>suspendProject (Suspends a project)</para></entry>
           <entry><para>listProjects (Lists projects and provides detailed information for listed
               projects)</para></entry>
-          <entry><para>addAccountToProject (Adds acoount to a project)</para></entry>
+          <entry><para>addAccountToProject (Adds account to a project)</para></entry>
         </row>
         <row>
           <entry><para>deleteAccountFromProject (Deletes account from the project)</para></entry>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/aws-ec2-introduction.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/aws-ec2-introduction.xml b/docs/en-US/aws-ec2-introduction.xml
index 538c09d..4cf071b 100644
--- a/docs/en-US/aws-ec2-introduction.xml
+++ b/docs/en-US/aws-ec2-introduction.xml
@@ -45,7 +45,7 @@
         <para>Available in fresh installations of &PRODUCT;. Not available through upgrade of previous versions.</para>
       </listitem>
       <listitem>
-        <para>Features such as Elastic IP (EIP) and Elastic Load Balacing (ELB) are only available in an infrastructure
+        <para>Features such as Elastic IP (EIP) and Elastic Load Balancing (ELB) are only available in an infrastructure
         with a Citrix NetScaler device. Users accessing a Zone with a NetScaler device will need to use a 
         NetScaler-enabled network offering (DefaultSharedNetscalerEIP and ELBNetworkOffering).</para>
       </listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/building-documentation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/building-documentation.xml b/docs/en-US/building-documentation.xml
index 4848266..8ee63b0 100644
--- a/docs/en-US/building-documentation.xml
+++ b/docs/en-US/building-documentation.xml
@@ -25,7 +25,7 @@
 <section id="building-documentation">
     <title>Building &PRODUCT; Documentation</title>
     <para>To build a specific guide, go to the source tree of the documentation in /docs and identify the guide you want to build.</para>
-    <para>Currenlty there are four guides plus the release notes, all defined in publican configuration files:</para>
+    <para>Currently there are four guides plus the release notes, all defined in publican configuration files:</para>
     <programlisting>
         publican-adminguide.cfg
         publican-devguide.cfg

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/building-marvin.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/building-marvin.xml b/docs/en-US/building-marvin.xml
index 3332b16..e33c4cb 100644
--- a/docs/en-US/building-marvin.xml
+++ b/docs/en-US/building-marvin.xml
@@ -27,7 +27,7 @@
     <para>Marvin is built with Maven and is dependent on APIdoc. To build it do the following in the root tree of &PRODUCT;:</para>
     <programlisting>mvn -P developer -pl :cloud-apidoc</programlisting>
     <programlisting>mvn -P developer -pl :cloud-marvin</programlisting>
-    <para>If successfull the build will have created the cloudstackAPI Python package under tools/marvin/marvin/cloudstackAPI as well as a gziped Marvin package under tools/marvin dist. To install the Python Marvin module do the following in tools/marvin:</para>
+    <para>If successful the build will have created the cloudstackAPI Python package under tools/marvin/marvin/cloudstackAPI as well as a gziped Marvin package under tools/marvin dist. To install the Python Marvin module do the following in tools/marvin:</para>
     <programlisting>sudo python ./setup.py install</programlisting>
     <para>The dependencies will be downloaded the Python module installed and you should be able to use Marvin in Python. Check that you can import the module before starting to use it.</para>
     <programlisting>$ python

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/building-translation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/building-translation.xml b/docs/en-US/building-translation.xml
index 659c55f..dd66365 100644
--- a/docs/en-US/building-translation.xml
+++ b/docs/en-US/building-translation.xml
@@ -52,7 +52,7 @@
     how to <ulink url="http://rlandmann.fedorapeople.org/pug/sect-Users_Guide-Preparing_a_document_for_translation.html">prepare</ulink> a document for translation.</para>
     <para>The basic command to execute to build the pot files for the developer guide is:</para>
     <programlisting>publican update_pot --config=publican-devguide.cfg</programlisting>
-    <para>This will create a pot directory with pot files in it, one for each corresponding xml files needed to build the guide. Once genereated, all pots files need to be configured for translation using transifex this is best done by using the transifex client that you can install with the following command (For RHEL and its derivatives):</para>
+    <para>This will create a pot directory with pot files in it, one for each corresponding xml files needed to build the guide. Once generated, all pots files need to be configured for translation using transifex this is best done by using the transifex client that you can install with the following command (For RHEL and its derivatives):</para>
     <programlisting>yum install transifex-client</programlisting>
     <para>The transifex client is also available via PyPi and you can install it like this:</para>
     <programlisting>easy_install transifex-client</programlisting>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/change-console-proxy-ssl-certificate-domain.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/change-console-proxy-ssl-certificate-domain.xml b/docs/en-US/change-console-proxy-ssl-certificate-domain.xml
index 89796a2..3fd0501 100644
--- a/docs/en-US/change-console-proxy-ssl-certificate-domain.xml
+++ b/docs/en-US/change-console-proxy-ssl-certificate-domain.xml
@@ -32,7 +32,7 @@
             <listitem><para>Generate a new 2048-bit private key</para><programlisting>openssl genrsa -des3 -out yourprivate.key 2048</programlisting></listitem>
             <listitem><para>Generate a new certificate CSR</para><programlisting>openssl req -new -key yourprivate.key -out yourcertificate.csr</programlisting></listitem>
             <listitem><para>Head to the website of your favorite trusted Certificate Authority, purchase an SSL certificate, and submit the CSR. You should receive a valid certificate in return</para></listitem>
-            <listitem><para>Convert your private key format into PKCS#8 encrypted format.</para><programlisting>openssl pkcs8 -topk8 -in yourprivate.key -out yourprivate.pkcs8.encryped.key</programlisting></listitem>
+            <listitem><para>Convert your private key format into PKCS#8 encrypted format.</para><programlisting>openssl pkcs8 -topk8 -in yourprivate.key -out yourprivate.pkcs8.encrypted.key</programlisting></listitem>
             <listitem><para>Convert your PKCS#8 encrypted private key into the PKCS#8 format that is compliant with &PRODUCT;</para><programlisting>openssl pkcs8 -in yourprivate.pkcs8.encrypted.key -out yourprivate.pkcs8.key</programlisting></listitem>
         </orderedlist>          
         </listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/citrix-xenserver-installation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/citrix-xenserver-installation.xml b/docs/en-US/citrix-xenserver-installation.xml
index 4053865..2cd39a4 100644
--- a/docs/en-US/citrix-xenserver-installation.xml
+++ b/docs/en-US/citrix-xenserver-installation.xml
@@ -62,7 +62,7 @@
           support any system that is not up to date with patches.</para>
       </listitem>
       <listitem>
-        <para>All hosts within a cluster must be homogenous. The CPUs must be of the same type,
+        <para>All hosts within a cluster must be homogeneous. The CPUs must be of the same type,
           count, and feature flags.</para>
       </listitem>
       <listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/configure-package-repository.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/configure-package-repository.xml b/docs/en-US/configure-package-repository.xml
index 3d102c6..c8ba48f 100644
--- a/docs/en-US/configure-package-repository.xml
+++ b/docs/en-US/configure-package-repository.xml
@@ -33,7 +33,7 @@
         If you didn't follow the steps to build your own packages from source 
         in the sections for <xref linkend="sect-source-buildrpm" /> or
         <xref linkend="sect-source-builddebs" /> you may find pre-built
-        DEB and RPM packages for your convience linked from the 
+        DEB and RPM packages for your convenience linked from the
         <ulink url="http://cloudstack.apache.org/downloads.html">downloads</ulink>
         page.
     </para>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/configure-vpn.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/configure-vpn.xml b/docs/en-US/configure-vpn.xml
index 87b4e65..5d25620 100644
--- a/docs/en-US/configure-vpn.xml
+++ b/docs/en-US/configure-vpn.xml
@@ -29,7 +29,7 @@
 		<listitem><para>In the left navigation, click Global Settings.</para></listitem>
 		<listitem><para>Set the following global configuration parameters.</para>
 		<itemizedlist>
-			<listitem><para>remote.access.vpn.client.ip.range – The range of IP addressess to be allocated to remote access VPN clients. The first IP in the range is used by the VPN server.</para></listitem>
+			<listitem><para>remote.access.vpn.client.ip.range – The range of IP addresses to be allocated to remote access VPN clients. The first IP in the range is used by the VPN server.</para></listitem>
 			<listitem><para>remote.access.vpn.psk.length – Length of the IPSec key.</para></listitem>
 			<listitem><para>remote.access.vpn.user.limit – Maximum number of VPN users per account.</para></listitem>
 		</itemizedlist></listitem></orderedlist>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/console-proxy.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/console-proxy.xml b/docs/en-US/console-proxy.xml
index 64183b4..5f9a820 100644
--- a/docs/en-US/console-proxy.xml
+++ b/docs/en-US/console-proxy.xml
@@ -95,7 +95,7 @@
           </listitem>
           <listitem>
             <para>Convert your private key format into PKCS#8 encrypted format.</para>
-            <programlisting>openssl pkcs8 -topk8 -in yourprivate.key -out yourprivate.pkcs8.encryped.key</programlisting>
+            <programlisting>openssl pkcs8 -topk8 -in yourprivate.key -out yourprivate.pkcs8.encrypted.key</programlisting>
           </listitem>
           <listitem>
             <para>Convert your PKCS#8 encrypted private key into the PKCS#8 format that is compliant

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/hypervisor-host-install-libvirt.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/hypervisor-host-install-libvirt.xml b/docs/en-US/hypervisor-host-install-libvirt.xml
index d7dc47f..f3ff090 100644
--- a/docs/en-US/hypervisor-host-install-libvirt.xml
+++ b/docs/en-US/hypervisor-host-install-libvirt.xml
@@ -28,7 +28,7 @@
     <orderedlist>
         <listitem>
             <para>In order to have live migration working libvirt has to listen for unsecured TCP connections. We also need to turn off libvirts attempt to use Multicast DNS advertising. Both of these settings are in <filename>/etc/libvirt/libvirtd.conf</filename></para>
-            <para>Set the following paramaters:</para>
+            <para>Set the following parameters:</para>
             <programlisting>listen_tls = 0</programlisting>
             <programlisting>listen_tcp = 1</programlisting>
             <programlisting>tcp_port = "16509"</programlisting>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/hypervisor-host-install-network-openvswitch.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/hypervisor-host-install-network-openvswitch.xml b/docs/en-US/hypervisor-host-install-network-openvswitch.xml
index e9bf47a..a16dc8e 100644
--- a/docs/en-US/hypervisor-host-install-network-openvswitch.xml
+++ b/docs/en-US/hypervisor-host-install-network-openvswitch.xml
@@ -69,7 +69,7 @@
                 we can proceed to configuring the network.</para>
             <para>First we configure eth0</para>
             <programlisting language="Bash">vi /etc/sysconfig/network-scripts/ifcfg-eth0</programlisting>
-            <para>Make sure it looks similair to:</para>
+            <para>Make sure it looks similar to:</para>
             <programlisting><![CDATA[DEVICE=eth0
 HWADDR=00:04:xx:xx:xx:xx
 ONBOOT=yes

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/hypervisor-host-install-network.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/hypervisor-host-install-network.xml b/docs/en-US/hypervisor-host-install-network.xml
index 54cdc27..80156d9 100644
--- a/docs/en-US/hypervisor-host-install-network.xml
+++ b/docs/en-US/hypervisor-host-install-network.xml
@@ -50,7 +50,7 @@
             <para>The required packages were installed when libvirt was installed, we can proceed to configuring the network.</para>
             <para>First we configure eth0</para>
             <programlisting language="Bash">vi /etc/sysconfig/network-scripts/ifcfg-eth0</programlisting>
-            <para>Make sure it looks similair to:</para>
+            <para>Make sure it looks similar to:</para>
             <programlisting><![CDATA[DEVICE=eth0
 HWADDR=00:04:xx:xx:xx:xx
 ONBOOT=yes
@@ -89,7 +89,7 @@ VLAN=yes
 BRIDGE=cloudbr1]]></programlisting>
             <para>Now we have the VLAN interfaces configured we can add the bridges on top of them.</para>
             <programlisting language="Bash">vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0</programlisting>
-            <para>Now we just configure it is a plain bridge without an IP-Adress</para>
+            <para>Now we just configure it is a plain bridge without an IP-Address</para>
             <programlisting><![CDATA[DEVICE=cloudbr0
 TYPE=Bridge
 ONBOOT=yes

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/management-server-install-prepare-os.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-prepare-os.xml b/docs/en-US/management-server-install-prepare-os.xml
index ef78731..02453a0 100644
--- a/docs/en-US/management-server-install-prepare-os.xml
+++ b/docs/en-US/management-server-install-prepare-os.xml
@@ -30,7 +30,7 @@
         <listitem>
             <para>Check for a fully qualified hostname.</para>
             <programlisting language="Bash">hostname --fqdn</programlisting>
-            <para>This should return a fully qualified hostname such as "managament1.lab.example.org".  If it does not, edit /etc/hosts so that it does.</para>
+            <para>This should return a fully qualified hostname such as "management1.lab.example.org".  If it does not, edit /etc/hosts so that it does.</para>
         </listitem>
         <listitem>
             <para>Make sure that the machine can reach the Internet.</para>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/management-server-lb.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-lb.xml b/docs/en-US/management-server-lb.xml
index 9aee154..13f8756 100644
--- a/docs/en-US/management-server-lb.xml
+++ b/docs/en-US/management-server-lb.xml
@@ -58,7 +58,7 @@
       </tbody>
     </tgroup>
   </informaltable>
-  <para>In addition to above settings, the adminstrator is responsible for setting the 'host' global
+  <para>In addition to above settings, the administrator is responsible for setting the 'host' global
     config value from the management server IP to load balancer virtual IP address.
     If the 'host' value is not set to the VIP for Port 8250 and one of your management servers crashes,
     the UI is still available but the system VMs will not be able to contact the management server.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/minimum-system-requirements.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/minimum-system-requirements.xml b/docs/en-US/minimum-system-requirements.xml
index de1bc22..870ef68 100644
--- a/docs/en-US/minimum-system-requirements.xml
+++ b/docs/en-US/minimum-system-requirements.xml
@@ -57,7 +57,7 @@
             <listitem><note><para>If DHCP is used for hosts, ensure that no conflict occurs between DHCP server used for these hosts and the DHCP router created by &PRODUCT;.</para></note></listitem>
 			<listitem><para>Latest hotfixes applied to hypervisor software</para></listitem>
 			<listitem><para>When you deploy &PRODUCT;, the hypervisor host must not have any VMs already running</para></listitem>
-            <listitem><para>All hosts within a cluster must be homogenous. The CPUs must be of the same type, count, and feature flags.</para></listitem>
+            <listitem><para>All hosts within a cluster must be homogeneous. The CPUs must be of the same type, count, and feature flags.</para></listitem>
 		</itemizedlist>
 		<para>Hosts have additional requirements depending on the hypervisor. See the requirements listed at the top of the Installation section for your chosen hypervisor:</para>
         <warning>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/translating-documentation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/translating-documentation.xml b/docs/en-US/translating-documentation.xml
index afe2765..4d5e3d2 100644
--- a/docs/en-US/translating-documentation.xml
+++ b/docs/en-US/translating-documentation.xml
@@ -32,7 +32,7 @@
             <listitem><para>Using the Transifex client and pushing your translated strings to the website.</para></listitem>
         </itemizedlist>
     </para>
-    <para>Once a translation is complete, a site admin will pull the translated strings within the &PRODUCT; repository, build the documenation and publish it.</para>
+    <para>Once a translation is complete, a site admin will pull the translated strings within the &PRODUCT; repository, build the documentation and publish it.</para>
     <para>For instructions on how to use the Transifex website see <ulink url="http://sebgoa.blogspot.ch/2012/11/translating-apache-cloudstack-docs-with.html">http://sebgoa.blogspot.ch/2012/11/translating-apache-cloudstack-docs-with.html</ulink></para>
     <para>For instructions on how to use the Transifex client to translate from the command line see <ulink url="http://sebgoa.blogspot.ch/2012/12/using-transifex-client-to-translate.html">http://sebgoa.blogspot.ch/2012/12/using-transifex-client-to-translate.html</ulink></para>
 </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/using-sshkeys.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/using-sshkeys.xml b/docs/en-US/using-sshkeys.xml
index cd10d68..f34dfa0 100644
--- a/docs/en-US/using-sshkeys.xml
+++ b/docs/en-US/using-sshkeys.xml
@@ -92,7 +92,7 @@ KfEEuzcCUIxtJYTahJ1pvlFkQ8anpuxjSEDp8x/18bq3
         <para>After you save the SSH keypair file, you must create an instance by using the template that you created at <xref linkend="create-ssh-template"/>. Ensure that you use the same SSH key name that you created at <xref linkend="create-ssh-keypair"/>.</para>
         <note><para>You cannot create the instance by using the GUI at this time and associate the instance with the newly created SSH keypair.</para></note>
         <para>A sample curl command to create a new instance is:</para>
-        <programlisting>curl --globoff http://localhost:&lt;port numbet&gt;/?command=deployVirtualMachine\&amp;zoneId=1\&amp;serviceOfferingId=18727021-7556-4110-9322-d625b52e0813\&amp;templateId=e899c18a-ce13-4bbf-98a9-625c5026e0b5\&amp;securitygroupids=ff03f02f-9e3b-48f8-834d-91b822da40c5\&amp;account=admin\&amp;domainid=1\&amp;keypair=keypair-doc</programlisting>
+        <programlisting>curl --globoff http://localhost:&lt;port number&gt;/?command=deployVirtualMachine\&amp;zoneId=1\&amp;serviceOfferingId=18727021-7556-4110-9322-d625b52e0813\&amp;templateId=e899c18a-ce13-4bbf-98a9-625c5026e0b5\&amp;securitygroupids=ff03f02f-9e3b-48f8-834d-91b822da40c5\&amp;account=admin\&amp;domainid=1\&amp;keypair=keypair-doc</programlisting>
         <para>Substitute the template, service offering and security group IDs (if you are using the security group feature) that are in your cloud environment.</para>
         </section>
         <section id="logging-in-ssh">

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/vmware-requirements.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/vmware-requirements.xml b/docs/en-US/vmware-requirements.xml
index 207a456..d7a6d70 100644
--- a/docs/en-US/vmware-requirements.xml
+++ b/docs/en-US/vmware-requirements.xml
@@ -68,7 +68,7 @@
         <listitem><para>vCenter must be configured to use the standard port 443 so that it can communicate with the &PRODUCT; Management Server.</para></listitem>
         <listitem><para>You must re-install VMware ESXi if you are going to re-use a host from a previous install.</para></listitem>
         <listitem><para>&PRODUCT; requires VMware vSphere 4.1 or 5.0.  VMware vSphere 4.0 is not supported.</para></listitem>
-        <listitem><para>All hosts must be 64-bit and must support HVM (Intel-VT or AMD-V enabled). All hosts within a cluster must be homogenous. That means the CPUs must be of the same type, count, and feature flags.</para></listitem>
+        <listitem><para>All hosts must be 64-bit and must support HVM (Intel-VT or AMD-V enabled). All hosts within a cluster must be homogeneous. That means the CPUs must be of the same type, count, and feature flags.</para></listitem>
         <listitem><para>The &PRODUCT; management network must not be configured as a separate virtual network. The &PRODUCT; management network is the same as the vCenter management network, and will inherit its configuration. See <xref linkend="vmware-physical-host-networking-config-vcenter-mgt" />.</para></listitem>
         <listitem><para>&PRODUCT; requires ESXi.  ESX is not supported.</para></listitem>
         <listitem><para>All resources used for &PRODUCT; must be used for &PRODUCT; only.  &PRODUCT; cannot share instance of ESXi or storage with other management consoles.  Do not share the same storage volumes that will be used by &PRODUCT; with a different set of ESXi servers that are not managed by &PRODUCT;.</para></listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/595f0703/docs/en-US/writing-new-documentation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/writing-new-documentation.xml b/docs/en-US/writing-new-documentation.xml
index 340900e..7557359 100644
--- a/docs/en-US/writing-new-documentation.xml
+++ b/docs/en-US/writing-new-documentation.xml
@@ -82,7 +82,7 @@
         <section id="building-documentation">
             <title>Building &PRODUCT; Documentation</title>
             <para>To build a specific guide, go to the source tree of the documentation in /docs and identify the guide you want to build.</para>
-            <para>Currenlty there are four guides plus the release notes, all defined in publican configuration files:</para>
+            <para>Currently there are four guides plus the release notes, all defined in publican configuration files:</para>
             <programlisting>
                publican-adminguide.cfg
                publican-devguide.cfg
@@ -96,5 +96,5 @@
         </section>
     ]]>
     </programlisting>
-    <para>Happy Publicaning and DocBooking.</para>
+    <para>Happy Publicating and DocBooking.</para>
 </section>


[18/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
VPC - new system vm doesn't bring up eth0 reliably, and we don't set eth0 to
auto start like we should.  cloud-early-config sets 'auto lo $1', but we don't
pass $1 in vpc router scenario like we do in others for some reason. eth0 is
always link local in vpc router, so setting it to that.

Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1365546368 -0600


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

Branch: refs/heads/internallb
Commit: 5516a5adcadac7c7a4fbdd27d856a99982104c66
Parents: 18def02
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Tue Apr 9 16:26:08 2013 -0600
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5516a5ad/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
index 2b99c5b..514c0b0 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -704,7 +704,7 @@ setup_vpcrouter() {
   fi
 
     cat > /etc/network/interfaces << EOF
-auto lo $1
+auto lo eth0
 iface lo inet loopback
 EOF
   setup_interface "0" $ETH0_IP $ETH0_MASK $GW


[17/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: default to enabled if not specified in datacenter config


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

Branch: refs/heads/internallb
Commit: 18def0291e0b403524fbada8f6a503102bec94c5
Parents: dbf3f90
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Tue Apr 9 14:45:12 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:36 2013 -0700

----------------------------------------------------------------------
 tools/marvin/marvin/deployDataCenter.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18def029/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index d365395..2e270a7 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -329,7 +329,7 @@ class deployDataCenters():
             self.createSecondaryStorages(zone.secondaryStorages, zoneId)
             
             enabled = getattr(zone, 'enabled', 'True')
-            if enabled == 'True' or enabled == 'None':
+            if enabled == 'True' or enabled is None:
                 self.enableZone(zoneId, "Enabled")
             details = getattr(zone, 'details')
             if details is not None:


[04/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
QuickCloud: start console proxy service from mvn exec:java


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

Branch: refs/heads/internallb
Commit: 254e5767ad2187a5bd7c4510e03ee5f45f9082bd
Parents: f2e06ce
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Mon Mar 25 12:15:14 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:43:34 2013 -0700

----------------------------------------------------------------------
 services/console-proxy/server/conf/log4j-cloud.xml |    2 +-
 services/console-proxy/server/pom.xml              |   38 +++++++++++++++
 2 files changed, 39 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/254e5767/services/console-proxy/server/conf/log4j-cloud.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/log4j-cloud.xml b/services/console-proxy/server/conf/log4j-cloud.xml
index 5b31c9d..2d1d361 100644
--- a/services/console-proxy/server/conf/log4j-cloud.xml
+++ b/services/console-proxy/server/conf/log4j-cloud.xml
@@ -27,7 +27,7 @@ under the License.
 
    <!-- A time/date based rolling appender -->
    <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
-      <param name="File" value="/var/log/cloud/systemvm.log"/>
+      <param name="File" value="${log.home}systemvm.log"/>
       <param name="Append" value="true"/>
       <param name="Threshold" value="DEBUG"/>
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/254e5767/services/console-proxy/server/pom.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/pom.xml b/services/console-proxy/server/pom.xml
index f57b4ca..fd7b964 100644
--- a/services/console-proxy/server/pom.xml
+++ b/services/console-proxy/server/pom.xml
@@ -254,6 +254,44 @@
       </plugins>
       </build>
     </profile>
+    <profile>
+      <id>quickcloud</id>
+      <activation>
+        <property>
+          <name>quickcloud</name>
+        </property>
+      </activation>
+      <build>
+      <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>com.cloud.agent.AgentShell</mainClass>
+          <arguments>
+            <argument>zone=1</argument>
+            <argument>pod=1</argument>
+            <argument>host=192.168.56.1</argument>
+          </arguments>
+          <systemProperties>
+            <systemProperty>
+              <key>javax.net.ssl.trustStore</key>
+              <value>certs/realhostip.keystore</value>
+            </systemProperty>
+          </systemProperties>
+        </configuration>
+      </plugin>
+      </plugins>
+    </build>
+  </profile>
   </profiles>
 
 </project>


[33/50] git commit: updated refs/heads/internallb to ed0cb2f

Posted by al...@apache.org.
appliance: Permute again, give some more megas to /usr for systemvm

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/internallb
Commit: fd57bf1ccc64dcf8f8574e0d35933790511e1e87
Parents: 4fb3d26
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Apr 10 18:01:02 2013 +0530
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg       |    4 ++--
 .../definitions/systemvmtemplate64/preseed.cfg     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd57bf1c/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index cafb9c3..d456256 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              850 20 1100 ext4                                \
+              900 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -161,7 +161,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \
               .                                               \
-              100 70 400 ext4                                 \
+              50 70 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd57bf1c/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
index cafb9c3..d456256 100644
--- a/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate64/preseed.cfg
@@ -146,7 +146,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /home }                     \
               .                                               \
-              850 20 1100 ext4                                \
+              900 20 1100 ext4                                \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /usr }                      \
@@ -161,7 +161,7 @@ d-i partman-auto/expert_recipe string                         \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /var }                      \
               .                                               \
-              100 70 400 ext4                                 \
+              50 70 400 ext4                                 \
                       method{ format } format{ }              \
                       use_filesystem{ } filesystem{ ext4 }    \
                       mountpoint{ /tmp }                      \