mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack
This commit is contained in:
commit
54d7a10b99
|
|
@ -27,7 +27,7 @@
|
|||
<import file="${base.dir}/build/build-marvin.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/package.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/developer.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-clouddev.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-devcloud.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-usage.xml" optional="false"/>
|
||||
<import file="${base.dir}/build/build-aws-api.xml" optional="false"/>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -279,8 +279,8 @@
|
|||
|
||||
<!-- ===================== Network Elements ===================== -->
|
||||
|
||||
<target name="compile-network-elements" depends="compile-netscaler, compile-f5, compile-srx, compile-ovs" description="Compile all network elements"/>
|
||||
<target name="build-network-elements" depends="build-netscaler, build-f5, build-srx, build-ovs" description="build all network elements"/>
|
||||
<target name="compile-network-elements" depends="compile-netscaler, compile-f5, compile-srx, compile-ovs, compile-elb" description="Compile all network elements"/>
|
||||
<target name="build-network-elements" depends="build-netscaler, build-f5, build-srx, build-ovs, build-elb" description="build all network elements"/>
|
||||
|
||||
<target name="compile-netscaler" depends="-init, compile-server" description="Compile NetScaler plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/netscaler/build.xml" target="build"/>
|
||||
|
|
@ -302,6 +302,11 @@
|
|||
</target>
|
||||
<target name="build-ovs" depends="compile-ovs"/>
|
||||
|
||||
<target name="compile-elb" depends="-init, compile-server" description="Compile ELB plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/elastic-loadbalancer/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-elb" depends="compile-elb"/>
|
||||
|
||||
|
||||
<!-- ===================== File Systems ===================== -->
|
||||
|
||||
|
|
|
|||
|
|
@ -30,28 +30,30 @@
|
|||
|
||||
<target name="deploydbIfSet" if="deploydb.is.set">
|
||||
<echo message="ant deploydb"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/apache-tomcat-6.0.32;killall java;cd /opt/incubator-cloudstack;ant deploycddb"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;killall java;cd /opt/cloudstack/incubator-cloudstack;ant deploycddb"/>
|
||||
</target>
|
||||
|
||||
<target name="rdeploydb">
|
||||
<echo message="ant rdeploydb"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/apache-tomcat-6.0.32;killall java;cd /opt/incubator-cloudstack;ant deploycddb"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;killall java;cd /opt/cloudstack/incubator-cloudstack;ant deploycddb -Drhost=${host}"/>
|
||||
</target>
|
||||
|
||||
<target name="deploycddb" description="deploy specific db configuration for clouddev" depends="deploydb">
|
||||
<exec dir="${db.scripts.dir}" executable="bash">
|
||||
<arg value="deploy-db-clouddev.sh" />
|
||||
<arg value="${host}" />
|
||||
<arg value="8443" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="rdebug-suspend" >
|
||||
<echo message="ant debug-suspend"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="killall java;sleep 1;echo $CATALINA_HOME; export CATALINA_HOME=/opt/apache-tomcat-6.0.32;cd /opt/incubator-cloudstack;ant deploy-server;ant debug-suspend"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="killall java;sleep 1;echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server;ant debug-suspend"/>
|
||||
</target>
|
||||
|
||||
<target name="rdebug">
|
||||
<echo message="ant debug"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="killall java;sleep 1;echo $CATALINA_HOME; export CATALINA_HOME=/opt/apache-tomcat-6.0.32;cd /opt/incubator-cloudstack;ant deploy-server; ant debug"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="killall java;sleep 1;export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server; ant debug "/>
|
||||
</target>
|
||||
|
||||
|
||||
|
|
@ -63,33 +65,33 @@
|
|||
|
||||
|
||||
<echo message="copying build folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/incubator-cloudstack/build">
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/build">
|
||||
<fileset dir="build">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<scp trust="yes" port="${port}" file="build.xml" todir="root:password@${host}:/opt/incubator-cloudstack/">
|
||||
<scp trust="yes" port="${port}" file="build.xml" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/">
|
||||
</scp>
|
||||
|
||||
<echo message="copying deps folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/incubator-cloudstack/deps">
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/deps">
|
||||
<fileset dir="deps">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<echo message="copying target folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/incubator-cloudstack/target">
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/target">
|
||||
<fileset dir="target">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<echo message="copying dist folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/incubator-cloudstack/dist">
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/dist">
|
||||
<fileset dir="dist">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/apache-tomcat-6.0.32;cd /opt/incubator-cloudstack;ant deploy-server"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server"/>
|
||||
|
||||
</target>
|
||||
|
||||
|
|
@ -159,6 +159,7 @@
|
|||
</adapters>
|
||||
<manager name="VmwareManager" key="com.cloud.hypervisor.vmware.manager.VmwareManager" class="com.cloud.hypervisor.vmware.manager.VmwareManagerImpl"/>
|
||||
<manager name="OvsTunnelManager" key="com.cloud.network.ovs.OvsTunnelManager" class="com.cloud.network.ovs.OvsTunnelManagerImpl"/>
|
||||
<manager name="ElasticLoadBalancerManager" key="com.cloud.network.lb.ElasticLoadBalancerManager" class="com.cloud.network.lb.ElasticLoadBalancerManagerImpl"/>
|
||||
<pluggableservice name="VirtualRouterElementService" key="com.cloud.network.element.VirtualRouterElementService" class="com.cloud.network.element.VirtualRouterElement"/>
|
||||
<pluggableservice name="NetscalerExternalLoadBalancerElementService" key="com.cloud.network.element.NetscalerLoadBalancerElementService" class="com.cloud.network.element.NetscalerElement"/>
|
||||
<pluggableservice name="F5ExternalLoadBalancerElementService" key="com.cloud.network.element.F5ExternalLoadBalancerElementService" class="com.cloud.network.element.F5ExternalLoadBalancerElement"/>
|
||||
|
|
@ -172,6 +173,7 @@
|
|||
<dao name="NetappVolume" class="com.cloud.netapp.dao.VolumeDaoImpl" singleton="false"/>
|
||||
<dao name="NetappLun" class="com.cloud.netapp.dao.LunDaoImpl" singleton="false"/>
|
||||
<manager name="NetappManager" key="com.cloud.netapp.NetappManager" class="com.cloud.netapp.NetappManagerImpl"/>
|
||||
<dao name="ElasticLbVmMapDao" class="com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl" singleton="false"/>
|
||||
</management-server>
|
||||
|
||||
<configuration-server class="com.cloud.server.ConfigurationServerImpl">
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{
|
|||
@Column(name = "username")
|
||||
private String vsmUserName;
|
||||
|
||||
@Column(name = "password")
|
||||
@Column(name = "password", encryptable=true)
|
||||
private String vsmPassword;
|
||||
|
||||
@Column(name = "ipaddr")
|
||||
|
|
|
|||
|
|
@ -31,10 +31,18 @@ import com.cloud.agent.api.Answer;
|
|||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.NetworkUsageAnswer;
|
||||
import com.cloud.agent.api.NetworkUsageCommand;
|
||||
import com.cloud.agent.api.StartAnswer;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StartupRoutingCommand;
|
||||
import com.cloud.agent.api.StopAnswer;
|
||||
import com.cloud.agent.api.StopCommand;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.script.Script;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.xensource.xenapi.Connection;
|
||||
import com.xensource.xenapi.Types;
|
||||
import com.xensource.xenapi.VBD;
|
||||
|
|
@ -124,4 +132,35 @@ public class XcpOssResource extends CitrixResourceBase {
|
|||
return super.executeRequest(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StartAnswer execute(StartCommand cmd) {
|
||||
StartAnswer answer = super.execute(cmd);
|
||||
|
||||
VirtualMachineTO vmSpec = cmd.getVirtualMachine();
|
||||
if (vmSpec.getType() == VirtualMachine.Type.ConsoleProxy) {
|
||||
Connection conn = getConnection();
|
||||
String publicIp = null;
|
||||
for (NicTO nic : vmSpec.getNics()) {
|
||||
if (nic.getType() == TrafficType.Guest) {
|
||||
publicIp = nic.getIp();
|
||||
}
|
||||
}
|
||||
callHostPlugin(conn, "vmops", "setDNATRule", "ip", publicIp, "port", "8443", "add", "true");
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StopAnswer execute(StopCommand cmd) {
|
||||
StopAnswer answer = super.execute(cmd);
|
||||
String vmName = cmd.getVmName();
|
||||
if (vmName.startsWith("v-")) {
|
||||
Connection conn = getConnection();
|
||||
callHostPlugin(conn, "vmops", "setDNATRule", "add", "false");
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>elastic-loadbalancer</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
|
||||
<project name="Cloud Stack ELB network element" default="help" basedir=".">
|
||||
<description>
|
||||
Cloud Stack ant build file
|
||||
</description>
|
||||
|
||||
<dirname property="elb.base.dir" file="${ant.file.Cloud Stack ELB network element}/"/>
|
||||
<!-- This directory must be set -->
|
||||
<property name="top.dir" location="${elb.base.dir}/../../.."/>
|
||||
<property name="build.dir" location="${top.dir}/build"/>
|
||||
|
||||
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; elb.base.dir=${elb.base.dir}"/>
|
||||
|
||||
<!-- Import anything that the user wants to set-->
|
||||
<!-- Import properties files and environment variables here -->
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
|
||||
<available file="${build.dir}/override/build-cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
|
||||
<available file="${build.dir}/override/cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
|
||||
<available file="${build.dir}/override/replace.properties" />
|
||||
</condition>
|
||||
|
||||
<echo message="Using build parameters from ${build-cloud.properties.file}" />
|
||||
<property file="${build-cloud.properties.file}" />
|
||||
|
||||
<echo message="Using company info from ${cloud.properties.file}" />
|
||||
<property file="${cloud.properties.file}" />
|
||||
|
||||
<echo message="Using override file from ${override.file}" />
|
||||
<property file="${override.file}" />
|
||||
|
||||
<property file="${build.dir}/build.number" />
|
||||
|
||||
<!-- In case these didn't get defined in the build-cloud.properties -->
|
||||
<property name="branding.name" value="default" />
|
||||
<property name="deprecation" value="off" />
|
||||
<property name="target.compat.version" value="1.6" />
|
||||
<property name="source.compat.version" value="1.6" />
|
||||
<property name="debug" value="true" />
|
||||
<property name="debuglevel" value="lines,source"/>
|
||||
|
||||
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
|
||||
<!-- directories for build and distribution -->
|
||||
<property name="target.dir" location="${top.dir}/target" />
|
||||
<property name="classes.dir" location="${target.dir}/classes" />
|
||||
<property name="jar.dir" location="${target.dir}/jar" />
|
||||
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
|
||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||
|
||||
<property name="deps.dir" location="${top.dir}/deps" />
|
||||
|
||||
<property name="cloud-plugin-elb.jar" value="cloud-plugin-elb.jar" />
|
||||
|
||||
<import file="${build.dir}/build-common.xml"/>
|
||||
|
||||
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
|
||||
|
||||
<!-- This section needs to be replaced by some kind of dependency library-->
|
||||
<path id="deps.classpath">
|
||||
<!--filelist files="${deps.classpath}" /-->
|
||||
<fileset dir="${deps.dir}" erroronmissingdir="false">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<path id="cloudstack.classpath">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<path id="elb.classpath">
|
||||
<path refid="deps.classpath"/>
|
||||
<path refid="cloudstack.classpath"/>
|
||||
</path>
|
||||
|
||||
<!-- This section needs to be replaced by some kind of dependency library-->
|
||||
|
||||
<target name="deploy-elb" >
|
||||
</target>
|
||||
|
||||
<target name="init" description="Initialize binaries directory">
|
||||
<mkdir dir="${classes.dir}/${cloud-plugin-elb.jar}"/>
|
||||
<mkdir dir="${jar.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="compile-elb" depends="init" description="Compile ELB">
|
||||
<compile-java jar.name="${cloud-plugin-elb.jar}" top.dir="${elb.base.dir}" classpath="elb.classpath" />
|
||||
</target>
|
||||
|
||||
<target name="clean-elb">
|
||||
<delete dir="${classes.dir}/${cloud-plugin-elb.jar}"/>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="compile-elb"/>
|
||||
<target name="clean" depends="clean-elb"/>
|
||||
|
||||
<target name="help" description="help">
|
||||
<echo level="info" message="This is the build file for ELB network element plugin"/>
|
||||
<echo level="info" message="You can do a build by doing ant build or clean by doing ant clean" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
|
@ -1450,6 +1450,18 @@ def bumpUpPriority(session, args):
|
|||
txt = ''
|
||||
|
||||
return txt
|
||||
|
||||
@echo
|
||||
def setDNATRule(session, args):
|
||||
add = args["add"]
|
||||
if add == "false":
|
||||
util.pread2(["iptables", "-t", "nat", "-F"])
|
||||
else:
|
||||
ip = args["ip"]
|
||||
port = args["port"]
|
||||
util.pread2(["iptables", "-t", "nat", "-F"])
|
||||
util.pread2(["iptables", "-t", "nat", "-A", "PREROUTING", "-i", "xenbr0", "-p", "tcp", "--dport", port, "-m", "state", "--state", "NEW", "-j", "DNAT", "--to-destination", ip +":443"])
|
||||
return ""
|
||||
|
||||
@echo
|
||||
def createISOVHD(session, args):
|
||||
|
|
@ -1533,4 +1545,5 @@ if __name__ == "__main__":
|
|||
"cleanup_rules":cleanup_rules, "checkRouter":checkRouter,
|
||||
"bumpUpPriority":bumpUpPriority, "getDomRVersion":getDomRVersion,
|
||||
"kill_copy_process":kill_copy_process,
|
||||
"createISOVHD":createISOVHD})
|
||||
"createISOVHD":createISOVHD,
|
||||
"setDNATRule":setDNATRule})
|
||||
|
|
|
|||
|
|
@ -2132,6 +2132,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
if (network == null) {
|
||||
if (zone.getNetworkType() == DataCenter.NetworkType.Basic) {
|
||||
networkId = _networkMgr.getExclusiveGuestNetwork(zoneId).getId();
|
||||
network = _networkMgr.getNetwork(networkId);
|
||||
} else {
|
||||
network = _networkMgr.getNetworkWithSecurityGroupEnabled(zoneId);
|
||||
if (network == null) {
|
||||
|
|
|
|||
|
|
@ -100,9 +100,7 @@ import com.cloud.network.dao.VpnUserDaoImpl;
|
|||
import com.cloud.network.element.VirtualRouterElement;
|
||||
import com.cloud.network.element.VirtualRouterElementService;
|
||||
import com.cloud.network.firewall.FirewallManagerImpl;
|
||||
import com.cloud.network.lb.ElasticLoadBalancerManagerImpl;
|
||||
import com.cloud.network.lb.LoadBalancingRulesManagerImpl;
|
||||
import com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl;
|
||||
import com.cloud.network.router.VirtualNetworkApplianceManagerImpl;
|
||||
import com.cloud.network.rules.RulesManagerImpl;
|
||||
import com.cloud.network.rules.dao.PortForwardingRulesDaoImpl;
|
||||
|
|
@ -296,7 +294,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com
|
|||
addDao("AgentTransferMapDao", HostTransferMapDaoImpl.class);
|
||||
addDao("ProjectDao", ProjectDaoImpl.class);
|
||||
addDao("InlineLoadBalancerNicMapDao", InlineLoadBalancerNicMapDaoImpl.class);
|
||||
addDao("ElasticLbVmMap", ElasticLbVmMapDaoImpl.class);
|
||||
addDao("ProjectsAccountDao", ProjectAccountDaoImpl.class);
|
||||
addDao("ProjectInvitationDao", ProjectInvitationDaoImpl.class);
|
||||
addDao("IdentityDao", IdentityDaoImpl.class);
|
||||
|
|
@ -369,7 +366,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com
|
|||
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
||||
info.addParameter("consoleproxy.sslEnabled", "true");
|
||||
addManager("ProjectManager", ProjectManagerImpl.class);
|
||||
addManager("ElasticLoadBalancerManager", ElasticLoadBalancerManagerImpl.class);
|
||||
addManager("SwiftManager", SwiftManagerImpl.class);
|
||||
addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
|
||||
addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
|
||||
|
|
|
|||
|
|
@ -262,6 +262,8 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
private Map<Long, ConsoleProxyLoadInfo> _zoneVmCountMap; // map <zone id, info about running VMs count in zone>
|
||||
|
||||
private String _hashKey;
|
||||
private String _staticPublicIp;
|
||||
private int _staticPort;
|
||||
|
||||
private final GlobalLock _allocProxyLock = GlobalLock.getInternLock(getAllocProxyLockName());
|
||||
|
||||
|
|
@ -465,8 +467,12 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
|
||||
KeystoreVO ksVo = _ksDao.findByName(ConsoleProxyManager.CERTIFICATE_NAME);
|
||||
assert (ksVo != null);
|
||||
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), proxy.getPublicIpAddress(), _consoleProxyPort, proxy.getPort(), ksVo.getDomainSuffix());
|
||||
|
||||
if (_staticPublicIp == null) {
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), proxy.getPublicIpAddress(), _consoleProxyPort, proxy.getPort(), ksVo.getDomainSuffix());
|
||||
} else {
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), _staticPublicIp, _consoleProxyPort, _staticPort, ksVo.getDomainSuffix());
|
||||
}
|
||||
}
|
||||
|
||||
public ConsoleProxyVO doAssignProxy(long dataCenterId, long vmId) {
|
||||
|
|
@ -1529,6 +1535,11 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
_loadScanner = new SystemVmLoadScanner<Long>(this);
|
||||
_loadScanner.initScan(STARTUP_DELAY, _capacityScanInterval);
|
||||
_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
|
||||
|
||||
_staticPublicIp = _configDao.getValue("consoleproxy.static.publicIp");
|
||||
if (_staticPublicIp != null) {
|
||||
_staticPort = NumbersUtil.parseInt(_configDao.getValue("consoleproxy.static.port"), 8443);
|
||||
}
|
||||
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Console Proxy Manager is configured.");
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.util.Map;
|
|||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.utils.crypt.DBEncryptionUtil;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
|
|
@ -31,12 +32,12 @@ import com.cloud.utils.db.Transaction;
|
|||
public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long> implements ClusterDetailsDao {
|
||||
protected final SearchBuilder<ClusterDetailsVO> ClusterSearch;
|
||||
protected final SearchBuilder<ClusterDetailsVO> DetailSearch;
|
||||
|
||||
|
||||
protected ClusterDetailsDaoImpl() {
|
||||
ClusterSearch = createSearchBuilder();
|
||||
ClusterSearch.and("clusterId", ClusterSearch.entity().getClusterId(), SearchCriteria.Op.EQ);
|
||||
ClusterSearch.done();
|
||||
|
||||
|
||||
DetailSearch = createSearchBuilder();
|
||||
DetailSearch.and("clusterId", DetailSearch.entity().getClusterId(), SearchCriteria.Op.EQ);
|
||||
DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -48,32 +49,40 @@ public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long
|
|||
SearchCriteria<ClusterDetailsVO> sc = DetailSearch.create();
|
||||
sc.setParameters("clusterId", clusterId);
|
||||
sc.setParameters("name", name);
|
||||
|
||||
return findOneIncludingRemovedBy(sc);
|
||||
|
||||
ClusterDetailsVO detail = findOneIncludingRemovedBy(sc);
|
||||
if("password".equals(name) && detail != null){
|
||||
detail.setValue(DBEncryptionUtil.decrypt(detail.getValue()));
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, String> findDetails(long clusterId) {
|
||||
SearchCriteria<ClusterDetailsVO> sc = ClusterSearch.create();
|
||||
sc.setParameters("clusterId", clusterId);
|
||||
|
||||
|
||||
List<ClusterDetailsVO> results = search(sc, null);
|
||||
Map<String, String> details = new HashMap<String, String>(results.size());
|
||||
for (ClusterDetailsVO result : results) {
|
||||
details.put(result.getName(), result.getValue());
|
||||
if("password".equals(result.getName())){
|
||||
details.put(result.getName(), DBEncryptionUtil.decrypt(result.getValue()));
|
||||
} else {
|
||||
details.put(result.getName(), result.getValue());
|
||||
}
|
||||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteDetails(long clusterId) {
|
||||
SearchCriteria sc = ClusterSearch.create();
|
||||
sc.setParameters("clusterId", clusterId);
|
||||
|
||||
|
||||
List<ClusterDetailsVO> results = search(sc, null);
|
||||
for (ClusterDetailsVO result : results) {
|
||||
remove(result.getId());
|
||||
remove(result.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,9 +93,13 @@ public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long
|
|||
SearchCriteria<ClusterDetailsVO> sc = ClusterSearch.create();
|
||||
sc.setParameters("clusterId", clusterId);
|
||||
expunge(sc);
|
||||
|
||||
|
||||
for (Map.Entry<String, String> detail : details.entrySet()) {
|
||||
ClusterDetailsVO vo = new ClusterDetailsVO(clusterId, detail.getKey(), detail.getValue());
|
||||
String value = detail.getValue();
|
||||
if("password".equals(detail.getKey())){
|
||||
value = DBEncryptionUtil.encrypt(value);
|
||||
}
|
||||
ClusterDetailsVO vo = new ClusterDetailsVO(clusterId, detail.getKey(), value);
|
||||
persist(vo);
|
||||
}
|
||||
txn.commit();
|
||||
|
|
@ -100,10 +113,10 @@ public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long
|
|||
sc.setParameters("clusterId", clusterId);
|
||||
sc.setParameters("name", name);
|
||||
expunge(sc);
|
||||
|
||||
|
||||
ClusterDetailsVO vo = new ClusterDetailsVO(clusterId, name, value);
|
||||
persist(vo);
|
||||
txn.commit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,8 +151,6 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||
@Inject
|
||||
FirewallManager _firewallMgr;
|
||||
@Inject
|
||||
ElasticLoadBalancerManager _elbMgr;
|
||||
@Inject
|
||||
NetworkDao _networkDao;
|
||||
@Inject
|
||||
FirewallRulesDao _firewallDao;
|
||||
|
|
@ -684,7 +682,9 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||
_firewallDao.remove(lb.getId());
|
||||
}
|
||||
|
||||
_elbMgr.handleDeleteLoadBalancerRule(lb, callerUserId, caller);
|
||||
// FIXME: breaking the dependency on ELB manager. This breaks functionality of ELB using virtual router
|
||||
// Bug CS-15411 opened to document this
|
||||
//_elbMgr.handleDeleteLoadBalancerRule(lb, callerUserId, caller);
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Load balancer with id " + lb.getId() + " is removed successfully");
|
||||
|
|
@ -726,7 +726,10 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||
_networkMgr.checkIpForService(ipAddressVo, Service.Lb);
|
||||
}
|
||||
|
||||
LoadBalancer result = _elbMgr.handleCreateLoadBalancerRule(lb, lbOwner, lb.getNetworkId());
|
||||
// FIXME: breaking the dependency on ELB manager. This breaks functionality of ELB using virtual router
|
||||
// Bug CS-15411 opened to document this
|
||||
//LoadBalancer result = _elbMgr.handleCreateLoadBalancerRule(lb, lbOwner, lb.getNetworkId());
|
||||
LoadBalancer result = null;
|
||||
if (result == null) {
|
||||
IpAddress ip = null;
|
||||
Network guestNetwork = _networkMgr.getNetwork(lb.getNetworkId());
|
||||
|
|
|
|||
|
|
@ -210,12 +210,12 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
|
|||
public long findCorrectResourceLimitForAccount(Account account, ResourceType type) {
|
||||
|
||||
long max = Resource.RESOURCE_UNLIMITED; // if resource limit is not found, then we treat it as unlimited
|
||||
|
||||
//no limits for Admin accounts
|
||||
if (_accountMgr.isAdmin(account.getType())) {
|
||||
|
||||
// No limits for Root Admin accounts
|
||||
if (_accountMgr.isRootAdmin(account.getType())) {
|
||||
return max;
|
||||
}
|
||||
|
||||
|
||||
ResourceLimitVO limit = _resourceLimitDao.findByOwnerIdAndType(account.getId(), ResourceOwnerType.Account, type);
|
||||
|
||||
// Check if limit is configured for account
|
||||
|
|
@ -277,8 +277,8 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
|
|||
long numResources = ((count.length == 0) ? 1 : count[0]);
|
||||
Project project = null;
|
||||
|
||||
// Don't place any limits on system or admin accounts
|
||||
if (_accountMgr.isAdmin(account.getType())) {
|
||||
// Don't place any limits on system or root admin accounts
|
||||
if (_accountMgr.isRootAdmin(account.getType())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -510,10 +510,17 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
|
|||
if (account.getId() == Account.ACCOUNT_ID_SYSTEM) {
|
||||
throw new InvalidParameterValueException("Can't update system account");
|
||||
}
|
||||
|
||||
//only Unlimited value is accepted if account is Admin
|
||||
if (_accountMgr.isAdmin(account.getType()) && max.shortValue() != ResourceLimit.RESOURCE_UNLIMITED) {
|
||||
throw new InvalidParameterValueException("Only " + ResourceLimit.RESOURCE_UNLIMITED + " limit is supported for Admin accounts");
|
||||
|
||||
//only Unlimited value is accepted if account is Root Admin
|
||||
if (_accountMgr.isRootAdmin(account.getType()) && max.shortValue() != ResourceLimit.RESOURCE_UNLIMITED) {
|
||||
throw new InvalidParameterValueException("Only " + ResourceLimit.RESOURCE_UNLIMITED + " limit is supported for Root Admin accounts");
|
||||
}
|
||||
|
||||
if ((caller.getAccountId() == accountId.longValue()) &&
|
||||
(caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN ||
|
||||
caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN)) {
|
||||
// If the admin is trying to update his own account, disallow.
|
||||
throw new PermissionDeniedException("Unable to update resource limit for his own account " + accountId + ", permission denied");
|
||||
}
|
||||
|
||||
if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
|
||||
|
|
|
|||
|
|
@ -1063,7 +1063,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
if (profile.getHypervisorType() == HypervisorType.Hyperv) {
|
||||
buf.append(" resource=com.cloud.storage.resource.CifsSecondaryStorageResource");
|
||||
} else {
|
||||
buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource");
|
||||
buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
|
||||
}
|
||||
} else {
|
||||
buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
|
||||
|
|
|
|||
|
|
@ -21,3 +21,23 @@ mysql --user=cloud --password=cloud < clouddev.sql
|
|||
if [ $? -ne 0 ]; then
|
||||
printf "failed to init cloudev db"
|
||||
fi
|
||||
mysql --user=cloud -t cloud --password=cloud -e "insert into configuration (name, value) VALUES('consoleproxy.static.publicip', \"$1\")"
|
||||
mysql --user=cloud -t cloud --password=cloud -e "insert into configuration (name, value) VALUES('consoleproxy.static.port', \"$2\")"
|
||||
|
||||
vmids=`xe vm-list is-control-domain=false |grep uuid|awk '{print $5}'`
|
||||
for vm in $vmids
|
||||
do
|
||||
echo $vm
|
||||
xe vm-shutdown uuid=$vm
|
||||
xe vm-destroy uuid=$vm
|
||||
done
|
||||
|
||||
vdis=`xe vdi-list |grep ^uuid |awk '{print $5}'`
|
||||
for vdi in $vdis
|
||||
do
|
||||
xe vdi-destroy uuid=$vdi
|
||||
if [ $? -gt 0 ];then
|
||||
xe vdi-forget uuid=$vdi
|
||||
fi
|
||||
|
||||
done
|
||||
|
|
|
|||
|
|
@ -61,23 +61,31 @@ if [[ $OSTYPE == "cygwin" ]] ; then
|
|||
PATHSEP=';'
|
||||
fi
|
||||
|
||||
echo "Recreating Database."
|
||||
handle_error() {
|
||||
mysqlout=$?
|
||||
if [ $mysqlout -eq 1 ]; then
|
||||
printf "Please enter root password for MySQL.\n"
|
||||
mysql --user=root --password < $1
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "Error: Cannot execute $1\n"
|
||||
exit 10
|
||||
fi
|
||||
elif [ $mysqlout -eq 127 ]; then
|
||||
printf "Error: Cannot execute $1 - mysql command not found.\n"
|
||||
exit 11
|
||||
elif [ $mysqlout -ne 0 ]; then
|
||||
printf "Error: Cannot execute $1\n"
|
||||
exit 11
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Recreating Database cloud."
|
||||
mysql --user=root --password=$3 < create-database.sql > /dev/null 2>/dev/null
|
||||
mysqlout=$?
|
||||
if [ $mysqlout -eq 1 ]; then
|
||||
printf "Please enter root password for MySQL.\n"
|
||||
mysql --user=root --password < create-database.sql
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "Error: Cannot execute create-database.sql\n"
|
||||
exit 10
|
||||
fi
|
||||
elif [ $mysqlout -eq 127 ]; then
|
||||
printf "Error: Cannot execute create-database.sql - mysql command not found.\n"
|
||||
exit 11
|
||||
elif [ $mysqlout -ne 0 ]; then
|
||||
printf "Error: Cannot execute create-database.sql\n"
|
||||
exit 11
|
||||
fi
|
||||
handle_error create-database.sql
|
||||
|
||||
echo "Recreating Database cloud_usage."
|
||||
mysql --user=root --password=$3 < create-database-premium.sql > /dev/null 2>/dev/null
|
||||
handle_error create-database-premium.sql
|
||||
|
||||
mysql --user=cloud --password=cloud cloud < create-schema.sql
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
@ -85,6 +93,12 @@ if [ $? -ne 0 ]; then
|
|||
exit 11
|
||||
fi
|
||||
|
||||
mysql --user=cloud --password=cloud < create-schema-premium.sql
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "Error: Cannot execute create-schema-premium.sql\n"
|
||||
exit 11
|
||||
fi
|
||||
|
||||
mysql --user=cloud --password=cloud cloud < create-schema-simulator.sql
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "Error: Cannot execute create-schema-simulator.sql\n"
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ def describe_setup_in_basic_mode():
|
|||
z.internaldns2 = "192.168.110.253"
|
||||
z.name = "test"+str(l)
|
||||
z.networktype = 'Basic'
|
||||
z.securitygroupenabled = 'True'
|
||||
|
||||
'''create 10 pods'''
|
||||
for i in range(2):
|
||||
|
|
|
|||
|
|
@ -262,8 +262,15 @@ class deployDataCenters():
|
|||
listnetworkoffering = \
|
||||
listNetworkOfferings.listNetworkOfferingsCmd()
|
||||
|
||||
listnetworkoffering.name = \
|
||||
"DefaultSharedNetworkOfferingWithSGService"
|
||||
if zone.securitygroupenabled:
|
||||
listnetworkoffering.name = \
|
||||
"DefaultSharedNetworkOfferingWithSGService"
|
||||
else:
|
||||
# need both name and display text for single result
|
||||
listnetworkoffering.name = \
|
||||
"DefaultSharedNetworkOffering"
|
||||
listnetworkoffering.displaytext = \
|
||||
"Offering for Shared networks"
|
||||
|
||||
listnetworkofferingresponse = \
|
||||
self.apiClient.listNetworkOfferings(listnetworkoffering)
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
action: function(args) {
|
||||
var array1 = [];
|
||||
array1.push("&username=" + todb(args.data.username));
|
||||
|
||||
var errorMsg = "";
|
||||
var password = args.data.password;
|
||||
if (md5Hashed)
|
||||
password = $.md5(password);
|
||||
|
|
@ -266,6 +266,7 @@
|
|||
edit: {
|
||||
label: 'message.edit.account',
|
||||
action: function(args) {
|
||||
var errorMsg = "";
|
||||
var accountObj = args.context.accounts[0];
|
||||
|
||||
var array1 = [];
|
||||
|
|
@ -277,7 +278,12 @@
|
|||
async: false,
|
||||
success: function(json) {
|
||||
accountObj = json.updateaccountresponse.account;
|
||||
},
|
||||
error: function(json) {
|
||||
errorMsg = parseXMLHttpResponse(json);
|
||||
args.response.error(errorMsg);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
|
|
@ -325,6 +331,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
if(errorMsg == "")
|
||||
args.response.success({data: accountObj});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1310,7 +1310,7 @@
|
|||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
if(jsonObj.state != "Allocated") {
|
||||
if(jsonObj.vmstate == "Stopped" || jsonObj.virtualmachineid == null) {
|
||||
if((jsonObj.vmstate == "Stopped" || jsonObj.virtualmachineid == null) && jsonObj.state != "Ready") {
|
||||
allowedActions.push("downloadVolume");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue