mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Brought over new changes from master
This commit is contained in:
commit
db9cc97ab3
4
.gitignore
vendored
4
.gitignore
vendored
@ -51,4 +51,6 @@ deps/*.mar
|
|||||||
*.jar
|
*.jar
|
||||||
awsapi/modules/*
|
awsapi/modules/*
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings.xml
|
||||||
|
|||||||
@ -109,6 +109,7 @@ public class SimulatorManagerImpl implements SimulatorManager {
|
|||||||
private ConnectionConcierge _concierge;
|
private ConnectionConcierge _concierge;
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
|
/*
|
||||||
try {
|
try {
|
||||||
Connection conn = Transaction.getStandaloneConnectionWithException();
|
Connection conn = Transaction.getStandaloneConnectionWithException();
|
||||||
conn.setAutoCommit(true);
|
conn.setAutoCommit(true);
|
||||||
@ -116,6 +117,7 @@ public class SimulatorManagerImpl implements SimulatorManager {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new CloudRuntimeException("Unable to get a db connection", e);
|
throw new CloudRuntimeException("Unable to get a db connection", e);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,8 +154,8 @@ public class SimulatorManagerImpl implements SimulatorManager {
|
|||||||
@DB
|
@DB
|
||||||
@Override
|
@Override
|
||||||
public Answer simulate(Command cmd, String hostGuid) {
|
public Answer simulate(Command cmd, String hostGuid) {
|
||||||
Transaction txn = Transaction.currentTxn();
|
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
|
||||||
txn.transitToUserManagedConnection(_concierge.conn());
|
// txn.transitToUserManagedConnection(_concierge.conn());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MockHost host = _mockHost.findByGuid(hostGuid);
|
MockHost host = _mockHost.findByGuid(hostGuid);
|
||||||
|
|||||||
@ -18,4 +18,4 @@
|
|||||||
# management server compile-time environment parameters
|
# management server compile-time environment parameters
|
||||||
|
|
||||||
paths.pid=@PIDDIR@
|
paths.pid=@PIDDIR@
|
||||||
paths.script=@AGENTLIBDIR@
|
paths.script=@COMMONLIBDIR@
|
||||||
|
|||||||
@ -30,13 +30,12 @@ public class IpAddressTO {
|
|||||||
private String vlanGateway;
|
private String vlanGateway;
|
||||||
private String vlanNetmask;
|
private String vlanNetmask;
|
||||||
private String vifMacAddress;
|
private String vifMacAddress;
|
||||||
private String guestIp;
|
|
||||||
private Integer networkRate;
|
private Integer networkRate;
|
||||||
private TrafficType trafficType;
|
private TrafficType trafficType;
|
||||||
private String networkName;
|
private String networkName;
|
||||||
|
|
||||||
public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String vlanId,
|
public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String vlanId,
|
||||||
String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp, Integer networkRate, boolean isOneToOneNat) {
|
String vlanGateway, String vlanNetmask, String vifMacAddress, Integer networkRate, boolean isOneToOneNat) {
|
||||||
this.accountId = accountId;
|
this.accountId = accountId;
|
||||||
this.publicIp = ipAddress;
|
this.publicIp = ipAddress;
|
||||||
this.add = add;
|
this.add = add;
|
||||||
@ -46,7 +45,6 @@ public class IpAddressTO {
|
|||||||
this.vlanGateway = vlanGateway;
|
this.vlanGateway = vlanGateway;
|
||||||
this.vlanNetmask = vlanNetmask;
|
this.vlanNetmask = vlanNetmask;
|
||||||
this.vifMacAddress = vifMacAddress;
|
this.vifMacAddress = vifMacAddress;
|
||||||
this.guestIp = guestIp;
|
|
||||||
this.networkRate = networkRate;
|
this.networkRate = networkRate;
|
||||||
this.oneToOneNat = isOneToOneNat;
|
this.oneToOneNat = isOneToOneNat;
|
||||||
}
|
}
|
||||||
@ -58,10 +56,6 @@ public class IpAddressTO {
|
|||||||
return accountId;
|
return accountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getGuestIp(){
|
|
||||||
return guestIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPublicIp() {
|
public String getPublicIp() {
|
||||||
return publicIp;
|
return publicIp;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,9 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||||||
@Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso")
|
@Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso")
|
||||||
private Long isoId;
|
private Long isoId;
|
||||||
|
|
||||||
|
@IdentityMapper(entityTableName="vpc")
|
||||||
|
@Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc")
|
||||||
|
private Long vpcId;
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -156,6 +159,10 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||||||
return isoId;
|
return isoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getVpcId(){
|
||||||
|
return vpcId;
|
||||||
|
}
|
||||||
|
|
||||||
public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
|
public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
|
||||||
EnumSet<VMDetails> dv;
|
EnumSet<VMDetails> dv;
|
||||||
if (viewDetails==null || viewDetails.size() <=0){
|
if (viewDetails==null || viewDetails.size() <=0){
|
||||||
|
|||||||
@ -95,12 +95,24 @@
|
|||||||
<artifactId>rahas</artifactId>
|
<artifactId>rahas</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
<type>mar</type>
|
<type>mar</type>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk14</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.rampart</groupId>
|
<groupId>org.apache.rampart</groupId>
|
||||||
<artifactId>rampart</artifactId>
|
<artifactId>rampart</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
<type>mar</type>
|
<type>mar</type>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk14</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.rampart</groupId>
|
<groupId>org.apache.rampart</groupId>
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<property name="jar.dir" location="${target.dir}/jar" />
|
<property name="jar.dir" location="${target.dir}/jar" />
|
||||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||||
<property name="thirdparty.dir" location="${base.dir}/deps/awsapi-lib" />
|
<property name="thirdparty.dir" location="${base.dir}/deps/awsapi-lib" />
|
||||||
<property name="rampart.dir" location="${base.dir}/deps/awsapi-lib/rampart-lib" />
|
<!-- <property name="rampart.dir" location="${base.dir}/deps/awsapi-lib/rampart-lib" /> -->
|
||||||
<property file="${build.dir}/build-aws-api.properties" />
|
<property file="${build.dir}/build-aws-api.properties" />
|
||||||
<property name="version" value="${company.major.version}.${company.minor.version}.${company.patch.version}" />
|
<property name="version" value="${company.major.version}.${company.minor.version}.${company.patch.version}" />
|
||||||
<property name="tomcat.home" location="${catalina.dir}" />
|
<property name="tomcat.home" location="${catalina.dir}" />
|
||||||
@ -58,11 +58,11 @@
|
|||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
<path id="rampart.classpath">
|
<!-- <path id="rampart.classpath">
|
||||||
<fileset dir="${rampart.dir}">
|
<fileset dir="${rampart.dir}">
|
||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path> -->
|
||||||
<path id="dist.classpath">
|
<path id="dist.classpath">
|
||||||
<fileset dir="${target.dir}">
|
<fileset dir="${target.dir}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
@ -114,7 +114,7 @@
|
|||||||
<path id="awsapi.classpath">
|
<path id="awsapi.classpath">
|
||||||
<path refid="deps.classpath" />
|
<path refid="deps.classpath" />
|
||||||
<!-- <path refid="thirdparty.classpath" /> -->
|
<!-- <path refid="thirdparty.classpath" /> -->
|
||||||
<path refid="rampart.classpath" />
|
<!-- <path refid="rampart.classpath" /> -->
|
||||||
<path refid="dist.classpath" />
|
<path refid="dist.classpath" />
|
||||||
</path>
|
</path>
|
||||||
<target name="compile-awsapi" depends="-init-awsapi" description="Compile Cloud.com Simple Storage Service">
|
<target name="compile-awsapi" depends="-init-awsapi" description="Compile Cloud.com Simple Storage Service">
|
||||||
@ -171,7 +171,11 @@
|
|||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
<target name="deploy-axis" depends="-init-awsapi">
|
<target name="deploy-axis" depends="-init-awsapi">
|
||||||
<unwar overwrite="true" src="${base.dir}/deps/awsapi-lib/axis2-webapp-1.5.1.war" dest="${server.deploy.to.dir}/webapps7080/awsapi" />
|
<unwar overwrite="true" src="${base.dir}/deps/awsapi-lib/axis2-webapp-1.5.1.war" dest="${server.deploy.to.dir}/webapps7080/awsapi" >
|
||||||
|
<patternset>
|
||||||
|
<exclude name="WEB-INF/lib/log4j-1.2.15.jar"/>
|
||||||
|
</patternset>
|
||||||
|
</unwar>
|
||||||
</target>
|
</target>
|
||||||
<condition property="access_key.private.notpresent">
|
<condition property="access_key.private.notpresent">
|
||||||
<not>
|
<not>
|
||||||
@ -252,12 +256,12 @@
|
|||||||
<include name="web.xml" />
|
<include name="web.xml" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<!-- rampart lib goes where the axis lib files go -->
|
<!-- rampart lib goes where the axis lib files go
|
||||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/lib">
|
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||||
<fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
<fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy> -->
|
||||||
<!-- copying over rampart mar files for WS-Security -->
|
<!-- copying over rampart mar files for WS-Security -->
|
||||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/modules">
|
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||||
<fileset dir="${base.dir}/deps/awsapi-lib/modules">
|
<fileset dir="${base.dir}/deps/awsapi-lib/modules">
|
||||||
@ -365,9 +369,9 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/lib">
|
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||||
<fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
<!-- <fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
||||||
<include name="*.jar" />
|
<include name="*.jar" />
|
||||||
</fileset>
|
</fileset> -->
|
||||||
<fileset dir="${jar.dir}">
|
<fileset dir="${jar.dir}">
|
||||||
<include name="cloud-awsapi.jar" />
|
<include name="cloud-awsapi.jar" />
|
||||||
<include name="cloud-jasypt-1.8.jar" />
|
<include name="cloud-jasypt-1.8.jar" />
|
||||||
|
|||||||
@ -119,7 +119,6 @@
|
|||||||
<property name="tools.dir" location="${base.dir}/tools" />
|
<property name="tools.dir" location="${base.dir}/tools" />
|
||||||
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
||||||
<property name="deploy.dir" location="${build.dir}/deploy" />
|
<property name="deploy.dir" location="${build.dir}/deploy" />
|
||||||
<property name="production.dir" location="${deploy.dir}/production" />
|
|
||||||
<property name="meld.home" location="/usr/local/bin" />
|
<property name="meld.home" location="/usr/local/bin" />
|
||||||
<property name="assertion" value="-da" />
|
<property name="assertion" value="-da" />
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,6 @@
|
|||||||
<import file="${build.dir}/build-common.xml" />
|
<import file="${build.dir}/build-common.xml" />
|
||||||
|
|
||||||
<!-- In case these didn't get defined in the build-cloud.properties -->
|
<!-- In case these didn't get defined in the build-cloud.properties -->
|
||||||
<property name="branding.name" value="default" />
|
|
||||||
<property name="tomcat.home" value="${env.CATALINA_HOME}" />
|
<property name="tomcat.home" value="${env.CATALINA_HOME}" />
|
||||||
<property name="deprecation" value="off" />
|
<property name="deprecation" value="off" />
|
||||||
<property name="target.compat.version" value="1.6" />
|
<property name="target.compat.version" value="1.6" />
|
||||||
@ -113,17 +112,12 @@
|
|||||||
|
|
||||||
<property name="tools.dir" location="${base.dir}/tools" />
|
<property name="tools.dir" location="${base.dir}/tools" />
|
||||||
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
||||||
<property name="deploy.dir" location="${build.dir}/deploy" />
|
|
||||||
<property name="production.dir" location="${deploy.dir}/production" />
|
|
||||||
<property name="meld.home" location="/usr/local/bin" />
|
<property name="meld.home" location="/usr/local/bin" />
|
||||||
<property name="assertion" value="-da" />
|
<property name="assertion" value="-da" />
|
||||||
|
|
||||||
<!-- directory for vmware-base library -->
|
<!-- directory for vmware-base library -->
|
||||||
<property name="vmware-base.dir" location="${base.dir}/vmware-base" />
|
<property name="vmware-base.dir" location="${base.dir}/vmware-base" />
|
||||||
|
|
||||||
<!-- directories for branding -->
|
|
||||||
<property name="branding.dir" location="${build.dir}/deploy/branding/${branding.name}" />
|
|
||||||
|
|
||||||
<property name="core.jar" value="cloud-core.jar" />
|
<property name="core.jar" value="cloud-core.jar" />
|
||||||
<property name="utils.jar" value="cloud-utils.jar" />
|
<property name="utils.jar" value="cloud-utils.jar" />
|
||||||
<property name="server.jar" value="cloud-server.jar" />
|
<property name="server.jar" value="cloud-server.jar" />
|
||||||
@ -374,7 +368,7 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${copyto.dir}/conf">
|
<copy todir="${copyto.dir}/conf">
|
||||||
<fileset dir="${production.dir}/consoleproxy/conf">
|
<fileset dir="${console-proxy.dir}/conf">
|
||||||
<include name="log4j-cloud.xml" />
|
<include name="log4j-cloud.xml" />
|
||||||
<include name="consoleproxy.properties" />
|
<include name="consoleproxy.properties" />
|
||||||
</fileset>
|
</fileset>
|
||||||
@ -487,17 +481,9 @@
|
|||||||
<target name="build-servers" depends="-init, build-server" />
|
<target name="build-servers" depends="-init, build-server" />
|
||||||
|
|
||||||
<target name="build-opensource" depends="-init, build-server, build-agent, build-scripts, build-ui, build-console-proxy, package-oss-systemvm-iso">
|
<target name="build-opensource" depends="-init, build-server, build-agent, build-scripts, build-ui, build-console-proxy, package-oss-systemvm-iso">
|
||||||
<copy overwrite="true" todir="${dist.dir}">
|
|
||||||
<fileset dir="${base.dir}/build/deploy/">
|
|
||||||
<include name="deploy-agent.sh" />
|
|
||||||
<include name="deploy-server.sh" />
|
|
||||||
<include name="deploy-console-proxy.sh" />
|
|
||||||
<include name="install.sh" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${base.dir}/client">
|
<fileset dir="${base.dir}/client">
|
||||||
<include name="setup/**/*" />
|
<include name="setup/**/*" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
|
||||||
|
|
||||||
<copy overwrite="true" todir="${jar.dir}">
|
<copy overwrite="true" todir="${jar.dir}">
|
||||||
<fileset dir="${deps.dir}">
|
<fileset dir="${deps.dir}">
|
||||||
@ -505,8 +491,6 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
<chmod file="${dist.dir}/deploy-agent.sh" perm="uog+xr" />
|
|
||||||
<chmod file="${dist.dir}/deploy-server.sh" perm="uog+xr" />
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
@ -1,126 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# deploy-db.sh -- deploys the database configuration.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
# set -x
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
printf "Usage: %s [path to additional sql] [root password]\n" $(basename $0) >&2
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $1 ]; then
|
|
||||||
echo "Error: Unable to find $1"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$2" != "" ]; then
|
|
||||||
if [ ! -f $2 ]; then
|
|
||||||
echo "Error: Unable to find $2"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f create-database.sql ]; then
|
|
||||||
printf "Error: Unable to find create-database.sql\n"
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f create-schema.sql ]; then
|
|
||||||
printf "Error: Unable to find create-schema.sql\n"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f create-index-fk.sql ]; then
|
|
||||||
printf "Error: Unable to find create-index-fk.sql\n"
|
|
||||||
exit 6;
|
|
||||||
fi
|
|
||||||
|
|
||||||
PATHSEP=':'
|
|
||||||
if [[ $OSTYPE == "cygwin" ]] ; then
|
|
||||||
export CATALINA_HOME=`cygpath -m $CATALINA_HOME`
|
|
||||||
PATHSEP=';'
|
|
||||||
else
|
|
||||||
mysql="mysql"
|
|
||||||
service mysql status > /dev/null 2>/dev/null
|
|
||||||
if [ $? -eq 1 ]; then
|
|
||||||
mysql="mysqld"
|
|
||||||
service mysqld status > /dev/null 2>/dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Unable to find mysql daemon\n"
|
|
||||||
exit 7
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting mysql"
|
|
||||||
service $mysql start > /dev/null 2>/dev/null
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Recreating Database."
|
|
||||||
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 -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute create-database.sql\n"
|
|
||||||
exit 11
|
|
||||||
fi
|
|
||||||
|
|
||||||
mysql --user=cloud --password=cloud cloud < create-schema.sql
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute create-schema.sql\n"
|
|
||||||
exit 11
|
|
||||||
fi
|
|
||||||
|
|
||||||
mysql --user=cloud --password=cloud cloud < create-schema-premium.sql
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute create-schema-premium.sql\n"
|
|
||||||
exit 11
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" != "" ]; then
|
|
||||||
mysql --user=cloud --password=cloud cloud < $1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute $1\n"
|
|
||||||
exit 12
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$2" != "" ]; then
|
|
||||||
echo "Adding Templates"
|
|
||||||
mysql --user=cloud --password=cloud cloud < $2
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute $2\n"
|
|
||||||
exit 12
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo "Creating Indice and Foreign Keys"
|
|
||||||
mysql --user=cloud --password=cloud cloud < create-index-fk.sql
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf "Error: Cannot execute create-index-fk.sql\n"
|
|
||||||
exit 13
|
|
||||||
fi
|
|
||||||
@ -1,24 +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.
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.Target=System.out
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
|
||||||
log4j.appender.stdout.threshold=ERROR
|
|
||||||
log4j.rootLogger=INFO, stdout
|
|
||||||
log4j.category.org.apache=INFO, stdout
|
|
||||||
@ -1,232 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# install.sh -- installs an agent
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf "Usage: %s: -d [directory to deploy to] -t [routing|storage|computing] -z [zip file] -h [host] -p [pod] -c [data center] -m [expert|novice|setup]\n" $(basename $0) >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
mode=
|
|
||||||
host=
|
|
||||||
pod=
|
|
||||||
zone=
|
|
||||||
|
|
||||||
deploydir=
|
|
||||||
confdir=
|
|
||||||
zipfile=
|
|
||||||
typ=
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
while getopts 'd:z:t:x:m:h:p:c:' OPTION
|
|
||||||
do
|
|
||||||
case "$OPTION" in
|
|
||||||
d) deploydir="$OPTARG"
|
|
||||||
;;
|
|
||||||
z) zipfile="$OPTARG"
|
|
||||||
;;
|
|
||||||
t) typ="$OPTARG"
|
|
||||||
;;
|
|
||||||
m) mode="$OPTARG"
|
|
||||||
;;
|
|
||||||
h) host="$OPTARG"
|
|
||||||
;;
|
|
||||||
p) pod="$OPTARG"
|
|
||||||
;;
|
|
||||||
c) zone="$OPTARG"
|
|
||||||
;;
|
|
||||||
?) usage
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
printf "NOTE: You must have root privileges to install and run this program.\n"
|
|
||||||
|
|
||||||
if [ "$typ" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]
|
|
||||||
then
|
|
||||||
printf "Type of agent to install [routing|computing|storage]: "
|
|
||||||
read typ
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$typ" != "computing" ] && [ "$typ" != "routing" ] && [ "$typ" != "storage" ]
|
|
||||||
then
|
|
||||||
printf "ERROR: The choices are computing, routing, or storage.\n"
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$host" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]
|
|
||||||
then
|
|
||||||
printf "Host name or ip address of management server [Required]: "
|
|
||||||
read host
|
|
||||||
if [ "$host" == "" ]; then
|
|
||||||
printf "ERROR: Host is required\n"
|
|
||||||
exit 23;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
port=
|
|
||||||
if [ "$mode" != "expert" ]
|
|
||||||
then
|
|
||||||
printf "Port number of management server [defaults to 8250]: "
|
|
||||||
read port
|
|
||||||
fi
|
|
||||||
if [ "$port" == "" ]
|
|
||||||
then
|
|
||||||
port=8250
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zone" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Availability Zone [Required]: "
|
|
||||||
read zone
|
|
||||||
if [ "$zone" == "" ]; then
|
|
||||||
printf "ERROR: Zone is required\n";
|
|
||||||
exit 21;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$pod" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Pod [Required]: "
|
|
||||||
read pod
|
|
||||||
if [ "$pod" == "" ]; then
|
|
||||||
printf "ERROR: Pod is required\n";
|
|
||||||
exit 22;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
workers=
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "# of workers to start [defaults to 3]: "
|
|
||||||
read workers
|
|
||||||
fi
|
|
||||||
if [ "$workers" == "" ]; then
|
|
||||||
workers=3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$deploydir" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Directory to deploy to [defaults to /usr/local/vmops/agent]: "
|
|
||||||
read deploydir
|
|
||||||
fi
|
|
||||||
if [ "$deploydir" == "" ]; then
|
|
||||||
deploydir="/usr/local/vmops/agent"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if ! mkdir -p $deploydir
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to create $deploydir\n"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zipfile" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Path of the zip file [defaults to agent.zip]: "
|
|
||||||
read zipfile
|
|
||||||
fi
|
|
||||||
if [ "$zipfile" == "" ]; then
|
|
||||||
zipfile="agent.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
if ! unzip -o $zipfile -d $deploydir
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to unzip $zipfile to $deploydir\n"
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if ! chmod -R +x $deploydir/scripts/*.sh
|
|
||||||
#then
|
|
||||||
# printf "ERROR: Unable to change scripts to executable.\n"
|
|
||||||
# exit 7
|
|
||||||
#fi
|
|
||||||
#if ! chmod -R +x $deploydir/scripts/iscsi/*.sh
|
|
||||||
#then
|
|
||||||
# printf "ERROR: Unable to change scripts to executable.\n"
|
|
||||||
# exit 8
|
|
||||||
#fi
|
|
||||||
#if ! chmod -R +x $deploydir/*.sh
|
|
||||||
#then
|
|
||||||
# printf "ERROR: Unable to change scripts to executable.\n"
|
|
||||||
# exit 9
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [ "$mode" == "setup" ]; then
|
|
||||||
mode="expert"
|
|
||||||
deploydir="/usr/local/vmops/agent"
|
|
||||||
confdir="/etc/vmops"
|
|
||||||
/bin/cp -f $deploydir/conf/agent.properties $confdir/agent.properties
|
|
||||||
if [ $? -gt 0 ]; then
|
|
||||||
printf "ERROR: Failed to copy the agent.properties file into the right place."
|
|
||||||
exit 10;
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
confdir="$deploydir/conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$typ" != "" ]; then
|
|
||||||
sed s/@TYPE@/"$typ"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Type is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$host" != "" ]; then
|
|
||||||
sed s/@HOST@/"$host"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: host is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$port" != "" ]; then
|
|
||||||
sed s/@PORT@/"$port"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Port is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$pod" != "" ]; then
|
|
||||||
sed s/@POD@/"$pod"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Pod is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zone" != "" ]; then
|
|
||||||
sed s/@ZONE@/"$zone"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Zone is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$workers" != "" ]; then
|
|
||||||
sed s/@WORKERS@/"$workers"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Workers is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "SUCCESS: Installation is now complete. If you like to make changes, edit $confdir/agent.properties\n"
|
|
||||||
exit 0
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Deploy console proxy package to an existing VM template
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf "Usage: %s: -d [work directory to deploy to] -z [zip file]" $(basename $0) >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
deploydir=
|
|
||||||
zipfile=
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
while getopts 'd:z:' OPTION
|
|
||||||
do
|
|
||||||
case "$OPTION" in
|
|
||||||
d) deploydir="$OPTARG"
|
|
||||||
;;
|
|
||||||
z) zipfile="$OPTARG"
|
|
||||||
;;
|
|
||||||
?) usage
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
printf "NOTE: You must have root privileges to install and run this program.\n"
|
|
||||||
|
|
||||||
if [ "$deploydir" == "" ]; then
|
|
||||||
printf "ERROR: Unable to find deployment work directory $deploydir\n"
|
|
||||||
exit 3;
|
|
||||||
fi
|
|
||||||
if [ ! -f $deploydir/consoleproxy.tar.gz ]
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to find existing console proxy template file (consoleproxy.tar.gz) to work on at $deploydir\n"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zipfile" == "" ]; then
|
|
||||||
zipfile="console-proxy.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! mkdir -p /mnt/consoleproxy
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to create /mnt/consoleproxy for mounting template image\n"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
tar xvfz $deploydir/consoleproxy.tar.gz -C $deploydir
|
|
||||||
mount -o loop $deploydir/vmi-root-fc8-x86_64-domP /mnt/consoleproxy
|
|
||||||
|
|
||||||
if ! unzip -o $zipfile -d /mnt/consoleproxy/usr/local/vmops/consoleproxy
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to unzip $zipfile to $deploydir\n"
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
umount /mnt/consoleproxy
|
|
||||||
|
|
||||||
pushd $deploydir
|
|
||||||
tar cvf consoleproxy.tar vmi-root-fc8-x86_64-domP
|
|
||||||
|
|
||||||
mv -f consoleproxy.tar.gz consoleproxy.tar.gz.old
|
|
||||||
gzip consoleproxy.tar
|
|
||||||
popd
|
|
||||||
|
|
||||||
if [ ! -f $deploydir/consoleproxy.tar.gz ]
|
|
||||||
then
|
|
||||||
mv consoleproxy.tar.gz.old consoleproxy.tar.gz
|
|
||||||
printf "ERROR: failed to deploy and recreate the template at $deploydir\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "SUCCESS: Installation is now complete. please go to $deploydir to review it\n"
|
|
||||||
exit 0
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# deploy.sh -- deploys a management server
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf "Usage: %s: -d [tomcat directory to deploy to] -z [zip file to use]\n" $(basename $0) >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
dflag=
|
|
||||||
zflag=
|
|
||||||
tflag=
|
|
||||||
iflag=
|
|
||||||
|
|
||||||
deploydir=
|
|
||||||
zipfile="client.zip"
|
|
||||||
typ=
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
while getopts 'd:z:x:h:' OPTION
|
|
||||||
do
|
|
||||||
case "$OPTION" in
|
|
||||||
d) dflag=1
|
|
||||||
deploydir="$OPTARG"
|
|
||||||
;;
|
|
||||||
z) zflag=1
|
|
||||||
zipfile="$OPTARG"
|
|
||||||
;;
|
|
||||||
h) iflag="$OPTARG"
|
|
||||||
;;
|
|
||||||
?) usage
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$deploydir" == "" ]
|
|
||||||
then
|
|
||||||
if [ "$CATALINA_HOME" == "" ]
|
|
||||||
then
|
|
||||||
printf "Tomcat Directory to deploy to: "
|
|
||||||
read deploydir
|
|
||||||
else
|
|
||||||
deploydir="$CATALINA_HOME"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$deploydir" == "" ]
|
|
||||||
then
|
|
||||||
printf "Tomcat directory was not specified\n";
|
|
||||||
exit 15;
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "Check to see if the Tomcat directory exist: $deploydir\n"
|
|
||||||
if [ ! -d $deploydir ]
|
|
||||||
then
|
|
||||||
printf "Tomcat directory does not exist\n";
|
|
||||||
exit 16;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zipfile" == "" ]
|
|
||||||
then
|
|
||||||
printf "Path of the zip file [defaults to client.zip]: "
|
|
||||||
read zipfile
|
|
||||||
if [ "$zipfile" == "" ]
|
|
||||||
then
|
|
||||||
zipfile="client.zip"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if ! unzip -o $zipfile client.war
|
|
||||||
then
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -fr $deploydir/webapps/client
|
|
||||||
|
|
||||||
if ! unzip -o ./client.war -d $deploydir/webapps/client
|
|
||||||
then
|
|
||||||
exit 10;
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f ./client.war
|
|
||||||
|
|
||||||
if ! unzip -o $zipfile lib/* -d $deploydir
|
|
||||||
then
|
|
||||||
exit 11;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! unzip -o $zipfile conf/* -d $deploydir
|
|
||||||
then
|
|
||||||
exit 12;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! unzip -o $zipfile bin/* -d $deploydir
|
|
||||||
then
|
|
||||||
exit 13;
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "Adding the conf directory to the class loader for tomcat\n"
|
|
||||||
sed 's/shared.loader=$/shared.loader=\$\{catalina.home\},\$\{catalina.home\}\/conf\
|
|
||||||
/' $deploydir/conf/catalina.properties > $deploydir/conf/catalina.properties.tmp
|
|
||||||
mv $deploydir/conf/catalina.properties.tmp $deploydir/conf/catalina.properties
|
|
||||||
|
|
||||||
printf "Installation is now complete\n"
|
|
||||||
exit 0
|
|
||||||
@ -1,200 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# install.sh -- installs an agent
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf "Usage: %s: -d [directory to deploy to] -z [zip file] -h [host] -p [pod] -c [data center] -m [expert|novice|setup]\n" $(basename $0) >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
mode=
|
|
||||||
host=
|
|
||||||
pod=
|
|
||||||
zone=
|
|
||||||
|
|
||||||
deploydir=
|
|
||||||
confdir=
|
|
||||||
zipfile=
|
|
||||||
typ=
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
while getopts 'd:z:x:m:h:p:c:' OPTION
|
|
||||||
do
|
|
||||||
case "$OPTION" in
|
|
||||||
d) deploydir="$OPTARG"
|
|
||||||
;;
|
|
||||||
z) zipfile="$OPTARG"
|
|
||||||
;;
|
|
||||||
m) mode="$OPTARG"
|
|
||||||
;;
|
|
||||||
h) host="$OPTARG"
|
|
||||||
;;
|
|
||||||
p) pod="$OPTARG"
|
|
||||||
;;
|
|
||||||
c) zone="$OPTARG"
|
|
||||||
;;
|
|
||||||
?) usage
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
printf "NOTE: You must have root privileges to install and run this program.\n"
|
|
||||||
|
|
||||||
if [ "$mode" == "setup" ]; then
|
|
||||||
mode="expert"
|
|
||||||
deploydir="/usr/local/cloud/agent-simulator"
|
|
||||||
confdir="/etc/cloud"
|
|
||||||
/bin/cp -f $deploydir/conf/agent.properties $confdir/agent.properties
|
|
||||||
if [ $? -gt 0 ]; then
|
|
||||||
printf "ERROR: Failed to copy the agent.properties file into the right place."
|
|
||||||
exit 10;
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
confdir="$deploydir/conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$host" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]
|
|
||||||
then
|
|
||||||
printf "Host name or ip address of management server [Required]: "
|
|
||||||
read host
|
|
||||||
if [ "$host" == "" ]; then
|
|
||||||
printf "ERROR: Host is required\n"
|
|
||||||
exit 23;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
port=
|
|
||||||
if [ "$mode" != "expert" ]
|
|
||||||
then
|
|
||||||
printf "Port number of management server [defaults to 8250]: "
|
|
||||||
read port
|
|
||||||
fi
|
|
||||||
if [ "$port" == "" ]
|
|
||||||
then
|
|
||||||
port=8250
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zone" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Availability Zone [Required]: "
|
|
||||||
read zone
|
|
||||||
if [ "$zone" == "" ]; then
|
|
||||||
printf "ERROR: Zone is required\n";
|
|
||||||
exit 21;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$pod" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Pod [Required]: "
|
|
||||||
read pod
|
|
||||||
if ["$pod" == ""]; then
|
|
||||||
printf "ERROR: Pod is required\n";
|
|
||||||
exit 22;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
workers=
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "# of workers to start [defaults to 3]: "
|
|
||||||
read workers
|
|
||||||
fi
|
|
||||||
if [ "$workers" == "" ]; then
|
|
||||||
workers=3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$deploydir" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Directory to deploy to [defaults to /usr/local/cloud/agent-simulator]: "
|
|
||||||
read deploydir
|
|
||||||
fi
|
|
||||||
if [ "$deploydir" == "" ]; then
|
|
||||||
deploydir="/usr/local/cloud/agent-simulator"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if ! mkdir -p $deploydir
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to create $deploydir\n"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zipfile" == "" ]; then
|
|
||||||
if [ "$mode" != "expert" ]; then
|
|
||||||
printf "Path of the zip file [defaults to agent-simulator.zip]: "
|
|
||||||
read zipfile
|
|
||||||
fi
|
|
||||||
if [ "$zipfile" == "" ]; then
|
|
||||||
zipfile="agent-simulator.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
if ! unzip -o $zipfile -d $deploydir
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to unzip $zipfile to $deploydir\n"
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! chmod +x $deploydir/*.sh
|
|
||||||
then
|
|
||||||
printf "ERROR: Unable to change scripts to executable.\n"
|
|
||||||
exit 9
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$host" != "" ]; then
|
|
||||||
sed s/@HOST@/"$host"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: host is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$port" != "" ]; then
|
|
||||||
sed s/@PORT@/"$port"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Port is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$pod" != "" ]; then
|
|
||||||
sed s/@POD@/"$pod"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Pod is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$zone" != "" ]; then
|
|
||||||
sed s/@ZONE@/"$zone"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Zone is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$workers" != "" ]; then
|
|
||||||
sed s/@WORKERS@/"$workers"/ $confdir/agent.properties > $confdir/tmp
|
|
||||||
/bin/mv -f $confdir/tmp $confdir/agent.properties
|
|
||||||
else
|
|
||||||
printf "INFO: Workers is not set\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "SUCCESS: Installation is now complete. If you like to make changes, edit $confdir/agent.properties\n"
|
|
||||||
exit 0
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# install-storage-server.sh: Installs a VMOps Storage Server
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
choose_correct_filename() {
|
|
||||||
local default_filename=$1
|
|
||||||
local user_specified_filename=$2
|
|
||||||
|
|
||||||
if [ -f "$user_specified_filename" ]
|
|
||||||
then
|
|
||||||
echo $user_specified_filename
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
if [ -f "$default_filename" ]
|
|
||||||
then
|
|
||||||
echo $default_filename
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
install_opensolaris_package() {
|
|
||||||
pkg_name=$1
|
|
||||||
|
|
||||||
pkg info $pkg_name >> /dev/null
|
|
||||||
|
|
||||||
if [ $? -gt 0 ]
|
|
||||||
then
|
|
||||||
# The package is not installed, so install it
|
|
||||||
pkg install $pkg_name
|
|
||||||
return $?
|
|
||||||
else
|
|
||||||
# The package is already installed
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
exit_if_error() {
|
|
||||||
return_code=$1
|
|
||||||
msg=$2
|
|
||||||
|
|
||||||
if [ $return_code -gt 0 ]
|
|
||||||
then
|
|
||||||
echo $msg
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf "Usage: ./install-storage-server.sh <path to agent.zip> <path to templates.tar.gz>"
|
|
||||||
}
|
|
||||||
|
|
||||||
AGENT_FILE=$(choose_correct_filename "./agent.zip" $1)
|
|
||||||
exit_if_error $? "Please download agent.zip to your Storage Server."
|
|
||||||
|
|
||||||
TEMPLATES_FILE=$(choose_correct_filename "./templates.tar.gz" $2)
|
|
||||||
exit_if_error $? "Please download templates.tar.gz to your Storage Server."
|
|
||||||
|
|
||||||
VMOPS_DIR="/usr/local/vmops"
|
|
||||||
AGENT_DIR="/usr/local/vmops/agent"
|
|
||||||
CONF_DIR="/etc/vmops"
|
|
||||||
TEMPLATES_DIR="/root/template"
|
|
||||||
|
|
||||||
# Make all the necessary directories if they don't already exist
|
|
||||||
|
|
||||||
echo "Creating VMOps directories..."
|
|
||||||
for dir in $VMOPS_DIR $CONF_DIR $TEMPLATES_DIR
|
|
||||||
do
|
|
||||||
mkdir -p $dir
|
|
||||||
done
|
|
||||||
|
|
||||||
# Unzip agent.zip to $AGENT_DIR
|
|
||||||
|
|
||||||
echo "Uncompressing and installing VMOps Storage Agent..."
|
|
||||||
unzip -o $AGENT_FILE -d $AGENT_DIR >> /dev/null
|
|
||||||
|
|
||||||
# Remove agent/conf/agent.properties, since we should use the file in the real configuration directory
|
|
||||||
|
|
||||||
rm $AGENT_DIR/conf/agent.properties
|
|
||||||
|
|
||||||
# Backup any existing VMOps configuration files, if there aren't any backups already
|
|
||||||
|
|
||||||
if [ ! -d $CONF_DIR/BACKUP ]
|
|
||||||
then
|
|
||||||
echo "Backing up existing configuration files..."
|
|
||||||
mkdir -p $CONF_DIR/BACKUP
|
|
||||||
cp $CONF_DIR/*.properties $CONF_DIR/BACKUP >> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy all the files in storagehdpatch to their proper places
|
|
||||||
|
|
||||||
echo "Installing system files..."
|
|
||||||
(cd $AGENT_DIR/storagehdpatch; tar cf - .) | (cd /; tar xf -)
|
|
||||||
exit_if_error $? "There was a problem with installing system files. Please contact VMOps Support."
|
|
||||||
|
|
||||||
# Make vsetup executable
|
|
||||||
chmod +x /usr/sbin/vsetup
|
|
||||||
|
|
||||||
# Make vmops executable
|
|
||||||
chmod +x /lib/svc/method/vmops
|
|
||||||
|
|
||||||
# Uncompress the templates and copy them to the templates directory
|
|
||||||
|
|
||||||
echo "Uncompressing templates..."
|
|
||||||
tar -xzf $TEMPLATES_FILE -C $TEMPLATES_DIR >> /dev/null
|
|
||||||
exit_if_error $? "There was a problem with uncompressing templates. Please contact VMOps Support."
|
|
||||||
|
|
||||||
# Install the storage-server package, if it is not already installed
|
|
||||||
echo "Installing OpenSolaris storage server package..."
|
|
||||||
install_opensolaris_package "storage-server"
|
|
||||||
exit_if_error $? "There was a problem with installing the storage server package. Please contact VMOps Support."
|
|
||||||
|
|
||||||
echo "Installing COMSTAR..."
|
|
||||||
install_opensolaris_package "SUNWiscsit"
|
|
||||||
exit_if_error $? "Unable to install COMSTAR iscsi target. Please contact VMOps Support."
|
|
||||||
|
|
||||||
# Install the SUNWinstall-test package, if it is not already installed
|
|
||||||
|
|
||||||
echo "Installing OpenSolaris test tools package..."
|
|
||||||
install_opensolaris_package "SUNWinstall-test"
|
|
||||||
exit_if_error $? "There was a problem with installing the test tools package. Please contact VMOps Support."
|
|
||||||
|
|
||||||
# Print a success message
|
|
||||||
printf "\nSuccessfully installed the VMOps Storage Server.\n"
|
|
||||||
printf "Please complete the following steps to configure your networking settings and storage pools:\n\n"
|
|
||||||
printf "1. Specify networking settings in /etc/vmops/network.properties\n"
|
|
||||||
printf "2. Run \"vsetup networking\" and then specify disk settings in /etc/vmops/disks.properties\n"
|
|
||||||
printf "3. Run \"vsetup zpool\" and reboot the machine when prompted.\n\n"
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# install.sh -- installs MySQL, Java, Tomcat, and the VMOps server
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
set -e
|
|
||||||
|
|
||||||
EX_NOHOSTNAME=15
|
|
||||||
EX_SELINUX=16
|
|
||||||
|
|
||||||
function usage() {
|
|
||||||
printf "Usage: %s [path to server-setup.xml]\n" $(basename $0) >&2
|
|
||||||
exit 64
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkhostname() {
|
|
||||||
if hostname | grep -qF . ; then true ; else
|
|
||||||
echo "You need to have a fully-qualified host name for the setup to work." > /dev/stderr
|
|
||||||
echo "Please use your operating system's network setup tools to set one." > /dev/stderr
|
|
||||||
exit $EX_NOHOSTNAME
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkselinux() {
|
|
||||||
#### before checking arguments, make sure SELINUX is "permissible" in /etc/selinux/config
|
|
||||||
if /usr/sbin/getenforce | grep -qi enforcing ; then borked=1 ; fi
|
|
||||||
if grep -i SELINUX=enforcing /etc/selinux/config ; then borked=1 ; fi
|
|
||||||
if [ "$borked" == "1" ] ; then
|
|
||||||
echo "SELINUX is set to enforcing, please set it to permissive in /etc/selinux/config" > /dev/stderr
|
|
||||||
echo "then reboot the machine, after which you can run the install script again." > /dev/stderr
|
|
||||||
exit $EX_SELINUX
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
checkhostname
|
|
||||||
checkselinux
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $1 ]; then
|
|
||||||
echo "Error: Unable to find $1" > /dev/stderr
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
#### check that all files exist
|
|
||||||
if [ ! -f apache-tomcat-6.0.18.tar.gz ]; then
|
|
||||||
printf "Error: Unable to find apache-tomcat-6.0.18.tar.gz\n" > /dev/stderr
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f MySQL-client-5.1.30-0.glibc23.x86_64.rpm ]; then
|
|
||||||
printf "Error: Unable to find MySQL-client-5.1.30-0.glibc23.x86_64.rpm\n" > /dev/stderr
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f MySQL-server-5.1.30-0.glibc23.x86_64.rpm ]; then
|
|
||||||
printf "Error: Unable to find MySQL-server-5.1.30-0.glibc23.x86_64.rpm\n" > /dev/stderr
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f jdk-6u13-linux-amd64.rpm.bin ]; then
|
|
||||||
printf "Error: Unable to find jdk-6u13-linux-amd64.rpm.bin\n" > /dev/stderr
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if [ ! -f osol.tar.bz2 ]; then
|
|
||||||
# printf "Error: Unable to find osol.tar.bz2\n"
|
|
||||||
# exit 7
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [ ! -f apache-tomcat-6.0.18.tar.gz ]; then
|
|
||||||
printf "Error: Unable to find apache-tomcat-6.0.18.tar.gz\n" > /dev/stderr
|
|
||||||
exit 8
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f vmops-*.zip ]; then
|
|
||||||
printf "Error: Unable to find vmops install file\n" > /dev/stderr
|
|
||||||
exit 9
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f catalina ] ; then
|
|
||||||
printf "Error: Unable to find catalina initscript\n" > /dev/stderr
|
|
||||||
exit 10
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f usageserver ] ; then
|
|
||||||
printf "Error: Unable to find usageserver initscript\n" > /dev/stderr
|
|
||||||
exit 11
|
|
||||||
fi
|
|
||||||
|
|
||||||
###### install Apache
|
|
||||||
# if [ ! -d /usr/local/tomcat ] ; then
|
|
||||||
echo "installing Apache..."
|
|
||||||
mkdir -p /usr/local/tomcat
|
|
||||||
tar xfz apache-tomcat-6.0.18.tar.gz -C /usr/local/tomcat
|
|
||||||
ln -s /usr/local/tomcat/apache-tomcat-6.0.18 /usr/local/tomcat/current
|
|
||||||
# fi
|
|
||||||
# if [ ! -f /etc/profile.d/catalinahome.sh ] ; then
|
|
||||||
# echo "export CATALINA_HOME=/usr/local/tomcat/current" >> /etc/profile.d/catalinahome.sh
|
|
||||||
# fi
|
|
||||||
source /etc/profile.d/catalinahome.sh
|
|
||||||
# if [ ! -f /etc/init.d/catalina ] ; then
|
|
||||||
cp -f catalina /etc/init.d
|
|
||||||
/sbin/chkconfig catalina on
|
|
||||||
# fi
|
|
||||||
|
|
||||||
####### set up usage server as a service
|
|
||||||
if [ ! -f /etc/init.d/usageserver ] ; then
|
|
||||||
cp -f usageserver /etc/init.d
|
|
||||||
/sbin/chkconfig usageserver on
|
|
||||||
fi
|
|
||||||
|
|
||||||
##### set up mysql
|
|
||||||
if rpm -q MySQL-server MySQL-client > /dev/null 2>&1 ; then true ; else
|
|
||||||
echo "installing MySQL..."
|
|
||||||
yum localinstall --nogpgcheck -y MySQL-*.rpm
|
|
||||||
fi
|
|
||||||
|
|
||||||
#### install JDK
|
|
||||||
echo "installing JDK..."
|
|
||||||
sh jdk-6u13-linux-amd64.rpm.bin
|
|
||||||
rm -rf /usr/bin/java
|
|
||||||
ln -s /usr/java/default/bin/java /usr/bin/java
|
|
||||||
|
|
||||||
#### setting up OSOL image
|
|
||||||
#mkdir -p $CATALINA_HOME/webapps/images
|
|
||||||
#echo "copying Open Solaris image, this may take a few moments..."
|
|
||||||
#cp osol.tar.bz2 $CATALINA_HOME/webapps/images
|
|
||||||
|
|
||||||
#### deploying database
|
|
||||||
unzip -o vmops-*.zip
|
|
||||||
cd vmops-*
|
|
||||||
sh deploy-server.sh -d "$CATALINA_HOME"
|
|
||||||
cd db
|
|
||||||
sh deploy-db.sh "../../$1" templates.sql
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@ -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.
|
|
||||||
|
|
||||||
consoleproxy.tcpListenPort=0
|
|
||||||
consoleproxy.httpListenPort=80
|
|
||||||
consoleproxy.httpCmdListenPort=8001
|
|
||||||
consoleproxy.jarDir=./applet/
|
|
||||||
consoleproxy.viewerLinger=180
|
|
||||||
consoleproxy.reconnectMaxRetry=5
|
|
||||||
@ -1,550 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<data>
|
|
||||||
<version>2.0</version>
|
|
||||||
<zones>
|
|
||||||
<zone>
|
|
||||||
<id>1</id>
|
|
||||||
<name>AH</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>100-199</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>2</id>
|
|
||||||
<name>KM</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>200-299</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>3</id>
|
|
||||||
<name>KY</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>300-399</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>4</id>
|
|
||||||
<name>WC</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>400-499</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>5</id>
|
|
||||||
<name>CV</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>500-599</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>6</id>
|
|
||||||
<name>KS</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>600-699</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>7</id>
|
|
||||||
<name>ES</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>700-799</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>8</id>
|
|
||||||
<name>RC</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>800-899</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>9</id>
|
|
||||||
<name>AX</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>900-999</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>10</id>
|
|
||||||
<name>JW</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>900-999</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
<zone>
|
|
||||||
<id>11</id>
|
|
||||||
<name>AJ</name>
|
|
||||||
<dns1>72.52.126.11</dns1>
|
|
||||||
<dns2>72.52.126.12</dns2>
|
|
||||||
<internalDns1>192.168.10.253</internalDns1>
|
|
||||||
<internalDns2>192.168.10.254</internalDns2>
|
|
||||||
<vnet>1000-1099</vnet>
|
|
||||||
<guestNetworkCidr>10.1.1.0/24</guestNetworkCidr>
|
|
||||||
</zone>
|
|
||||||
</zones>
|
|
||||||
<!--
|
|
||||||
<storagePools>
|
|
||||||
<storagePool>
|
|
||||||
<zoneId>5</zoneId>
|
|
||||||
<name>sol10-2</name>
|
|
||||||
<hostAddress>sol10-2</hostAddress>
|
|
||||||
<hostPath>/tank/cloud-nfs/</hostPath>
|
|
||||||
</storagePool>
|
|
||||||
</storagePools>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vlans>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<vlanId>31</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.31.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.31.150-192.168.31.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>2</zoneId>
|
|
||||||
<vlanId>32</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.32.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.32.150-192.168.32.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>3</zoneId>
|
|
||||||
<vlanId>33</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.33.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.33.150-192.168.33.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>4</zoneId>
|
|
||||||
<vlanId>34</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.34.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.34.150-192.168.34.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>5</zoneId>
|
|
||||||
<vlanId>35</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.35.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.35.150-192.168.35.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>6</zoneId>
|
|
||||||
<vlanId>36</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.36.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.36.150-192.168.36.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>7</zoneId>
|
|
||||||
<vlanId>37</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.37.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.37.150-192.168.37.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>8</zoneId>
|
|
||||||
<vlanId>38</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.38.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.38.150-192.168.38.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>9</zoneId>
|
|
||||||
<vlanId>39</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.39.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.39.150-192.168.39.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>10</zoneId>
|
|
||||||
<vlanId>40</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.40.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.40.150-192.168.40.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
<vlan>
|
|
||||||
<zoneId>11</zoneId>
|
|
||||||
<vlanId>41</vlanId>
|
|
||||||
<vlanType>VirtualNetwork</vlanType>
|
|
||||||
<gateway>192.168.41.1</gateway>
|
|
||||||
<netmask>255.255.255.0</netmask>
|
|
||||||
<ipAddressRange>192.168.41.150-192.168.41.159</ipAddressRange>
|
|
||||||
</vlan>
|
|
||||||
</vlans>
|
|
||||||
|
|
||||||
<pods>
|
|
||||||
<pod>
|
|
||||||
<id>1</id>
|
|
||||||
<name>AH</name>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.20-192.168.10.24</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>2</id>
|
|
||||||
<name>KM</name>
|
|
||||||
<zoneId>2</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.25-192.168.10.29</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>3</id>
|
|
||||||
<name>KY</name>
|
|
||||||
<zoneId>3</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.30-192.168.10.34</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>4</id>
|
|
||||||
<name>WC</name>
|
|
||||||
<zoneId>4</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.35-192.168.10.39</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>5</id>
|
|
||||||
<name>CV</name>
|
|
||||||
<zoneId>5</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.40-192.168.10.44</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>6</id>
|
|
||||||
<name>KS</name>
|
|
||||||
<zoneId>6</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.45-192.168.10.49</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>7</id>
|
|
||||||
<name>ES</name>
|
|
||||||
<zoneId>7</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.50-192.168.10.54</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>8</id>
|
|
||||||
<name>RC</name>
|
|
||||||
<zoneId>8</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.55-192.168.10.59</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>9</id>
|
|
||||||
<name>AX</name>
|
|
||||||
<zoneId>9</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.62-192.168.10.64</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>10</id>
|
|
||||||
<name>JW</name>
|
|
||||||
<zoneId>10</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.65-192.168.10.69</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
<pod>
|
|
||||||
<id>11</id>
|
|
||||||
<name>AJ</name>
|
|
||||||
<zoneId>11</zoneId>
|
|
||||||
<ipAddressRange>192.168.10.70-192.168.10.74</ipAddressRange>
|
|
||||||
<cidr>192.168.10.0/24</cidr>
|
|
||||||
</pod>
|
|
||||||
</pods>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
* cpu is the number of CPUs for the offering
|
|
||||||
* ramSize is total memory in MB
|
|
||||||
* speed is the CPU speed for each core in MHZ
|
|
||||||
* diskSpace is the storage space in MB
|
|
||||||
* price is the price of the offering per hour
|
|
||||||
-->
|
|
||||||
<serviceOfferings>
|
|
||||||
<serviceOffering>
|
|
||||||
<id>1</id>
|
|
||||||
<name>Small Instance</name>
|
|
||||||
<displayText>Small Instance [500MHZ CPU, 512MB MEM, 16GB Disk] - $0.10 per hour</displayText>
|
|
||||||
<cpu>1</cpu>
|
|
||||||
<ramSize>512</ramSize>
|
|
||||||
<speed>500</speed>
|
|
||||||
<mirrored>false</mirrored>
|
|
||||||
</serviceOffering>
|
|
||||||
<serviceOffering>
|
|
||||||
<id>2</id>
|
|
||||||
<name>Medium Instance</name>
|
|
||||||
<displayText>Medium Instance [500MHZ CPU, 1GB MEM, 32GB Disk] - $0.20 per hour</displayText>
|
|
||||||
<cpu>1</cpu>
|
|
||||||
<ramSize>1024</ramSize>
|
|
||||||
<speed>512</speed>
|
|
||||||
</serviceOffering>
|
|
||||||
<serviceOffering>
|
|
||||||
<id>3</id>
|
|
||||||
<name>Large Instance</name>
|
|
||||||
<displayText>Large Instance [2GHZ CPU, 4GB MEM, 64GB Disk] - $0.30 per hour</displayText>
|
|
||||||
<cpu>2</cpu>
|
|
||||||
<ramSize>4096</ramSize>
|
|
||||||
<speed>2000</speed>
|
|
||||||
</serviceOffering>
|
|
||||||
</serviceOfferings>
|
|
||||||
|
|
||||||
<diskOfferings>
|
|
||||||
<diskOffering>
|
|
||||||
<id>1</id>
|
|
||||||
<domainId>1</domainId>
|
|
||||||
<name>Small Disk</name>
|
|
||||||
<displayText>Small Disk [16GB Disk]</displayText>
|
|
||||||
<diskSpace>16000</diskSpace>
|
|
||||||
</diskOffering>
|
|
||||||
<diskOffering>
|
|
||||||
<id>2</id>
|
|
||||||
<domainId>1</domainId>
|
|
||||||
<name>Medium Disk</name>
|
|
||||||
<displayText>Medium Disk [32GB Disk]</displayText>
|
|
||||||
<diskSpace>32000</diskSpace>
|
|
||||||
</diskOffering>
|
|
||||||
<diskOffering>
|
|
||||||
<id>3</id>
|
|
||||||
<domainId>1</domainId>
|
|
||||||
<name>Large Disk</name>
|
|
||||||
<displayText>Large Disk [64GB Disk]</displayText>
|
|
||||||
<diskSpace>64000</diskSpace>
|
|
||||||
</diskOffering>
|
|
||||||
</diskOfferings>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
* firstname/lastname are optional parameters
|
|
||||||
* id, username, password are required parameters
|
|
||||||
-->
|
|
||||||
<users>
|
|
||||||
<user>
|
|
||||||
<id>2</id>
|
|
||||||
<username>admin</username>
|
|
||||||
<password>password</password>
|
|
||||||
<firstname>Admin</firstname>
|
|
||||||
<lastname>User</lastname>
|
|
||||||
<email>admin@mailprovider.com</email>
|
|
||||||
</user>
|
|
||||||
</users>
|
|
||||||
|
|
||||||
<configurationEntries>
|
|
||||||
<configuration>
|
|
||||||
<name>default.zone</name>
|
|
||||||
<value>AH</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>domain.suffix</name>
|
|
||||||
<value>cloud-test.cloud.com</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>instance.name</name>
|
|
||||||
<value>AH</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>consoleproxy.ram.size</name>
|
|
||||||
<value>256</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>host.stats.interval</name>
|
|
||||||
<value>3600000</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>storage.stats.interval</name>
|
|
||||||
<value>120000</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>volume.stats.interval</name>
|
|
||||||
<value>-1</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>ping.interval</name>
|
|
||||||
<value>60</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.wait</name>
|
|
||||||
<value>1800</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>expunge.interval</name>
|
|
||||||
<value>86400</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>usage.aggregation.timezone</name>
|
|
||||||
<value>GMT</value>
|
|
||||||
</configuration>
|
|
||||||
<!-- RSA Keys -->
|
|
||||||
<configuration>
|
|
||||||
<name>ssh.privatekey</name>
|
|
||||||
<value>-----BEGIN RSA PRIVATE KEY-----\nMIIEoQIBAAKCAQEAnNUMVgQS87EzAQN9ufGgH3T1kOpqcvTmUrp8RVZyeA5qwptS\nrZxONRbhLK709pZFBJLmeFqiqciWoA/srVIFk+rPmBlVsMw8BK53hTGoax7iSe8s\nLFCAATm6vp0HnZzYqNfrzR2by36ET5aQD/VAyA55u+uUgAlxQuhKff2xjyahEHs+\nUiRlReiAgItygm9g3co3+8fJDOuRse+s0TOip1D0jPdo2AJFscyxrG9hWqQH86R/\nZlLJ7DqsiaAcUmn52u6Nsmd3BkRmGVx/D35Mq6upJqrk/QDfug9LF66yiIP/BEIn\n08N/wQ6m/O37WUtqqyl3rRKqs5TJ9ZnhsqeO9QIBIwKCAQA6QIDsv69EkkYk8qsK\njPJU06uq2rnS7T+bEhDmjdK+4MiRbOQx2vh6HnDktgM3BJ1K13oss/NGYHJ190lH\nsMA+QUXKx5TbRItSMixkrAta/Ne1D7FSScklBtBVbYZ8XtQhdMVML5GjWuCv2NZs\nU8eaw4xNHPyklcr7mBurI7b6p13VK5BNUWR/VNuigT4U89YzRcoEZ/sTlR+4ACYr\nxbUJJGBA03+NhdSAe2vodlMh5lGflD0JmHMFqqg9BcAtVb73JsOsxFQArbXwRd/q\nNckdoAvgJfhTOvXF5GMPLI0lGb6skJkS229F4GaBB2Iz4A9O0aHZob8I8zsWUbiu\npvBrAoGBAMjUDfF2x13NjH1cFHietO5O1oM0nZaAxKodxoAUvHVMUd5DIY50tqYw\n7ecKi2Cw43ONpdj0nP9Nc2NV3NDRqLopwkKUsTtq9AKQ2cIuw3+uS5vm0VZBzmTP\nuF04Qo4bXh/jFRA62u9bXsmIFtaehKxE1Gp6zi393GcbWP4HX/3dAoGBAMfq0KD3\ngeU1PHi9uI3Ss89nXzJsiGcwC5Iunu1aTzJCYhMlJkfmRcXYMAqSfg0nGWnfvlDh\nuOO26CHKjG182mTwYXdgQzIPpBc8suvgUWDBTrIzJI+zuyBLtPbd9DJEVrZkRVQX\nXrOV3Y5oOWsba4F+b20jaaHFAiY7s6OtrX/5AoGBAMMXI3zZyPwJgSlSIoPNX03m\nL3gke9QID4CvNduB26UlkVuRq5GzNRZ4rJdMEl3tqcC1fImdKswfWiX7o06ChqY3\nMb0FePfkPX7V2tnkSOJuzRsavLoxTCdqsxi6T0g318c0XZq81K4A/P5Jr8ksRl40\nPA+qfyVdAf3Cy3ptkHLzAoGASkFGLSi7N+CSzcLPhSJgCzUGGgsOF7LCeB/x4yGL\nIUvbSPCKj7vuB6gR2AqGlyvHnFprQpz7h8eYDI0PlmGS8kqn2+HtEpgYYGcAoMEI\nSIJQbhL+84vmaxTOL87IanEnhZL1LdzLZ0ZK+mE55fQ936P9gE77WVfNmSweJtob\n3xMCgYAl0aLeGf4oUZbI56eEaCbu8U7dEe6MF54VbozyiXqbp455QnUpuBrRn5uf\nc079dNcqTNDuk1+hYX9qNn1aXsvWeuofBXqWoFXu/c4yoWxJAPhEVhzZ9xrXI76I\nBKiPCyKrOa7bSLvs6SQPpuf5AQ8+NJrOxkEB9hbMuaAr2N5rCw==\n-----END RSA PRIVATE KEY-----
|
|
||||||
</value>
|
|
||||||
<category>Hidden</category>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>ssh.publickey</name>
|
|
||||||
<value>
|
|
||||||
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnNUMVgQS87EzAQN9ufGgH3T1kOpqcvTmUrp8RVZyeA5qwptSrZxONRbhLK709pZFBJLmeFqiqciWoA/srVIFk+rPmBlVsMw8BK53hTGoax7iSe8sLFCAATm6vp0HnZzYqNfrzR2by36ET5aQD/VAyA55u+uUgAlxQuhKff2xjyahEHs+UiRlReiAgItygm9g3co3+8fJDOuRse+s0TOip1D0jPdo2AJFscyxrG9hWqQH86R/ZlLJ7DqsiaAcUmn52u6Nsmd3BkRmGVx/D35Mq6upJqrk/QDfug9LF66yiIP/BEIn08N/wQ6m/O37WUtqqyl3rRKqs5TJ9ZnhsqeO9Q== root@test2.lab.vmops.com
|
|
||||||
</value>
|
|
||||||
<category>Hidden</category>
|
|
||||||
</configuration>
|
|
||||||
<!-- the following are for configuring alerts and need to be changed to proper configuration values -->
|
|
||||||
<!--
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.host</name>
|
|
||||||
<value>smtp.host.com</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.port</name>
|
|
||||||
<value>25</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.useAuth</name>
|
|
||||||
<value>false</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.username</name>
|
|
||||||
<value>some.user@example.com</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.password</name>
|
|
||||||
<value>password</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.email.sender</name>
|
|
||||||
<value>some.user@example.com</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.email.addresses</name>
|
|
||||||
<value>some.admin@example.com</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>alert.smtp.debug</name>
|
|
||||||
<value>false</value>
|
|
||||||
</configuration>
|
|
||||||
-->
|
|
||||||
<configuration>
|
|
||||||
<name>memory.capacity.threshold</name>
|
|
||||||
<value>0.85</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>cpu.capacity.threshold</name>
|
|
||||||
<value>0.85</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>storage.capacity.threshold</name>
|
|
||||||
<value>0.85</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>storage.allocated.capacity.threshold</name>
|
|
||||||
<value>0.85</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>capacity.check.period</name>
|
|
||||||
<value>3600000</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>wait</name>
|
|
||||||
<value>240</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>network.throttling.rate</name>
|
|
||||||
<value>200</value>
|
|
||||||
</configuration>
|
|
||||||
<configuration>
|
|
||||||
<name>multicast.throttling.rate</name>
|
|
||||||
<value>10</value>
|
|
||||||
</configuration>
|
|
||||||
</configurationEntries>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
It is possible to specify a single IP address. For example, to add 192.168.1.1
|
|
||||||
as the only address, specify as follows.
|
|
||||||
<publicIpAddresses>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<ipAddressRange>192.168.1.1</ipAddressRange>
|
|
||||||
</publicIpAddresses>
|
|
||||||
|
|
||||||
For each ip address range, create a new object. For example, to add the range 192.168.2.1 to 192.168.2.255
|
|
||||||
copy the following object tag into the privateIpRange
|
|
||||||
<privateIpAddresses>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<podId>1</podId>
|
|
||||||
<ipAddressRange>192.168.2.1-192.168.2.255</ipAddressRange>
|
|
||||||
</privateIpAddresses>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
It is possible to specify a single IP address. For example, to add 65.37.141.29
|
|
||||||
as the only address, specify as follows.
|
|
||||||
<publicIpAddresses>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<ipAddressRange>65.37.141.29</ipAddressRange>
|
|
||||||
</publicIpAddresses>
|
|
||||||
|
|
||||||
For each ip address range, create a new object. For example, to add the range 65.37.141.29 to 65.37.141.39
|
|
||||||
copy the following object tag into the publicIpRange
|
|
||||||
<publicIpAddresses>
|
|
||||||
<zoneId>1</zoneId>
|
|
||||||
<ipAddressRange>65.37.141.29-65.37.141.39</ipAddressRange>
|
|
||||||
</publicIpAddresses>
|
|
||||||
-->
|
|
||||||
</data>
|
|
||||||
@ -1,30 +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.
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (1, 'routing', 'DomR Template', 0, 'tank/volumes/demo/template/private/u000000/os/routing', now(), 'ext3', 0, 64, 1, 'http://vmopsserver.lab.vmops.com/images/routing/vmi-root-fc8-x86_64-domR.img.bz2', 'd00927f863a23b98cc6df6e377c9d0c6', 0, 'DomR Template', 0);
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (3, 'centos53-x86_64', 'Centos 5.3(x86_64) no GUI', 1, 'tank/volumes/demo/template/public/os/centos53-x86_64', now(), 'ext3', 0, 64, 1, 'http://vmopsserver.lab.vmops.com/images/centos52-x86_64/vmi-root-centos.5-2.64.pv.img.gz', 'd4ca80825d936db00eedf26620f13d69', 0, 'Centos 5.3(x86_64) no GUI', 0);
|
|
||||||
#INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
# VALUES (4, 'centos52-x86_64-gui', 'Centos 5.2(x86_64) GUI', 1, 'tank/volumes/demo/template/public/os/centos52-x86_64-gui', now(), 'ext3', 0, 64, 1, 'http://vmopsserver.lab.vmops.com/images/centos52-x86_64/vmi-root-centos.5-2.64.pv.img.gz', 'd4ca80825d936db00eedf26620f13d69', 0, 'Centos 5.2(x86_64) GUI', 0);
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (5, 'winxpsp3', 'Windows XP SP3 (32-bit)', 1, 'tank/volumes/demo/template/public/os/winxpsp3', now(), 'ntfs', 1, 32, 1, 'http://vmopsserver.lab.vmops.com/images/fedora10-x86_64/vmi-root-fedora10.64.img.gz', 'c76d42703f14108b15acc9983307c759', 0, 'Windows XP SP3 (32-bit)', 0);
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (7, 'win2003sp2', 'Windows 2003 SP2 (32-bit)', 1, 'tank/volumes/demo/template/public/os/win2003sp2', now(), 'ntfs', 1, 32, 1, 'http://vmopsserver.lab.vmops.com/images/win2003sp2/vmi-root-win2003sp2.img.gz', '4d2cc51898d05c0f7a2852c15bcdc77b', 0, 'Windows 2003 SP2 (32-bit)', 0);
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (8, 'win2003sp2-x64', 'Windows 2003 SP2 (64-bit)', 1, 'tank/volumes/demo/template/public/os/win2003sp2-x64', now(), 'ntfs', 1, 64, 1, 'http://vmopsserver.lab.vmops.com/images/win2003sp2-x86_64/vmi-root-win2003sp2-x64.img.gz', '35d4de1c38eb4fb9d81a31c1d989c482', 0, 'Windows 2003 SP2 (64-bit)', 0);
|
|
||||||
INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password)
|
|
||||||
VALUES (9, 'fedora12-GUI-x86_64', 'Fedora 12 Desktop(64-bit)', 1, 'tank/volumes/demo/template/public/os/fedora12-GUI-x86_64', now(), 'ext3', 1, 64, 1, 'http://vmopsserver.lab.vmops.com/images/fedora12-GUI-x86_64/vmi-root-fedora12-GUI-x86_64.qcow2.gz', '', 0, 'Fedora 12 Desktop (with httpd,java and mysql)', 0);
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
|
||||||
|
|
||||||
<!-- ============================== -->
|
|
||||||
<!-- Append messages to the console -->
|
|
||||||
<!-- ============================== -->
|
|
||||||
|
|
||||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
|
||||||
<param name="Target" value="System.out"/>
|
|
||||||
<param name="Threshold" value="INFO"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ABSOLUTE}{GMT} %5p %c{1}:%L - %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================================ -->
|
|
||||||
<!-- Append messages to the usage log -->
|
|
||||||
<!-- ================================ -->
|
|
||||||
|
|
||||||
<!-- A time/date based rolling appender -->
|
|
||||||
<appender name="USAGE" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="Threshold" value="DEBUG"/>
|
|
||||||
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
|
|
||||||
<param name="FileNamePattern" value="/var/log/cloud/cloud_usage.log.%d{yyyy-MM-dd}{GMT}.gz"/>
|
|
||||||
<param name="ActiveFileName" value="/var/log/cloud/cloud_usage.log"/>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p [%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================ -->
|
|
||||||
<!-- Limit categories -->
|
|
||||||
<!-- ================ -->
|
|
||||||
|
|
||||||
<category name="com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
|
|
||||||
<category name="org.apache">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="org">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="net">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- ======================= -->
|
|
||||||
<!-- Setup the Root category -->
|
|
||||||
<!-- ======================= -->
|
|
||||||
|
|
||||||
<root>
|
|
||||||
<level value="INFO"/>
|
|
||||||
<appender-ref ref="CONSOLE"/>
|
|
||||||
<appender-ref ref="USAGE"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</log4j:configuration>
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
|
||||||
|
|
||||||
<!-- ============================== -->
|
|
||||||
<!-- Append messages to the console -->
|
|
||||||
<!-- ============================== -->
|
|
||||||
|
|
||||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
|
||||||
<param name="Target" value="System.out"/>
|
|
||||||
<param name="Threshold" value="INFO"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ABSOLUTE}{GMT} %5p %c{1}:%L - %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================================ -->
|
|
||||||
<!-- Append messages to the usage log -->
|
|
||||||
<!-- ================================ -->
|
|
||||||
|
|
||||||
<!-- A time/date based rolling appender -->
|
|
||||||
<appender name="USAGE" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="Threshold" value="DEBUG"/>
|
|
||||||
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
|
|
||||||
<param name="FileNamePattern" value="@logdir@/cloud_usage.log.%d{yyyy-MM-dd}{GMT}.gz"/>
|
|
||||||
<param name="ActiveFileName" value="@logdir@/cloud_usage.log"/>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p [%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================ -->
|
|
||||||
<!-- Limit categories -->
|
|
||||||
<!-- ================ -->
|
|
||||||
|
|
||||||
<category name="com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
|
|
||||||
<category name="org.apache">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="org">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="net">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- ======================= -->
|
|
||||||
<!-- Setup the Root category -->
|
|
||||||
<!-- ======================= -->
|
|
||||||
|
|
||||||
<root>
|
|
||||||
<level value="INFO"/>
|
|
||||||
<appender-ref ref="CONSOLE"/>
|
|
||||||
<appender-ref ref="USAGE"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</log4j:configuration>
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
<?xml version="1.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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
usage-components.xml is the configuration file for the VM Ops
|
|
||||||
usage servers.
|
|
||||||
|
|
||||||
Here are some places to look for information.
|
|
||||||
- To find out the general functionality that each Manager
|
|
||||||
or Adapter provide, look at the javadoc for the interface
|
|
||||||
that it implements. The interface is usually the
|
|
||||||
"key" attribute in the declaration.
|
|
||||||
- To find specific implementation of each Manager or
|
|
||||||
Adapter, look at the javadoc for the actual class. The
|
|
||||||
class can be found in the <class> element.
|
|
||||||
- To find out the configuration parameters for each Manager
|
|
||||||
or Adapter, look at the javadoc for the actual implementation
|
|
||||||
class. It should be documented in the description of the
|
|
||||||
class.
|
|
||||||
- To know more about the components.xml in general, look for
|
|
||||||
the javadoc for ComponentLocator.java.
|
|
||||||
|
|
||||||
If you found that the Manager or Adapter are not properly
|
|
||||||
documented, please contact the author.
|
|
||||||
-->
|
|
||||||
<components.xml>
|
|
||||||
<usage-server>
|
|
||||||
<dao name="VM Instance" class="com.cloud.vm.dao.VMInstanceDaoImpl"/>
|
|
||||||
<dao name="User VM" class="com.cloud.vm.dao.UserVmDaoImpl"/>
|
|
||||||
<dao name="ServiceOffering" class="com.cloud.service.dao.ServiceOfferingDaoImpl">
|
|
||||||
<param name="cache.size">50</param>
|
|
||||||
<param name="cache.time.to.live">-1</param>
|
|
||||||
</dao>
|
|
||||||
<dao name="UserStats" class="com.cloud.user.dao.UserStatisticsDaoImpl"/>
|
|
||||||
<dao name="IP Addresses" class="com.cloud.network.dao.IPAddressDaoImpl"/>
|
|
||||||
<dao name="Usage" class="com.cloud.usage.dao.UsageDaoImpl"/>
|
|
||||||
<dao name="Domain" class="com.cloud.domain.dao.DomainDaoImpl"/>
|
|
||||||
<dao name="Account" class="com.cloud.user.dao.AccountDaoImpl"/>
|
|
||||||
<dao name="UserAccount" class="com.cloud.user.dao.UserAccountDaoImpl"/>
|
|
||||||
<dao name="Usage VmInstance" class="com.cloud.usage.dao.UsageVMInstanceDaoImpl"/>
|
|
||||||
<dao name="Usage Network" class="com.cloud.usage.dao.UsageNetworkDaoImpl"/>
|
|
||||||
<dao name="Usage IPAddress" class="com.cloud.usage.dao.UsageIPAddressDaoImpl"/>
|
|
||||||
<dao name="Usage Job" class="com.cloud.usage.dao.UsageJobDaoImpl"/>
|
|
||||||
<dao name="Configuration" class="com.cloud.configuration.dao.ConfigurationDaoImpl"/>
|
|
||||||
<dao name="Usage Event" class="com.cloud.event.dao.UsageEventDaoImpl"/>
|
|
||||||
<manager name="Usage alert manager" class="com.cloud.usage.UsageAlertManagerImpl"/>
|
|
||||||
<manager name="usage manager" class="com.cloud.usage.UsageManagerImpl">
|
|
||||||
<param name="period">DAILY</param> <!-- DAILY, WEEKLY, MONTHLY; how often it creates usage records -->
|
|
||||||
</manager>
|
|
||||||
</usage-server>
|
|
||||||
</components.xml>
|
|
||||||
@ -1,18 +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.
|
|
||||||
|
|
||||||
agent.minimal.version=@agent.min.version@
|
|
||||||
Binary file not shown.
@ -1,544 +0,0 @@
|
|||||||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:noNamespaceSchemaLocation="ehcache.xsd">
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
CacheManager Configuration
|
|
||||||
==========================
|
|
||||||
An ehcache.xml corresponds to a single CacheManager.
|
|
||||||
|
|
||||||
See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
|
|
||||||
|
|
||||||
System property tokens can be specified in this file which are replaced when the configuration is loaded.
|
|
||||||
For example multicastGroupPort=${multicastGroupPort} can be replaced with the System property either
|
|
||||||
from an environment variable or a system property specified with a command line switch such as
|
|
||||||
-DmulticastGroupPort=4446.
|
|
||||||
|
|
||||||
DiskStore configuration
|
|
||||||
=======================
|
|
||||||
|
|
||||||
The diskStore element is optional. To turn off disk store path creation, comment out the diskStore
|
|
||||||
element below.
|
|
||||||
|
|
||||||
Configure it if you have overflowToDisk or diskPersistent enabled for any cache.
|
|
||||||
|
|
||||||
If it is not configured, and a cache is created which requires a disk store, a warning will be
|
|
||||||
issued and java.io.tmpdir will automatically be used.
|
|
||||||
|
|
||||||
diskStore has only one attribute - "path". It is the path to the directory where
|
|
||||||
.data and .index files will be created.
|
|
||||||
|
|
||||||
If the path is one of the following Java System Property it is replaced by its value in the
|
|
||||||
running VM. For backward compatibility these are not specified without being enclosed in the ${token}
|
|
||||||
replacement syntax.
|
|
||||||
|
|
||||||
The following properties are translated:
|
|
||||||
* user.home - User's home directory
|
|
||||||
* user.dir - User's current working directory
|
|
||||||
* java.io.tmpdir - Default temp file path
|
|
||||||
* ehcache.disk.store.dir - A system property you would normally specify on the command line
|
|
||||||
e.g. java -Dehcache.disk.store.dir=/u01/myapp/diskdir ...
|
|
||||||
|
|
||||||
Subdirectories can be specified below the property e.g. java.io.tmpdir/one
|
|
||||||
-->
|
|
||||||
<!-- diskStore path="java.io.tmpdir"/ -->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
CacheManagerEventListener
|
|
||||||
=========================
|
|
||||||
Specifies a CacheManagerEventListenerFactory, be used to create a CacheManagerPeerProvider,
|
|
||||||
which is notified when Caches are added or removed from the CacheManager.
|
|
||||||
|
|
||||||
The attributes of CacheManagerEventListenerFactory are:
|
|
||||||
* class - a fully qualified factory class name
|
|
||||||
* properties - comma separated properties having meaning only to the factory.
|
|
||||||
|
|
||||||
Sets the fully qualified class name to be registered as the CacheManager event listener.
|
|
||||||
|
|
||||||
The events include:
|
|
||||||
* adding a Cache
|
|
||||||
* removing a Cache
|
|
||||||
|
|
||||||
Callbacks to listener methods are synchronous and unsynchronized. It is the responsibility
|
|
||||||
of the implementer to safely handle the potential performance and thread safety issues
|
|
||||||
depending on what their listener is doing.
|
|
||||||
|
|
||||||
If no class is specified, no listener is created. There is no default.
|
|
||||||
-->
|
|
||||||
<cacheManagerEventListenerFactory class="" properties=""/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
CacheManagerPeerProvider
|
|
||||||
========================
|
|
||||||
(Enable for distributed operation)
|
|
||||||
|
|
||||||
Specifies a CacheManagerPeerProviderFactory which will be used to create a
|
|
||||||
CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
|
|
||||||
|
|
||||||
The attributes of cacheManagerPeerProviderFactory are:
|
|
||||||
* class - a fully qualified factory class name
|
|
||||||
* properties - comma separated properties having meaning only to the factory.
|
|
||||||
|
|
||||||
Ehcache comes with a built-in RMI-based distribution system with two means of discovery of
|
|
||||||
CacheManager peers participating in the cluster:
|
|
||||||
* automatic, using a multicast group. This one automatically discovers peers and detects
|
|
||||||
changes such as peers entering and leaving the group
|
|
||||||
* manual, using manual rmiURL configuration. A hardcoded list of peers is provided at
|
|
||||||
configuration time.
|
|
||||||
|
|
||||||
Configuring Automatic Discovery:
|
|
||||||
Automatic discovery is configured as per the following example:
|
|
||||||
<cacheManagerPeerProviderFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
|
|
||||||
properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
|
|
||||||
multicastGroupPort=4446, timeToLive=32"/>
|
|
||||||
|
|
||||||
Valid properties are:
|
|
||||||
* peerDiscovery (mandatory) - specify "automatic"
|
|
||||||
* multicastGroupAddress (mandatory) - specify a valid multicast group address
|
|
||||||
* multicastGroupPort (mandatory) - specify a dedicated port for the multicast heartbeat
|
|
||||||
traffic
|
|
||||||
* timeToLive - specify a value between 0 and 255 which determines how far the packets will
|
|
||||||
propagate.
|
|
||||||
|
|
||||||
By convention, the restrictions are:
|
|
||||||
0 - the same host
|
|
||||||
1 - the same subnet
|
|
||||||
32 - the same site
|
|
||||||
64 - the same region
|
|
||||||
128 - the same continent
|
|
||||||
255 - unrestricted
|
|
||||||
|
|
||||||
Configuring Manual Discovery:
|
|
||||||
Manual discovery is configured as per the following example:
|
|
||||||
<cacheManagerPeerProviderFactory class=
|
|
||||||
"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
|
|
||||||
properties="peerDiscovery=manual,
|
|
||||||
rmiUrls=//server1:40000/sampleCache1|//server2:40000/sampleCache1
|
|
||||||
| //server1:40000/sampleCache2|//server2:40000/sampleCache2"
|
|
||||||
propertySeparator="," />
|
|
||||||
|
|
||||||
Valid properties are:
|
|
||||||
* peerDiscovery (mandatory) - specify "manual"
|
|
||||||
* rmiUrls (mandatory) - specify a pipe separated list of rmiUrls, in the form
|
|
||||||
//hostname:port
|
|
||||||
|
|
||||||
The hostname is the hostname of the remote CacheManager peer. The port is the listening
|
|
||||||
port of the RMICacheManagerPeerListener of the remote CacheManager peer.
|
|
||||||
|
|
||||||
Configuring JGroups replication:
|
|
||||||
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
|
|
||||||
properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
|
|
||||||
mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
|
|
||||||
PING(timeout=2000;num_initial_members=6):
|
|
||||||
MERGE2(min_interval=5000;max_interval=10000):
|
|
||||||
FD_SOCK:VERIFY_SUSPECT(timeout=1500):
|
|
||||||
pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
|
|
||||||
UNICAST(timeout=5000):
|
|
||||||
pbcast.STABLE(desired_avg_gossip=20000):
|
|
||||||
FRAG:
|
|
||||||
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)"
|
|
||||||
propertySeparator="::"
|
|
||||||
/>
|
|
||||||
The only property necessay is the connect String used by jgroups to configure itself. Refer to the Jgroups documentation for explanation
|
|
||||||
of all the protocols. The example above uses UDP multicast. If the connect property is not specified the default JGroups connection will be
|
|
||||||
used.
|
|
||||||
|
|
||||||
-->
|
|
||||||
<cacheManagerPeerProviderFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
|
|
||||||
properties="peerDiscovery=automatic,
|
|
||||||
multicastGroupAddress=230.0.0.1,
|
|
||||||
multicastGroupPort=4446, timeToLive=1"
|
|
||||||
propertySeparator=","
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
CacheManagerPeerListener
|
|
||||||
========================
|
|
||||||
(Enable for distributed operation)
|
|
||||||
|
|
||||||
Specifies a CacheManagerPeerListenerFactory which will be used to create a
|
|
||||||
CacheManagerPeerListener, which
|
|
||||||
listens for messages from cache replicators participating in the cluster.
|
|
||||||
|
|
||||||
The attributes of cacheManagerPeerListenerFactory are:
|
|
||||||
class - a fully qualified factory class name
|
|
||||||
properties - comma separated properties having meaning only to the factory.
|
|
||||||
|
|
||||||
Ehcache comes with a built-in RMI-based distribution system. The listener component is
|
|
||||||
RMICacheManagerPeerListener which is configured using
|
|
||||||
RMICacheManagerPeerListenerFactory. It is configured as per the following example:
|
|
||||||
|
|
||||||
<cacheManagerPeerListenerFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
|
|
||||||
properties="hostName=fully_qualified_hostname_or_ip,
|
|
||||||
port=40001,
|
|
||||||
socketTimeoutMillis=120000"
|
|
||||||
propertySeparator="," />
|
|
||||||
|
|
||||||
All properties are optional. They are:
|
|
||||||
* hostName - the hostName of the host the listener is running on. Specify
|
|
||||||
where the host is multihomed and you want to control the interface over which cluster
|
|
||||||
messages are received. Defaults to the host name of the default interface if not
|
|
||||||
specified.
|
|
||||||
* port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
|
|
||||||
* remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
|
|
||||||
This defaults to a free port if not specified.
|
|
||||||
* socketTimeoutMillis - the number of ms client sockets will stay open when sending
|
|
||||||
messages to the listener. This should be long enough for the slowest message.
|
|
||||||
If not specified it defaults 120000ms.
|
|
||||||
|
|
||||||
-->
|
|
||||||
<cacheManagerPeerListenerFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Cache configuration
|
|
||||||
===================
|
|
||||||
|
|
||||||
The following attributes are required.
|
|
||||||
|
|
||||||
name:
|
|
||||||
Sets the name of the cache. This is used to identify the cache. It must be unique.
|
|
||||||
|
|
||||||
maxElementsInMemory:
|
|
||||||
Sets the maximum number of objects that will be created in memory
|
|
||||||
|
|
||||||
maxElementsOnDisk:
|
|
||||||
Sets the maximum number of objects that will be maintained in the DiskStore
|
|
||||||
The default value is zero, meaning unlimited.
|
|
||||||
|
|
||||||
eternal:
|
|
||||||
Sets whether elements are eternal. If eternal, timeouts are ignored and the
|
|
||||||
element is never expired.
|
|
||||||
|
|
||||||
overflowToDisk:
|
|
||||||
Sets whether elements can overflow to disk when the memory store
|
|
||||||
has reached the maxInMemory limit.
|
|
||||||
|
|
||||||
The following attributes and elements are optional.
|
|
||||||
|
|
||||||
timeToIdleSeconds:
|
|
||||||
Sets the time to idle for an element before it expires.
|
|
||||||
i.e. The maximum amount of time between accesses before an element expires
|
|
||||||
Is only used if the element is not eternal.
|
|
||||||
Optional attribute. A value of 0 means that an Element can idle for infinity.
|
|
||||||
The default value is 0.
|
|
||||||
|
|
||||||
timeToLiveSeconds:
|
|
||||||
Sets the time to live for an element before it expires.
|
|
||||||
i.e. The maximum time between creation time and when an element expires.
|
|
||||||
Is only used if the element is not eternal.
|
|
||||||
Optional attribute. A value of 0 means that and Element can live for infinity.
|
|
||||||
The default value is 0.
|
|
||||||
|
|
||||||
diskPersistent:
|
|
||||||
Whether the disk store persists between restarts of the Virtual Machine.
|
|
||||||
The default value is false.
|
|
||||||
|
|
||||||
diskExpiryThreadIntervalSeconds:
|
|
||||||
The number of seconds between runs of the disk expiry thread. The default value
|
|
||||||
is 120 seconds.
|
|
||||||
|
|
||||||
diskSpoolBufferSizeMB:
|
|
||||||
This is the size to allocate the DiskStore for a spool buffer. Writes are made
|
|
||||||
to this area and then asynchronously written to disk. The default size is 30MB.
|
|
||||||
Each spool buffer is used only by its cache. If you get OutOfMemory errors consider
|
|
||||||
lowering this value. To improve DiskStore performance consider increasing it. Trace level
|
|
||||||
logging in the DiskStore will show if put back ups are occurring.
|
|
||||||
|
|
||||||
memoryStoreEvictionPolicy:
|
|
||||||
Policy would be enforced upon reaching the maxElementsInMemory limit. Default
|
|
||||||
policy is Least Recently Used (specified as LRU). Other policies available -
|
|
||||||
First In First Out (specified as FIFO) and Less Frequently Used
|
|
||||||
(specified as LFU)
|
|
||||||
|
|
||||||
Cache elements can also contain sub elements which take the same format of a factory class
|
|
||||||
and properties. Defined sub-elements are:
|
|
||||||
|
|
||||||
* cacheEventListenerFactory - Enables registration of listeners for cache events, such as
|
|
||||||
put, remove, update, and expire.
|
|
||||||
|
|
||||||
* bootstrapCacheLoaderFactory - Specifies a BootstrapCacheLoader, which is called by a
|
|
||||||
cache on initialisation to prepopulate itself.
|
|
||||||
|
|
||||||
* cacheExtensionFactory - Specifies a CacheExtension, a generic mechansim to tie a class
|
|
||||||
which holds a reference to a cache to the cache lifecycle.
|
|
||||||
|
|
||||||
* cacheExceptionHandlerFactory - Specifies a CacheExceptionHandler, which is called when
|
|
||||||
cache exceptions occur.
|
|
||||||
|
|
||||||
* cacheLoaderFactory - Specifies a CacheLoader, which can be used both asynchronously and
|
|
||||||
synchronously to load objects into a cache.
|
|
||||||
|
|
||||||
RMI Cache Replication
|
|
||||||
|
|
||||||
Each cache that will be distributed needs to set a cache event listener which replicates
|
|
||||||
messages to the other CacheManager peers. For the built-in RMI implementation this is done
|
|
||||||
by adding a cacheEventListenerFactory element of type RMICacheReplicatorFactory to each
|
|
||||||
distributed cache's configuration as per the following example:
|
|
||||||
|
|
||||||
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
|
|
||||||
properties="replicateAsynchronously=true,
|
|
||||||
replicatePuts=true,
|
|
||||||
replicateUpdates=true,
|
|
||||||
replicateUpdatesViaCopy=true,
|
|
||||||
replicateRemovals=true
|
|
||||||
asynchronousReplicationIntervalMillis=<number of milliseconds"
|
|
||||||
propertySeparator="," />
|
|
||||||
|
|
||||||
The RMICacheReplicatorFactory recognises the following properties:
|
|
||||||
|
|
||||||
* replicatePuts=true|false - whether new elements placed in a cache are
|
|
||||||
replicated to others. Defaults to true.
|
|
||||||
|
|
||||||
* replicateUpdates=true|false - whether new elements which override an
|
|
||||||
element already existing with the same key are replicated. Defaults to true.
|
|
||||||
|
|
||||||
* replicateRemovals=true - whether element removals are replicated. Defaults to true.
|
|
||||||
|
|
||||||
* replicateAsynchronously=true | false - whether replications are
|
|
||||||
asynchronous (true) or synchronous (false). Defaults to true.
|
|
||||||
|
|
||||||
* replicateUpdatesViaCopy=true | false - whether the new elements are
|
|
||||||
copied to other caches (true), or whether a remove message is sent. Defaults to true.
|
|
||||||
|
|
||||||
* asynchronousReplicationIntervalMillis=<number of milliseconds> - The asynchronous
|
|
||||||
replicator runs at a set interval of milliseconds. The default is 1000. The minimum
|
|
||||||
is 10. This property is only applicable if replicateAsynchronously=true
|
|
||||||
|
|
||||||
|
|
||||||
For the Jgroups replication this is done with:
|
|
||||||
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
|
|
||||||
properties="replicateAsynchronously=true, replicatePuts=true,
|
|
||||||
replicateUpdates=true, replicateUpdatesViaCopy=false,
|
|
||||||
replicateRemovals=true,asynchronousReplicationIntervalMillis=1000"/>
|
|
||||||
This listener supports the same property than the RMICacheReplicationFactory.
|
|
||||||
|
|
||||||
Cluster Bootstrapping
|
|
||||||
|
|
||||||
The RMIBootstrapCacheLoader bootstraps caches in clusters where RMICacheReplicators are
|
|
||||||
used. It is configured as per the following example:
|
|
||||||
|
|
||||||
<bootstrapCacheLoaderFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
|
|
||||||
properties="bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000"
|
|
||||||
propertySeparator="," />
|
|
||||||
|
|
||||||
The RMIBootstrapCacheLoaderFactory recognises the following optional properties:
|
|
||||||
|
|
||||||
* bootstrapAsynchronously=true|false - whether the bootstrap happens in the background
|
|
||||||
after the cache has started. If false, bootstrapping must complete before the cache is
|
|
||||||
made available. The default value is true.
|
|
||||||
|
|
||||||
* maximumChunkSizeBytes=<integer> - Caches can potentially be very large, larger than the
|
|
||||||
memory limits of the VM. This property allows the bootstraper to fetched elements in
|
|
||||||
chunks. The default chunk size is 5000000 (5MB).
|
|
||||||
|
|
||||||
|
|
||||||
Cache Exception Handling
|
|
||||||
|
|
||||||
By default, most cache operations will propagate a runtime CacheException on failure. An
|
|
||||||
interceptor, using a dynamic proxy, may be configured so that a CacheExceptionHandler can
|
|
||||||
be configured to intercept Exceptions. Errors are not intercepted.
|
|
||||||
|
|
||||||
It is configured as per the following example:
|
|
||||||
|
|
||||||
<cacheExceptionHandlerFactory class="com.example.ExampleExceptionHandlerFactory"
|
|
||||||
properties="logLevel=FINE"/>
|
|
||||||
|
|
||||||
Caches with ExceptionHandling configured are not of type Cache, but are of type Ehcache only,
|
|
||||||
and are not available using CacheManager.getCache(), but using CacheManager.getEhcache().
|
|
||||||
|
|
||||||
|
|
||||||
Cache Loader
|
|
||||||
|
|
||||||
A default CacheLoader may be set which loads objects into the cache through asynchronous and
|
|
||||||
synchronous methods on Cache. This is different to the bootstrap cache loader, which is used
|
|
||||||
only in distributed caching.
|
|
||||||
|
|
||||||
It is configured as per the following example:
|
|
||||||
|
|
||||||
<cacheLoaderFactory class="com.example.ExampleCacheLoaderFactory"
|
|
||||||
properties="type=int,startCounter=10"/>
|
|
||||||
|
|
||||||
Cache Extension
|
|
||||||
|
|
||||||
CacheExtensions are a general purpose mechanism to allow generic extensions to a Cache.
|
|
||||||
CacheExtensions are tied into the Cache lifecycle.
|
|
||||||
|
|
||||||
CacheExtensions are created using the CacheExtensionFactory which has a
|
|
||||||
<code>createCacheCacheExtension()</code> method which takes as a parameter a
|
|
||||||
Cache and properties. It can thus call back into any public method on Cache, including, of
|
|
||||||
course, the load methods.
|
|
||||||
|
|
||||||
Extensions are added as per the following example:
|
|
||||||
|
|
||||||
<cacheExtensionFactory class="com.example.FileWatchingCacheRefresherExtensionFactory"
|
|
||||||
properties="refreshIntervalMillis=18000, loaderTimeout=3000,
|
|
||||||
flushPeriod=whatever, someOtherProperty=someValue ..."/>
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Mandatory Default Cache configuration. These settings will be applied to caches
|
|
||||||
created programmtically using CacheManager.add(String cacheName).
|
|
||||||
|
|
||||||
The defaultCache has an implicit name "default" which is a reserved cache name.
|
|
||||||
-->
|
|
||||||
<defaultCache
|
|
||||||
maxElementsInMemory="10000"
|
|
||||||
eternal="false"
|
|
||||||
timeToIdleSeconds="120"
|
|
||||||
timeToLiveSeconds="120"
|
|
||||||
overflowToDisk="false"
|
|
||||||
diskSpoolBufferSizeMB="30"
|
|
||||||
maxElementsOnDisk="10000000"
|
|
||||||
diskPersistent="false"
|
|
||||||
diskExpiryThreadIntervalSeconds="120"
|
|
||||||
memoryStoreEvictionPolicy="LRU"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample caches. Following are some example caches. Remove these before use.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample cache named sampleCache1
|
|
||||||
This cache contains a maximum in memory of 10000 elements, and will expire
|
|
||||||
an element if it is idle for more than 5 minutes and lives for more than
|
|
||||||
10 minutes.
|
|
||||||
|
|
||||||
If there are more than 10000 elements it will overflow to the
|
|
||||||
disk cache, which in this configuration will go to wherever java.io.tmp is
|
|
||||||
defined on your system. On a standard Linux system this will be /tmp"
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleCache1"
|
|
||||||
maxElementsInMemory="10000"
|
|
||||||
maxElementsOnDisk="1000"
|
|
||||||
eternal="false"
|
|
||||||
overflowToDisk="true"
|
|
||||||
diskSpoolBufferSizeMB="20"
|
|
||||||
timeToIdleSeconds="300"
|
|
||||||
timeToLiveSeconds="600"
|
|
||||||
memoryStoreEvictionPolicy="LFU"
|
|
||||||
/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample cache named sampleCache2
|
|
||||||
This cache has a maximum of 1000 elements in memory. There is no overflow to disk, so 1000
|
|
||||||
is also the maximum cache size. Note that when a cache is eternal, timeToLive and
|
|
||||||
timeToIdle are not used and do not need to be specified.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleCache2"
|
|
||||||
maxElementsInMemory="1000"
|
|
||||||
eternal="true"
|
|
||||||
overflowToDisk="false"
|
|
||||||
memoryStoreEvictionPolicy="FIFO"
|
|
||||||
/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample cache named sampleCache3. This cache overflows to disk. The disk store is
|
|
||||||
persistent between cache and VM restarts. The disk expiry thread interval is set to 10
|
|
||||||
minutes, overriding the default of 2 minutes.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleCache3"
|
|
||||||
maxElementsInMemory="500"
|
|
||||||
eternal="false"
|
|
||||||
overflowToDisk="true"
|
|
||||||
timeToIdleSeconds="300"
|
|
||||||
timeToLiveSeconds="600"
|
|
||||||
diskPersistent="true"
|
|
||||||
diskExpiryThreadIntervalSeconds="1"
|
|
||||||
memoryStoreEvictionPolicy="LFU"
|
|
||||||
/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample distributed cache named sampleDistributedCache1.
|
|
||||||
This cache replicates using defaults.
|
|
||||||
It also bootstraps from the cluster, using default properties.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleDistributedCache1"
|
|
||||||
maxElementsInMemory="10"
|
|
||||||
eternal="false"
|
|
||||||
timeToIdleSeconds="100"
|
|
||||||
timeToLiveSeconds="100"
|
|
||||||
overflowToDisk="false">
|
|
||||||
<cacheEventListenerFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
|
|
||||||
<bootstrapCacheLoaderFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
|
|
||||||
</cache>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample distributed cache named sampleDistributedCache2.
|
|
||||||
This cache replicates using specific properties.
|
|
||||||
It only replicates updates and does so synchronously via copy
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleDistributedCache2"
|
|
||||||
maxElementsInMemory="10"
|
|
||||||
eternal="false"
|
|
||||||
timeToIdleSeconds="100"
|
|
||||||
timeToLiveSeconds="100"
|
|
||||||
overflowToDisk="false">
|
|
||||||
<cacheEventListenerFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
|
|
||||||
properties="replicateAsynchronously=false, replicatePuts=false,
|
|
||||||
replicateUpdates=true, replicateUpdatesViaCopy=true,
|
|
||||||
replicateRemovals=false"/>
|
|
||||||
</cache>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Sample distributed cache named sampleDistributedCache3.
|
|
||||||
This cache replicates using defaults except that the asynchronous replication
|
|
||||||
interval is set to 200ms.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<cache name="sampleDistributedCache3"
|
|
||||||
maxElementsInMemory="10"
|
|
||||||
eternal="false"
|
|
||||||
timeToIdleSeconds="100"
|
|
||||||
timeToLiveSeconds="100"
|
|
||||||
overflowToDisk="false">
|
|
||||||
<cacheEventListenerFactory
|
|
||||||
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
|
|
||||||
properties="asynchronousReplicationIntervalMillis=200"/>
|
|
||||||
</cache>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</ehcache>
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
|
||||||
|
|
||||||
<!-- ================================= -->
|
|
||||||
<!-- Preserve messages in a local file -->
|
|
||||||
<!-- ================================= -->
|
|
||||||
|
|
||||||
<appender name="FILE1" class="org.apache.log4j.RollingFileAppender">
|
|
||||||
<param name="File" value="/var/log/cloud.log"/>
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="MaxFileSize" value="10000KB"/>
|
|
||||||
<param name="MaxBackupIndex" value="4"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p
|
|
||||||
[%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="FILE2" class="org.apache.log4j.RollingFileAppender">
|
|
||||||
<param name="File" value="/var/log/cloud/cloud.out"/>
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="MaxFileSize" value="10000KB"/>
|
|
||||||
<param name="MaxBackupIndex" value="4"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p
|
|
||||||
[%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="FILE3" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="File" value="/usr/local/cloud/systemvm/cloud.log"/>
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="MaxFileSize" value="10000KB"/>
|
|
||||||
<param name="MaxBackupIndex" value="4"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p
|
|
||||||
[%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="APISERVER" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="Threshold" value="DEBUG"/>
|
|
||||||
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
|
|
||||||
<param name="FileNamePattern" value="/var/log/cloud/api-server.log.%d{yyyy-MM-dd}{GMT}.gz"/>
|
|
||||||
<param name="ActiveFileName" value="/var/log/cloud/api-server.log"/>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ============================== -->
|
|
||||||
<!-- Append messages to the console -->
|
|
||||||
<!-- ============================== -->
|
|
||||||
|
|
||||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
|
||||||
<param name="Target" value="System.out"/>
|
|
||||||
<param name="Threshold" value="INFO"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ABSOLUTE}{GMT} %5p %c{1}:%L - %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================ -->
|
|
||||||
<!-- Limit categories -->
|
|
||||||
<!-- ================ -->
|
|
||||||
|
|
||||||
<category name="com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
|
|
||||||
<category name="org.apache">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="org">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="net">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="apiserver.com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<logger name="apiserver.com.cloud" additivity="false">
|
|
||||||
<level value="DEBUG"/>
|
|
||||||
<appender-ref ref="APISERVER"/>
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<!-- ======================= -->
|
|
||||||
<!-- Setup the Root category -->
|
|
||||||
<!-- ======================= -->
|
|
||||||
|
|
||||||
<root>
|
|
||||||
<level value="INFO"/>
|
|
||||||
<appender-ref ref="CONSOLE"/>
|
|
||||||
<appender-ref ref="FILE1"/>
|
|
||||||
<appender-ref ref="FILE2"/>
|
|
||||||
<appender-ref ref="FILE3"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</log4j:configuration>
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
|
||||||
|
|
||||||
<!-- ================================= -->
|
|
||||||
<!-- Preserve messages in a local file -->
|
|
||||||
<!-- ================================= -->
|
|
||||||
|
|
||||||
<!-- A time/date based rolling appender -->
|
|
||||||
<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="Threshold" value="DEBUG"/>
|
|
||||||
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
|
|
||||||
<param name="FileNamePattern" value="@logdir@/cloud.log.%d{yyyy-MM-dd}{GMT}.gz"/>
|
|
||||||
<param name="ActiveFileName" value="@logdir@/cloud.log"/>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %-5p [%c{3}] (%t:%x) %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="APISERVER" class="org.apache.log4j.rolling.RollingFileAppender">
|
|
||||||
<param name="Append" value="true"/>
|
|
||||||
<param name="Threshold" value="DEBUG"/>
|
|
||||||
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
|
|
||||||
<param name="FileNamePattern" value="@logdir@/api-server.log.%d{yyyy-MM-dd}{GMT}.gz"/>
|
|
||||||
<param name="ActiveFileName" value="@logdir@/api-server.log"/>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ISO8601}{GMT} %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ============================== -->
|
|
||||||
<!-- Append messages to the console -->
|
|
||||||
<!-- ============================== -->
|
|
||||||
|
|
||||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
|
||||||
<param name="Target" value="System.out"/>
|
|
||||||
<param name="Threshold" value="INFO"/>
|
|
||||||
|
|
||||||
<layout class="org.apache.log4j.EnhancedPatternLayout">
|
|
||||||
<param name="ConversionPattern" value="%d{ABSOLUTE}{GMT} %5p %c{1}:%L - %m%n"/>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- ================ -->
|
|
||||||
<!-- Limit categories -->
|
|
||||||
<!-- ================ -->
|
|
||||||
|
|
||||||
<category name="com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
|
|
||||||
<category name="org.apache">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="org">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="net">
|
|
||||||
<priority value="INFO"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<category name="apiserver.com.cloud">
|
|
||||||
<priority value="DEBUG"/>
|
|
||||||
</category>
|
|
||||||
|
|
||||||
<logger name="apiserver.com.cloud" additivity="false">
|
|
||||||
<level value="DEBUG"/>
|
|
||||||
<appender-ref ref="APISERVER"/>
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<!-- ======================= -->
|
|
||||||
<!-- Setup the Root category -->
|
|
||||||
<!-- ======================= -->
|
|
||||||
|
|
||||||
<root>
|
|
||||||
<level value="INFO"/>
|
|
||||||
<appender-ref ref="CONSOLE"/>
|
|
||||||
<appender-ref ref="FILE"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</log4j:configuration>
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
<?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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Note: A "Server" is not itself a "Container", so you may not
|
|
||||||
define subcomponents such as "Valves" at this level.
|
|
||||||
Documentation at /docs/config/server.html
|
|
||||||
-->
|
|
||||||
<Server port="8005" shutdown="SHUTDOWN">
|
|
||||||
|
|
||||||
<!--APR library loader. Documentation at /docs/apr.html -->
|
|
||||||
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
|
|
||||||
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
|
|
||||||
<Listener className="org.apache.catalina.core.JasperListener" />
|
|
||||||
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
|
|
||||||
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
|
|
||||||
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
|
|
||||||
|
|
||||||
<!-- Global JNDI resources
|
|
||||||
Documentation at /docs/jndi-resources-howto.html
|
|
||||||
-->
|
|
||||||
<GlobalNamingResources>
|
|
||||||
<!-- Editable user database that can also be used by
|
|
||||||
UserDatabaseRealm to authenticate users
|
|
||||||
-->
|
|
||||||
<Resource name="UserDatabase" auth="Container"
|
|
||||||
type="org.apache.catalina.UserDatabase"
|
|
||||||
description="User database that can be updated and saved"
|
|
||||||
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
|
|
||||||
pathname="conf/tomcat-users.xml" />
|
|
||||||
</GlobalNamingResources>
|
|
||||||
|
|
||||||
<!-- A "Service" is a collection of one or more "Connectors" that share
|
|
||||||
a single "Container" Note: A "Service" is not itself a "Container",
|
|
||||||
so you may not define subcomponents such as "Valves" at this level.
|
|
||||||
Documentation at /docs/config/service.html
|
|
||||||
-->
|
|
||||||
<Service name="Catalina">
|
|
||||||
|
|
||||||
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
|
|
||||||
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
|
|
||||||
maxThreads="150" minSpareThreads="25"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- A "Connector" represents an endpoint by which requests are received
|
|
||||||
and responses are returned. Documentation at :
|
|
||||||
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
|
|
||||||
Java AJP Connector: /docs/config/ajp.html
|
|
||||||
APR (HTTP/AJP) Connector: /docs/apr.html
|
|
||||||
Define a non-SSL HTTP/1.1 Connector on port 8080
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<Connector port="8080" protocol="HTTP/1.1"
|
|
||||||
connectionTimeout="20000"
|
|
||||||
redirectPort="8443" />
|
|
||||||
-->
|
|
||||||
<!-- A "Connector" using the shared thread pool-->
|
|
||||||
<Connector executor="tomcatThreadPool"
|
|
||||||
port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
|
|
||||||
connectionTimeout="20000" disableUploadTimeout="true"
|
|
||||||
acceptCount="150" enableLookups="false" maxThreads="150"
|
|
||||||
maxHttpHeaderSize="8192" redirectPort="8443" />
|
|
||||||
<!-- Define a SSL HTTP/1.1 Connector on port 8443
|
|
||||||
This connector uses the JSSE configuration, when using APR, the
|
|
||||||
connector should be using the OpenSSL style configuration
|
|
||||||
described in the APR documentation -->
|
|
||||||
<!--
|
|
||||||
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
|
|
||||||
maxThreads="150" scheme="https" secure="true"
|
|
||||||
clientAuth="false" sslProtocol="TLS"
|
|
||||||
keystoreType="PKCS12"
|
|
||||||
keystoreFile="conf\cloud-localhost.pk12"
|
|
||||||
keystorePass="password"
|
|
||||||
/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Define an AJP 1.3 Connector on port 8009 -->
|
|
||||||
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- An Engine represents the entry point (within Catalina) that processes
|
|
||||||
every request. The Engine implementation for Tomcat stand alone
|
|
||||||
analyzes the HTTP headers included with the request, and passes them
|
|
||||||
on to the appropriate Host (virtual host).
|
|
||||||
Documentation at /docs/config/engine.html -->
|
|
||||||
|
|
||||||
<!-- You should set jvmRoute to support load-balancing via AJP ie :
|
|
||||||
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
|
|
||||||
-->
|
|
||||||
<Engine name="Catalina" defaultHost="localhost">
|
|
||||||
|
|
||||||
<!--For clustering, please take a look at documentation at:
|
|
||||||
/docs/cluster-howto.html (simple how to)
|
|
||||||
/docs/config/cluster.html (reference documentation) -->
|
|
||||||
<!--
|
|
||||||
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- The request dumper valve dumps useful debugging information about
|
|
||||||
the request and response data received and sent by Tomcat.
|
|
||||||
Documentation at: /docs/config/valve.html -->
|
|
||||||
<!--
|
|
||||||
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- This Realm uses the UserDatabase configured in the global JNDI
|
|
||||||
resources under the key "UserDatabase". Any edits
|
|
||||||
that are performed against this UserDatabase are immediately
|
|
||||||
available for use by the Realm. -->
|
|
||||||
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
|
|
||||||
resourceName="UserDatabase"/>
|
|
||||||
|
|
||||||
<!-- Define the default virtual host
|
|
||||||
Note: XML Schema validation will not work with Xerces 2.2.
|
|
||||||
-->
|
|
||||||
<Host name="localhost" appBase="webapps"
|
|
||||||
unpackWARs="true" autoDeploy="true"
|
|
||||||
xmlValidation="false" xmlNamespaceAware="false">
|
|
||||||
|
|
||||||
<!-- SingleSignOn valve, share authentication between web applications
|
|
||||||
Documentation at: /docs/config/valve.html -->
|
|
||||||
<!--
|
|
||||||
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Access log processes all example.
|
|
||||||
Documentation at: /docs/config/valve.html -->
|
|
||||||
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve" directory="logs"
|
|
||||||
prefix="access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
|
|
||||||
|
|
||||||
</Host>
|
|
||||||
</Engine>
|
|
||||||
</Service>
|
|
||||||
</Server>
|
|
||||||
@ -185,6 +185,9 @@
|
|||||||
<copy todir="${server.deploy.to.dir}/lib">
|
<copy todir="${server.deploy.to.dir}/lib">
|
||||||
<fileset dir="${deps.dir}/">
|
<fileset dir="${deps.dir}/">
|
||||||
<include name="*.jar"/>
|
<include name="*.jar"/>
|
||||||
|
<exclude name="servlet*.jar"/>
|
||||||
|
<exclude name="axis2*.jar"/>
|
||||||
|
<exclude name="*slf4j*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<touch file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version"/>
|
<touch file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version"/>
|
||||||
|
|||||||
@ -272,29 +272,6 @@
|
|||||||
<tstamp>
|
<tstamp>
|
||||||
<format property="package.date" pattern="yyyy-MM-dd" />
|
<format property="package.date" pattern="yyyy-MM-dd" />
|
||||||
</tstamp>
|
</tstamp>
|
||||||
<zip destfile="${publish.dir}/cloud-${company.major.version}.${company.minor.version}.${company.patch.version}.${build.number}-${package.date}.zip" duplicate="preserve">
|
|
||||||
<zipfileset dir="${dist.dir}" prefix="cloud-${company.major.version}.${company.minor.version}.${company.patch.version}.${build.number}-${package.date}" filemode="777">
|
|
||||||
<include name="deploy-agent.sh" />
|
|
||||||
<include name="deploy-server.sh" />
|
|
||||||
</zipfileset>
|
|
||||||
<zipfileset dir="${db.dist.dir}" prefix="cloud-${company.major.version}.${company.minor.version}.${company.patch.version}.${build.number}-${package.date}/db" filemode="777">
|
|
||||||
<include name="deploy-db.sh" />
|
|
||||||
</zipfileset>
|
|
||||||
<zipfileset dir="${db.dist.dir}" prefix="cloud-${company.major.version}.${company.minor.version}.${company.patch.version}.${build.number}-${package.date}/db">
|
|
||||||
<include name="log4j.properties" />
|
|
||||||
<include name="create-schema.sql" />
|
|
||||||
<include name="init-data.sql" />
|
|
||||||
<include name="create-index-fk.sql" />
|
|
||||||
<include name="server-setup.xml" />
|
|
||||||
<include name="create-database.sql" />
|
|
||||||
<include name="templates.sql" />
|
|
||||||
</zipfileset>
|
|
||||||
<zipfileset dir="${dist.dir}" prefix="cloud-${company.major.version}.${company.minor.version}.${company.patch.version}.${build.number}-${package.date}">
|
|
||||||
<include name="agent.zip" />
|
|
||||||
<include name="client.zip" />
|
|
||||||
<include name="docs.zip" />
|
|
||||||
</zipfileset>
|
|
||||||
</zip>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-kvm" depends="package-agent">
|
<target name="package-kvm" depends="package-agent">
|
||||||
|
|||||||
@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
# management server compile-time environment parameters
|
# management server compile-time environment parameters
|
||||||
|
|
||||||
paths.script=@AGENTLIBDIR@
|
paths.script=@COMMONLIBDIR@
|
||||||
mount.parent=@MSMNTDIR@
|
mount.parent=@MSMNTDIR@
|
||||||
cloud-stack-components-specification=@COMPONENTS-SPEC@
|
cloud-stack-components-specification=@COMPONENTS-SPEC@
|
||||||
|
|||||||
37
cloud.spec
37
cloud.spec
@ -81,8 +81,8 @@ Group: System Environment/Libraries
|
|||||||
%description server
|
%description server
|
||||||
The CloudStack server libraries provide a set of Java classes for CloudStack.
|
The CloudStack server libraries provide a set of Java classes for CloudStack.
|
||||||
|
|
||||||
%package agent-scripts
|
%package scripts
|
||||||
Summary: CloudStack agent scripts
|
Summary: CloudStack scripts
|
||||||
# FIXME nuke the archdependency
|
# FIXME nuke the archdependency
|
||||||
Requires: python
|
Requires: python
|
||||||
Requires: bash
|
Requires: bash
|
||||||
@ -95,13 +95,10 @@ Requires: nfs-utils
|
|||||||
Requires: wget
|
Requires: wget
|
||||||
# there is a fsimage.so in the source code, which adds xen-libs as a dependence, needs to supress it, as rhel doesn't have this pacakge
|
# there is a fsimage.so in the source code, which adds xen-libs as a dependence, needs to supress it, as rhel doesn't have this pacakge
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
Obsoletes: vmops-agent-scripts < %{version}-%{release}
|
Obsoletes: cloud-agent-scripts < %{version}-%{release}
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
%description agent-scripts
|
%description scripts
|
||||||
The CloudStack agent is in charge of managing shared computing resources in
|
This package contains common scripts used by the Agent and Management server
|
||||||
a KVM-powered cloud. Install this package if this computer
|
|
||||||
will participate in your cloud -- this is a requirement for the CloudStack KVM
|
|
||||||
agent.
|
|
||||||
|
|
||||||
%package python
|
%package python
|
||||||
Summary: CloudStack Python library
|
Summary: CloudStack Python library
|
||||||
@ -143,8 +140,7 @@ Requires: java >= 1.6.0
|
|||||||
Requires: %{name}-deps = %{version}, %{name}-utils = %{version}, %{name}-server = %{version}
|
Requires: %{name}-deps = %{version}, %{name}-utils = %{version}, %{name}-server = %{version}
|
||||||
Requires: %{name}-client-ui = %{version}
|
Requires: %{name}-client-ui = %{version}
|
||||||
Requires: %{name}-setup = %{version}
|
Requires: %{name}-setup = %{version}
|
||||||
# reqs the agent-scripts package because of xenserver within the management server
|
Requires: %{name}-scripts = %{version}
|
||||||
Requires: %{name}-agent-scripts = %{version}
|
|
||||||
Requires: %{name}-python = %{version}
|
Requires: %{name}-python = %{version}
|
||||||
Requires: %{name}-aws-api = %{version}
|
Requires: %{name}-aws-api = %{version}
|
||||||
# for consoleproxy
|
# for consoleproxy
|
||||||
@ -209,7 +205,7 @@ Obsoletes: cloud-premium-agent < %{version}-%{release}
|
|||||||
Requires: java >= 1.6.0
|
Requires: java >= 1.6.0
|
||||||
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
|
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
|
||||||
Requires: %{name}-agent-libs = %{version}
|
Requires: %{name}-agent-libs = %{version}
|
||||||
Requires: %{name}-agent-scripts = %{version}
|
Requires: %{name}-scripts = %{version}
|
||||||
Requires: python
|
Requires: python
|
||||||
Requires: %{name}-python = %{version}
|
Requires: %{name}-python = %{version}
|
||||||
Requires: commons-httpclient
|
Requires: commons-httpclient
|
||||||
@ -376,10 +372,6 @@ else
|
|||||||
/sbin/service %{name}-usage condrestart >/dev/null 2>&1 || true
|
/sbin/service %{name}-usage condrestart >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%pre agent-scripts
|
|
||||||
id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
|
|
||||||
-r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
|
|
||||||
|
|
||||||
%preun agent
|
%preun agent
|
||||||
if [ "$1" == "0" ] ; then
|
if [ "$1" == "0" ] ; then
|
||||||
/sbin/chkconfig --del %{name}-agent > /dev/null 2>&1 || true
|
/sbin/chkconfig --del %{name}-agent > /dev/null 2>&1 || true
|
||||||
@ -454,12 +446,12 @@ fi
|
|||||||
%{_javadir}/%{name}-plugin-nicira-nvp.jar
|
%{_javadir}/%{name}-plugin-nicira-nvp.jar
|
||||||
%config(noreplace) %{_sysconfdir}/%{name}/server/*
|
%config(noreplace) %{_sysconfdir}/%{name}/server/*
|
||||||
|
|
||||||
%files agent-scripts
|
%files scripts
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{_libdir}/%{name}/agent/scripts/*
|
%{_libdir}/%{name}/common/scripts/*
|
||||||
# maintain the following list in sync with files agent-scripts
|
# maintain the following list in sync with files scripts
|
||||||
%{_libdir}/%{name}/agent/vms/systemvm.zip
|
%{_libdir}/%{name}/common/vms/systemvm.zip
|
||||||
%{_libdir}/%{name}/agent/vms/systemvm.iso
|
%{_libdir}/%{name}/common/vms/systemvm.iso
|
||||||
|
|
||||||
|
|
||||||
%files deps
|
%files deps
|
||||||
@ -468,6 +460,7 @@ fi
|
|||||||
%{_javadir}/commons-dbcp-1.4.jar
|
%{_javadir}/commons-dbcp-1.4.jar
|
||||||
%{_javadir}/commons-pool-1.6.jar
|
%{_javadir}/commons-pool-1.6.jar
|
||||||
%{_javadir}/gson-1.7.1.jar
|
%{_javadir}/gson-1.7.1.jar
|
||||||
|
%{_javadir}/CAStorSDK-*.jar
|
||||||
%{_javadir}/backport-util-concurrent-3.1.jar
|
%{_javadir}/backport-util-concurrent-3.1.jar
|
||||||
%{_javadir}/ehcache-1.5.0.jar
|
%{_javadir}/ehcache-1.5.0.jar
|
||||||
%{_javadir}/httpcore-4.0.jar
|
%{_javadir}/httpcore-4.0.jar
|
||||||
@ -489,7 +482,7 @@ fi
|
|||||||
%{_javadir}/commons-discovery-0.5.jar
|
%{_javadir}/commons-discovery-0.5.jar
|
||||||
%{_javadir}/jstl-1.2.jar
|
%{_javadir}/jstl-1.2.jar
|
||||||
%{_javadir}/javax.persistence-2.0.0.jar
|
%{_javadir}/javax.persistence-2.0.0.jar
|
||||||
|
%{_javadir}/bcprov-jdk16-1.45.jar
|
||||||
%files core
|
%files core
|
||||||
%defattr(0644,root,root,0755)
|
%defattr(0644,root,root,0755)
|
||||||
%{_javadir}/%{name}-core.jar
|
%{_javadir}/%{name}-core.jar
|
||||||
@ -541,7 +534,7 @@ fi
|
|||||||
%defattr(0644,root,root,0755)
|
%defattr(0644,root,root,0755)
|
||||||
%{_javadir}/%{name}-agent.jar
|
%{_javadir}/%{name}-agent.jar
|
||||||
%{_javadir}/%{name}-plugin-hypervisor-kvm.jar
|
%{_javadir}/%{name}-plugin-hypervisor-kvm.jar
|
||||||
%{_javadir}/libvirt-0.4.8.jar
|
%{_javadir}/libvirt-0.4.9.jar
|
||||||
|
|
||||||
%files agent
|
%files agent
|
||||||
%defattr(0644,root,root,0755)
|
%defattr(0644,root,root,0755)
|
||||||
|
|||||||
@ -404,7 +404,7 @@ public class VirtualRoutingResource implements Manager {
|
|||||||
for (IpAddressTO ip : ips) {
|
for (IpAddressTO ip : ips) {
|
||||||
result = assignPublicIpAddress(routerName, routerIp, ip.getPublicIp(), ip.isAdd(),
|
result = assignPublicIpAddress(routerName, routerIp, ip.getPublicIp(), ip.isAdd(),
|
||||||
ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),
|
ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),
|
||||||
ip.getVifMacAddress(), ip.getGuestIp(), 2);
|
ip.getVifMacAddress(), 2);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
results[i++] = IpAssocAnswer.errorResult;
|
results[i++] = IpAssocAnswer.errorResult;
|
||||||
} else {
|
} else {
|
||||||
@ -812,7 +812,7 @@ public class VirtualRoutingResource implements Manager {
|
|||||||
final String privateIpAddress, final String publicIpAddress,
|
final String privateIpAddress, final String publicIpAddress,
|
||||||
final boolean add, final boolean firstIP, final boolean sourceNat,
|
final boolean add, final boolean firstIP, final boolean sourceNat,
|
||||||
final String vlanId, final String vlanGateway,
|
final String vlanId, final String vlanGateway,
|
||||||
final String vlanNetmask, final String vifMacAddress, String guestIp, int nicNum){
|
final String vlanNetmask, final String vifMacAddress, int nicNum){
|
||||||
|
|
||||||
String args = "";
|
String args = "";
|
||||||
if (add) {
|
if (add) {
|
||||||
|
|||||||
@ -83,6 +83,9 @@ public class UserAccountVO implements UserAccount {
|
|||||||
@Column(name="is_registered")
|
@Column(name="is_registered")
|
||||||
boolean registered;
|
boolean registered;
|
||||||
|
|
||||||
|
@Column (name="incorrect_login_attempts")
|
||||||
|
int loginAttempts;
|
||||||
|
|
||||||
@Column(name="account_name", table="account", insertable=false, updatable=false)
|
@Column(name="account_name", table="account", insertable=false, updatable=false)
|
||||||
private String accountName = null;
|
private String accountName = null;
|
||||||
|
|
||||||
@ -269,4 +272,12 @@ public class UserAccountVO implements UserAccount {
|
|||||||
public void setRegistered(boolean registered) {
|
public void setRegistered(boolean registered) {
|
||||||
this.registered = registered;
|
this.registered = registered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLoginAttempts(int loginAttempts) {
|
||||||
|
this.loginAttempts = loginAttempts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLoginAttempts() {
|
||||||
|
return loginAttempts;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
2
debian/cloud-agent-deps.install
vendored
2
debian/cloud-agent-deps.install
vendored
@ -16,4 +16,4 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
/usr/share/java/gson-1.7.1.jar
|
/usr/share/java/gson-1.7.1.jar
|
||||||
/usr/share/java/libvirt-0.4.8.jar
|
/usr/share/java/libvirt-0.4.9.jar
|
||||||
|
|||||||
17
debian/cloud-agent-scripts.config
vendored
17
debian/cloud-agent-scripts.config
vendored
@ -1,17 +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.
|
|
||||||
|
|
||||||
27
debian/cloud-agent-scripts.install
vendored
27
debian/cloud-agent-scripts.install
vendored
@ -1,27 +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.
|
|
||||||
|
|
||||||
/usr/lib/cloud/agent/scripts/installer/*
|
|
||||||
/usr/lib/cloud/agent/scripts/network/*
|
|
||||||
/usr/lib/cloud/agent/scripts/storage/*
|
|
||||||
/usr/lib/cloud/agent/scripts/util/*
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/network/*
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/systemvm/*
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/pingtest.sh
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/hypervisor/kvm/*
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/hypervisor/versions.sh
|
|
||||||
/usr/lib/cloud/agent/scripts/vm/hypervisor/xenserver/*
|
|
||||||
29
debian/cloud-agent-scripts.postinst
vendored
29
debian/cloud-agent-scripts.postinst
vendored
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
if ! id cloud > /dev/null 2>&1 ; then
|
|
||||||
adduser --system --home /var/lib/cloud/management --no-create-home \
|
|
||||||
--group --disabled-password --shell /bin/sh cloud
|
|
||||||
# update me in cloud-usage.postinst as well
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
2
debian/cloud-deps.install
vendored
2
debian/cloud-deps.install
vendored
@ -26,7 +26,7 @@
|
|||||||
/usr/share/java/jstl-1.2.jar
|
/usr/share/java/jstl-1.2.jar
|
||||||
/usr/share/java/axis2-1.5.1.jar
|
/usr/share/java/axis2-1.5.1.jar
|
||||||
/usr/share/java/wsdl4j-1.6.2.jar
|
/usr/share/java/wsdl4j-1.6.2.jar
|
||||||
/usr/share/java/bcprov-jdk16-1.46.jar
|
/usr/share/java/bcprov-*.jar
|
||||||
/usr/share/java/jasypt-1.*.jar
|
/usr/share/java/jasypt-1.*.jar
|
||||||
/usr/share/java/ejb-api-3.0.jar
|
/usr/share/java/ejb-api-3.0.jar
|
||||||
/usr/share/java/javax.persistence-2.0.0.jar
|
/usr/share/java/javax.persistence-2.0.0.jar
|
||||||
|
|||||||
@ -15,40 +15,13 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
build/replace.properties
|
/usr/lib/cloud/common/scripts/installer/*
|
||||||
build/build.number
|
/usr/lib/cloud/common/scripts/network/*
|
||||||
bin/
|
/usr/lib/cloud/common/scripts/storage/*
|
||||||
cloudstack-proprietary/
|
/usr/lib/cloud/common/scripts/util/*
|
||||||
premium/
|
/usr/lib/cloud/common/scripts/vm/network/*
|
||||||
.lock-wscript
|
/usr/lib/cloud/common/scripts/vm/systemvm/*
|
||||||
artifacts/
|
/usr/lib/cloud/common/scripts/vm/pingtest.sh
|
||||||
.waf-*
|
/usr/lib/cloud/common/scripts/vm/hypervisor/kvm/*
|
||||||
waf-*
|
/usr/lib/cloud/common/scripts/vm/hypervisor/versions.sh
|
||||||
target/
|
/usr/lib/cloud/common/scripts/vm/hypervisor/xenserver/*
|
||||||
override/
|
|
||||||
.metadata
|
|
||||||
dist/
|
|
||||||
*~
|
|
||||||
*.bak
|
|
||||||
cloud-*.tar.bz2
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
build.number
|
|
||||||
api.log.*.gz
|
|
||||||
cloud.log.*.*
|
|
||||||
unittest
|
|
||||||
deps/cloud.userlibraries
|
|
||||||
deps/awsapi-lib/
|
|
||||||
.DS_Store
|
|
||||||
.idea
|
|
||||||
*.iml
|
|
||||||
git-remote-https.exe.stackdump
|
|
||||||
*.swp
|
|
||||||
tools/devcloud/devcloudbox/.vagrant
|
|
||||||
deps/*.jar
|
|
||||||
deps/*.war
|
|
||||||
deps/*.mar
|
|
||||||
*.jar
|
|
||||||
awsapi/modules/*
|
|
||||||
!.gitignore
|
|
||||||
|
|
||||||
2
debian/cloud-system-iso.install
vendored
2
debian/cloud-system-iso.install
vendored
@ -15,4 +15,4 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
/usr/lib/cloud/agent/vms/systemvm.iso
|
/usr/lib/cloud/common/vms/systemvm.iso
|
||||||
|
|||||||
46
debian/control
vendored
46
debian/control
vendored
@ -2,14 +2,11 @@ Source: cloud
|
|||||||
Section: libs
|
Section: libs
|
||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Wido den Hollander <wido@widodh.nl>
|
Maintainer: Wido den Hollander <wido@widodh.nl>
|
||||||
Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, libws-commons-util-java, libcommons-dbcp-java, libcommons-collections-java, libcommons-httpclient-java, libservlet2.5-java, genisoimage, python-mysqldb, maven (>= 3.0.4), liblog4j1.2-java (>= 1.2.16)
|
Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, libws-commons-util-java, libcommons-dbcp-java, libcommons-collections-java, libcommons-httpclient-java, libservlet2.5-java, genisoimage, python-mysqldb, maven3 | maven (>= 3), liblog4j1.2-java (>= 1.2.16)
|
||||||
Standards-Version: 3.8.1
|
Standards-Version: 3.8.1
|
||||||
Homepage: http://www.cloudstack.org/
|
Homepage: http://www.cloudstack.org/
|
||||||
|
|
||||||
Package: cloud-deps
|
Package: cloud-deps
|
||||||
Provides: vmops-deps
|
|
||||||
Conflicts: vmops-deps
|
|
||||||
Replaces: vmops-deps
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, libcommons-discovery-java (>= 0.5), libcommons-dbcp-java (>= 1.4), libcommons-pool-java (>= 1.5.6), libcommons-codec-java (>= 1.5)
|
Depends: openjdk-6-jre, libcommons-discovery-java (>= 0.5), libcommons-dbcp-java (>= 1.4), libcommons-pool-java (>= 1.5.6), libcommons-codec-java (>= 1.5)
|
||||||
Description: CloudStack library dependencies
|
Description: CloudStack library dependencies
|
||||||
@ -18,9 +15,6 @@ Description: CloudStack library dependencies
|
|||||||
Management Server.
|
Management Server.
|
||||||
|
|
||||||
Package: cloud-agent-deps
|
Package: cloud-agent-deps
|
||||||
Provides: cloud-agent-deps
|
|
||||||
Conflicts: cloud-agent-deps
|
|
||||||
Replaces: cloud-agent-deps
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre
|
Depends: openjdk-6-jre
|
||||||
Description: CloudStack agent library dependencies
|
Description: CloudStack agent library dependencies
|
||||||
@ -29,9 +23,6 @@ Description: CloudStack agent library dependencies
|
|||||||
Agent.
|
Agent.
|
||||||
|
|
||||||
Package: cloud-utils
|
Package: cloud-utils
|
||||||
Provides: vmops-utils
|
|
||||||
Conflicts: vmops-utils
|
|
||||||
Replaces: vmops-utils
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, python, libcglib-java (>= 2.2.2), libjsch-java (>= 0.1.42), libbackport-util-concurrent-java (>= 3.1)
|
Depends: openjdk-6-jre, python, libcglib-java (>= 2.2.2), libjsch-java (>= 0.1.42), libbackport-util-concurrent-java (>= 3.1)
|
||||||
Description: CloudStack utility library
|
Description: CloudStack utility library
|
||||||
@ -39,9 +30,6 @@ Description: CloudStack utility library
|
|||||||
in the CloudStack environment.
|
in the CloudStack environment.
|
||||||
|
|
||||||
Package: cloud-client-ui
|
Package: cloud-client-ui
|
||||||
Provides: vmops-client-ui
|
|
||||||
Conflicts: vmops-client-ui
|
|
||||||
Replaces: vmops-client-ui
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-client (= ${source:Version})
|
Depends: openjdk-6-jre, cloud-client (= ${source:Version})
|
||||||
Description: CloudStack management server UI
|
Description: CloudStack management server UI
|
||||||
@ -51,29 +39,21 @@ Description: CloudStack management server UI
|
|||||||
CloudStack management server.
|
CloudStack management server.
|
||||||
|
|
||||||
Package: cloud-server
|
Package: cloud-server
|
||||||
Provides: vmops-server
|
|
||||||
Conflicts: vmops-server
|
|
||||||
Replaces: vmops-server
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), libservlet2.5-java
|
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), libservlet2.5-java
|
||||||
Description: CloudStack server library
|
Description: CloudStack server library
|
||||||
The CloudStack server libraries provide a set of Java classes used
|
The CloudStack server libraries provide a set of Java classes used
|
||||||
in the CloudStack management server.
|
in the CloudStack management server.
|
||||||
|
|
||||||
Package: cloud-agent-scripts
|
Package: cloud-scripts
|
||||||
Provides: vmops-agent-scripts, vmops-console, cloud-console, vmops-console-proxy
|
Replaces: cloud-agent-scripts
|
||||||
Conflicts: vmops-agent-scripts, vmops-console, cloud-console, vmops-console-proxy
|
|
||||||
Replaces: vmops-agent-scripts, vmops-console, cloud-console, vmops-console-proxy
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, openssh-client
|
Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, openssh-client
|
||||||
Description: CloudStack agent scripts
|
Description: CloudStack scripts
|
||||||
This package contains a number of scripts needed for the CloudStack Agent on KVM
|
This package contains a number of scripts needed for the CloudStack Agent and Management Server.
|
||||||
HyperVisor hosts. The CloudStack Agent depends on this package.
|
Both the CloudStack Agent and Management server depend on this package
|
||||||
|
|
||||||
Package: cloud-core
|
Package: cloud-core
|
||||||
Provides: vmops-core
|
|
||||||
Conflicts: vmops-core
|
|
||||||
Replaces: vmops-core
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-utils (= ${source:Version})
|
Depends: openjdk-6-jre, cloud-utils (= ${source:Version})
|
||||||
Description: CloudStack core library
|
Description: CloudStack core library
|
||||||
@ -82,9 +62,6 @@ Description: CloudStack core library
|
|||||||
|
|
||||||
|
|
||||||
Package: cloud-client
|
Package: cloud-client
|
||||||
Provides: vmops-client
|
|
||||||
Conflicts: vmops-client
|
|
||||||
Replaces: vmops-client
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-deps (= ${source:Version}), cloud-utils (= ${source:Version}), cloud-server (= ${source:Version}), cloud-client-ui (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-python (= ${source:Version}), tomcat6, libws-commons-util-java, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools, genisoimage, cloud-system-iso, libmysql-java (>= 5.1)
|
Depends: openjdk-6-jre, cloud-deps (= ${source:Version}), cloud-utils (= ${source:Version}), cloud-server (= ${source:Version}), cloud-client-ui (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-python (= ${source:Version}), tomcat6, libws-commons-util-java, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools, genisoimage, cloud-system-iso, libmysql-java (>= 5.1)
|
||||||
Description: CloudStack client
|
Description: CloudStack client
|
||||||
@ -93,9 +70,6 @@ Description: CloudStack client
|
|||||||
is required for the management server to work.
|
is required for the management server to work.
|
||||||
|
|
||||||
Package: cloud-setup
|
Package: cloud-setup
|
||||||
Provides: vmops-setup
|
|
||||||
Conflicts: vmops-setup
|
|
||||||
Replaces: vmops-setup
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, python, cloud-utils (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-python (= ${source:Version}), python-mysqldb
|
Depends: openjdk-6-jre, python, cloud-utils (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-python (= ${source:Version}), python-mysqldb
|
||||||
Description: CloudStack client
|
Description: CloudStack client
|
||||||
@ -115,11 +89,8 @@ Description: CloudStack agent libraries
|
|||||||
The CloudStack agent libraries are used by the Cloud Agent.
|
The CloudStack agent libraries are used by the Cloud Agent.
|
||||||
|
|
||||||
Package: cloud-agent
|
Package: cloud-agent
|
||||||
Provides: vmops-agent
|
|
||||||
Conflicts: vmops-agent
|
|
||||||
Replaces: vmops-agent
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java (>= 1.2.16), libjna-java, wget, jsvc, lsb-base (>= 3.2)
|
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-scripts (= ${source:Version}), libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java (>= 1.2.16), libjna-java, wget, jsvc, lsb-base (>= 3.2)
|
||||||
Description: CloudStack agent
|
Description: CloudStack agent
|
||||||
The CloudStack agent is in charge of managing shared computing resources in
|
The CloudStack agent is in charge of managing shared computing resources in
|
||||||
a CloudStack powered cloud. Install this package if this computer
|
a CloudStack powered cloud. Install this package if this computer
|
||||||
@ -133,9 +104,6 @@ Description: CloudStack system iso
|
|||||||
will participate in your cloud.
|
will participate in your cloud.
|
||||||
|
|
||||||
Package: cloud-usage
|
Package: cloud-usage
|
||||||
Provides: vmops-usage
|
|
||||||
Conflicts: vmops-usage
|
|
||||||
Replaces: vmops-usage
|
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-client (= ${source:Version}), jsvc
|
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-client (= ${source:Version}), jsvc
|
||||||
Description: CloudStack usage monitor
|
Description: CloudStack usage monitor
|
||||||
|
|||||||
489
docs/en-US/citrix-xenserver-installation.xml
Normal file
489
docs/en-US/citrix-xenserver-installation.xml
Normal file
@ -0,0 +1,489 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8' ?>
|
||||||
|
<!DOCTYPE bookinfo 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="citrix-xenserver-installation">
|
||||||
|
<title>Citrix XenServer Installation for &PRODUCT;</title>
|
||||||
|
<para>If you want to use the Citrix XenServer hypervisor to run guest virtual machines, install XenServer 6.0 or XenServer 6.0.2 on the host(s) in your cloud. For an initial installation, follow the steps below. If you have previously installed XenServer and want to upgrade to another version, see <xref linkend="xenserver-version-upgrading" />.</para>
|
||||||
|
<section id="system-requirements-xenserver-hosts">
|
||||||
|
<title>System Requirements for XenServer Hosts</title>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>The host must be certified as compatible with one of the following. See the Citrix Hardware Compatibility Guide: <ulink url="http://hcl.xensource.com">http://hcl.xensource.com</ulink></para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>XenServer 5.6 SP2</para></listitem>
|
||||||
|
<listitem><para>XenServer 6.0</para></listitem>
|
||||||
|
<listitem><para>XenServer 6.0.2</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>All hosts must be 64-bit and must support HVM (Intel-VT or AMD-V enabled in BIOS).</para></listitem>
|
||||||
|
<listitem><para>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>You must re-install Citrix XenServer if you are going to re-use a host from a previous install.</para></listitem>
|
||||||
|
<listitem><para>64-bit x86 CPU (more cores results in better performance)</para></listitem>
|
||||||
|
<listitem><para>Hardware virtualization support required</para></listitem>
|
||||||
|
<listitem><para>4 GB of memory</para></listitem>
|
||||||
|
<listitem><para>36 GB of local disk</para></listitem>
|
||||||
|
<listitem><para>At least 1 NIC</para></listitem>
|
||||||
|
<listitem><para>Statically allocated IP Address</para></listitem>
|
||||||
|
<listitem><para>Be sure all the hotfixes provided by the hypervisor vendor are applied. Track the release of hypervisor patches through your hypervisor vendor’s support channel, and apply patches as soon as possible after they are released. &PRODUCT; will not track or notify you of required hypervisor patches. It is essential that your hosts are completely up to date with the provided hypervisor patches. The hypervisor vendor is likely to refuse to support any system that is not up to date with patches. For more information, see <ulink url="http://docs.cloudstack.org/Knowledge_Base/Possible_VM_corruption_if_XenServer_Hotfix_is_not_Applied/Highly_Recomended_Hotfixes_for_XenServer_5.6_SP2">Highly Recommended Hotfixes for XenServer</ulink> in the &PRODUCT; Knowledge Base.</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
<warning><para>The lack of up-do-date hotfixes can lead to data corruption and lost VMs.</para></warning>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-installation-steps">
|
||||||
|
<title>XenServer Installation Steps</title>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>From <ulink url="https://www.citrix.com/English/ss/downloads/">https://www.citrix.com/English/ss/downloads/</ulink>, download the appropriate version of XenServer for your &PRODUCT; version (see <xref linkend="system-requirements-xenserver-hosts"/>). Install it using the Citrix XenServer Installation Guide.</para></listitem>
|
||||||
|
<listitem><para>After installation, perform the following configuration steps, which are described in the next few sections:</para>
|
||||||
|
<informaltable frame="all">
|
||||||
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||||||
|
<colspec colname="c1" />
|
||||||
|
<colspec colname="c2" />
|
||||||
|
<thead>
|
||||||
|
<row>
|
||||||
|
<entry><para>Required</para></entry>
|
||||||
|
<entry><para>Optional</para></entry>
|
||||||
|
</row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry><para><xref linkend="config-xenserver-dom0-memory" /></para></entry>
|
||||||
|
<entry><para><xref linkend="xenserver-support-pkg-installation" /></para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para><xref linkend="xenserver-username-password" /></para></entry>
|
||||||
|
<entry><para>Set up SR if not using NFS, iSCSI, or local disk; see <xref linkend="xenserver-primary-storage-setup" /></para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para><xref linkend="xenserver-time-sync" /></para></entry>
|
||||||
|
<entry><para><xref linkend="xenserver-iscsi-multipath-setup" /></para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para><xref linkend="xenserver-get-deploy-license" /></para></entry>
|
||||||
|
<entry><para><xref linkend="xenserver-physical-network-setup" /></para></entry>
|
||||||
|
</row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</informaltable>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
<section id="config-xenserver-dom0-memory">
|
||||||
|
<title>Configure XenServer dom0 Memory</title>
|
||||||
|
<para>Configure the XenServer dom0 settings to allocate more memory to dom0. This can enable XenServer to handle larger numbers of virtual machines. We recommend 2940 MB of RAM for XenServer dom0. For instructions on how to do this, see <ulink url="http://support.citrix.com/article/CTX126531">http://support.citrix.com/article/CTX126531</ulink>. The article refers to XenServer 5.6, but the same information applies to XenServer 6.0.</para>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-username-password">
|
||||||
|
<title>Username and Password</title>
|
||||||
|
<para>All XenServers in a cluster must have the same username and password as configured in &PRODUCT;.</para>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-time-sync">
|
||||||
|
<title>Time Synchronization</title>
|
||||||
|
<para>The host must be set to use NTP. All hosts in a pod must have the same time.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Install NTP.</para>
|
||||||
|
<programlisting language="Bash"># yum install ntp</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Edit the NTP configuration file to point to your NTP server.</para>
|
||||||
|
<programlisting language="Bash"># vi /etc/ntp.conf</programlisting>
|
||||||
|
<para>Add one or more server lines in this file with the names of the NTP servers you want to use. For example:</para>
|
||||||
|
<programlisting>
|
||||||
|
server 0.xenserver.pool.ntp.org
|
||||||
|
server 1.xenserver.pool.ntp.org
|
||||||
|
server 2.xenserver.pool.ntp.org
|
||||||
|
server 3.xenserver.pool.ntp.org
|
||||||
|
</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Restart the NTP client.</para>
|
||||||
|
<programlisting language="Bash"># service ntpd restart</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Make sure NTP will start again upon reboot.</para>
|
||||||
|
<programlisting language="Bash"># chkconfig ntpd on</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-licensing">
|
||||||
|
<title>Licensing</title>
|
||||||
|
<para>Citrix XenServer Free version provides 30 days usage without a license. Following the 30 day trial, XenServer requires a free activation and license. You can choose to install a license now or skip this step. If you skip this step, you will need to install a license when you activate and license the XenServer.</para>
|
||||||
|
<section id="xenserver-get-deploy-license">
|
||||||
|
<title>Getting and Deploying a License</title>
|
||||||
|
<para>If you choose to install a license now you will need to use the XenCenter to activate and get a license.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>In XenCenter, click Tools > License manager.</para></listitem>
|
||||||
|
<listitem><para>Select your XenServer and select Activate Free XenServer.</para></listitem>
|
||||||
|
<listitem><para>Request a license.</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
|
<para>You can install the license with XenCenter or using the xe command line tool.</para>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-support-pkg-installation">
|
||||||
|
<title>Install &PRODUCT; XenServer Support Package (CSP)</title>
|
||||||
|
<para>(Optional)</para>
|
||||||
|
<para>To enable security groups, elastic load balancing, and elastic IP on XenServer, download and install the &PRODUCT; XenServer Support Package (CSP). After installing XenServer, perform the following additional steps on each XenServer host.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Download the CSP software onto the XenServer host from one of the following links:</para>
|
||||||
|
<para>For XenServer 6.0.2:</para>
|
||||||
|
<para><ulink url="http://download.cloud.com/releases/3.0.1/XS-6.0.2/xenserver-cloud-supp.tgz">http://download.cloud.com/releases/3.0.1/XS-6.0.2/xenserver-cloud-supp.tgz</ulink></para>
|
||||||
|
<para>For XenServer 5.6 SP2:</para>
|
||||||
|
<para><ulink url="http://download.cloud.com/releases/2.2.0/xenserver-cloud-supp.tgz">http://download.cloud.com/releases/2.2.0/xenserver-cloud-supp.tgz</ulink></para>
|
||||||
|
<para>For XenServer 6.0:</para>
|
||||||
|
<para><ulink url="http://download.cloud.com/releases/3.0/xenserver-cloud-supp.tgz">http://download.cloud.com/releases/3.0/xenserver-cloud-supp.tgz</ulink></para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Extract the file:</para>
|
||||||
|
<programlisting language="Bash"># tar xf xenserver-cloud-supp.tgz</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the following script:</para>
|
||||||
|
<programlisting language="Bash"># xe-install-supplemental-pack xenserver-cloud-supp.iso</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>If the XenServer host is part of a zone that uses basic networking, disable Open vSwitch (OVS):</para>
|
||||||
|
<programlisting language="Bash"># xe-switch-network-backend bridge</programlisting>
|
||||||
|
<para>Restart the host machine when prompted.</para>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
<para>The XenServer host is now ready to be added to &PRODUCT;.</para>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-primary-storage-setup">
|
||||||
|
<title>Primary Storage Setup for XenServer</title>
|
||||||
|
<para>&PRODUCT; natively supports NFS, iSCSI and local storage. If you are using one of these storage types, there is no need to create the XenServer Storage Repository ("SR").</para>
|
||||||
|
<para>If, however, you would like to use storage connected via some other technology, such as FiberChannel, you must set up the SR yourself. To do so, perform the following steps. If you have your hosts in a XenServer pool, perform the steps on the master node. If you are working with a single XenServer which is not part of a cluster, perform the steps on that XenServer.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>Connect FiberChannel cable to all hosts in the cluster and to the FiberChannel storage host.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Rescan the SCSI bus. Either use the following command or use XenCenter to perform an HBA rescan.</para>
|
||||||
|
<programlisting language="Bash"># scsi-rescan</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Repeat step 2 on every host.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Check to be sure you see the new SCSI disk.</para>
|
||||||
|
<programlisting language="Bash"># ls /dev/disk/by-id/scsi-360a98000503365344e6f6177615a516b -l</programlisting>
|
||||||
|
<para>The output should look like this, although the specific file name will be different (scsi-<scsiID>):</para>
|
||||||
|
<programlisting>
|
||||||
|
lrwxrwxrwx 1 root root 9 Mar 16 13:47
|
||||||
|
/dev/disk/by-id/scsi-360a98000503365344e6f6177615a516b -> ../../sdc
|
||||||
|
</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Repeat step 4 on every host.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>On the storage server, run this command to get a unique ID for the new SR.</para>
|
||||||
|
<programlisting language="Bash"># uuidgen</programlisting>
|
||||||
|
<para>The output should look like this, although the specific ID will be different:</para>
|
||||||
|
<programlisting language="Bash">e6849e96-86c3-4f2c-8fcc-350cc711be3d</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Create the FiberChannel SR. In name-label, use the unique ID you just generated.</para>
|
||||||
|
<programlisting>
|
||||||
|
# xe sr-create type=lvmohba shared=true
|
||||||
|
device-config:SCSIid=360a98000503365344e6f6177615a516b
|
||||||
|
name-label="e6849e96-86c3-4f2c-8fcc-350cc711be3d"
|
||||||
|
</programlisting>
|
||||||
|
<para>This command returns a unique ID for the SR, like the following example (your ID will be different):</para>
|
||||||
|
<programlisting language="Bash">7a143820-e893-6c6a-236e-472da6ee66bf</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>To create a human-readable description for the SR, use the following command. In uuid, use the SR ID returned by the previous command. In name-description, set whatever friendly text you prefer.</para>
|
||||||
|
<programlisting language="Bash"># xe sr-param-set uuid=7a143820-e893-6c6a-236e-472da6ee66bf name-description="Fiber Channel storage repository"</programlisting>
|
||||||
|
<para>Make note of the values you will need when you add this storage to &PRODUCT; later (see <xref linkend="primary-storage-add" />). In the Add Primary Storage dialog, in Protocol, you will choose PreSetup. In SR Name-Label, you will enter the name-label you set earlier (in this example, e6849e96-86c3-4f2c-8fcc-350cc711be3d).</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>(Optional) If you want to enable multipath I/O on a FiberChannel SAN, refer to the documentation provided by the SAN vendor.</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-iscsi-multipath-setup">
|
||||||
|
<title>iSCSI Multipath Setup for XenServer (Optional)</title>
|
||||||
|
<para>When setting up the storage repository on a Citrix XenServer, you can enable multipath I/O, which uses redundant physical components to provide greater reliability in the connection between the server and the SAN. To enable multipathing, use a SAN solution that is supported for Citrix servers and follow the procedures in Citrix documentation. The following links provide a starting point:</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para><ulink url="http://support.citrix.com/article/CTX118791">http://support.citrix.com/article/CTX118791</ulink></para></listitem>
|
||||||
|
<listitem><para><ulink url="http://support.citrix.com/article/CTX125403">http://support.citrix.com/article/CTX125403</ulink></para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
<para>You can also ask your SAN vendor for advice about setting up your Citrix repository for multipathing.</para>
|
||||||
|
<para>Make note of the values you will need when you add this storage to the &PRODUCT; later (see <xref linkend="primary-storage-add" />). In the Add Primary Storage dialog, in Protocol, you will choose PreSetup. In SR Name-Label, you will enter the same name used to create the SR.</para>
|
||||||
|
<para>If you encounter difficulty, address the support team for the SAN provided by your vendor. If they are not able to solve your issue, see Contacting Support.</para>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-physical-network-setup">
|
||||||
|
<title>Physical Networking Setup for XenServer</title>
|
||||||
|
<para>Once XenServer has been installed, you may need to do some additional network configuration. At this point in the installation, you should have a plan for what NICs the host will have and what traffic each NIC will carry. The NICs should be cabled as necessary to implement your plan.</para>
|
||||||
|
<para>If you plan on using NIC bonding, the NICs on all hosts in the cluster must be cabled exactly the same. For example, if eth0 is in the private bond on one host in a cluster, then eth0 must be in the private bond on all hosts in the cluster.</para>
|
||||||
|
<para>The IP address assigned for the management network interface must be static. It can be set on the host itself or obtained via static DHCP.</para>
|
||||||
|
<para>&PRODUCT; configures network traffic of various types to use different NICs or bonds on the XenServer host. You can control this process and provide input to the Management Server through the use of XenServer network name labels. The name labels are placed on physical interfaces or bonds and configured in &PRODUCT;. In some simple cases the name labels are not required.</para>
|
||||||
|
<section id="xenserver-public-network-config">
|
||||||
|
<title>Configuring Public Network with a Dedicated NIC for XenServer (Optional)</title>
|
||||||
|
<para>&PRODUCT; supports the use of a second NIC (or bonded pair of NICs, described in <xref linkend="xenserver-nic-bonding" />) for the public network. If bonding is not used, the public network can be on any NIC and can be on different NICs on the hosts in a cluster. For example, the public network can be on eth0 on node A and eth1 on node B. However, the XenServer name-label for the public network must be identical across all hosts. The following examples set the network label to "cloud-public". After the management server is installed and running you must configure it with the name of the chosen network label (e.g. "cloud-public"); this is discussed in <xref linkend="management-server-install-flow" />.</para>
|
||||||
|
<para>If you are using two NICs bonded together to create a public network, see <xref linkend="xenserver-nic-bonding" />.</para>
|
||||||
|
<para>If you are using a single dedicated NIC to provide public network access, follow this procedure on each new host that is added to &PRODUCT; before adding the host.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>Run xe network-list and find the public network. This is usually attached to the NIC that is public. Once you find the network make note of its UUID. Call this <UUID-Public>.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the following command.</para>
|
||||||
|
<programlisting language="Bash"># xe network-param-set name-label=cloud-public uuid=<UUID-Public></programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-multi-guest-network-config">
|
||||||
|
<title>Configuring Multiple Guest Networks for XenServer (Optional)</title>
|
||||||
|
<para>&PRODUCT; supports the use of multiple guest networks with the XenServer hypervisor. Each network is assigned a name-label in XenServer. For example, you might have two networks with the labels "cloud-guest" and "cloud-guest2". After the management server is installed and running, you must add the networks and use these labels so that &PRODUCT; is aware of the networks.</para>
|
||||||
|
<para>Follow this procedure on each new host before adding the host to &PRODUCT;:</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>Run xe network-list and find one of the guest networks. Once you find the network make note of its UUID. Call this <UUID-Guest>.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the following command, substituting your own name-label and uuid values.</para>
|
||||||
|
<programlisting language="Bash"># xe network-param-set name-label=<cloud-guestN> uuid=<UUID-Guest></programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Repeat these steps for each additional guest network, using a different name-label and uuid each time.</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-separate-storage-network">
|
||||||
|
<title>Separate Storage Network for XenServer (Optional)</title>
|
||||||
|
<para>You can optionally set up a separate storage network. This should be done first on the host, before implementing the bonding steps below. This can be done using one or two available NICs. With two NICs bonding may be done as above. It is the administrator's responsibility to set up a separate storage network.</para>
|
||||||
|
<para>Give the storage network a different name-label than what will be given for other networks.</para>
|
||||||
|
<para>For the separate storage network to work correctly, it must be the only interface that can ping the primary storage device's IP address. For example, if eth0 is the management network NIC, ping -I eth0 <primary storage device IP> must fail. In all deployments, secondary storage devices must be pingable from the management network NIC or bond. If a secondary storage device has been placed on the storage network, it must also be pingable via the storage network NIC or bond on the hosts as well.</para>
|
||||||
|
<para>You can set up two separate storage networks as well. For example, if you intend to implement iSCSI multipath, dedicate two non-bonded NICs to multipath. Each of the two networks needs a unique name-label.</para>
|
||||||
|
<para>If no bonding is done, the administrator must set up and name-label the separate storage network on all hosts (masters and slaves).</para>
|
||||||
|
<para>Here is an example to set up eth5 to access a storage network on 172.16.0.0/24.</para>
|
||||||
|
<programlisting>
|
||||||
|
# xe pif-list host-name-label='hostname' device=eth5
|
||||||
|
uuid ( RO) : ab0d3dd4-5744-8fae-9693-a022c7a3471d
|
||||||
|
device ( RO): eth5
|
||||||
|
#xe pif-reconfigure-ip DNS=172.16.3.3 gateway=172.16.0.1 IP=172.16.0.55 mode=static netmask=255.255.255.0 uuid=ab0d3dd4-5744-8fae-9693-a022c7a3471d</programlisting>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-nic-bonding">
|
||||||
|
<title>NIC Bonding for XenServer (Optional)</title>
|
||||||
|
<para>XenServer supports Source Level Balancing (SLB) NIC bonding. Two NICs can be bonded together to carry public, private, and guest traffic, or some combination of these. Separate storage networks are also possible. Here are some example supported configurations:</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>2 NICs on private, 2 NICs on public, 2 NICs on storage</para></listitem>
|
||||||
|
<listitem><para>2 NICs on private, 1 NIC on public, storage uses management network</para></listitem>
|
||||||
|
<listitem><para>2 NICs on private, 2 NICs on public, storage uses management network</para></listitem>
|
||||||
|
<listitem><para>1 NIC for private, public, and storage</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
<para>All NIC bonding is optional.</para>
|
||||||
|
<para>XenServer expects all nodes in a cluster will have the same network cabling and same bonds implemented. In an installation the master will be the first host that was added to the cluster and the slave hosts will be all subsequent hosts added to the cluster. The bonds present on the master set the expectation for hosts added to the cluster later. The procedure to set up bonds on the master and slaves are different, and are described below. There are several important implications of this:</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>You must set bonds on the first host added to a cluster. Then you must use xe commands as below to establish the same bonds in the second and subsequent hosts added to a cluster.</para></listitem>
|
||||||
|
<listitem><para>Slave hosts in a cluster must be cabled exactly the same as the master. For example, if eth0 is in the private bond on the master, it must be in the management network for added slave hosts.</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
<section id="management-network-bonding">
|
||||||
|
<title>Management Network Bonding</title>
|
||||||
|
<para>The administrator must bond the management network NICs prior to adding the host to &PRODUCT;.</para>
|
||||||
|
</section>
|
||||||
|
<section id="first-host-private-bond">
|
||||||
|
<title>Creating a Private Bond on the First Host in the Cluster</title>
|
||||||
|
<para>Use the following steps to create a bond in XenServer. These steps should be run on only the first host in a cluster. This example creates the cloud-private network with two physical NICs (eth0 and eth1) bonded into it.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Find the physical NICs that you want to bond together.</para>
|
||||||
|
<programlisting>
|
||||||
|
# xe pif-list host-name-label='hostname' device=eth0
|
||||||
|
# xe pif-list host-name-label='hostname' device=eth1</programlisting>
|
||||||
|
<para>These command shows the eth0 and eth1 NICs and their UUIDs. Substitute the ethX devices of your choice. Call the UUID's returned by the above command slave1-UUID and slave2-UUID.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Create a new network for the bond. For example, a new network with name "cloud-private".</para>
|
||||||
|
<para><emphasis role="bold">This label is important. &PRODUCT; looks for a network by a name you configure. You must use the same name-label for all hosts in the cloud for the management network.</emphasis></para>
|
||||||
|
<programlisting>
|
||||||
|
# xe network-create name-label=cloud-private
|
||||||
|
# xe bond-create network-uuid=[uuid of cloud-private created above]
|
||||||
|
pif-uuids=[slave1-uuid],[slave2-uuid]</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
<para>Now you have a bonded pair that can be recognized by &PRODUCT; as the management network.</para>
|
||||||
|
</section>
|
||||||
|
<section id="public-network-bonding">
|
||||||
|
<title>Public Network Bonding</title>
|
||||||
|
<para>Bonding can be implemented on a separate, public network. The administrator is responsible for creating a bond for the public network if that network will be bonded and will be separate from the management network.</para>
|
||||||
|
</section>
|
||||||
|
<section id="first-host-public-network-bond">
|
||||||
|
<title>Creating a Public Bond on the First Host in the Cluster</title>
|
||||||
|
<para>These steps should be run on only the first host in a cluster. This example creates the cloud-public network with two physical NICs (eth2 and eth3) bonded into it.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Find the physical NICs that you want to bond together.</para>
|
||||||
|
<programlisting>
|
||||||
|
#xe pif-list host-name-label='hostname' device=eth2
|
||||||
|
# xe pif-list host-name-label='hostname' device=eth3</programlisting>
|
||||||
|
<para>These command shows the eth2 and eth3 NICs and their UUIDs. Substitute the ethX devices of your choice. Call the UUID's returned by the above command slave1-UUID and slave2-UUID.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Create a new network for the bond. For example, a new network with name "cloud-public".</para>
|
||||||
|
<para><emphasis role="bold">This label is important. &PRODUCT; looks for a network by a name you configure. You must use the same name-label for all hosts in the cloud for the public network.</emphasis></para>
|
||||||
|
<programlisting>
|
||||||
|
# xe network-create name-label=cloud-public
|
||||||
|
# xe bond-create network-uuid=[uuid of cloud-public created above]
|
||||||
|
pif-uuids=[slave1-uuid],[slave2-uuid]</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
<para>Now you have a bonded pair that can be recognized by &PRODUCT; as the public network.</para>
|
||||||
|
</section>
|
||||||
|
<section id="adding-more-hosts">
|
||||||
|
<title>Adding More Hosts to the Cluster</title>
|
||||||
|
<para>With the bonds (if any) established on the master, you should add additional, slave hosts. Run the following command for all additional hosts to be added to the cluster. This will cause the host to join the master in a single XenServer pool.</para>
|
||||||
|
<programlisting>
|
||||||
|
# xe pool-join master-address=[master IP] master-username=root
|
||||||
|
master-password=[your password]</programlisting>
|
||||||
|
</section>
|
||||||
|
<section id="complete-bonding-setup">
|
||||||
|
<title>Complete the Bonding Setup Across the Cluster</title>
|
||||||
|
<para>With all hosts added to the pool, run the cloud-setup-bond script. This script will complete the configuration and set up of the bonds across all hosts in the cluster.</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>Copy the script from the Management Server in /usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh to the master host and ensure it is executable.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the script:</para>
|
||||||
|
<programlisting language="Bash"># ./cloud-setup-bonding.sh</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
<para>Now the bonds are set up and configured properly across the cluster.</para>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="xenserver-version-upgrading">
|
||||||
|
<title>Upgrading XenServer Versions</title>
|
||||||
|
<para>This section tells how to upgrade XenServer software on &PRODUCT; hosts. The actual upgrade is described in XenServer documentation, but there are some additional steps you must perform before and after the upgrade.</para>
|
||||||
|
<note><para>Be sure the hardware is certified compatible with the new version of XenServer.</para></note>
|
||||||
|
<para>To upgrade XenServer:</para>
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Upgrade the database. On the Management Server node:</para>
|
||||||
|
<orderedlist numeration="loweralpha">
|
||||||
|
<listitem>
|
||||||
|
<para>Back up the database:</para>
|
||||||
|
<programlisting>
|
||||||
|
# mysqldump --user=root --databases cloud > cloud.backup.sql
|
||||||
|
# mysqldump --user=root --databases cloud_usage > cloud_usage.backup.sql</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>You might need to change the OS type settings for VMs running on the upgraded hosts.</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>If you upgraded from XenServer 5.6 GA to XenServer 5.6 SP2, change any VMs that have the OS type CentOS 5.5 (32-bit), Oracle Enterprise Linux 5.5 (32-bit), or Red Hat Enterprise Linux 5.5 (32-bit) to Other Linux (32-bit). Change any VMs that have the 64-bit versions of these same OS types to Other Linux (64-bit).</para></listitem>
|
||||||
|
<listitem><para>If you upgraded from XenServer 5.6 SP2 to XenServer 6.0.2, change any VMs that have the OS type CentOS 5.6 (32-bit), CentOS 5.7 (32-bit), Oracle Enterprise Linux 5.6 (32-bit), Oracle Enterprise Linux 5.7 (32-bit), Red Hat Enterprise Linux 5.6 (32-bit) , or Red Hat Enterprise Linux 5.7 (32-bit) to Other Linux (32-bit). Change any VMs that have the 64-bit versions of these same OS types to Other Linux (64-bit).</para></listitem>
|
||||||
|
<listitem><para>If you upgraded from XenServer 5.6 to XenServer 6.0.2, do all of the above.</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Restart the Management Server and Usage Server. You only need to do this once for all clusters.</para>
|
||||||
|
<programlisting>
|
||||||
|
# service cloud-management start
|
||||||
|
# service cloud-usage start</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Disconnect the XenServer cluster from &PRODUCT;.</para>
|
||||||
|
<orderedlist numeration="loweralpha">
|
||||||
|
<listitem><para>Log in to the &PRODUCT; UI as root.</para></listitem>
|
||||||
|
<listitem><para>Navigate to the XenServer cluster, and click Actions – Unmanage.</para></listitem>
|
||||||
|
<listitem><para>Watch the cluster status until it shows Unmanaged.</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Log in to one of the hosts in the cluster, and run this command to clean up the VLAN:</para>
|
||||||
|
<programlisting language="Bash"># . /opt/xensource/bin/cloud-clean-vlan.sh</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Still logged in to the host, run the upgrade preparation script:</para>
|
||||||
|
<programlisting language="Bash"># /opt/xensource/bin/cloud-prepare-upgrade.sh</programlisting>
|
||||||
|
<para>Troubleshooting: If you see the error "can't eject CD," log in to the VM and umount the CD, then run the script again.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Upgrade the XenServer software on all hosts in the cluster. Upgrade the master first.</para>
|
||||||
|
<orderedlist numeration="loweralpha">
|
||||||
|
<listitem>
|
||||||
|
<para>Live migrate all VMs on this host to other hosts. See the instructions for live migration in the Administrator's Guide.</para>
|
||||||
|
<para>Troubleshooting: You might see the following error when you migrate a VM:</para>
|
||||||
|
<programlisting>
|
||||||
|
[root@xenserver-qa-2-49-4 ~]# xe vm-migrate live=true host=xenserver-qa-2-49-5 vm=i-2-8-VM
|
||||||
|
You attempted an operation on a VM which requires PV drivers to be installed but the drivers were not detected.
|
||||||
|
vm: b6cf79c8-02ee-050b-922f-49583d9f1a14 (i-2-8-VM)</programlisting>
|
||||||
|
<para>To solve this issue, run the following:</para>
|
||||||
|
<programlisting language="Bash"># /opt/xensource/bin/make_migratable.sh b6cf79c8-02ee-050b-922f-49583d9f1a14</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Reboot the host.</para></listitem>
|
||||||
|
<listitem><para>Upgrade to the newer version of XenServer. Use the steps in XenServer documentation.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>After the upgrade is complete, copy the following files from the management server to this host, in the directory locations shown below:</para>
|
||||||
|
<informaltable frame="all">
|
||||||
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||||||
|
<colspec colname="c1" />
|
||||||
|
<colspec colname="c2" />
|
||||||
|
<thead>
|
||||||
|
<row>
|
||||||
|
<entry><para>Copy this Management Server file...</para></entry>
|
||||||
|
<entry><para>...to this location on the XenServer host</para></entry>
|
||||||
|
</row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry><para>/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py</para></entry>
|
||||||
|
<entry><para>/opt/xensource/sm/NFSSR.py</para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para>/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/setupxenserver.sh</para></entry>
|
||||||
|
<entry><para>/opt/xensource/bin/setupxenserver.sh</para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para>/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/make_migratable.sh</para></entry>
|
||||||
|
<entry><para>/opt/xensource/bin/make_migratable.sh</para></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><para>/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh</para></entry>
|
||||||
|
<entry><para>/opt/xensource/bin/cloud-clean-vlan.sh</para></entry>
|
||||||
|
</row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</informaltable>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the following script:</para>
|
||||||
|
<programlisting language="Bash"># /opt/xensource/bin/setupxenserver.sh</programlisting>
|
||||||
|
<para>Troubleshooting: If you see the following error message, you can safely ignore it.</para>
|
||||||
|
<programlisting language="Bash">mv: cannot stat `/etc/cron.daily/logrotate': No such file or directory</programlisting>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Plug in the storage repositories (physical block devices) to the XenServer host:</para>
|
||||||
|
<programlisting language="Bash"># for pbd in `xe pbd-list currently-attached=false| grep ^uuid | awk '{print $NF}'`; do xe pbd-plug uuid=$pbd ; done</programlisting>
|
||||||
|
<para>Note: If you add a host to this XenServer pool, you need to migrate all VMs on this host to other hosts, and eject this host from XenServer pool.</para>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Repeat these steps to upgrade every host in the cluster to the same version of XenServer.</para></listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Run the following command on one host in the XenServer cluster to clean up the host tags:</para>
|
||||||
|
<programlisting language="Bash"># for host in $(xe host-list | grep ^uuid | awk '{print $NF}') ; do xe host-param-clear uuid=$host param-name=tags; done;</programlisting>
|
||||||
|
<note><para>When copying and pasting a command, be sure the command has pasted as a single line before executing. Some document viewers may introduce unwanted line breaks in copied text.</para></note>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Reconnect the XenServer cluster to &PRODUCT;.</para>
|
||||||
|
<orderedlist numeration="loweralpha">
|
||||||
|
<listitem><para>Log in to the &PRODUCT; UI as root.</para></listitem>
|
||||||
|
<listitem><para>Navigate to the XenServer cluster, and click Actions – Manage.</para></listitem>
|
||||||
|
<listitem><para>Watch the status to see that all the hosts come up.</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>After all hosts are up, run the following on one host in the cluster:</para>
|
||||||
|
<programlisting language="Bash"># /opt/xensource/bin/cloud-clean-vlan.sh</programlisting>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
@ -32,4 +32,5 @@
|
|||||||
<xi:include href="primary-storage-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
<xi:include href="primary-storage-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||||
<xi:include href="secondary-storage-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
<xi:include href="secondary-storage-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||||
<xi:include href="initialize-and-test.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
<xi:include href="initialize-and-test.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||||
</chapter>
|
<xi:include href="citrix-xenserver-installation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||||
|
</section>
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.libvirt</groupId>
|
<groupId>org.libvirt</groupId>
|
||||||
<artifactId>libvirt</artifactId>
|
<artifactId>libvirt</artifactId>
|
||||||
<version>0.4.8</version>
|
<version>0.4.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -1534,8 +1534,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
result = _virtRouterResource.assignPublicIpAddress(routerName,
|
result = _virtRouterResource.assignPublicIpAddress(routerName,
|
||||||
routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(),
|
routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(),
|
||||||
ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(),
|
ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(),
|
||||||
ip.getVlanNetmask(), ip.getVifMacAddress(),
|
ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum);
|
||||||
ip.getGuestIp(), nicNum);
|
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
results[i++] = IpAssocAnswer.errorResult;
|
results[i++] = IpAssocAnswer.errorResult;
|
||||||
@ -2586,8 +2585,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
for (DiskDef disk : disks) {
|
for (DiskDef disk : disks) {
|
||||||
if (disk.getDeviceType() == DiskDef.deviceType.CDROM
|
if (disk.getDeviceType() == DiskDef.deviceType.CDROM
|
||||||
&& disk.getDiskPath() != null)
|
&& disk.getDiskPath() != null) {
|
||||||
cleanupDisk(conn, disk);
|
cleanupDisk(conn, disk);
|
||||||
|
} else if (disk.getDiskPath().contains(vmName + "-patchdisk")
|
||||||
|
&& vmName.matches("^[rsv]-\\d+-VM$")) {
|
||||||
|
if (!_storagePoolMgr.deleteVbdByPath(disk.getDiskPath())) {
|
||||||
|
s_logger.warn("failed to delete patch disk " + disk.getDiskPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2621,9 +2626,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
String result = null;
|
String result = null;
|
||||||
if (!sshKeysDir.exists()) {
|
if (!sshKeysDir.exists()) {
|
||||||
sshKeysDir.mkdir();
|
sshKeysDir.mkdir();
|
||||||
// Change permissions for the 600
|
// Change permissions for the 700
|
||||||
Script script = new Script("chmod", _timeout, s_logger);
|
Script script = new Script("chmod", _timeout, s_logger);
|
||||||
script.add("600", _SSHKEYSPATH);
|
script.add("700", _SSHKEYSPATH);
|
||||||
script.execute();
|
script.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2948,29 +2953,45 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
List<DiskDef> disks = vm.getDevices().getDisks();
|
List<DiskDef> disks = vm.getDevices().getDisks();
|
||||||
DiskDef rootDisk = disks.get(0);
|
DiskDef rootDisk = disks.get(0);
|
||||||
VolumeTO rootVol = getVolume(vmSpec, Volume.Type.ROOT);
|
VolumeTO rootVol = getVolume(vmSpec, Volume.Type.ROOT);
|
||||||
KVMStoragePool pool = _storagePoolMgr.getStoragePool(rootVol
|
String patchName = vmName + "-patchdisk";
|
||||||
.getPoolUuid());
|
KVMStoragePool pool = _storagePoolMgr.getStoragePool(rootVol.getPoolUuid());
|
||||||
KVMPhysicalDisk disk = pool.createPhysicalDisk(UUID.randomUUID()
|
String patchDiskPath = pool.getLocalPath() + "/" + patchName;
|
||||||
.toString(), KVMPhysicalDisk.PhysicalDiskFormat.RAW,
|
|
||||||
|
List<KVMPhysicalDisk> phyDisks = pool.listPhysicalDisks();
|
||||||
|
boolean foundDisk = false;
|
||||||
|
|
||||||
|
for (KVMPhysicalDisk phyDisk : phyDisks) {
|
||||||
|
if (phyDisk.getPath().equals(patchDiskPath)) {
|
||||||
|
foundDisk = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundDisk) {
|
||||||
|
s_logger.debug("generating new patch disk for " + vmName + " since none was found");
|
||||||
|
KVMPhysicalDisk disk = pool.createPhysicalDisk(patchName, KVMPhysicalDisk.PhysicalDiskFormat.RAW,
|
||||||
10L * 1024 * 1024);
|
10L * 1024 * 1024);
|
||||||
|
} else {
|
||||||
|
s_logger.debug("found existing patch disk at " + patchDiskPath + " using it for " + vmName);
|
||||||
|
}
|
||||||
|
|
||||||
/* Format/create fs on this disk */
|
/* Format/create fs on this disk */
|
||||||
final Script command = new Script(_createvmPath, _timeout, s_logger);
|
final Script command = new Script(_createvmPath, _timeout, s_logger);
|
||||||
command.add("-f", disk.getPath());
|
command.add("-f", patchDiskPath);
|
||||||
String result = command.execute();
|
String result = command.execute();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
s_logger.debug("Failed to create data disk: " + result);
|
s_logger.debug("Failed to create data disk: " + result);
|
||||||
throw new InternalErrorException("Failed to create data disk: "
|
throw new InternalErrorException("Failed to create data disk: "
|
||||||
+ result);
|
+ result);
|
||||||
}
|
}
|
||||||
String datadiskPath = disk.getPath();
|
|
||||||
|
|
||||||
/* add patch disk */
|
/* add patch disk */
|
||||||
DiskDef patchDisk = new DiskDef();
|
DiskDef patchDisk = new DiskDef();
|
||||||
|
|
||||||
if (pool.getType() == StoragePoolType.CLVM) {
|
if (pool.getType() == StoragePoolType.CLVM) {
|
||||||
patchDisk.defBlockBasedDisk(datadiskPath, 1, rootDisk.getBusType());
|
patchDisk.defBlockBasedDisk(patchDiskPath, 1, rootDisk.getBusType());
|
||||||
} else {
|
} else {
|
||||||
patchDisk.defFileBasedDisk(datadiskPath, 1, rootDisk.getBusType(),
|
patchDisk.defFileBasedDisk(patchDiskPath, 1, rootDisk.getBusType(),
|
||||||
DiskDef.diskFmtType.RAW);
|
DiskDef.diskFmtType.RAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2978,7 +2999,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
|
|
||||||
String bootArgs = vmSpec.getBootArgs();
|
String bootArgs = vmSpec.getBootArgs();
|
||||||
|
|
||||||
patchSystemVm(bootArgs, datadiskPath, vmName);
|
patchSystemVm(bootArgs, patchDiskPath, vmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createVif(LibvirtVMDef vm, NicTO nic)
|
private void createVif(LibvirtVMDef vm, NicTO nic)
|
||||||
|
|||||||
@ -73,6 +73,10 @@ public class KVMStoragePoolManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean deleteVbdByPath(String diskPath) {
|
||||||
|
return this._storageAdaptor.deleteVbdByPath(diskPath);
|
||||||
|
}
|
||||||
|
|
||||||
public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String name,
|
public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String name,
|
||||||
KVMStoragePool destPool) {
|
KVMStoragePool destPool) {
|
||||||
if (destPool.getType() == StoragePoolType.RBD) {
|
if (destPool.getType() == StoragePoolType.RBD) {
|
||||||
|
|||||||
@ -882,4 +882,21 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean deleteVbdByPath(String diskPath) {
|
||||||
|
Connect conn;
|
||||||
|
try {
|
||||||
|
conn = LibvirtConnection.getConnection();
|
||||||
|
StorageVol vol = conn.storageVolLookupByPath(diskPath);
|
||||||
|
if(vol != null) {
|
||||||
|
s_logger.debug("requested delete disk " + diskPath);
|
||||||
|
vol.delete(0);
|
||||||
|
}
|
||||||
|
} catch (LibvirtException e) {
|
||||||
|
s_logger.debug("Libvirt error in attempting to find and delete patch disk:" + e.toString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,4 +65,6 @@ public interface StorageAdaptor {
|
|||||||
|
|
||||||
public boolean createFolder(String uuid, String path);
|
public boolean createFolder(String uuid, String path);
|
||||||
|
|
||||||
|
public boolean deleteVbdByPath(String path);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1365,7 +1365,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void assignPublicIpAddress(VirtualMachineMO vmMo, final String vmName, final String privateIpAddress, final String publicIpAddress, final boolean add, final boolean firstIP,
|
protected void assignPublicIpAddress(VirtualMachineMO vmMo, final String vmName, final String privateIpAddress, final String publicIpAddress, final boolean add, final boolean firstIP,
|
||||||
final boolean sourceNat, final String vlanId, final String vlanGateway, final String vlanNetmask, final String vifMacAddress, String guestIp) throws Exception {
|
final boolean sourceNat, final String vlanId, final String vlanGateway, final String vlanNetmask, final String vifMacAddress) throws Exception {
|
||||||
|
|
||||||
String publicNeworkName = HypervisorHostHelper.getPublicNetworkNamePrefix(vlanId);
|
String publicNeworkName = HypervisorHostHelper.getPublicNetworkNamePrefix(vlanId);
|
||||||
Pair<Integer, VirtualDevice> publicNicInfo = vmMo.getNicDeviceIndex(publicNeworkName);
|
Pair<Integer, VirtualDevice> publicNicInfo = vmMo.getNicDeviceIndex(publicNeworkName);
|
||||||
@ -1570,7 +1570,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||||||
|
|
||||||
for (IpAddressTO ip : ips) {
|
for (IpAddressTO ip : ips) {
|
||||||
assignPublicIpAddress(vmMo, routerName, controlIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),
|
assignPublicIpAddress(vmMo, routerName, controlIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),
|
||||||
ip.getVifMacAddress(), ip.getGuestIp());
|
ip.getVifMacAddress());
|
||||||
results[i++] = ip.getPublicIp() + " - success";
|
results[i++] = ip.getPublicIp() + " - success";
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|||||||
@ -1849,7 +1849,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
|||||||
|
|
||||||
|
|
||||||
protected void assignPublicIpAddress(Connection conn, String vmName, String privateIpAddress, String publicIpAddress, boolean add, boolean firstIP,
|
protected void assignPublicIpAddress(Connection conn, String vmName, String privateIpAddress, String publicIpAddress, boolean add, boolean firstIP,
|
||||||
boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp, Integer networkRate, TrafficType trafficType, String name) throws InternalErrorException {
|
boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, Integer networkRate, TrafficType trafficType, String name) throws InternalErrorException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
VM router = getVM(conn, vmName);
|
VM router = getVM(conn, vmName);
|
||||||
@ -2028,7 +2028,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
|||||||
for (IpAddressTO ip : ips) {
|
for (IpAddressTO ip : ips) {
|
||||||
|
|
||||||
assignPublicIpAddress(conn, routerName, routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(),
|
assignPublicIpAddress(conn, routerName, routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(),
|
||||||
ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(), ip.getGuestIp(), ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName());
|
ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(), ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName());
|
||||||
results[i++] = ip.getPublicIp() + " - success";
|
results[i++] = ip.getPublicIp() + " - success";
|
||||||
}
|
}
|
||||||
} catch (InternalErrorException e) {
|
} catch (InternalErrorException e) {
|
||||||
|
|||||||
@ -464,7 +464,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan
|
|||||||
@Override
|
@Override
|
||||||
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
||||||
// return true, as IP will be associated as part of LB rule configuration
|
// return true, as IP will be associated as part of LB rule configuration
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -543,7 +543,7 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
||||||
// TODO Auto-generated method stub
|
// return true, as IP will be associated as part of static NAT/port forwarding rule configuration
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -617,7 +617,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl
|
|||||||
@Override
|
@Override
|
||||||
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> service) throws ResourceUnavailableException {
|
||||||
// return true, as IP will be associated as part of LB rule configuration
|
// return true, as IP will be associated as part of LB rule configuration
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -14,23 +14,7 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
/**
|
|
||||||
* Copyright (C) 2012 Cloud.com, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is licensed under the GNU General Public License v3 or later.
|
|
||||||
*
|
|
||||||
* It is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package com.cloud.network.ovs;
|
package com.cloud.network.ovs;
|
||||||
|
|
||||||
import com.cloud.agent.api.Command;
|
import com.cloud.agent.api.Command;
|
||||||
|
|||||||
@ -14,23 +14,7 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
/**
|
|
||||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is licensed under the GNU General Public License v3 or later.
|
|
||||||
*
|
|
||||||
* It is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.cloud.network.ovs;
|
package com.cloud.network.ovs;
|
||||||
|
|
||||||
|
|||||||
@ -14,23 +14,6 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
/**
|
|
||||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is licensed under the GNU General Public License v3 or later.
|
|
||||||
*
|
|
||||||
* It is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.cloud.network.ovs;
|
package com.cloud.network.ovs;
|
||||||
|
|
||||||
|
|||||||
@ -14,23 +14,6 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
/**
|
|
||||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is licensed under the GNU General Public License v3 or later.
|
|
||||||
*
|
|
||||||
* It is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.cloud.network.ovs;
|
package com.cloud.network.ovs;
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$dflag" != 1]; then
|
if [ "$dflag" != 1 ]; then
|
||||||
dbPassword=$(sed '/^\#/d' /etc/cloud/management/db.properties | grep 'db.cloud.password' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'i )
|
dbPassword=$(sed '/^\#/d' /etc/cloud/management/db.properties | grep 'db.cloud.password' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'i )
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -14,23 +14,6 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
/**
|
|
||||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is licensed under the GNU General Public License v3 or later.
|
|
||||||
*
|
|
||||||
* It is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.cloud.async;
|
package com.cloud.async;
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,7 @@ public enum Config {
|
|||||||
EnableEC2API("Advanced", ManagementServer.class, Boolean.class, "enable.ec2.api", "false", "enable EC2 API on CloudStack", null),
|
EnableEC2API("Advanced", ManagementServer.class, Boolean.class, "enable.ec2.api", "false", "enable EC2 API on CloudStack", null),
|
||||||
EnableS3API("Advanced", ManagementServer.class, Boolean.class, "enable.s3.api", "false", "enable Amazon S3 API on CloudStack", null),
|
EnableS3API("Advanced", ManagementServer.class, Boolean.class, "enable.s3.api", "false", "enable Amazon S3 API on CloudStack", null),
|
||||||
RecreateSystemVmEnabled("Advanced", ManagementServer.class, Boolean.class, "recreate.systemvm.enabled", "false", "If true, will recreate system vm root disk whenever starting system vm", "true,false"),
|
RecreateSystemVmEnabled("Advanced", ManagementServer.class, Boolean.class, "recreate.systemvm.enabled", "false", "If true, will recreate system vm root disk whenever starting system vm", "true,false"),
|
||||||
|
IncorrectLoginAttemptsAllowed("Advanced", ManagementServer.class, Integer.class, "incorrect.login.attempts.allowed", "5", "Incorrect login attempts allowed before the user is disabled", null),
|
||||||
// Ovm
|
// Ovm
|
||||||
OvmPublicNetwork("Hidden", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null),
|
OvmPublicNetwork("Hidden", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null),
|
||||||
OvmPrivateNetwork("Hidden", ManagementServer.class, String.class, "ovm.private.network.device", null, "Specify the private bridge on host for private network", null),
|
OvmPrivateNetwork("Hidden", ManagementServer.class, String.class, "ovm.private.network.device", null, "Specify the private bridge on host for private network", null),
|
||||||
|
|||||||
@ -274,6 +274,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||||||
configValuesForValidation.add("storage.cleanup.interval");
|
configValuesForValidation.add("storage.cleanup.interval");
|
||||||
configValuesForValidation.add("wait");
|
configValuesForValidation.add("wait");
|
||||||
configValuesForValidation.add("xen.heartbeat.interval");
|
configValuesForValidation.add("xen.heartbeat.interval");
|
||||||
|
configValuesForValidation.add("incorrect.login.attempts.allowed");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -413,7 +413,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||||||
// Get network rate
|
// Get network rate
|
||||||
Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
|
Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
|
||||||
|
|
||||||
IpAddressTO ip = new IpAddressTO(account.getAccountId(), sourceNatIpAddress, add, false, !sharedSourceNat, publicVlanTag, null, null, null, null, networkRate, false);
|
IpAddressTO ip = new IpAddressTO(account.getAccountId(), sourceNatIpAddress, add, false, !sharedSourceNat, publicVlanTag, null, null, null, networkRate, false);
|
||||||
IpAddressTO[] ips = new IpAddressTO[1];
|
IpAddressTO[] ips = new IpAddressTO[1];
|
||||||
ips[0] = ip;
|
ips[0] = ip;
|
||||||
IpAssocCommand cmd = new IpAssocCommand(ips);
|
IpAssocCommand cmd = new IpAssocCommand(ips);
|
||||||
|
|||||||
@ -946,7 +946,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
|
|||||||
selfIp = selfipNic.getIp4Address();
|
selfIp = selfipNic.getIp4Address();
|
||||||
}
|
}
|
||||||
|
|
||||||
IpAddressTO ip = new IpAddressTO(guestConfig.getAccountId(), null, add, false, true, String.valueOf(guestVlanTag), selfIp, guestVlanNetmask, null, null, networkRate, false);
|
IpAddressTO ip = new IpAddressTO(guestConfig.getAccountId(), null, add, false, true, String.valueOf(guestVlanTag), selfIp, guestVlanNetmask, null, networkRate, false);
|
||||||
IpAddressTO[] ips = new IpAddressTO[1];
|
IpAddressTO[] ips = new IpAddressTO[1];
|
||||||
ips[0] = ip;
|
ips[0] = ip;
|
||||||
IpAssocCommand cmd = new IpAssocCommand(ips);
|
IpAssocCommand cmd = new IpAssocCommand(ips);
|
||||||
|
|||||||
@ -2654,10 +2654,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||||||
String vlanNetmask = ipAddr.getNetmask();
|
String vlanNetmask = ipAddr.getNetmask();
|
||||||
String vifMacAddress = ipAddr.getMacAddress();
|
String vifMacAddress = ipAddr.getMacAddress();
|
||||||
|
|
||||||
String vmGuestAddress = null;
|
|
||||||
|
|
||||||
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, firstIP,
|
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, firstIP,
|
||||||
sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, vmGuestAddress, networkRate, ipAddr.isOneToOneNat());
|
sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, networkRate, ipAddr.isOneToOneNat());
|
||||||
|
|
||||||
ip.setTrafficType(network.getTrafficType());
|
ip.setTrafficType(network.getTrafficType());
|
||||||
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
||||||
|
|||||||
@ -497,7 +497,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
|
|
||||||
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false,
|
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false,
|
||||||
ipAddr.isSourceNat(), ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(), macAddress,
|
ipAddr.isSourceNat(), ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(), macAddress,
|
||||||
null, networkRate, ipAddr.isOneToOneNat());
|
networkRate, ipAddr.isOneToOneNat());
|
||||||
|
|
||||||
ip.setTrafficType(network.getTrafficType());
|
ip.setTrafficType(network.getTrafficType());
|
||||||
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
||||||
@ -1172,7 +1172,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
Network network = _networkMgr.getNetwork(ipAddr.getNetworkId());
|
Network network = _networkMgr.getNetwork(ipAddr.getNetworkId());
|
||||||
IpAddressTO ip = new IpAddressTO(Account.ACCOUNT_ID_SYSTEM, ipAddr.getIpAddress(), add, false,
|
IpAddressTO ip = new IpAddressTO(Account.ACCOUNT_ID_SYSTEM, ipAddr.getIpAddress(), add, false,
|
||||||
false, ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(), ipAddr.getMacAddress(),
|
false, ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(), ipAddr.getMacAddress(),
|
||||||
null, null, false);
|
null, false);
|
||||||
|
|
||||||
ip.setTrafficType(network.getTrafficType());
|
ip.setTrafficType(network.getTrafficType());
|
||||||
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
|
||||||
|
|||||||
@ -158,6 +158,7 @@ public class SecurityGroupWorkDaoImpl extends GenericDaoBase<SecurityGroupWorkVO
|
|||||||
|
|
||||||
final List<SecurityGroupWorkVO> vos = lockRows(sc, filter, true);
|
final List<SecurityGroupWorkVO> vos = lockRows(sc, filter, true);
|
||||||
if (vos.size() == 0) {
|
if (vos.size() == 0) {
|
||||||
|
txn.commit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SecurityGroupWorkVO work = vos.get(0);
|
SecurityGroupWorkVO work = vos.get(0);
|
||||||
@ -183,6 +184,7 @@ public class SecurityGroupWorkDaoImpl extends GenericDaoBase<SecurityGroupWorkVO
|
|||||||
|
|
||||||
SecurityGroupWorkVO work = lockRow(workId, true);
|
SecurityGroupWorkVO work = lockRow(workId, true);
|
||||||
if (work == null) {
|
if (work == null) {
|
||||||
|
txn.commit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
work.setStep(step);
|
work.setStep(step);
|
||||||
|
|||||||
@ -81,6 +81,7 @@ public class Criteria {
|
|||||||
public static final String STORAGE_ID="storageid";
|
public static final String STORAGE_ID="storageid";
|
||||||
public static final String TEMPLATE_ID = "templateid";
|
public static final String TEMPLATE_ID = "templateid";
|
||||||
public static final String ISO_ID = "isoid";
|
public static final String ISO_ID = "isoid";
|
||||||
|
public static final String VPC_ID = "vpcId";
|
||||||
|
|
||||||
public Criteria(String orderBy, Boolean ascending, Long offset, Long limit) {
|
public Criteria(String orderBy, Boolean ascending, Long offset, Long limit) {
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
|
|||||||
@ -224,6 +224,8 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
|
|
||||||
private final ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AccountChecker"));
|
private final ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AccountChecker"));
|
||||||
|
|
||||||
|
int _allowedLoginAttempts;
|
||||||
|
|
||||||
UserVO _systemUser;
|
UserVO _systemUser;
|
||||||
AccountVO _systemAccount;
|
AccountVO _systemAccount;
|
||||||
@Inject(adapter = SecurityChecker.class)
|
@Inject(adapter = SecurityChecker.class)
|
||||||
@ -248,6 +250,9 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
|
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
|
||||||
Map<String, String> configs = configDao.getConfiguration(params);
|
Map<String, String> configs = configDao.getConfiguration(params);
|
||||||
|
|
||||||
|
String loginAttempts = configs.get(Config.IncorrectLoginAttemptsAllowed.key());
|
||||||
|
_allowedLoginAttempts = NumbersUtil.parseInt(loginAttempts, 5);
|
||||||
|
|
||||||
String value = configs.get(Config.AccountCleanupInterval.key());
|
String value = configs.get(Config.AccountCleanupInterval.key());
|
||||||
_cleanupInterval = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 day.
|
_cleanupInterval = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 day.
|
||||||
|
|
||||||
@ -302,6 +307,13 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
return (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN);
|
return (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInternalAccount(short accountType) {
|
||||||
|
if (isRootAdmin(accountType) || (accountType == Account.ACCOUNT_ID_SYSTEM)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkAccess(Account caller, Domain domain) throws PermissionDeniedException {
|
public void checkAccess(Account caller, Domain domain) throws PermissionDeniedException {
|
||||||
for (SecurityChecker checker : _securityCheckers) {
|
for (SecurityChecker checker : _securityCheckers) {
|
||||||
@ -420,6 +432,25 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DB
|
||||||
|
public void updateLoginAttempts(Long id, int attempts, boolean toDisable) {
|
||||||
|
Transaction txn = Transaction.currentTxn();
|
||||||
|
txn.start();
|
||||||
|
try {
|
||||||
|
UserAccountVO user = null;
|
||||||
|
user = _userAccountDao.lockRow(id, true);
|
||||||
|
user.setLoginAttempts(attempts);
|
||||||
|
if(toDisable) {
|
||||||
|
user.setState(State.disabled.toString());
|
||||||
|
}
|
||||||
|
_userAccountDao.update(id, user);
|
||||||
|
txn.commit();
|
||||||
|
} catch (Exception e) {
|
||||||
|
s_logger.error("Failed to update login attempts for user with id " + id );
|
||||||
|
}
|
||||||
|
txn.close();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean doSetUserStatus(long userId, State state) {
|
private boolean doSetUserStatus(long userId, State state) {
|
||||||
UserVO userForUpdate = _userDao.createForUpdate();
|
UserVO userForUpdate = _userDao.createForUpdate();
|
||||||
userForUpdate.setState(state);
|
userForUpdate.setState(state);
|
||||||
@ -1002,6 +1033,8 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
txn.commit();
|
txn.commit();
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
// whenever the user is successfully enabled, reset the login attempts to zero
|
||||||
|
updateLoginAttempts(userId, 0, false);
|
||||||
return _userAccountDao.findById(userId);
|
return _userAccountDao.findById(userId);
|
||||||
} else {
|
} else {
|
||||||
throw new CloudRuntimeException("Unable to enable user " + userId);
|
throw new CloudRuntimeException("Unable to enable user " + userId);
|
||||||
@ -1818,11 +1851,36 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||||||
throw new CloudAuthenticationException("User " + username + " in domain " + domainName + " is disabled/locked (or account is disabled/locked)");
|
throw new CloudAuthenticationException("User " + username + " in domain " + domainName + " is disabled/locked (or account is disabled/locked)");
|
||||||
// return null;
|
// return null;
|
||||||
}
|
}
|
||||||
|
// Whenever the user is able to log in successfully, reset the login attempts to zero
|
||||||
|
if(!isInternalAccount(userAccount.getType()))
|
||||||
|
updateLoginAttempts(userAccount.getId(), 0, false);
|
||||||
|
|
||||||
return userAccount;
|
return userAccount;
|
||||||
} else {
|
} else {
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Unable to authenticate user with username " + username + " in domain " + domainId);
|
s_logger.debug("Unable to authenticate user with username " + username + " in domain " + domainId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UserAccount userAccount = _userAccountDao.getUserAccount(username, domainId);
|
||||||
|
UserAccountVO user = _userAccountDao.findById(userAccount.getId());
|
||||||
|
if (user != null) {
|
||||||
|
if ((user.getState().toString()).equals("enabled")) {
|
||||||
|
if (!isInternalAccount(user.getType())) {
|
||||||
|
//Internal accounts are not disabled
|
||||||
|
int attemptsMade = user.getLoginAttempts() + 1;
|
||||||
|
if (attemptsMade < _allowedLoginAttempts) {
|
||||||
|
updateLoginAttempts(userAccount.getId(), attemptsMade, false);
|
||||||
|
s_logger.warn("Login attempt failed. You have " + ( _allowedLoginAttempts - attemptsMade ) + " attempt(s) remaining");
|
||||||
|
} else {
|
||||||
|
updateLoginAttempts(userAccount.getId(), _allowedLoginAttempts, true);
|
||||||
|
s_logger.warn("User " + user.getUsername() + " has been disabled due to multiple failed login attempts." +
|
||||||
|
" Please contact admin.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
s_logger.info("User " + user.getUsername() + " is disabled/locked");
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,6 +141,8 @@ import com.cloud.network.security.SecurityGroupManager;
|
|||||||
import com.cloud.network.security.dao.SecurityGroupDao;
|
import com.cloud.network.security.dao.SecurityGroupDao;
|
||||||
import com.cloud.network.security.dao.SecurityGroupVMMapDao;
|
import com.cloud.network.security.dao.SecurityGroupVMMapDao;
|
||||||
import com.cloud.network.vpc.VpcManager;
|
import com.cloud.network.vpc.VpcManager;
|
||||||
|
import com.cloud.network.vpc.VpcVO;
|
||||||
|
import com.cloud.network.vpc.dao.VpcDao;
|
||||||
import com.cloud.offering.NetworkOffering;
|
import com.cloud.offering.NetworkOffering;
|
||||||
import com.cloud.offering.NetworkOffering.Availability;
|
import com.cloud.offering.NetworkOffering.Availability;
|
||||||
import com.cloud.offering.ServiceOffering;
|
import com.cloud.offering.ServiceOffering;
|
||||||
@ -319,6 +321,8 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
@Inject
|
@Inject
|
||||||
protected NicDao _nicDao;
|
protected NicDao _nicDao;
|
||||||
@Inject
|
@Inject
|
||||||
|
protected VpcDao _vpcDao;
|
||||||
|
@Inject
|
||||||
protected RulesManager _rulesMgr;
|
protected RulesManager _rulesMgr;
|
||||||
@Inject
|
@Inject
|
||||||
protected LoadBalancingRulesManager _lbMgr;
|
protected LoadBalancingRulesManager _lbMgr;
|
||||||
@ -3012,6 +3016,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
c.addCriteria(Criteria.NETWORKID, cmd.getNetworkId());
|
c.addCriteria(Criteria.NETWORKID, cmd.getNetworkId());
|
||||||
c.addCriteria(Criteria.TEMPLATE_ID, cmd.getTemplateId());
|
c.addCriteria(Criteria.TEMPLATE_ID, cmd.getTemplateId());
|
||||||
c.addCriteria(Criteria.ISO_ID, cmd.getIsoId());
|
c.addCriteria(Criteria.ISO_ID, cmd.getIsoId());
|
||||||
|
c.addCriteria(Criteria.VPC_ID, cmd.getVpcId());
|
||||||
|
|
||||||
if (domainId != null) {
|
if (domainId != null) {
|
||||||
c.addCriteria(Criteria.DOMAINID, domainId);
|
c.addCriteria(Criteria.DOMAINID, domainId);
|
||||||
@ -3063,6 +3068,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
Object storageId = c.getCriteria(Criteria.STORAGE_ID);
|
Object storageId = c.getCriteria(Criteria.STORAGE_ID);
|
||||||
Object templateId = c.getCriteria(Criteria.TEMPLATE_ID);
|
Object templateId = c.getCriteria(Criteria.TEMPLATE_ID);
|
||||||
Object isoId = c.getCriteria(Criteria.ISO_ID);
|
Object isoId = c.getCriteria(Criteria.ISO_ID);
|
||||||
|
Object vpcId = c.getCriteria(Criteria.VPC_ID);
|
||||||
|
|
||||||
sb.and("displayName", sb.entity().getDisplayName(), SearchCriteria.Op.LIKE);
|
sb.and("displayName", sb.entity().getDisplayName(), SearchCriteria.Op.LIKE);
|
||||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||||
@ -3111,6 +3117,19 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
sb.join("nicSearch", nicSearch, sb.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER);
|
sb.join("nicSearch", nicSearch, sb.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(vpcId != null && networkId == null){
|
||||||
|
SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder();
|
||||||
|
|
||||||
|
SearchBuilder<NetworkVO> networkSearch = _networkDao.createSearchBuilder();
|
||||||
|
nicSearch.join("networkSearch", networkSearch, nicSearch.entity().getNetworkId(), networkSearch.entity().getId(), JoinBuilder.JoinType.INNER);
|
||||||
|
|
||||||
|
SearchBuilder<VpcVO> vpcSearch = _vpcDao.createSearchBuilder();
|
||||||
|
vpcSearch.and("vpcId", vpcSearch.entity().getId(), SearchCriteria.Op.EQ);
|
||||||
|
networkSearch.join("vpcSearch", vpcSearch, networkSearch.entity().getVpcId(), vpcSearch.entity().getId(), JoinBuilder.JoinType.INNER);
|
||||||
|
|
||||||
|
sb.join("nicSearch", nicSearch, sb.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER);
|
||||||
|
}
|
||||||
|
|
||||||
if (storageId != null) {
|
if (storageId != null) {
|
||||||
SearchBuilder<VolumeVO> volumeSearch = _volsDao.createSearchBuilder();
|
SearchBuilder<VolumeVO> volumeSearch = _volsDao.createSearchBuilder();
|
||||||
volumeSearch.and("poolId", volumeSearch.entity().getPoolId(), SearchCriteria.Op.EQ);
|
volumeSearch.and("poolId", volumeSearch.entity().getPoolId(), SearchCriteria.Op.EQ);
|
||||||
@ -3163,6 +3182,10 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
sc.setJoinParameters("nicSearch", "networkId", networkId);
|
sc.setJoinParameters("nicSearch", "networkId", networkId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(vpcId != null && networkId == null){
|
||||||
|
sc.setJoinParameters("vpcSearch", "vpcId", vpcId);
|
||||||
|
}
|
||||||
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
sc.setParameters("name", "%" + name + "%");
|
sc.setParameters("name", "%" + name + "%");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1745,7 +1745,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||||||
set_vms.addAll(_vmDao.listLHByClusterId(clusterId));
|
set_vms.addAll(_vmDao.listLHByClusterId(clusterId));
|
||||||
|
|
||||||
for (VMInstanceVO vm : set_vms) {
|
for (VMInstanceVO vm : set_vms) {
|
||||||
if (vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging) continue;
|
|
||||||
AgentVmInfo info = infos.remove(vm.getId());
|
AgentVmInfo info = infos.remove(vm.getId());
|
||||||
VMInstanceVO castedVm = null;
|
VMInstanceVO castedVm = null;
|
||||||
if ((info == null && (vm.getState() == State.Running || vm.getState() == State.Starting))
|
if ((info == null && (vm.getState() == State.Running || vm.getState() == State.Starting))
|
||||||
@ -1789,13 +1788,16 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (info != null && (vm.getState() == State.Stopped || vm.getState() == State.Stopping)) {
|
else if (info != null && (vm.getState() == State.Stopped || vm.getState() == State.Stopping
|
||||||
|
|| vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging)) {
|
||||||
Host host = _hostDao.findByGuid(info.getHostUuid());
|
Host host = _hostDao.findByGuid(info.getHostUuid());
|
||||||
if (host != null){
|
if (host != null){
|
||||||
s_logger.warn("Stopping a VM which is stopped/stopping " + info.name);
|
s_logger.warn("Stopping a VM which is stopped/stopping/destroyed/expunging " + info.name);
|
||||||
|
if (vm.getState() == State.Stopped || vm.getState() == State.Stopping) {
|
||||||
vm.setState(State.Stopped); // set it as stop and clear it from host
|
vm.setState(State.Stopped); // set it as stop and clear it from host
|
||||||
vm.setHostId(null);
|
vm.setHostId(null);
|
||||||
_vmDao.persist(vm);
|
_vmDao.persist(vm);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Answer answer = _agentMgr.send(host.getId(), cleanup(info.name));
|
Answer answer = _agentMgr.send(host.getId(), cleanup(info.name));
|
||||||
if (!answer.getResult()) {
|
if (!answer.getResult()) {
|
||||||
@ -1831,7 +1833,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (final AgentVmInfo left : infos.values()) {
|
for (final AgentVmInfo left : infos.values()) {
|
||||||
if (VirtualMachineName.isValidVmName(left.name)) continue; // if the vm follows cloudstack naming ignore it for stopping
|
if (!VirtualMachineName.isValidVmName(left.name)) continue; // if the vm doesn't follow CS naming ignore it for stopping
|
||||||
try {
|
try {
|
||||||
Host host = _hostDao.findByGuid(left.getHostUuid());
|
Host host = _hostDao.findByGuid(left.getHostUuid());
|
||||||
if (host != null){
|
if (host != null){
|
||||||
|
|||||||
@ -890,6 +890,7 @@ CREATE TABLE `cloud`.`user` (
|
|||||||
`timezone` varchar(30) default NULL,
|
`timezone` varchar(30) default NULL,
|
||||||
`registration_token` varchar(255) default NULL,
|
`registration_token` varchar(255) default NULL,
|
||||||
`is_registered` tinyint NOT NULL DEFAULT 0 COMMENT '1: yes, 0: no',
|
`is_registered` tinyint NOT NULL DEFAULT 0 COMMENT '1: yes, 0: no',
|
||||||
|
`incorrect_login_attempts` integer unsigned NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
INDEX `i_user__removed`(`removed`),
|
INDEX `i_user__removed`(`removed`),
|
||||||
INDEX `i_user__secret_key_removed`(`secret_key`, `removed`),
|
INDEX `i_user__secret_key_removed`(`secret_key`, `removed`),
|
||||||
|
|||||||
@ -472,3 +472,6 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'manage
|
|||||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway');
|
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway');
|
||||||
|
|
||||||
INSERT IGNORE INTO `cloud`.`guest_os_category` VALUES ('11','None',NULL);
|
INSERT IGNORE INTO `cloud`.`guest_os_category` VALUES ('11','None',NULL);
|
||||||
|
ALTER TABLE `cloud`.`user` ADD COLUMN `incorrect_login_attempts` integer unsigned NOT NULL DEFAULT '0';
|
||||||
|
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'incorrect.login.attempts.allowed', '5', 'Incorrect login attempts allowed before the user is disabled');
|
||||||
|
|
||||||
|
|||||||
@ -3,12 +3,6 @@ The tests are long running and are best monitored by external hudson jobs.
|
|||||||
|
|
||||||
Also you will have to point marvin to the right configuration file that has
|
Also you will have to point marvin to the right configuration file that has
|
||||||
details about your cloudstack deployment. For more help on how to write the
|
details about your cloudstack deployment. For more help on how to write the
|
||||||
config file check the tutorial at :
|
config file and run tests check the tutorial at :
|
||||||
|
|
||||||
|
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Testing+with+Python
|
||||||
http://docs.cloudstack.org/test_framework_1.0
|
|
||||||
|
|
||||||
http://wiki.cloudstack.org/display/QA/Testing+with+python
|
|
||||||
|
|
||||||
To run:
|
|
||||||
$ python -m marvin.deployAndRun -c config.cfg -d integration/smoke -t testcase.log -r result.log -l
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
274
test/integration/component/test_allocation_states.py
Normal file
274
test/integration/component/test_allocation_states.py
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
# Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||||
|
# Apache License, Version 2.0 (the "License"); you may not use this
|
||||||
|
# file except in compliance with the License. Citrix Systems, Inc.
|
||||||
|
# reserves all rights not expressly granted by 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.
|
||||||
|
#
|
||||||
|
# Automatically generated by addcopyright.py at 04/03/2012
|
||||||
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
|
from marvin.cloudstackTestCase import *
|
||||||
|
from marvin.cloudstackAPI import *
|
||||||
|
from integration.lib.utils import *
|
||||||
|
from integration.lib.base import *
|
||||||
|
from integration.lib.common import *
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
|
class Services:
|
||||||
|
"""Test Resource Limits Services
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.services = {
|
||||||
|
"domain": {
|
||||||
|
"name": "Domain",
|
||||||
|
},
|
||||||
|
"account": {
|
||||||
|
"email": "test@test.com",
|
||||||
|
"firstname": "Test",
|
||||||
|
"lastname": "User",
|
||||||
|
"username": "test",
|
||||||
|
# Random characters are appended for unique
|
||||||
|
# username
|
||||||
|
"password": "password",
|
||||||
|
},
|
||||||
|
"service_offering": {
|
||||||
|
"name": "Tiny Instance",
|
||||||
|
"displaytext": "Tiny Instance",
|
||||||
|
"cpunumber": 1,
|
||||||
|
"cpuspeed": 100, # in MHz
|
||||||
|
"memory": 64, # In MBs
|
||||||
|
},
|
||||||
|
"disk_offering": {
|
||||||
|
"displaytext": "Small",
|
||||||
|
"name": "Small",
|
||||||
|
"disksize": 1
|
||||||
|
},
|
||||||
|
"volume": {
|
||||||
|
"diskname": "TestDiskServ",
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"displayname": "TestVM",
|
||||||
|
"username": "root",
|
||||||
|
"password": "password",
|
||||||
|
"ssh_port": 22,
|
||||||
|
"hypervisor": 'XenServer',
|
||||||
|
"privateport": 22,
|
||||||
|
"publicport": 22,
|
||||||
|
"protocol": 'TCP',
|
||||||
|
},
|
||||||
|
"template": {
|
||||||
|
"displaytext": "Cent OS Template",
|
||||||
|
"name": "Cent OS Template",
|
||||||
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
|
"templatefilter": 'self',
|
||||||
|
},
|
||||||
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
|
# Cent OS 5.3 (64 bit)
|
||||||
|
"sleep": 60,
|
||||||
|
"timeout": 10,
|
||||||
|
"mode": 'advanced',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class TestAllocationState(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestResources,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone, Domain and templates
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
cls._cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
#Clean up, terminate the created instance, volumes and snapshots
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_01_zones(self):
|
||||||
|
"""Check the status of zones"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List zones
|
||||||
|
# 2. Check allocation state is "enabled" or not
|
||||||
|
|
||||||
|
zones = Zone.list(
|
||||||
|
self.apiclient,
|
||||||
|
id=self.zone.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(zones, list),
|
||||||
|
True,
|
||||||
|
"Check if listZones returns a valid response"
|
||||||
|
)
|
||||||
|
for zone in zones:
|
||||||
|
self.assertEqual(
|
||||||
|
zone.allocationstate,
|
||||||
|
'Enabled',
|
||||||
|
"Zone allocation state should be enabled"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_02_pods(self):
|
||||||
|
"""Check the status of pods"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List pods
|
||||||
|
# 2. Check allocation state is "enabled" or not
|
||||||
|
|
||||||
|
pods = Pod.list(
|
||||||
|
self.apiclient,
|
||||||
|
zoneid=self.zone.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(pods, list),
|
||||||
|
True,
|
||||||
|
"Check if listPods returns a valid response"
|
||||||
|
)
|
||||||
|
for pod in pods:
|
||||||
|
self.assertEqual(
|
||||||
|
pod.allocationstate,
|
||||||
|
'Enabled',
|
||||||
|
"Pods allocation state should be enabled"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_03_clusters(self):
|
||||||
|
"""Check the status of clusters"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List clusters
|
||||||
|
# 2. Check allocation state is "enabled" or not
|
||||||
|
|
||||||
|
clusters = Cluster.list(
|
||||||
|
self.apiclient,
|
||||||
|
zoneid=self.zone.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(clusters, list),
|
||||||
|
True,
|
||||||
|
"Check if listClusters returns a valid response"
|
||||||
|
)
|
||||||
|
for cluster in clusters:
|
||||||
|
self.assertEqual(
|
||||||
|
cluster.allocationstate,
|
||||||
|
'Enabled',
|
||||||
|
"Clusters allocation state should be enabled"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_04_hosts(self):
|
||||||
|
"""Check the status of hosts"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List hosts with type=Routing
|
||||||
|
# 2. Check state is "Up" or not
|
||||||
|
|
||||||
|
hosts = Host.list(
|
||||||
|
self.apiclient,
|
||||||
|
zoneid=self.zone.id,
|
||||||
|
type='Routing',
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(hosts, list),
|
||||||
|
True,
|
||||||
|
"Check if listHosts returns a valid response"
|
||||||
|
)
|
||||||
|
for host in hosts:
|
||||||
|
self.assertEqual(
|
||||||
|
host.state,
|
||||||
|
'Up',
|
||||||
|
"Host should be in Up state and running"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_05_storage_pools(self):
|
||||||
|
"""Check the status of Storage pools"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List storage pools for the zone
|
||||||
|
# 2. Check state is "enabled" or not
|
||||||
|
|
||||||
|
storage_pools = StoragePool.list(
|
||||||
|
self.apiclient,
|
||||||
|
zoneid=self.zone.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(storage_pools, list),
|
||||||
|
True,
|
||||||
|
"Check if listStoragePools returns a valid response"
|
||||||
|
)
|
||||||
|
for storage_pool in storage_pools:
|
||||||
|
self.assertEqual(
|
||||||
|
storage_pool.state,
|
||||||
|
'Up',
|
||||||
|
"storage pool should be in Up state and running"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
|
def test_06_secondary_storage(self):
|
||||||
|
"""Check the status of secondary storage"""
|
||||||
|
|
||||||
|
# Validate the following
|
||||||
|
# 1. List secondary storage
|
||||||
|
# 2. Check state is "Up" or not
|
||||||
|
|
||||||
|
sec_storages = Host.list(
|
||||||
|
self.apiclient,
|
||||||
|
zoneid=self.zone.id,
|
||||||
|
type='SecondaryStorageVM',
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(sec_storages, list),
|
||||||
|
True,
|
||||||
|
"Check if listHosts returns a valid response"
|
||||||
|
)
|
||||||
|
for sec_storage in sec_storages:
|
||||||
|
self.assertEqual(
|
||||||
|
sec_storage.state,
|
||||||
|
'Up',
|
||||||
|
"Secondary storage should be in Up state"
|
||||||
|
)
|
||||||
|
return
|
||||||
@ -17,6 +17,7 @@
|
|||||||
""" Tests for Blocker bugs
|
""" Tests for Blocker bugs
|
||||||
"""
|
"""
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
@ -24,7 +25,8 @@ from integration.lib.common import *
|
|||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Services
|
"""Test Services
|
||||||
@ -42,7 +44,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -74,15 +76,15 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
"displaytext": 'Template from snapshot',
|
"displaytext": 'Template from snapshot',
|
||||||
"name": 'Template from snapshot',
|
"name": 'Template from snapshot',
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||||
"hypervisor": 'XenServer',
|
"hypervisor": 'XenServer',
|
||||||
"format" : 'VHD',
|
"format": 'VHD',
|
||||||
"isfeatured": True,
|
"isfeatured": True,
|
||||||
"ispublic": True,
|
"ispublic": True,
|
||||||
"isextractable": True,
|
"isextractable": True,
|
||||||
"passwordenabled":True,
|
"passwordenabled": True,
|
||||||
},
|
},
|
||||||
"paths": {
|
"paths": {
|
||||||
"mount_dir": "/mnt/tmp",
|
"mount_dir": "/mnt/tmp",
|
||||||
@ -96,9 +98,9 @@ class Services:
|
|||||||
"endport": 22,
|
"endport": 22,
|
||||||
"protocol": "TCP"
|
"protocol": "TCP"
|
||||||
},
|
},
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep":60,
|
"sleep": 60,
|
||||||
"mode": 'advanced',
|
"mode": 'advanced',
|
||||||
# Networking mode, Advanced, Basic
|
# Networking mode, Advanced, Basic
|
||||||
}
|
}
|
||||||
@ -181,10 +183,12 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_volume_from_snapshot(self):
|
def test_01_volume_from_snapshot(self):
|
||||||
"""TS_BUG_001-Test Creating snapshot from volume having spaces in name(KVM)
|
"""TS_BUG_001-Test Creating snapshot from volume having spaces in name(KVM)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
#1. Create a virtual machine and data volume
|
#1. Create a virtual machine and data volume
|
||||||
#2. Attach data volume to VM
|
#2. Attach data volume to VM
|
||||||
@ -310,7 +314,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
None,
|
None,
|
||||||
"Check Volume list Length"
|
"Check Volume list Length"
|
||||||
)
|
)
|
||||||
self.assertEqual (
|
self.assertEqual(
|
||||||
volumes[0].id,
|
volumes[0].id,
|
||||||
volume_from_snapshot.id,
|
volume_from_snapshot.id,
|
||||||
"Check Volume in the List Volumes"
|
"Check Volume in the List Volumes"
|
||||||
@ -451,10 +455,12 @@ class TestTemplate(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "basic", "sg"])
|
||||||
def test_01_create_template(self):
|
def test_01_create_template(self):
|
||||||
"""TS_BUG_002-Test to create and deploy VM using password enabled template
|
"""TS_BUG_002-Test to create and deploy VM using password enabled template
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
#1. Create a password enabled template
|
#1. Create a password enabled template
|
||||||
#2. Deploy VM using this template
|
#2. Deploy VM using this template
|
||||||
@ -520,7 +526,7 @@ class TestTemplate(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
self.debug("Deployed VM with ID: %s " % virtual_machine.id)
|
self.debug("Deployed VM with ID: %s " % virtual_machine.id)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
hasattr(virtual_machine,"password"),
|
hasattr(virtual_machine, "password"),
|
||||||
True,
|
True,
|
||||||
"Check if the deployed VM returned a password"
|
"Check if the deployed VM returned a password"
|
||||||
)
|
)
|
||||||
@ -594,9 +600,11 @@ class TestNATRules(cloudstackTestCase):
|
|||||||
cleanup_resources(self.apiclient, self.cleanup)
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_01_firewall_rules_port_fw(self):
|
def test_01_firewall_rules_port_fw(self):
|
||||||
""""Checking firewall rules deletion after static NAT disable"""
|
""""Checking firewall rules deletion after static NAT disable"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
#1. Enable static NAT for a VM
|
#1. Enable static NAT for a VM
|
||||||
#2. Open up some ports. At this point there will be new rows in the
|
#2. Open up some ports. At this point there will be new rows in the
|
||||||
@ -793,10 +801,12 @@ class TestRouters(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_list_routers_admin(self):
|
def test_01_list_routers_admin(self):
|
||||||
"""TS_BUG_007-Check listRouters() using Admin User
|
"""TS_BUG_007-Check listRouters() using Admin User
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. PreReq: have rounters that are owned by other account
|
# 1. PreReq: have rounters that are owned by other account
|
||||||
# 2. Create domain and create accounts in that domain
|
# 2. Create domain and create accounts in that domain
|
||||||
@ -901,11 +911,12 @@ class TestRouterRestart(cloudstackTestCase):
|
|||||||
self.apiclient = self.testClient.getApiClient()
|
self.apiclient = self.testClient.getApiClient()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "advancedns", "eip"])
|
||||||
def test_01_restart_network_cleanup(self):
|
def test_01_restart_network_cleanup(self):
|
||||||
"""TS_BUG_008-Test restart network
|
"""TS_BUG_008-Test restart network
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. When cleanup = true, router is destroyed and a new one created
|
# 1. When cleanup = true, router is destroyed and a new one created
|
||||||
# 2. New router will have new publicIp and linkLocalIp and
|
# 2. New router will have new publicIp and linkLocalIp and
|
||||||
@ -1061,10 +1072,13 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"])
|
||||||
def test_01_check_template_size(self):
|
def test_01_check_template_size(self):
|
||||||
"""TS_BUG_009-Test the size of template created from root disk
|
"""TS_BUG_009-Test the size of template created from root disk
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Deploy new VM using the template created from Volume
|
# 1. Deploy new VM using the template created from Volume
|
||||||
# 2. VM should be in Up and Running state
|
# 2. VM should be in Up and Running state
|
||||||
@ -1086,10 +1100,13 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"])
|
||||||
def test_02_check_size_snapshotTemplate(self):
|
def test_02_check_size_snapshotTemplate(self):
|
||||||
"""TS_BUG_010-Test check size of snapshot and template
|
"""TS_BUG_010-Test check size of snapshot and template
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy VM using default template, small service offering
|
# 1. Deploy VM using default template, small service offering
|
||||||
# and small data disk offering.
|
# and small data disk offering.
|
||||||
@ -1164,10 +1181,13 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"])
|
||||||
def test_03_resuse_template_name(self):
|
def test_03_resuse_template_name(self):
|
||||||
"""TS_BUG_011-Test Reusing deleted template name
|
"""TS_BUG_011-Test Reusing deleted template name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy VM using default template, small service offering
|
# 1. Deploy VM using default template, small service offering
|
||||||
# and small data disk offering.
|
# and small data disk offering.
|
||||||
|
|||||||
@ -19,9 +19,10 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
@ -37,7 +38,7 @@ class Services:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.services = {
|
self.services = {
|
||||||
"disk_offering":{
|
"disk_offering": {
|
||||||
"displaytext": "Small",
|
"displaytext": "Small",
|
||||||
"name": "Small",
|
"name": "Small",
|
||||||
"disksize": 1
|
"disksize": 1
|
||||||
@ -49,7 +50,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended in create account to
|
# Random characters are appended in create account to
|
||||||
# ensure unique username generated each time
|
# ensure unique username generated each time
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"virtual_machine": {
|
"virtual_machine": {
|
||||||
# Create a small virtual machine instance with disk offering
|
# Create a small virtual machine instance with disk offering
|
||||||
@ -110,17 +111,18 @@ class Services:
|
|||||||
"protocol": 'TCP',
|
"protocol": 'TCP',
|
||||||
"startport": 22,
|
"startport": 22,
|
||||||
"endport": 22,
|
"endport": 22,
|
||||||
|
"cidrlist": '0.0.0.0/0'
|
||||||
},
|
},
|
||||||
"mgmt_server": {
|
"mgmt_server": {
|
||||||
"username": "root",
|
"username": "root",
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
"ipaddress": "192.168.100.21"
|
"ipaddress": "192.168.100.21"
|
||||||
},
|
},
|
||||||
"ostypeid": '85cb528f-72ed-4df9-ac6a-f6ccf0892ff2',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# CentOS 5.3 (64-bit)
|
# CentOS 5.3 (64-bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'basic',
|
"mode": 'basic',
|
||||||
# Networking mode: Basic or Advanced
|
# Networking mode: Basic or Advanced
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,10 +196,12 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_deployVM_InDefaultSecurityGroup(self):
|
def test_deployVM_InDefaultSecurityGroup(self):
|
||||||
"""Test deploy VM in default security group with no egress rules
|
"""Test deploy VM in default security group with no egress rules
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Deploy a VM.
|
# 1. Deploy a VM.
|
||||||
# 2. Deployed VM should be running, verify with listVirtualMachiens
|
# 2. Deployed VM should be running, verify with listVirtualMachiens
|
||||||
@ -349,10 +353,12 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_authorizeIngressRule(self):
|
def test_authorizeIngressRule(self):
|
||||||
"""Test authorize ingress rule
|
"""Test authorize ingress rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -505,10 +511,12 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_default_group_with_egress(self):
|
def test_01_default_group_with_egress(self):
|
||||||
"""Test default group with egress rule before VM deploy and ping, ssh
|
"""Test default group with egress rule before VM deploy and ping, ssh
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -704,11 +712,13 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_default_group_with_egress(self):
|
def test_01_default_group_with_egress(self):
|
||||||
""" Test default group with egress rule added after vm deploy and ping,
|
""" Test default group with egress rule added after vm deploy and ping,
|
||||||
ssh test
|
ssh test
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -885,10 +895,12 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_revoke_egress_rule(self):
|
def test_revoke_egress_rule(self):
|
||||||
"""Test revoke security group egress rule
|
"""Test revoke security group egress rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -1028,7 +1040,7 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
result = security_group.revokeEgress(
|
result = security_group.revokeEgress(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
id = ssh_egress_rule["ruleid"]
|
id=ssh_egress_rule["ruleid"]
|
||||||
)
|
)
|
||||||
self.debug("Revoke egress rule result: %s" % result)
|
self.debug("Revoke egress rule result: %s" % result)
|
||||||
|
|
||||||
@ -1145,10 +1157,12 @@ class TestInvalidAccountAuthroize(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_invalid_account_authroize(self):
|
def test_invalid_account_authroize(self):
|
||||||
"""Test invalid account authroize
|
"""Test invalid account authroize
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -1271,10 +1285,12 @@ class TestMultipleAccountsEgressRuleNeg(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_multiple_account_egress_rule_negative(self):
|
def test_multiple_account_egress_rule_negative(self):
|
||||||
"""Test multiple account egress rules negative case
|
"""Test multiple account egress rules negative case
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user A
|
# 1. createaccount of type user A
|
||||||
# 2. createaccount of type user B
|
# 2. createaccount of type user B
|
||||||
@ -1517,10 +1533,12 @@ class TestMultipleAccountsEgressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_multiple_account_egress_rule_positive(self):
|
def test_multiple_account_egress_rule_positive(self):
|
||||||
"""Test multiple account egress rules positive case
|
"""Test multiple account egress rules positive case
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user A
|
# 1. createaccount of type user A
|
||||||
# 2. createaccount of type user B
|
# 2. createaccount of type user B
|
||||||
@ -1806,10 +1824,12 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_start_stop_vm_egress(self):
|
def test_start_stop_vm_egress(self):
|
||||||
""" Test stop start Vm with egress rules
|
""" Test stop start Vm with egress rules
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createaccount of type user
|
# 1. createaccount of type user
|
||||||
# 2. createsecuritygroup (ssh) for this account
|
# 2. createsecuritygroup (ssh) for this account
|
||||||
@ -1947,6 +1967,7 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@unittest.skip("Valid bug- ID: CS-12647")
|
@unittest.skip("Valid bug- ID: CS-12647")
|
||||||
class TestInvalidParametersForEgress(cloudstackTestCase):
|
class TestInvalidParametersForEgress(cloudstackTestCase):
|
||||||
|
|
||||||
@ -2015,10 +2036,12 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_invalid_parameters(self):
|
def test_invalid_parameters(self):
|
||||||
""" Test invalid parameters for egress rules
|
""" Test invalid parameters for egress rules
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. createUserAccount
|
# 1. createUserAccount
|
||||||
# 2. createSecurityGroup (test)
|
# 2. createSecurityGroup (test)
|
||||||
@ -2200,6 +2223,8 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["sg", "eip", "maintenance"])
|
||||||
def test_egress_after_host_maintainance(self):
|
def test_egress_after_host_maintainance(self):
|
||||||
"""Test maintenance case for egress
|
"""Test maintenance case for egress
|
||||||
"""
|
"""
|
||||||
@ -2307,12 +2332,12 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
vm = vms[0]
|
vm = vms[0]
|
||||||
|
|
||||||
self.debug("Enabling host maintainance for ID: %s" % host.id)
|
self.debug("Enabling host maintainance for ID: %s" % vm.hostid)
|
||||||
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
|
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
|
||||||
cmd.id = vm.hostid
|
cmd.id = vm.hostid
|
||||||
self.apiclient.prepareHostForMaintenance(cmd)
|
self.apiclient.prepareHostForMaintenance(cmd)
|
||||||
|
|
||||||
self.debug("Canceling host maintainance for ID: %s" % host.id)
|
self.debug("Canceling host maintainance for ID: %s" % vm.hostid)
|
||||||
cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
|
cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
|
||||||
cmd.id = vm.hostid
|
cmd.id = vm.hostid
|
||||||
self.apiclient.cancelHostMaintenance(cmd)
|
self.apiclient.cancelHostMaintenance(cmd)
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
@ -41,7 +42,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -76,18 +77,17 @@ class Services:
|
|||||||
"protocol": 'TCP',
|
"protocol": 'TCP',
|
||||||
},
|
},
|
||||||
"netscaler": {
|
"netscaler": {
|
||||||
"ipaddress": '192.168.100.213',
|
"ipaddress": '10.147.40.100',
|
||||||
"username": 'nsroot',
|
"username": 'nsroot',
|
||||||
"password": 'nsroot'
|
"password": 'nsroot'
|
||||||
},
|
},
|
||||||
"ostypeid": 'd73dd44c-4244-4848-b20a-906796326749',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode": 'basic'
|
"mode": 'basic'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TestEIP(cloudstackTestCase):
|
class TestEIP(cloudstackTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -146,6 +146,7 @@ class TestEIP(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
if isinstance(ip_addrs, list):
|
if isinstance(ip_addrs, list):
|
||||||
cls.source_nat = ip_addrs[0]
|
cls.source_nat = ip_addrs[0]
|
||||||
|
print "source_nat ipaddress : ", cls.source_nat
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"No Source NAT IP found for guest network: %s" %
|
"No Source NAT IP found for guest network: %s" %
|
||||||
@ -180,10 +181,14 @@ class TestEIP(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("skipped - Framework DB Exception")
|
||||||
def test_01_eip_by_deploying_instance(self):
|
def test_01_eip_by_deploying_instance(self):
|
||||||
"""Test EIP by deploying an instance
|
"""Test EIP by deploying an instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Instance gets an IP from GUEST IP range.
|
# 1. Instance gets an IP from GUEST IP range.
|
||||||
# 2. One IP from EIP pool is taken and configured on NS
|
# 2. One IP from EIP pool is taken and configured on NS
|
||||||
@ -266,15 +271,15 @@ class TestEIP(cloudstackTestCase):
|
|||||||
cmd.endport = 22
|
cmd.endport = 22
|
||||||
cmd.cidrlist = '0.0.0.0/0'
|
cmd.cidrlist = '0.0.0.0/0'
|
||||||
self.apiclient.authorizeSecurityGroupIngress(cmd)
|
self.apiclient.authorizeSecurityGroupIngress(cmd)
|
||||||
|
#COMMENTED:
|
||||||
try:
|
# try:
|
||||||
self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip)
|
# self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip)
|
||||||
ssh = self.virtual_machine.get_ssh_client(
|
# ssh = self.virtual_machine.get_ssh_client(
|
||||||
ipaddress=self.source_nat.ipaddress)
|
# ipaddress=self.source_nat.ipaddress)
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.fail("SSH Access failed for %s: %s" % \
|
# self.fail("SSH Access failed for %s: %s" % \
|
||||||
(self.virtual_machine.ipaddress, e)
|
# (self.virtual_machine.ipaddress, e)
|
||||||
)
|
# )
|
||||||
# Fetch details from user_ip_address table in database
|
# Fetch details from user_ip_address table in database
|
||||||
self.debug(
|
self.debug(
|
||||||
"select is_system, one_to_one_nat from user_ip_address where public_ip_address='%s';" \
|
"select is_system, one_to_one_nat from user_ip_address where public_ip_address='%s';" \
|
||||||
@ -311,7 +316,7 @@ class TestEIP(cloudstackTestCase):
|
|||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -335,8 +340,8 @@ class TestEIP(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count("USIP: ON"),
|
result.count("NAME: Cloud-Inat-%s" % self.source_nat.ipaddress),
|
||||||
2,
|
1,
|
||||||
"User source IP should be enabled for INAT service"
|
"User source IP should be enabled for INAT service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -345,10 +350,13 @@ class TestEIP(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("skipped - Framework DB Exception")
|
||||||
def test_02_acquire_ip_enable_static_nat(self):
|
def test_02_acquire_ip_enable_static_nat(self):
|
||||||
"""Test associate new IP and enable static NAT for new IP and the VM
|
"""Test associate new IP and enable static NAT for new IP and the VM
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. user_ip_address.is_system = 0 & user_ip_address.one_to_one_nat=1
|
# 1. user_ip_address.is_system = 0 & user_ip_address.one_to_one_nat=1
|
||||||
# 2. releases default EIP whose user_ip_address.is_system=1
|
# 2. releases default EIP whose user_ip_address.is_system=1
|
||||||
@ -441,19 +449,19 @@ class TestEIP(cloudstackTestCase):
|
|||||||
"user_ip_address.is_system value should be 0 old source NAT"
|
"user_ip_address.is_system value should be 0 old source NAT"
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
# try:
|
||||||
self.debug("SSH into VM: %s" % public_ip.ipaddress.ipaddress)
|
# self.debug("SSH into VM: %s" % public_ip.ipaddress.ipaddress)
|
||||||
ssh = self.virtual_machine.get_ssh_client(
|
# ssh = self.virtual_machine.get_ssh_client(
|
||||||
ipaddress=public_ip.ipaddress.ipaddress)
|
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.fail("SSH Access failed for %s: %s" % \
|
# self.fail("SSH Access failed for %s: %s" % \
|
||||||
(public_ip.ipaddress.ipaddress, e)
|
# (public_ip.ipaddress.ipaddress, e)
|
||||||
)
|
# )
|
||||||
|
|
||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -477,8 +485,8 @@ class TestEIP(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count("USIP: ON"),
|
result.count("NAME: Cloud-Inat-%s" % public_ip.ipaddress.ipaddress),
|
||||||
2,
|
1,
|
||||||
"User source IP should be enabled for INAT service"
|
"User source IP should be enabled for INAT service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -487,10 +495,13 @@ class TestEIP(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("skipped - Framework DB Exception")
|
||||||
def test_03_disable_static_nat(self):
|
def test_03_disable_static_nat(self):
|
||||||
"""Test disable static NAT and release EIP acquired
|
"""Test disable static NAT and release EIP acquired
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Disable static NAT. Disables one-to-one NAT and releases EIP
|
# 1. Disable static NAT. Disables one-to-one NAT and releases EIP
|
||||||
# whose user_ip_address.is_system=0
|
# whose user_ip_address.is_system=0
|
||||||
@ -639,18 +650,18 @@ class TestEIP(cloudstackTestCase):
|
|||||||
1,
|
1,
|
||||||
"one_to_one_nat value should be 1 for automatically assigned IP"
|
"one_to_one_nat value should be 1 for automatically assigned IP"
|
||||||
)
|
)
|
||||||
try:
|
# try:
|
||||||
self.debug("SSH into VM: %s" % static_nat.ipaddress)
|
# self.debug("SSH into VM: %s" % static_nat.ipaddress)
|
||||||
ssh = self.virtual_machine.get_ssh_client(
|
# ssh = self.virtual_machine.get_ssh_client(
|
||||||
ipaddress=static_nat.ipaddress)
|
# ipaddress=static_nat.ipaddress)
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.fail("SSH Access failed for %s: %s" % \
|
# self.fail("SSH Access failed for %s: %s" % \
|
||||||
(static_nat.ipaddress, e))
|
# (static_nat.ipaddress, e))
|
||||||
|
|
||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -684,10 +695,13 @@ class TestEIP(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("skipped - Framework DB Exception")
|
||||||
def test_04_disable_static_nat_system(self):
|
def test_04_disable_static_nat_system(self):
|
||||||
"""Test disable static NAT with system = True
|
"""Test disable static NAT with system = True
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Try to disassociate/disable static NAT on EIP where is_system=1
|
# 1. Try to disassociate/disable static NAT on EIP where is_system=1
|
||||||
# 2. This operation should fail with proper error message.
|
# 2. This operation should fail with proper error message.
|
||||||
@ -751,10 +765,13 @@ class TestEIP(cloudstackTestCase):
|
|||||||
self.debug("Disassociate system IP failed")
|
self.debug("Disassociate system IP failed")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("skipped - Framework DB Exception")
|
||||||
def test_05_destroy_instance(self):
|
def test_05_destroy_instance(self):
|
||||||
"""Test EIO after destroying instance
|
"""Test EIO after destroying instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Destroy instance. Destroy should result in is_system=0 for EIP
|
# 1. Destroy instance. Destroy should result in is_system=0 for EIP
|
||||||
# and EIP should also be marked as free.
|
# and EIP should also be marked as free.
|
||||||
@ -860,7 +877,7 @@ class TestEIP(cloudstackTestCase):
|
|||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -987,10 +1004,12 @@ class TestELB(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
def test_01_elb_create(self):
|
def test_01_elb_create(self):
|
||||||
"""Test ELB by creating a LB rule
|
"""Test ELB by creating a LB rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy 2 instances
|
# 1. Deploy 2 instances
|
||||||
# 2. Create LB rule to port 22 for the VMs and try to access VMs with
|
# 2. Create LB rule to port 22 for the VMs and try to access VMs with
|
||||||
@ -1058,41 +1077,42 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.account.account.name,
|
self.account.account.name,
|
||||||
lb_ip.ipaddress
|
lb_ip.ipaddress
|
||||||
))
|
))
|
||||||
self.debug("SSHing into VMs using ELB IP: %s" % lb_ip.ipaddress)
|
#TODO: uncomment this after ssh issue is resolved
|
||||||
try:
|
# self.debug("SSHing into VMs using ELB IP: %s" % lb_ip.ipaddress)
|
||||||
ssh_1 = self.vm_1.get_ssh_client(ipaddress=lb_ip.ipaddress)
|
# try:
|
||||||
self.debug("Command: hostname")
|
# ssh_1 = self.vm_1.get_ssh_client(ipaddress=lb_ip.ipaddress)
|
||||||
result = ssh_1.execute("hostname")
|
# self.debug("Command: hostname")
|
||||||
self.debug("Result: %s" % result)
|
# result = ssh_1.execute("hostname")
|
||||||
|
# self.debug("Result: %s" % result)
|
||||||
if isinstance(result, list):
|
#
|
||||||
res = result[0]
|
# if isinstance(result, list):
|
||||||
else:
|
# res = result[0]
|
||||||
self.fail("hostname retrieval failed!")
|
# else:
|
||||||
|
# self.fail("hostname retrieval failed!")
|
||||||
self.assertIn(
|
#
|
||||||
res,
|
# self.assertIn(
|
||||||
[self.vm_1.name, self.vm_2.name],
|
# res,
|
||||||
"SSH should return hostname of one of the VM"
|
# [self.vm_1.name, self.vm_2.name],
|
||||||
)
|
# "SSH should return hostname of one of the VM"
|
||||||
|
# )
|
||||||
ssh_2 = self.vm_2.get_ssh_client(ipaddress=lb_ip.ipaddress)
|
#
|
||||||
self.debug("Command: hostname")
|
# ssh_2 = self.vm_2.get_ssh_client(ipaddress=lb_ip.ipaddress)
|
||||||
result = ssh_2.execute("hostname")
|
# self.debug("Command: hostname")
|
||||||
self.debug("Result: %s" % result)
|
# result = ssh_2.execute("hostname")
|
||||||
|
# self.debug("Result: %s" % result)
|
||||||
if isinstance(result, list):
|
#
|
||||||
res = result[0]
|
# if isinstance(result, list):
|
||||||
else:
|
# res = result[0]
|
||||||
self.fail("hostname retrieval failed!")
|
# else:
|
||||||
self.assertIn(
|
# self.fail("hostname retrieval failed!")
|
||||||
res,
|
# self.assertIn(
|
||||||
[self.vm_1.name, self.vm_2.name],
|
# res,
|
||||||
"SSH should return hostname of one of the VM"
|
# [self.vm_1.name, self.vm_2.name],
|
||||||
)
|
# "SSH should return hostname of one of the VM"
|
||||||
except Exception as e:
|
# )
|
||||||
self.fail(
|
# except Exception as e:
|
||||||
"SSH Access failed for %s: %s" % (self.vm_1.ipaddress, e))
|
# self.fail(
|
||||||
|
# "SSH Access failed for %s: %s" % (self.vm_1.ipaddress, e))
|
||||||
|
|
||||||
# Fetch details from user_ip_address table in database
|
# Fetch details from user_ip_address table in database
|
||||||
self.debug(
|
self.debug(
|
||||||
@ -1124,7 +1144,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -1148,8 +1168,8 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count("State: UP"),
|
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (lb_ip.ipaddress, lb_ip.ipaddress)),
|
||||||
2,
|
1,
|
||||||
"User subnet IP should be enabled for LB service"
|
"User subnet IP should be enabled for LB service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1158,10 +1178,12 @@ class TestELB(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
def test_02_elb_acquire_and_create(self):
|
def test_02_elb_acquire_and_create(self):
|
||||||
"""Test ELB by acquiring IP and then creating a LB rule
|
"""Test ELB by acquiring IP and then creating a LB rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy 2 instances
|
# 1. Deploy 2 instances
|
||||||
# 2. Create LB rule to port 22 for the VMs and try to access VMs with
|
# 2. Create LB rule to port 22 for the VMs and try to access VMs with
|
||||||
@ -1201,46 +1223,47 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.vm_2.name,
|
self.vm_2.name,
|
||||||
lb_rule.name))
|
lb_rule.name))
|
||||||
lb_rule.assign(self.apiclient, [self.vm_1, self.vm_2])
|
lb_rule.assign(self.apiclient, [self.vm_1, self.vm_2])
|
||||||
|
#TODO: workaround : add route in the guest VM for SNIP
|
||||||
self.debug("SSHing into VMs using ELB IP: %s" %
|
#
|
||||||
public_ip.ipaddress.ipaddress)
|
# self.debug("SSHing into VMs using ELB IP: %s" %
|
||||||
try:
|
# public_ip.ipaddress.ipaddress)
|
||||||
ssh_1 = self.vm_1.get_ssh_client(
|
# try:
|
||||||
ipaddress=public_ip.ipaddress.ipaddress)
|
# ssh_1 = self.vm_1.get_ssh_client(
|
||||||
self.debug("Command: hostname")
|
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||||
result = ssh_1.execute("hostname")
|
# self.debug("Command: hostname")
|
||||||
self.debug("Result: %s" % result)
|
# result = ssh_1.execute("hostname")
|
||||||
|
# self.debug("Result: %s" % result)
|
||||||
if isinstance(result, list):
|
#
|
||||||
res = result[0]
|
# if isinstance(result, list):
|
||||||
else:
|
# res = result[0]
|
||||||
self.fail("hostname retrieval failed!")
|
# else:
|
||||||
self.assertIn(
|
# self.fail("hostname retrieval failed!")
|
||||||
res,
|
# self.assertIn(
|
||||||
[self.vm_1.name, self.vm_2.name],
|
# res,
|
||||||
"SSH should return hostname of one of the VM"
|
# [self.vm_1.name, self.vm_2.name],
|
||||||
)
|
# "SSH should return hostname of one of the VM"
|
||||||
|
# )
|
||||||
ssh_2 = self.vm_2.get_ssh_client(
|
#
|
||||||
ipaddress=public_ip.ipaddress.ipaddress)
|
# ssh_2 = self.vm_2.get_ssh_client(
|
||||||
self.debug("Command: hostname")
|
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||||
result = ssh_2.execute("hostname")
|
# self.debug("Command: hostname")
|
||||||
self.debug("Result: %s" % result)
|
# result = ssh_2.execute("hostname")
|
||||||
|
# self.debug("Result: %s" % result)
|
||||||
if isinstance(result, list):
|
#
|
||||||
res = result[0]
|
# if isinstance(result, list):
|
||||||
else:
|
# res = result[0]
|
||||||
self.fail("hostname retrieval failed!")
|
# else:
|
||||||
self.assertIn(
|
# self.fail("hostname retrieval failed!")
|
||||||
res,
|
# self.assertIn(
|
||||||
[self.vm_1.name, self.vm_2.name],
|
# res,
|
||||||
"SSH should return hostname of one of the VM"
|
# [self.vm_1.name, self.vm_2.name],
|
||||||
)
|
# "SSH should return hostname of one of the VM"
|
||||||
except Exception as e:
|
# )
|
||||||
self.fail(
|
# except Exception as e:
|
||||||
"SSH Access failed for %s: %s" % (self.vm_1.ipaddress, e))
|
# self.fail(
|
||||||
|
# "SSH Access failed for %s: %s" % (self.vm_1.ipaddress, e))
|
||||||
# Fetch details from user_ip_address table in database
|
#
|
||||||
|
## Fetch details from user_ip_address table in database
|
||||||
self.debug(
|
self.debug(
|
||||||
"select is_system from user_ip_address where public_ip_address='%s';" \
|
"select is_system from user_ip_address where public_ip_address='%s';" \
|
||||||
% public_ip.ipaddress.ipaddress)
|
% public_ip.ipaddress.ipaddress)
|
||||||
@ -1270,7 +1293,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -1294,8 +1317,8 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count("State: UP"),
|
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (public_ip.ipaddress.ipaddress, public_ip.ipaddress.ipaddress)),
|
||||||
4,
|
1,
|
||||||
"User subnet IP should be enabled for LB service"
|
"User subnet IP should be enabled for LB service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1304,10 +1327,13 @@ class TestELB(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
def test_03_elb_delete_lb_system(self):
|
def test_03_elb_delete_lb_system(self):
|
||||||
"""Test delete LB rule generated with public IP with is_system = 1
|
"""Test delete LB rule generated with public IP with is_system = 1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deleting LB rule should release EIP where is_system=1
|
# 1. Deleting LB rule should release EIP where is_system=1
|
||||||
# 2. check configuration changes for EIP reflects on NS
|
# 2. check configuration changes for EIP reflects on NS
|
||||||
@ -1341,38 +1367,12 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("Deleting LB rule: %s" % self.lb_rule.id)
|
self.debug("Deleting LB rule: %s" % self.lb_rule.id)
|
||||||
self.lb_rule.delete(self.apiclient)
|
self.lb_rule.delete(self.apiclient)
|
||||||
|
|
||||||
config = list_configurations(
|
|
||||||
self.apiclient,
|
|
||||||
name='network.gc.wait'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(config, list),
|
|
||||||
True,
|
|
||||||
"Check list configurations response"
|
|
||||||
)
|
|
||||||
gc_delay = config[0]
|
|
||||||
self.debug("network.gc.wait: %s" % gc_delay.value)
|
|
||||||
|
|
||||||
config = list_configurations(
|
|
||||||
self.apiclient,
|
|
||||||
name='network.gc.interval'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(config, list),
|
|
||||||
True,
|
|
||||||
"Check list configurations response"
|
|
||||||
)
|
|
||||||
gc_interval = config[0]
|
|
||||||
self.debug("network.gc.intervall: %s" % gc_interval.value)
|
|
||||||
|
|
||||||
# wait for exp_delay+exp_interval - cleans up VM
|
|
||||||
total_wait = int(gc_interval.value) + int(gc_delay.value)
|
|
||||||
time.sleep(total_wait)
|
|
||||||
|
|
||||||
|
time.sleep(60)
|
||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -1385,7 +1385,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count(lb_ip.ipaddress),
|
result.count(lb_ip.ipaddress),
|
||||||
1,
|
0,
|
||||||
"One IP from EIP pool should be taken and configured on NS"
|
"One IP from EIP pool should be taken and configured on NS"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1396,8 +1396,8 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result.count("State: UP"),
|
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (lb_ip.ipaddress, lb_ip.ipaddress) ),
|
||||||
2,
|
0,
|
||||||
"User subnet IP should be enabled for LB service"
|
"User subnet IP should be enabled for LB service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1406,10 +1406,13 @@ class TestELB(cloudstackTestCase):
|
|||||||
(self.services["netscaler"]["ipaddress"], e))
|
(self.services["netscaler"]["ipaddress"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["eip"])
|
||||||
|
@unittest.skip("valid bug : http://bugs.cloudstack.org/browse/CS-15077 : ListPublicIPAddress failing")
|
||||||
def test_04_delete_lb_on_eip(self):
|
def test_04_delete_lb_on_eip(self):
|
||||||
"""Test delete LB rule generated on EIP
|
"""Test delete LB rule generated on EIP
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deleting LB rule won't release EIP where is_system=0
|
# 1. Deleting LB rule won't release EIP where is_system=0
|
||||||
# 2. disassociateIP must release the above IP
|
# 2. disassociateIP must release the above IP
|
||||||
@ -1471,6 +1474,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
ipaddress=public_ip,
|
ipaddress=public_ip,
|
||||||
listall=True
|
listall=True
|
||||||
)
|
)
|
||||||
|
self.debug("ip address list: %s" % ip_addrs)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
isinstance(ip_addrs, list),
|
isinstance(ip_addrs, list),
|
||||||
True,
|
True,
|
||||||
@ -1499,34 +1503,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("Deleting LB rule failed for IP: %s-%s" % (public_ip, e))
|
self.fail("Deleting LB rule failed for IP: %s-%s" % (public_ip, e))
|
||||||
|
|
||||||
config = list_configurations(
|
#TODO:check the lb rule list and then confirm that lb rule is deleted
|
||||||
self.apiclient,
|
|
||||||
name='network.gc.wait'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(config, list),
|
|
||||||
True,
|
|
||||||
"Check list configurations response"
|
|
||||||
)
|
|
||||||
gc_delay = config[0]
|
|
||||||
self.debug("network.gc.wait: %s" % gc_delay.value)
|
|
||||||
|
|
||||||
config = list_configurations(
|
|
||||||
self.apiclient,
|
|
||||||
name='network.gc.interval'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(config, list),
|
|
||||||
True,
|
|
||||||
"Check list configurations response"
|
|
||||||
)
|
|
||||||
gc_interval = config[0]
|
|
||||||
self.debug("network.gc.intervall: %s" % gc_interval.value)
|
|
||||||
|
|
||||||
# wait for exp_delay+exp_interval - cleans up VM
|
|
||||||
total_wait = int(gc_interval.value) + int(gc_delay.value)
|
|
||||||
time.sleep(total_wait)
|
|
||||||
|
|
||||||
self.debug("LB rule deleted!")
|
self.debug("LB rule deleted!")
|
||||||
|
|
||||||
ip_addrs = PublicIPAddress.list(
|
ip_addrs = PublicIPAddress.list(
|
||||||
@ -1542,7 +1519,7 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("SSH into netscaler: %s" %
|
self.debug("SSH into netscaler: %s" %
|
||||||
self.services["netscaler"]["ipaddress"])
|
self.services["netscaler"]["ipaddress"])
|
||||||
try:
|
try:
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["netscaler"]["ipaddress"],
|
self.services["netscaler"]["ipaddress"],
|
||||||
22,
|
22,
|
||||||
self.services["netscaler"]["username"],
|
self.services["netscaler"]["username"],
|
||||||
@ -1566,8 +1543,8 @@ class TestELB(cloudstackTestCase):
|
|||||||
self.debug("Output: %s" % result)
|
self.debug("Output: %s" % result)
|
||||||
|
|
||||||
self.assertNotEqual(
|
self.assertNotEqual(
|
||||||
result.count("State: UP"),
|
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (lb_ip.ipaddress, lb_ip.ipaddress)),
|
||||||
2,
|
1,
|
||||||
"User subnet IP should be enabled for LB service"
|
"User subnet IP should be enabled for LB service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -19,12 +19,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -57,7 +58,7 @@ class Services:
|
|||||||
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
||||||
"traffictype": 'GUEST',
|
"traffictype": 'GUEST',
|
||||||
"availability": 'Optional',
|
"availability": 'Optional',
|
||||||
"serviceProviderList" : {
|
"serviceProviderList": {
|
||||||
"Dhcp": 'VirtualRouter',
|
"Dhcp": 'VirtualRouter',
|
||||||
"Dns": 'VirtualRouter',
|
"Dns": 'VirtualRouter',
|
||||||
"SourceNat": 'VirtualRouter',
|
"SourceNat": 'VirtualRouter',
|
||||||
@ -76,7 +77,7 @@ class Services:
|
|||||||
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
||||||
"traffictype": 'GUEST',
|
"traffictype": 'GUEST',
|
||||||
"availability": 'Optional',
|
"availability": 'Optional',
|
||||||
"serviceProviderList" : {
|
"serviceProviderList": {
|
||||||
"Dhcp": 'VirtualRouter',
|
"Dhcp": 'VirtualRouter',
|
||||||
"Dns": 'VirtualRouter',
|
"Dns": 'VirtualRouter',
|
||||||
"SourceNat": 'VirtualRouter',
|
"SourceNat": 'VirtualRouter',
|
||||||
@ -91,6 +92,7 @@ class Services:
|
|||||||
"network": {
|
"network": {
|
||||||
"name": "Test Network",
|
"name": "Test Network",
|
||||||
"displaytext": "Test Network",
|
"displaytext": "Test Network",
|
||||||
|
"vlan": 2370,
|
||||||
},
|
},
|
||||||
"lbrule": {
|
"lbrule": {
|
||||||
"name": "SSH",
|
"name": "SSH",
|
||||||
@ -118,7 +120,7 @@ class Services:
|
|||||||
"publicport": 66,
|
"publicport": 66,
|
||||||
"protocol": "TCP"
|
"protocol": "TCP"
|
||||||
},
|
},
|
||||||
"fw_rule":{
|
"fw_rule": {
|
||||||
"startport": 1,
|
"startport": 1,
|
||||||
"endport": 6000,
|
"endport": 6000,
|
||||||
"cidr": '55.55.0.0/11',
|
"cidr": '55.55.0.0/11',
|
||||||
@ -136,11 +138,11 @@ class Services:
|
|||||||
"publicport": 22,
|
"publicport": 22,
|
||||||
"protocol": 'TCP',
|
"protocol": 'TCP',
|
||||||
},
|
},
|
||||||
"ostypeid": '9958b10f-9e5d-4ef1-908d-a047372d823b',
|
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'advanced'
|
"mode": 'advanced'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -209,10 +211,12 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_01_network_off_without_conserve_mode(self):
|
def test_01_network_off_without_conserve_mode(self):
|
||||||
"""Test Network offering with Conserve mode off and VR - All services
|
"""Test Network offering with Conserve mode off and VR - All services
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Network from the above network offering and deploy a VM.
|
# 1. Create a Network from the above network offering and deploy a VM.
|
||||||
# 2. On source NAT ipaddress, we should NOT be allowed to add a
|
# 2. On source NAT ipaddress, we should NOT be allowed to add a
|
||||||
@ -452,10 +456,12 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_02_network_off_with_conserve_mode(self):
|
def test_02_network_off_with_conserve_mode(self):
|
||||||
"""Test Network offering with Conserve mode ON and VR - All services
|
"""Test Network offering with Conserve mode ON and VR - All services
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Network from the above network offering and deploy a VM.
|
# 1. Create a Network from the above network offering and deploy a VM.
|
||||||
# 2. On source NAT ipaddress, we should be allowed to add a LB rules
|
# 2. On source NAT ipaddress, we should be allowed to add a LB rules
|
||||||
@ -783,10 +789,12 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advancedns"])
|
||||||
def test_01_network_off_without_conserve_mode(self):
|
def test_01_network_off_without_conserve_mode(self):
|
||||||
"""Test Nw off with Conserve mode off, VR-All services, LB-netscaler
|
"""Test Nw off with Conserve mode off, VR-All services, LB-netscaler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Network from the above network offering and deploy a VM.
|
# 1. Create a Network from the above network offering and deploy a VM.
|
||||||
# 2. On source NAT ipaddress, we should NOT be allowed to add LB rule
|
# 2. On source NAT ipaddress, we should NOT be allowed to add LB rule
|
||||||
@ -803,7 +811,6 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||||||
# address for different public port ranges.
|
# address for different public port ranges.
|
||||||
# 9. On source NAT ipaddress, we should NOT be allowed to Enable VPN.
|
# 9. On source NAT ipaddress, we should NOT be allowed to Enable VPN.
|
||||||
|
|
||||||
|
|
||||||
# Create a network offering with all virtual router services enabled
|
# Create a network offering with all virtual router services enabled
|
||||||
self.debug(
|
self.debug(
|
||||||
"Creating n/w offering with all services in VR & conserve mode:ON"
|
"Creating n/w offering with all services in VR & conserve mode:ON"
|
||||||
@ -1051,10 +1058,12 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advancedns"])
|
||||||
def test_02_network_off_with_conserve_mode_netscaler(self):
|
def test_02_network_off_with_conserve_mode_netscaler(self):
|
||||||
"""Test NW off with Conserve mode ON, LB-Netscaler and VR-All services
|
"""Test NW off with Conserve mode ON, LB-Netscaler and VR-All services
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Network from the above network offering and deploy a VM.
|
# 1. Create a Network from the above network offering and deploy a VM.
|
||||||
# 2. On source NAT ipaddress, we should NOT be allowed to add LB rule
|
# 2. On source NAT ipaddress, we should NOT be allowed to add LB rule
|
||||||
@ -1072,7 +1081,6 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||||||
# address for different public port ranges.
|
# address for different public port ranges.
|
||||||
# 9. On source NAT ipaddress, we should be allowed to Enable VPN.
|
# 9. On source NAT ipaddress, we should be allowed to Enable VPN.
|
||||||
|
|
||||||
|
|
||||||
# Create a network offering with all virtual router services enabled
|
# Create a network offering with all virtual router services enabled
|
||||||
self.debug(
|
self.debug(
|
||||||
"Creating n/w offering with all services in VR & conserve mode:ON"
|
"Creating n/w offering with all services in VR & conserve mode:ON"
|
||||||
@ -1425,10 +1433,13 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advancedns"])
|
||||||
def test_01_nwupgrade_netscaler_conserve_on(self):
|
def test_01_nwupgrade_netscaler_conserve_on(self):
|
||||||
"""Test Nw upgrade to netscaler lb service and conserve mode ON
|
"""Test Nw upgrade to netscaler lb service and conserve mode ON
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Upgrade a network with VR and conserve mode ON TO
|
# 1. Upgrade a network with VR and conserve mode ON TO
|
||||||
# A network that has Lb provided by "Netscaler" and all other
|
# A network that has Lb provided by "Netscaler" and all other
|
||||||
@ -1622,10 +1633,13 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advancedns"])
|
||||||
def test_02_nwupgrade_netscaler_conserve_off(self):
|
def test_02_nwupgrade_netscaler_conserve_off(self):
|
||||||
"""Test Nw upgrade to netscaler lb service and conserve mode OFF
|
"""Test Nw upgrade to netscaler lb service and conserve mode OFF
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Upgrade a network with VR and conserve mode ON TO
|
# 1. Upgrade a network with VR and conserve mode ON TO
|
||||||
# A network that has Lb provided by "Netscaler" and all other
|
# A network that has Lb provided by "Netscaler" and all other
|
||||||
@ -1798,3 +1812,131 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||||||
changecidr=True
|
changecidr=True
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skip("Skipped since shared network requires StartIp/endIp/gateway/netmask")
|
||||||
|
class TestSharedNetworkWithoutIp(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestSharedNetworkWithoutIp,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone, Domain and templates
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
cls.template = get_template(
|
||||||
|
cls.api_client,
|
||||||
|
cls.zone.id,
|
||||||
|
cls.services["ostypeid"]
|
||||||
|
)
|
||||||
|
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||||
|
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||||
|
|
||||||
|
cls.service_offering = ServiceOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["service_offering"]
|
||||||
|
)
|
||||||
|
|
||||||
|
cls._cleanup = [
|
||||||
|
cls.service_offering,
|
||||||
|
]
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.account = Account.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=self.domain.id
|
||||||
|
)
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
self.account.delete(self.apiclient)
|
||||||
|
interval = list_configurations(
|
||||||
|
self.apiclient,
|
||||||
|
name='account.cleanup.interval'
|
||||||
|
)
|
||||||
|
# Sleep to ensure that all resources are deleted
|
||||||
|
time.sleep(int(interval[0].value) * 2)
|
||||||
|
#Clean up, terminate the created network offerings
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator", "network", "api"])
|
||||||
|
def test_deployVmSharedNetworkWithoutIpRange(self):
|
||||||
|
"""Test deployVM in shared network without startIp/endIp
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Steps for validation
|
||||||
|
# 1. create a shared network using shared network offering but do not
|
||||||
|
# specify startIp/endIp arguments
|
||||||
|
# 2. create an account
|
||||||
|
# 3. deploy a VM in this account using the above network
|
||||||
|
# Validate the following
|
||||||
|
# 1. listNetworks should return the created network
|
||||||
|
# 2. listAccounts to return the created account
|
||||||
|
# 3. VM deployment should succeed and NIC is in networks address space
|
||||||
|
# 4. delete the account
|
||||||
|
|
||||||
|
self.debug(
|
||||||
|
"Fetching default shared network offering from nw offerings")
|
||||||
|
network_offerings = NetworkOffering.list(
|
||||||
|
self.apiclient,
|
||||||
|
listall=True,
|
||||||
|
guestiptype="Shared",
|
||||||
|
name="DefaultSharedNetworkOffering",
|
||||||
|
displaytext="Offering for Shared networks"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(network_offerings, list),
|
||||||
|
True,
|
||||||
|
"Nw offerings should have atleast a shared nw offering"
|
||||||
|
)
|
||||||
|
shared_nw_off = network_offerings[0]
|
||||||
|
self.debug("Shared netwrk offering: %s" % shared_nw_off.name)
|
||||||
|
|
||||||
|
self.debug("Creating a network from shared network offering")
|
||||||
|
self.network = Network.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["network"],
|
||||||
|
accountid=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
networkofferingid=shared_nw_off.id,
|
||||||
|
zoneid=self.zone.id
|
||||||
|
)
|
||||||
|
self.debug("Created network with ID: %s" % self.network.id)
|
||||||
|
|
||||||
|
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||||
|
try:
|
||||||
|
# Spawn an instance in that network
|
||||||
|
VirtualMachine.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["virtual_machine"],
|
||||||
|
accountid=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
serviceofferingid=self.service_offering.id,
|
||||||
|
networkids=[str(self.network.id)]
|
||||||
|
)
|
||||||
|
self.debug("Deployed VM in network: %s" % self.network.id)
|
||||||
|
except Exception as e:
|
||||||
|
self.fail("Deply Vm in shared network failed! - %s" % e)
|
||||||
|
return
|
||||||
|
|||||||
@ -18,12 +18,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ class Services:
|
|||||||
"mgmt_server": {
|
"mgmt_server": {
|
||||||
"ipaddress": '192.168.100.21',
|
"ipaddress": '192.168.100.21',
|
||||||
"username": 'root',
|
"username": 'root',
|
||||||
"password": 'fr3sca',
|
"password": 'password',
|
||||||
"port": 22,
|
"port": 22,
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
@ -53,7 +54,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"email": "administrator@clogeny.com",
|
"email": "administrator@clogeny.com",
|
||||||
@ -62,7 +63,7 @@ class Services:
|
|||||||
"username": "User",
|
"username": "User",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -86,10 +87,10 @@ class Services:
|
|||||||
"template": {
|
"template": {
|
||||||
"displaytext": "Public Template",
|
"displaytext": "Public Template",
|
||||||
"name": "Public template",
|
"name": "Public template",
|
||||||
"ostypeid": 'f9b709f2-e0fc-4c0f-80f1-b0494168f58d',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||||
"hypervisor": 'XenServer',
|
"hypervisor": 'XenServer',
|
||||||
"format" : 'VHD',
|
"format": 'VHD',
|
||||||
"isfeatured": True,
|
"isfeatured": True,
|
||||||
"ispublic": True,
|
"ispublic": True,
|
||||||
"isextractable": True,
|
"isextractable": True,
|
||||||
@ -97,17 +98,11 @@ class Services:
|
|||||||
"configs": {
|
"configs": {
|
||||||
"project.invite.timeout": 300,
|
"project.invite.timeout": 300,
|
||||||
},
|
},
|
||||||
"mail_account": {
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"server": 'imap.gmail.com',
|
|
||||||
"email": 'administrator@clogeny.com',
|
|
||||||
"password": 'fr3sca21!',
|
|
||||||
"folder": 'inbox',
|
|
||||||
},
|
|
||||||
"ostypeid": 'f9b709f2-e0fc-4c0f-80f1-b0494168f58d',
|
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'advanced'
|
"mode": 'advanced'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -123,6 +118,16 @@ class TestUserProjectCreation(cloudstackTestCase):
|
|||||||
# Get Zone
|
# Get Zone
|
||||||
cls.zone = get_zone(cls.api_client, cls.services)
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='allow.user.create.projects'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: allow.user.create.projects")
|
||||||
|
elif (configs[0].value).lower() != 'true':
|
||||||
|
raise unittest.SkipTest("'allow.user.create.projects' should be true")
|
||||||
|
|
||||||
# Create domains, account etc.
|
# Create domains, account etc.
|
||||||
cls.domain = Domain.create(
|
cls.domain = Domain.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -169,11 +174,11 @@ class TestUserProjectCreation(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(configuration = "allow.user.create.projects")
|
||||||
def test_01_admin_project_creation(self):
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
|
def test_admin_project_creation(self):
|
||||||
"""Test create project as a domain admin and domain user
|
"""Test create project as a domain admin and domain user
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Check if 'allow.user.create.projects' configuration is true
|
# 1. Check if 'allow.user.create.projects' configuration is true
|
||||||
# 2. Create a Project as domain admin
|
# 2. Create a Project as domain admin
|
||||||
@ -197,6 +202,7 @@ class TestUserProjectCreation(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
|
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.services["project"],
|
self.services["project"],
|
||||||
@ -263,11 +269,83 @@ class TestUserProjectCreation(cloudstackTestCase):
|
|||||||
"Check list project response returns a valid project"
|
"Check list project response returns a valid project"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class TestProjectCreationNegative(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestProjectCreationNegative,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Checking for prereqisits - global configs
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='allow.user.create.projects'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: allow.user.create.projects")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'allow.user.create.projects' should be false")
|
||||||
|
|
||||||
|
# Create domains, account etc.
|
||||||
|
cls.domain = Domain.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["domain"]
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.account = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.user = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls._cleanup = [cls.account, cls.user, cls.domain]
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
#Clean up, terminate the created accounts, domains etc
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(configuration = "allow.user.create.projects")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
@unittest.skip("Known bug-able to create project as a domain user")
|
@unittest.skip("Known bug-able to create project as a domain user")
|
||||||
def test_02_user_project_creation(self):
|
def test_user_project_creation(self):
|
||||||
"""Test create project as a domain admin and domain user
|
"""Test create project as a domain admin and domain user
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Check if 'allow.user.create.projects' configuration is false
|
# 1. Check if 'allow.user.create.projects' configuration is false
|
||||||
# 2. Create a Project as domain admin. Project creation should be
|
# 2. Create a Project as domain admin. Project creation should be
|
||||||
@ -342,7 +420,10 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.api_client = super(TestProjectInviteRequired, cls).getClsTestClient().getApiClient()
|
cls.api_client = super(
|
||||||
|
TestProjectInviteRequired,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
cls.services = Services().services
|
cls.services = Services().services
|
||||||
# Get Zone
|
# Get Zone
|
||||||
cls.zone = get_zone(cls.api_client, cls.services)
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
@ -350,6 +431,17 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
# Create domains, account etc.
|
# Create domains, account etc.
|
||||||
cls.domain = get_domain(cls.api_client, cls.services)
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Verify 'project.invite.required' is set to false
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("The 'project.invite.required' is not found in global configs")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be false")
|
||||||
|
|
||||||
cls.account = Account.create(
|
cls.account = Account.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.services["account"],
|
cls.services["account"],
|
||||||
@ -390,32 +482,16 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_03_add_user_to_project(self):
|
def test_add_user_to_project(self):
|
||||||
"""Add user to project when 'project.invite.required' is false"""
|
"""Add user to project when 'project.invite.required' is false"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Create a Project
|
# 1. Create a Project
|
||||||
# 2. Add users to the project. Verify user is added to project
|
# 2. Add users to the project. Verify user is added to project
|
||||||
# as regular user
|
# as regular user
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be true"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -491,30 +567,82 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_04_add_user_to_project(self):
|
class TestProjectInviteRequiredTrue(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestProjectInviteRequiredTrue,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Create domains, account etc.
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Verify 'project.invite.required' is set to true
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("The 'project.invite.required' is not found in global configs")
|
||||||
|
elif (configs[0].value).lower() != 'true':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be true")
|
||||||
|
|
||||||
|
cls.account = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.user = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["user"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls._cleanup = [cls.account, cls.user]
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
#Clean up, terminate the created accounts, domains etc
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(configuration = "project.invite.required")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
|
def test_add_user_to_project(self):
|
||||||
"""Add user to project when 'project.invite.required' is true"""
|
"""Add user to project when 'project.invite.required' is true"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Create a Project
|
# 1. Create a Project
|
||||||
# 2. Add users to the project. verify user is shown in pending state
|
# 2. Add users to the project. verify user is shown in pending state
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'true',
|
|
||||||
"'project.invite.required' should be true"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -590,9 +718,92 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_05_invitation_timeout(self):
|
|
||||||
|
class TestProjectInviteTimeout(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestProjectInviteTimeout,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Create domains, account etc.
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
# Verify 'project.invite.required' is set to true
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("The 'project.invite.required' is not found in global configs")
|
||||||
|
elif (configs[0].value).lower() != 'true':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be true")
|
||||||
|
|
||||||
|
# Verify 'project.invite.timeout' is set to 300
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.timeout'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("The 'project.invite.timeout' is not found in global configs")
|
||||||
|
elif int(configs[0].value) != cls.services["configs"]["project.invite.timeout"]:
|
||||||
|
raise unittest.SkipTest("'project.invite.timeout' should be: %s " %
|
||||||
|
cls.services["configs"]["project.invite.timeout"])
|
||||||
|
|
||||||
|
cls.config = configs[0]
|
||||||
|
cls.account = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.user = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["user"],
|
||||||
|
admin=True,
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls._cleanup = [cls.account, cls.user]
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
#Clean up, terminate the created accounts, domains etc
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(configuration = "project.invite.timeout")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
|
def test_01_invitation_timeout(self):
|
||||||
"""Test global config project invitation timeout"""
|
"""Test global config project invitation timeout"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Set configuration to 5 mins
|
# 1. Set configuration to 5 mins
|
||||||
# 2. Create a Project
|
# 2. Create a Project
|
||||||
@ -600,24 +811,6 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
# 4. As a user accept invitation within 5 mins. Verify invitation is
|
# 4. As a user accept invitation within 5 mins. Verify invitation is
|
||||||
# accepted and user become regular user of project
|
# accepted and user become regular user of project
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.timeout'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
int(config.value),
|
|
||||||
self.services["configs"]["project.invite.timeout"],
|
|
||||||
"'project.invite.timeout' should be %s" %
|
|
||||||
self.services["configs"]["project.invite.timeout"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -731,9 +924,12 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_06_invitation_timeout_after_expiry(self):
|
@attr(configuration = "project.invite.timeout")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
|
def test_02_invitation_timeout_after_expiry(self):
|
||||||
"""Test global config project invitation timeout"""
|
"""Test global config project invitation timeout"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Set configuration to 5 mins
|
# 1. Set configuration to 5 mins
|
||||||
# 2. Create a Project
|
# 2. Create a Project
|
||||||
@ -741,24 +937,6 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
# 4. As a user accept invitation after 5 mins. Verify invitation is
|
# 4. As a user accept invitation after 5 mins. Verify invitation is
|
||||||
# not accepted and is shown as expired
|
# not accepted and is shown as expired
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.timeout'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
int(config.value),
|
|
||||||
self.services["configs"]["project.invite.timeout"],
|
|
||||||
"'project.invite.timeout' should be %s" %
|
|
||||||
self.services["configs"]["project.invite.timeout"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -835,7 +1013,7 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
|
|
||||||
# sleep for 'project.invite.timeout' * 2 interval to wait for invite
|
# sleep for 'project.invite.timeout' * 2 interval to wait for invite
|
||||||
# to expire
|
# to expire
|
||||||
time.sleep(int(config.value) * 2)
|
time.sleep(int(self.config.value) * 2)
|
||||||
|
|
||||||
with self.assertRaises(Exception):
|
with self.assertRaises(Exception):
|
||||||
# Accept the invite
|
# Accept the invite
|
||||||
@ -877,7 +1055,9 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_07_invite_after_expiry(self):
|
@attr(configuration = "project.invite.timeout")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
|
def test_03_invite_after_expiry(self):
|
||||||
"""Test global config project invitation timeout"""
|
"""Test global config project invitation timeout"""
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
@ -888,24 +1068,6 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
# 5. Resend the invitation
|
# 5. Resend the invitation
|
||||||
# 6. Verify invitation is sent again
|
# 6. Verify invitation is sent again
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.timeout'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
int(config.value),
|
|
||||||
self.services["configs"]["project.invite.timeout"],
|
|
||||||
"'project.invite.timeout' should be %s" %
|
|
||||||
self.services["configs"]["project.invite.timeout"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -982,7 +1144,7 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
|
|
||||||
# sleep for 'project.invite.timeout' * 2 interval to wait for invite
|
# sleep for 'project.invite.timeout' * 2 interval to wait for invite
|
||||||
# to expire
|
# to expire
|
||||||
time.sleep(int(config.value) * 2)
|
time.sleep(int(self.config.value) * 2)
|
||||||
|
|
||||||
self.debug("Adding %s user again to project: %s" % (
|
self.debug("Adding %s user again to project: %s" % (
|
||||||
self.user.account.name,
|
self.user.account.name,
|
||||||
@ -1022,7 +1184,9 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_08_decline_invitation(self):
|
@attr(configuration = "project.invite.timeout")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
|
def test_04_decline_invitation(self):
|
||||||
"""Test decline invitation"""
|
"""Test decline invitation"""
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
@ -1033,24 +1197,6 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
# 5. Verify invitation is rejected and user doesn't become regular
|
# 5. Verify invitation is rejected and user doesn't become regular
|
||||||
# user.
|
# user.
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.timeout'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
int(config.value),
|
|
||||||
self.services["configs"]["project.invite.timeout"],
|
|
||||||
"'project.invite.timeout' should be %s" %
|
|
||||||
self.services["configs"]["project.invite.timeout"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -1148,6 +1294,7 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||||||
"Check for a valid list accounts response"
|
"Check for a valid list accounts response"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@unittest.skip("Requires SMPT configs")
|
@unittest.skip("Requires SMPT configs")
|
||||||
def test_09_invite_to_project_by_email(self):
|
def test_09_invite_to_project_by_email(self):
|
||||||
"""Test invite user to project by email"""
|
"""Test invite user to project by email"""
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
@ -25,6 +26,7 @@ from integration.lib.base import *
|
|||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Resource Limits Services
|
"""Test Resource Limits Services
|
||||||
"""
|
"""
|
||||||
@ -45,7 +47,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"email": "administrator@clogeny.com",
|
"email": "administrator@clogeny.com",
|
||||||
@ -54,7 +56,7 @@ class Services:
|
|||||||
"username": "User",
|
"username": "User",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -84,10 +86,33 @@ class Services:
|
|||||||
"template": {
|
"template": {
|
||||||
"displaytext": "Cent OS Template",
|
"displaytext": "Cent OS Template",
|
||||||
"name": "Cent OS Template",
|
"name": "Cent OS Template",
|
||||||
"ostypeid": '471a4b5b-5523-448f-9608-7d6218995733',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
},
|
},
|
||||||
"ostypeid": '471a4b5b-5523-448f-9608-7d6218995733',
|
"network_offering": {
|
||||||
|
"name": 'Network offering-VR services',
|
||||||
|
"displaytext": 'Network offering-VR services',
|
||||||
|
"guestiptype": 'Isolated',
|
||||||
|
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
||||||
|
"traffictype": 'GUEST',
|
||||||
|
"availability": 'Optional',
|
||||||
|
"serviceProviderList": {
|
||||||
|
"Dhcp": 'VirtualRouter',
|
||||||
|
"Dns": 'VirtualRouter',
|
||||||
|
"SourceNat": 'VirtualRouter',
|
||||||
|
"PortForwarding": 'VirtualRouter',
|
||||||
|
"Vpn": 'VirtualRouter',
|
||||||
|
"Firewall": 'VirtualRouter',
|
||||||
|
"Lb": 'VirtualRouter',
|
||||||
|
"UserData": 'VirtualRouter',
|
||||||
|
"StaticNat": 'VirtualRouter',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"name": "Test Network",
|
||||||
|
"displaytext": "Test Network",
|
||||||
|
},
|
||||||
|
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
@ -154,10 +179,10 @@ class TestProjectLimits(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_project_limits(self):
|
def test_01_project_limits(self):
|
||||||
""" Test project limits
|
""" Test project limits
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Project. Verify once projects are created, they inherit
|
# 1. Create a Project. Verify once projects are created, they inherit
|
||||||
# a default set of resource limits as configured by the Cloud Stack
|
# a default set of resource limits as configured by the Cloud Stack
|
||||||
@ -300,11 +325,12 @@ class TestProjectLimits(cloudstackTestCase):
|
|||||||
projectid=project.id
|
projectid=project.id
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
@unittest.skip("No provision for updating resource limits from account through API")
|
@unittest.skip("No provision for updating resource limits from account through API")
|
||||||
def test_02_project_limits_normal_user(self):
|
def test_02_project_limits_normal_user(self):
|
||||||
""" Test project limits
|
""" Test project limits
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a Project
|
# 1. Create a Project
|
||||||
# 2. Reduce the projects limits as a domain admin. Verify resource
|
# 2. Reduce the projects limits as a domain admin. Verify resource
|
||||||
@ -524,10 +550,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_03_vm_per_project(self):
|
def test_03_vm_per_project(self):
|
||||||
"""Test VM limit per project
|
"""Test VM limit per project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Set max VM per project to 2
|
# 1. Set max VM per project to 2
|
||||||
# 2. Create account and start 2 VMs. Verify VM state is Up and Running
|
# 2. Create account and start 2 VMs. Verify VM state is Up and Running
|
||||||
@ -586,10 +612,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "eip", "advancedns", "simulator"])
|
||||||
def test_04_publicip_per_project(self):
|
def test_04_publicip_per_project(self):
|
||||||
"""Test Public IP limit per project
|
"""Test Public IP limit per project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. set max no of IPs per project to 2.
|
# 1. set max no of IPs per project to 2.
|
||||||
# 2. Create an account in this domain
|
# 2. Create an account in this domain
|
||||||
@ -671,10 +697,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_05_snapshots_per_project(self):
|
def test_05_snapshots_per_project(self):
|
||||||
"""Test Snapshot limit per project
|
"""Test Snapshot limit per project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. set max no of snapshots per project to 1.
|
# 1. set max no of snapshots per project to 1.
|
||||||
# 2. Create one snapshot in the project. Snapshot should be
|
# 2. Create one snapshot in the project. Snapshot should be
|
||||||
@ -748,10 +774,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_06_volumes_per_project(self):
|
def test_06_volumes_per_project(self):
|
||||||
"""Test Volumes limit per project
|
"""Test Volumes limit per project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. set max no of volume per project to 1.
|
# 1. set max no of volume per project to 1.
|
||||||
# 2. Create 1 VM in this project
|
# 2. Create 1 VM in this project
|
||||||
@ -797,11 +823,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_07_templates_per_project(self):
|
def test_07_templates_per_project(self):
|
||||||
"""Test Templates limit per project
|
"""Test Templates limit per project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. set max no of templates per project to 1.
|
# 1. set max no of templates per project to 1.
|
||||||
# 2. Create a template in this project. Both template should be in
|
# 2. Create a template in this project. Both template should be in
|
||||||
# ready state
|
# ready state
|
||||||
@ -882,3 +907,141 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
projectid=self.project.id
|
projectid=self.project.id
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class TestMaxProjectNetworks(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestMaxProjectNetworks,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
# Get Zone, Domain and templates
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
cls.template = get_template(
|
||||||
|
cls.api_client,
|
||||||
|
cls.zone.id,
|
||||||
|
cls.services["ostypeid"]
|
||||||
|
)
|
||||||
|
cls.service_offering = ServiceOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["service_offering"]
|
||||||
|
)
|
||||||
|
cls.network_offering = NetworkOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["network_offering"],
|
||||||
|
conservemode=True
|
||||||
|
)
|
||||||
|
# Enable Network offering
|
||||||
|
cls.network_offering.update(cls.api_client, state='Enabled')
|
||||||
|
|
||||||
|
cls._cleanup = [
|
||||||
|
cls.service_offering,
|
||||||
|
cls.network_offering
|
||||||
|
]
|
||||||
|
return
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
try:
|
||||||
|
#Cleanup resources used
|
||||||
|
cleanup_resources(cls.api_client, cls._cleanup)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.account = Account.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=self.domain.id
|
||||||
|
)
|
||||||
|
self.cleanup = []
|
||||||
|
return
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
try:
|
||||||
|
#Clean up, terminate the created network offerings
|
||||||
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
|
self.account.delete(self.apiclient)
|
||||||
|
interval = list_configurations(
|
||||||
|
self.apiclient,
|
||||||
|
name='account.cleanup.interval'
|
||||||
|
)
|
||||||
|
# Sleep to ensure that all resources are deleted
|
||||||
|
time.sleep(int(interval[0].value) * 2)
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator",
|
||||||
|
"api", "basic", "eip", "sg"])
|
||||||
|
def test_maxAccountNetworks(self):
|
||||||
|
"""Test Limit number of guest account specific networks
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Steps for validation
|
||||||
|
# 1. Fetch max.account.networks from configurations
|
||||||
|
# 2. Create an account. Create account more that max.accout.network
|
||||||
|
# 3. Create network should fail
|
||||||
|
|
||||||
|
self.debug("Creating project with '%s' as admin" %
|
||||||
|
self.account.account.name)
|
||||||
|
# Create project as a domain admin
|
||||||
|
project = Project.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["project"],
|
||||||
|
account=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid
|
||||||
|
)
|
||||||
|
# Cleanup created project at end of test
|
||||||
|
self.cleanup.append(project)
|
||||||
|
self.debug("Created project with domain admin with ID: %s" %
|
||||||
|
project.id)
|
||||||
|
|
||||||
|
config = Configurations.list(
|
||||||
|
self.apiclient,
|
||||||
|
name='max.project.networks',
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(config, list),
|
||||||
|
True,
|
||||||
|
"List configurations hsould have max.project.networks"
|
||||||
|
)
|
||||||
|
|
||||||
|
config_value = int(config[0].value)
|
||||||
|
self.debug("max.project.networks: %s" % config_value)
|
||||||
|
|
||||||
|
for ctr in range(config_value):
|
||||||
|
# Creating network using the network offering created
|
||||||
|
self.debug("Creating network with network offering: %s" %
|
||||||
|
self.network_offering.id)
|
||||||
|
network = Network.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["network"],
|
||||||
|
projectid=project.id,
|
||||||
|
networkofferingid=self.network_offering.id,
|
||||||
|
zoneid=self.zone.id
|
||||||
|
)
|
||||||
|
self.debug("Created network with ID: %s" % network.id)
|
||||||
|
self.debug(
|
||||||
|
"Creating network in account already having networks : %s" %
|
||||||
|
config_value)
|
||||||
|
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
Network.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["network"],
|
||||||
|
projectid=project.id,
|
||||||
|
networkofferingid=self.network_offering.id,
|
||||||
|
zoneid=self.zone.id
|
||||||
|
)
|
||||||
|
self.debug('Create network failed (as expected)')
|
||||||
|
return
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
@ -26,6 +27,7 @@ from integration.lib.common import *
|
|||||||
from marvin.remoteSSHClient import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Resource creation Services
|
"""Test Resource creation Services
|
||||||
"""
|
"""
|
||||||
@ -46,7 +48,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"email": "administrator@clogeny.com",
|
"email": "administrator@clogeny.com",
|
||||||
@ -55,7 +57,7 @@ class Services:
|
|||||||
"username": "User",
|
"username": "User",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -85,7 +87,7 @@ class Services:
|
|||||||
"template": {
|
"template": {
|
||||||
"displaytext": "Cent OS Template",
|
"displaytext": "Cent OS Template",
|
||||||
"name": "Cent OS Template",
|
"name": "Cent OS Template",
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
"ispublic": False,
|
"ispublic": False,
|
||||||
},
|
},
|
||||||
@ -128,7 +130,7 @@ class Services:
|
|||||||
"endport": 22,
|
"endport": 22,
|
||||||
"cidrlist": '0.0.0.0/0',
|
"cidrlist": '0.0.0.0/0',
|
||||||
},
|
},
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
@ -205,10 +207,10 @@ class TestOfferings(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_service_offerings(self):
|
def test_01_service_offerings(self):
|
||||||
""" Test service offerings in a project
|
""" Test service offerings in a project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. List service offerings for the project. All SO available in the
|
# 2. List service offerings for the project. All SO available in the
|
||||||
@ -247,6 +249,7 @@ class TestOfferings(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_02_project_disk_offerings(self):
|
def test_02_project_disk_offerings(self):
|
||||||
""" Test project disk offerings
|
""" Test project disk offerings
|
||||||
"""
|
"""
|
||||||
@ -379,10 +382,10 @@ class TestNetwork(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
def test_03_network_create(self):
|
def test_03_network_create(self):
|
||||||
""" Test create network in project
|
""" Test create network in project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add virtual/direct network resource to the project. User shared
|
# 2. Add virtual/direct network resource to the project. User shared
|
||||||
@ -428,7 +431,7 @@ class TestNetwork(cloudstackTestCase):
|
|||||||
projectid=project.id
|
projectid=project.id
|
||||||
)
|
)
|
||||||
self.debug("Created network with ID: %s" % network.id)
|
self.debug("Created network with ID: %s" % network.id)
|
||||||
networks= Network.list(
|
networks = Network.list(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
projectid=project.id,
|
projectid=project.id,
|
||||||
listall=True
|
listall=True
|
||||||
@ -583,11 +586,10 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_04_public_template_use_in_project(self):
|
def test_04_public_template_use_in_project(self):
|
||||||
"""Test Templates creation in projects
|
"""Test Templates creation in projects
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. Create a project
|
# 1. Create a project
|
||||||
# 2. Verify Public templates can be used without any restriction
|
# 2. Verify Public templates can be used without any restriction
|
||||||
# 3. Verify that template created in project can be used in project
|
# 3. Verify that template created in project can be used in project
|
||||||
@ -642,11 +644,10 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_05_use_private_template_in_project(self):
|
def test_05_use_private_template_in_project(self):
|
||||||
"""Test use of private template in a project
|
"""Test use of private template in a project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. Create a project
|
# 1. Create a project
|
||||||
# 2. Verify that in order to use somebody’s Private template for vm
|
# 2. Verify that in order to use somebody’s Private template for vm
|
||||||
# creation in the project, permission to use the template has to
|
# creation in the project, permission to use the template has to
|
||||||
@ -808,10 +809,11 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_06_create_snapshots_in_project(self):
|
def test_06_create_snapshots_in_project(self):
|
||||||
"""Test create snapshots in project
|
"""Test create snapshots in project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project
|
# 1. Create a project
|
||||||
# 2. Add some snapshots to the project
|
# 2. Add some snapshots to the project
|
||||||
@ -961,10 +963,10 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_07_associate_public_ip(self):
|
def test_07_associate_public_ip(self):
|
||||||
"""Test associate public IP within the project
|
"""Test associate public IP within the project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project
|
# 1. Create a project
|
||||||
# 2. Add some public Ips to the project
|
# 2. Add some public Ips to the project
|
||||||
@ -1237,10 +1239,10 @@ class TestSecurityGroup(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_08_security_group(self):
|
def test_08_security_group(self):
|
||||||
"""Test security groups in project
|
"""Test security groups in project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Create a project
|
# 1. Create a project
|
||||||
# 2. Assign some security groups to that project
|
# 2. Assign some security groups to that project
|
||||||
|
|||||||
@ -18,14 +18,16 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Snapshots Services
|
"""Test Snapshots Services
|
||||||
"""
|
"""
|
||||||
@ -39,7 +41,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"name": "Project",
|
"name": "Project",
|
||||||
@ -73,7 +75,7 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
"displaytext": 'Template',
|
"displaytext": 'Template',
|
||||||
"name": 'Template',
|
"name": 'Template',
|
||||||
"ostypeid": '471a4b5b-5523-448f-9608-7d6218995733',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
||||||
},
|
},
|
||||||
@ -85,7 +87,7 @@ class Services:
|
|||||||
"isextractable": True,
|
"isextractable": True,
|
||||||
"isfeatured": True,
|
"isfeatured": True,
|
||||||
"ispublic": True,
|
"ispublic": True,
|
||||||
"ostypeid": '471a4b5b-5523-448f-9608-7d6218995733',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
},
|
},
|
||||||
"lbrule": {
|
"lbrule": {
|
||||||
"name": "SSH",
|
"name": "SSH",
|
||||||
@ -103,11 +105,11 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
"password": "test",
|
"password": "test",
|
||||||
},
|
},
|
||||||
"ostypeid": '471a4b5b-5523-448f-9608-7d6218995733',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'advanced'
|
"mode": 'advanced'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,10 +192,10 @@ class TestVmUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_vm_usage(self):
|
def test_01_vm_usage(self):
|
||||||
"""Test Create/Destroy VM and verify usage calculation
|
"""Test Create/Destroy VM and verify usage calculation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a VM. Verify usage_events table contains VM .create,
|
# 1. Create a VM. Verify usage_events table contains VM .create,
|
||||||
# VM.start , Network.offering.assign , Volume.create events
|
# VM.start , Network.offering.assign , Volume.create events
|
||||||
@ -401,10 +403,10 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "eip", "advancedns", "simulator"])
|
||||||
def test_01_public_ip_usage(self):
|
def test_01_public_ip_usage(self):
|
||||||
"""Test Assign new IP and verify usage calculation
|
"""Test Assign new IP and verify usage calculation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Acquire a IP for the network of this account. Verify usage_event
|
# 1. Acquire a IP for the network of this account. Verify usage_event
|
||||||
# table has Acquire IP event for the IP for this account
|
# table has Acquire IP event for the IP for this account
|
||||||
@ -559,10 +561,10 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_volume_usage(self):
|
def test_01_volume_usage(self):
|
||||||
"""Test Create/delete a volume and verify correct usage is recorded
|
"""Test Create/delete a volume and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Volume.create event for both root and data disk is there for the
|
# 1. Volume.create event for both root and data disk is there for the
|
||||||
# created account in cloud.usage_event table
|
# created account in cloud.usage_event table
|
||||||
@ -750,11 +752,11 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_01_template_usage(self):
|
def test_01_template_usage(self):
|
||||||
"""Test Upload/ delete a template and verify correct usage is generated
|
"""Test Upload/ delete a template and verify correct usage is generated
|
||||||
for the template uploaded
|
for the template uploaded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a account
|
# 1. Create a account
|
||||||
# 2. Upload a template from this account. template.create event is
|
# 2. Upload a template from this account. template.create event is
|
||||||
@ -902,10 +904,10 @@ class TestISOUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_01_ISO_usage(self):
|
def test_01_ISO_usage(self):
|
||||||
"""Test Create/Delete a ISO and verify its usage is generated correctly
|
"""Test Create/Delete a ISO and verify its usage is generated correctly
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a account
|
# 1. Create a account
|
||||||
# 2. Upload a ISO from this account. ISO.create event is recorded in
|
# 2. Upload a ISO from this account. ISO.create event is recorded in
|
||||||
@ -1074,10 +1076,10 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "eip", "advancedns", "simulator"])
|
||||||
def test_01_lb_usage(self):
|
def test_01_lb_usage(self):
|
||||||
"""Test Create/Delete a LB rule and verify correct usage is recorded
|
"""Test Create/Delete a LB rule and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Acquire a IP for this account. lb.rule.create event is registered
|
# 1. Acquire a IP for this account. lb.rule.create event is registered
|
||||||
# for this account in cloud.usage_event table
|
# for this account in cloud.usage_event table
|
||||||
@ -1240,11 +1242,12 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_snapshot_usage(self):
|
def test_01_snapshot_usage(self):
|
||||||
"""Test Create/Delete a manual snap shot and verify
|
"""Test Create/Delete a manual snap shot and verify
|
||||||
correct usage is recorded
|
correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create snapshot of the root disk for this account.Snapshot.create
|
# 1. Create snapshot of the root disk for this account.Snapshot.create
|
||||||
# event is there for the created account in cloud.usage_event table
|
# event is there for the created account in cloud.usage_event table
|
||||||
@ -1432,10 +1435,10 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
def test_01_nat_usage(self):
|
def test_01_nat_usage(self):
|
||||||
"""Test Create/Delete a PF rule and verify correct usage is recorded
|
"""Test Create/Delete a PF rule and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Acquire a IP for this account
|
# 1. Acquire a IP for this account
|
||||||
# 2. Create a PF rule on the IP associated with this account.
|
# 2. Create a PF rule on the IP associated with this account.
|
||||||
@ -1615,10 +1618,10 @@ class TestVpnUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
def test_01_vpn_usage(self):
|
def test_01_vpn_usage(self):
|
||||||
"""Test Create/Delete a VPN and verify correct usage is recorded
|
"""Test Create/Delete a VPN and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Enable VPN for this IP. vpn.add.user event is registered for this
|
# 1. Enable VPN for this IP. vpn.add.user event is registered for this
|
||||||
# account in cloud.usage_event table
|
# account in cloud.usage_event table
|
||||||
|
|||||||
@ -18,12 +18,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ class Services:
|
|||||||
"mgmt_server": {
|
"mgmt_server": {
|
||||||
"ipaddress": '192.168.100.21',
|
"ipaddress": '192.168.100.21',
|
||||||
"username": 'root',
|
"username": 'root',
|
||||||
"password": 'fr3sca',
|
"password": 'password',
|
||||||
"port": 22,
|
"port": 22,
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
@ -53,7 +54,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"email": "administrator@clogeny.com",
|
"email": "administrator@clogeny.com",
|
||||||
@ -62,7 +63,7 @@ class Services:
|
|||||||
"username": "User",
|
"username": "User",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"disk_offering": {
|
"disk_offering": {
|
||||||
"displaytext": "Tiny Disk Offering",
|
"displaytext": "Tiny Disk Offering",
|
||||||
@ -91,11 +92,11 @@ class Services:
|
|||||||
"publicport": 22,
|
"publicport": 22,
|
||||||
"protocol": 'TCP',
|
"protocol": 'TCP',
|
||||||
},
|
},
|
||||||
"ostypeid": '8531d1df-faac-4895-a741-238d3b10e6e6',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'advanced'
|
"mode": 'advanced'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -117,6 +118,16 @@ class TestMultipleProjectCreation(cloudstackTestCase):
|
|||||||
cls.services
|
cls.services
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
cls.account = Account.create(
|
cls.account = Account.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.services["account"],
|
cls.services["account"],
|
||||||
@ -157,34 +168,17 @@ class TestMultipleProjectCreation(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_create_multiple_projects_by_account(self):
|
def test_01_create_multiple_projects_by_account(self):
|
||||||
""" Verify an account can own multiple projects and can belong to
|
""" Verify an account can own multiple projects and can belong to
|
||||||
multiple projects
|
multiple projects
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create multiple project. Verify at step 1 An account is allowed
|
# 1. Create multiple project. Verify at step 1 An account is allowed
|
||||||
# to create multiple projects
|
# to create multiple projects
|
||||||
# 2. add one account to multiple project. Verify at step 2 an account
|
# 2. add one account to multiple project. Verify at step 2 an account
|
||||||
# is allowed to added to multiple project
|
# is allowed to added to multiple project
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project_1 = Project.create(
|
project_1 = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -334,6 +328,16 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
|
|||||||
cls.services
|
cls.services
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create domains, account etc.
|
# Create domains, account etc.
|
||||||
cls.new_domain = Domain.create(
|
cls.new_domain = Domain.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -380,32 +384,15 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_02_cross_domain_account_add(self):
|
def test_02_cross_domain_account_add(self):
|
||||||
""" Verify No cross domain projects
|
""" Verify No cross domain projects
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project in a domain.
|
# 1. Create a project in a domain.
|
||||||
# 2. Add different domain account to the project. Add account should
|
# 2. Add different domain account to the project. Add account should
|
||||||
# fail
|
# fail
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -443,7 +430,7 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
|
|||||||
"Check project name from list response"
|
"Check project name from list response"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.debug("Adding user: %s from domain: %s to project: %s" %(
|
self.debug("Adding user: %s from domain: %s to project: %s" % (
|
||||||
self.user.account.name,
|
self.user.account.name,
|
||||||
self.user.account.domainid,
|
self.user.account.domainid,
|
||||||
project.id
|
project.id
|
||||||
@ -474,6 +461,16 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
|
|||||||
cls.services
|
cls.services
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create account
|
# Create account
|
||||||
cls.account = Account.create(
|
cls.account = Account.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -507,32 +504,15 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_03_delete_account_with_project(self):
|
def test_03_delete_account_with_project(self):
|
||||||
""" Test As long as the project exists, its owner can't be removed
|
""" Test As long as the project exists, its owner can't be removed
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Delete account who is owner of the project. Delete account should
|
# 2. Delete account who is owner of the project. Delete account should
|
||||||
# fail
|
# fail
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -576,6 +556,7 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
|
|||||||
self.account.account.name)
|
self.account.account.name)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@unittest.skip("Deleting domain doesn't cleanup account")
|
@unittest.skip("Deleting domain doesn't cleanup account")
|
||||||
class TestDeleteDomainWithProject(cloudstackTestCase):
|
class TestDeleteDomainWithProject(cloudstackTestCase):
|
||||||
|
|
||||||
@ -588,6 +569,17 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
|
|||||||
cls.services = Services().services
|
cls.services = Services().services
|
||||||
# Get Zone
|
# Get Zone
|
||||||
cls.zone = get_zone(cls.api_client, cls.services)
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create account
|
# Create account
|
||||||
cls.domain = Domain.create(
|
cls.domain = Domain.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -626,33 +618,16 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_04_delete_domain_with_project(self):
|
def test_04_delete_domain_with_project(self):
|
||||||
""" Test Verify delete domain with cleanup=true should delete projects
|
""" Test Verify delete domain with cleanup=true should delete projects
|
||||||
belonging to the domain
|
belonging to the domain
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project in a domain
|
# 1. Create a project in a domain
|
||||||
# 2. Delete domain forcefully. Verify that project is also deleted as
|
# 2. Delete domain forcefully. Verify that project is also deleted as
|
||||||
# as part of domain cleanup
|
# as part of domain cleanup
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -739,6 +714,16 @@ class TestProjectOwners(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
cls.zone = get_zone(cls.api_client, cls.services)
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create accounts
|
# Create accounts
|
||||||
cls.admin = Account.create(
|
cls.admin = Account.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -778,34 +763,17 @@ class TestProjectOwners(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_05_user_project_owner_promotion(self):
|
def test_05_user_project_owner_promotion(self):
|
||||||
""" Test Verify a project user can be later promoted to become a
|
""" Test Verify a project user can be later promoted to become a
|
||||||
owner
|
owner
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add account to the project. Edit account to make it a project
|
# 2. Add account to the project. Edit account to make it a project
|
||||||
# owner. verify new user is project owner and old account is
|
# owner. verify new user is project owner and old account is
|
||||||
# regular user of the project.
|
# regular user of the project.
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -937,33 +905,16 @@ class TestProjectOwners(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_06_max_one_project_owner(self):
|
def test_06_max_one_project_owner(self):
|
||||||
""" Test Verify there can only be one owner of a project at a time
|
""" Test Verify there can only be one owner of a project at a time
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add account to the project. Edit account to make it a project
|
# 2. Add account to the project. Edit account to make it a project
|
||||||
# owner.
|
# owner.
|
||||||
# 3. Update project to add another account as an owner
|
# 3. Update project to add another account as an owner
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -1190,6 +1141,16 @@ class TestProjectResources(cloudstackTestCase):
|
|||||||
cls.services
|
cls.services
|
||||||
)
|
)
|
||||||
|
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create account, disk offering etc.
|
# Create account, disk offering etc.
|
||||||
cls.disk_offering = DiskOffering.create(
|
cls.disk_offering = DiskOffering.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -1234,34 +1195,17 @@ class TestProjectResources(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_07_project_resources_account_delete(self):
|
def test_07_project_resources_account_delete(self):
|
||||||
""" Test Verify after an account is removed from the project, all his
|
""" Test Verify after an account is removed from the project, all his
|
||||||
resources stay with the project.
|
resources stay with the project.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add some accounts to project. Add resources to the project
|
# 2. Add some accounts to project. Add resources to the project
|
||||||
# 3. Delete the account. Verify resources are still there after
|
# 3. Delete the account. Verify resources are still there after
|
||||||
# account deletion.
|
# account deletion.
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -1367,10 +1311,10 @@ class TestProjectResources(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_08_cleanup_after_project_delete(self):
|
def test_08_cleanup_after_project_delete(self):
|
||||||
""" Test accounts are unassigned from project after project deletion
|
""" Test accounts are unassigned from project after project deletion
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add some accounts to project. Add resources to the project
|
# 2. Add some accounts to project. Add resources to the project
|
||||||
@ -1378,23 +1322,6 @@ class TestProjectResources(cloudstackTestCase):
|
|||||||
# account deletion.
|
# account deletion.
|
||||||
# 4. Verify all accounts are unassigned from project.
|
# 4. Verify all accounts are unassigned from project.
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create project as a domain admin
|
# Create project as a domain admin
|
||||||
project = Project.create(
|
project = Project.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -1526,6 +1453,16 @@ class TestProjectSuspendActivate(cloudstackTestCase):
|
|||||||
cls.zone.id,
|
cls.zone.id,
|
||||||
cls.services["ostypeid"]
|
cls.services["ostypeid"]
|
||||||
)
|
)
|
||||||
|
configs = Configurations.list(
|
||||||
|
cls.api_client,
|
||||||
|
name='project.invite.required'
|
||||||
|
)
|
||||||
|
|
||||||
|
if not isinstance(configs, list):
|
||||||
|
raise unittest.SkipTest("List configurations has no config: project.invite.required")
|
||||||
|
elif (configs[0].value).lower() != 'false':
|
||||||
|
raise unittest.SkipTest("'project.invite.required' should be set to false")
|
||||||
|
|
||||||
# Create account, service offering, disk offering etc.
|
# Create account, service offering, disk offering etc.
|
||||||
cls.disk_offering = DiskOffering.create(
|
cls.disk_offering = DiskOffering.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
@ -1588,34 +1525,17 @@ class TestProjectSuspendActivate(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_09_project_suspend(self):
|
def test_09_project_suspend(self):
|
||||||
""" Test Verify after an account is removed from the project, all his
|
""" Test Verify after an account is removed from the project, all his
|
||||||
resources stay with the project.
|
resources stay with the project.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a project.
|
# 1. Create a project.
|
||||||
# 2. Add some accounts to project. Add resources to the project
|
# 2. Add some accounts to project. Add resources to the project
|
||||||
# 3. Delete the account. Verify resources are still there after
|
# 3. Delete the account. Verify resources are still there after
|
||||||
# account deletion.
|
# account deletion.
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug("Adding %s user to project: %s" % (
|
self.debug("Adding %s user to project: %s" % (
|
||||||
self.user.account.name,
|
self.user.account.name,
|
||||||
self.project.name
|
self.project.name
|
||||||
@ -1742,31 +1662,14 @@ class TestProjectSuspendActivate(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_10_project_activation(self):
|
def test_10_project_activation(self):
|
||||||
""" Test project activation after suspension
|
""" Test project activation after suspension
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Activate the project
|
# 1. Activate the project
|
||||||
# 2. Verify project is activated and we are able to add resources
|
# 2. Verify project is activated and we are able to add resources
|
||||||
|
|
||||||
# Verify 'project.invite.required' is set to false
|
|
||||||
configs = Configurations.list(
|
|
||||||
self.apiclient,
|
|
||||||
name='project.invite.required'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(configs, list),
|
|
||||||
True,
|
|
||||||
"Check for a valid list configurations response"
|
|
||||||
)
|
|
||||||
config = configs[0]
|
|
||||||
self.assertEqual(
|
|
||||||
(config.value).lower(),
|
|
||||||
'false',
|
|
||||||
"'project.invite.required' should be set to false"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Activating the project
|
# Activating the project
|
||||||
self.debug("Activating project: %s" % self.project.name)
|
self.debug("Activating project: %s" % self.project.name)
|
||||||
self.project.activate(self.apiclient)
|
self.project.activate(self.apiclient)
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
@ -25,6 +26,7 @@ from integration.lib.base import *
|
|||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Resource Limits Services
|
"""Test Resource Limits Services
|
||||||
"""
|
"""
|
||||||
@ -41,14 +43,16 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
"displaytext": "Tiny Instance",
|
"displaytext": "Tiny Instance",
|
||||||
"cpunumber": 1,
|
"cpunumber": 1,
|
||||||
"cpuspeed": 100, # in MHz
|
"cpuspeed": 100,
|
||||||
"memory": 64, # In MBs
|
# in MHz
|
||||||
|
"memory": 64,
|
||||||
|
# In MBs
|
||||||
},
|
},
|
||||||
"disk_offering": {
|
"disk_offering": {
|
||||||
"displaytext": "Small",
|
"displaytext": "Small",
|
||||||
@ -71,16 +75,40 @@ class Services:
|
|||||||
"template": {
|
"template": {
|
||||||
"displaytext": "Cent OS Template",
|
"displaytext": "Cent OS Template",
|
||||||
"name": "Cent OS Template",
|
"name": "Cent OS Template",
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
},
|
},
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"network_offering": {
|
||||||
|
"name": 'Network offering',
|
||||||
|
"displaytext": 'Network offering',
|
||||||
|
"guestiptype": 'Isolated',
|
||||||
|
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
|
||||||
|
"traffictype": 'GUEST',
|
||||||
|
"availability": 'Optional',
|
||||||
|
"serviceProviderList": {
|
||||||
|
"Dhcp": 'VirtualRouter',
|
||||||
|
"Dns": 'VirtualRouter',
|
||||||
|
"SourceNat": 'VirtualRouter',
|
||||||
|
"PortForwarding": 'VirtualRouter',
|
||||||
|
"Vpn": 'VirtualRouter',
|
||||||
|
"Firewall": 'VirtualRouter',
|
||||||
|
"Lb": 'VirtualRouter',
|
||||||
|
"UserData": 'VirtualRouter',
|
||||||
|
"StaticNat": 'VirtualRouter',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"name": "test network",
|
||||||
|
"displaytext": "test network"
|
||||||
|
},
|
||||||
|
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode": 'advanced',
|
"mode": 'advanced',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TestResourceLimitsAccount(cloudstackTestCase):
|
class TestResourceLimitsAccount(cloudstackTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -150,6 +178,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_01_vm_per_account(self):
|
def test_01_vm_per_account(self):
|
||||||
"""Test VM limit per account
|
"""Test VM limit per account
|
||||||
"""
|
"""
|
||||||
@ -242,6 +271,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_02_publicip_per_account(self):
|
def test_02_publicip_per_account(self):
|
||||||
"""Test Public IP limit per account
|
"""Test Public IP limit per account
|
||||||
"""
|
"""
|
||||||
@ -384,6 +414,8 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed="slow")
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_03_snapshots_per_account(self):
|
def test_03_snapshots_per_account(self):
|
||||||
"""Test Snapshot limit per account
|
"""Test Snapshot limit per account
|
||||||
"""
|
"""
|
||||||
@ -539,6 +571,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_04_volumes_per_account(self):
|
def test_04_volumes_per_account(self):
|
||||||
"""Test Volumes limit per account
|
"""Test Volumes limit per account
|
||||||
"""
|
"""
|
||||||
@ -680,6 +713,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns"])
|
||||||
def test_05_templates_per_account(self):
|
def test_05_templates_per_account(self):
|
||||||
"""Test Templates limit per account
|
"""Test Templates limit per account
|
||||||
"""
|
"""
|
||||||
@ -909,6 +943,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_01_vm_per_domain(self):
|
def test_01_vm_per_domain(self):
|
||||||
"""Test VM limit per domain
|
"""Test VM limit per domain
|
||||||
"""
|
"""
|
||||||
@ -974,6 +1009,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_01_publicip_per_domain(self):
|
def test_01_publicip_per_domain(self):
|
||||||
"""Test Public IP limit per domain
|
"""Test Public IP limit per domain
|
||||||
"""
|
"""
|
||||||
@ -1043,6 +1079,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed="slow")
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_03_snapshots_per_domain(self):
|
def test_03_snapshots_per_domain(self):
|
||||||
"""Test Snapshot limit per domain
|
"""Test Snapshot limit per domain
|
||||||
"""
|
"""
|
||||||
@ -1125,6 +1163,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns", "simulator"])
|
||||||
def test_04_volumes_per_domain(self):
|
def test_04_volumes_per_domain(self):
|
||||||
"""Test Volumes limit per domain
|
"""Test Volumes limit per domain
|
||||||
"""
|
"""
|
||||||
@ -1177,6 +1216,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "advancedns"])
|
||||||
def test_05_templates_per_domain(self):
|
def test_05_templates_per_domain(self):
|
||||||
"""Test Templates limit per domain
|
"""Test Templates limit per domain
|
||||||
"""
|
"""
|
||||||
@ -1286,18 +1326,40 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
class TestResources(cloudstackTestCase):
|
class TestMaxAccountNetworks(cloudstackTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.api_client = super(
|
cls.api_client = super(
|
||||||
TestResources,
|
TestMaxAccountNetworks,
|
||||||
cls
|
cls
|
||||||
).getClsTestClient().getApiClient()
|
).getClsTestClient().getApiClient()
|
||||||
cls.services = Services().services
|
cls.services = Services().services
|
||||||
# Get Zone, Domain and templates
|
# Get Zone, Domain and templates
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
cls.zone = get_zone(cls.api_client, cls.services)
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
cls._cleanup = []
|
cls.template = get_template(
|
||||||
|
cls.api_client,
|
||||||
|
cls.zone.id,
|
||||||
|
cls.services["ostypeid"]
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.service_offering = ServiceOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["service_offering"]
|
||||||
|
)
|
||||||
|
cls.network_offering = NetworkOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["network_offering"],
|
||||||
|
conservemode=True
|
||||||
|
)
|
||||||
|
# Enable Network offering
|
||||||
|
cls.network_offering.update(cls.api_client, state='Enabled')
|
||||||
|
|
||||||
|
cls._cleanup = [
|
||||||
|
cls.service_offering,
|
||||||
|
cls.network_offering
|
||||||
|
]
|
||||||
return
|
return
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -1312,165 +1374,80 @@ class TestResources(cloudstackTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.apiclient = self.testClient.getApiClient()
|
self.apiclient = self.testClient.getApiClient()
|
||||||
self.dbclient = self.testClient.getDbConnection()
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.account = Account.create(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["account"],
|
||||||
|
admin=True,
|
||||||
|
domainid=self.domain.id
|
||||||
|
)
|
||||||
self.cleanup = []
|
self.cleanup = []
|
||||||
return
|
return
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
#Clean up, terminate the created instance, volumes and snapshots
|
self.account.delete(self.apiclient)
|
||||||
|
interval = list_configurations(
|
||||||
|
self.apiclient,
|
||||||
|
name='account.cleanup.interval'
|
||||||
|
)
|
||||||
|
# Sleep to ensure that all resources are deleted
|
||||||
|
time.sleep(int(interval[0].value) * 2)
|
||||||
|
#Clean up, terminate the created network offerings
|
||||||
cleanup_resources(self.apiclient, self.cleanup)
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_01_zones(self):
|
@attr(tags=["advanced", "advancedns", "simulator",
|
||||||
"""Check the status of zones"""
|
"api", "basic", "eip", "sg"])
|
||||||
|
def test_maxAccountNetworks(self):
|
||||||
|
"""Test Limit number of guest account specific networks
|
||||||
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Steps for validation
|
||||||
# 1. List zones
|
# 1. Fetch max.account.networks from configurations
|
||||||
# 2. Check allocation state is "enabled" or not
|
# 2. Create an account. Create account more that max.accout.network
|
||||||
|
# 3. Create network should fail
|
||||||
|
|
||||||
zones = Zone.list(
|
config = Configurations.list(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
id=self.zone.id,
|
name='max.account.networks',
|
||||||
listall=True
|
listall=True
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
isinstance(zones, list),
|
isinstance(config, list),
|
||||||
True,
|
True,
|
||||||
"Check if listZones returns a valid response"
|
"List configurations should have max.account.networks"
|
||||||
)
|
)
|
||||||
for zone in zones:
|
|
||||||
self.assertEqual(
|
|
||||||
zone.allocationstate,
|
|
||||||
'Enabled',
|
|
||||||
"Zone allocation state should be enabled"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def test_02_pods(self):
|
config_value = int(config[0].value)
|
||||||
"""Check the status of pods"""
|
self.debug("max.account.networks: %s" % config_value)
|
||||||
|
|
||||||
# Validate the following
|
for ctr in range(config_value):
|
||||||
# 1. List pods
|
# Creating network using the network offering created
|
||||||
# 2. Check allocation state is "enabled" or not
|
self.debug("Creating network with network offering: %s" %
|
||||||
|
self.network_offering.id)
|
||||||
pods = Pod.list(
|
network = Network.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
zoneid=self.zone.id,
|
self.services["network"],
|
||||||
listall=True
|
accountid=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
networkofferingid=self.network_offering.id,
|
||||||
|
zoneid=self.zone.id
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.debug("Created network with ID: %s" % network.id)
|
||||||
isinstance(pods, list),
|
self.debug(
|
||||||
True,
|
"Creating network in account already having networks : %s" %
|
||||||
"Check if listPods returns a valid response"
|
config_value)
|
||||||
)
|
|
||||||
for pod in pods:
|
|
||||||
self.assertEqual(
|
|
||||||
pod.allocationstate,
|
|
||||||
'Enabled',
|
|
||||||
"Pods allocation state should be enabled"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def test_03_clusters(self):
|
with self.assertRaises(Exception):
|
||||||
"""Check the status of clusters"""
|
Network.create(
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. List clusters
|
|
||||||
# 2. Check allocation state is "enabled" or not
|
|
||||||
|
|
||||||
clusters = Cluster.list(
|
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
zoneid=self.zone.id,
|
self.services["network"],
|
||||||
listall=True
|
accountid=self.account.account.name,
|
||||||
)
|
domainid=self.account.account.domainid,
|
||||||
self.assertEqual(
|
networkofferingid=self.network_offering.id,
|
||||||
isinstance(clusters, list),
|
zoneid=self.zone.id
|
||||||
True,
|
|
||||||
"Check if listClusters returns a valid response"
|
|
||||||
)
|
|
||||||
for cluster in clusters:
|
|
||||||
self.assertEqual(
|
|
||||||
cluster.allocationstate,
|
|
||||||
'Enabled',
|
|
||||||
"Clusters allocation state should be enabled"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def test_04_hosts(self):
|
|
||||||
"""Check the status of hosts"""
|
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. List hosts with type=Routing
|
|
||||||
# 2. Check state is "Up" or not
|
|
||||||
|
|
||||||
hosts = Host.list(
|
|
||||||
self.apiclient,
|
|
||||||
zoneid=self.zone.id,
|
|
||||||
type='Routing',
|
|
||||||
listall=True
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(hosts, list),
|
|
||||||
True,
|
|
||||||
"Check if listHosts returns a valid response"
|
|
||||||
)
|
|
||||||
for host in hosts:
|
|
||||||
self.assertEqual(
|
|
||||||
host.state,
|
|
||||||
'Up',
|
|
||||||
"Host should be in Up state and running"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def test_05_storage_pools(self):
|
|
||||||
"""Check the status of Storage pools"""
|
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. List storage pools for the zone
|
|
||||||
# 2. Check state is "enabled" or not
|
|
||||||
|
|
||||||
storage_pools = StoragePool.list(
|
|
||||||
self.apiclient,
|
|
||||||
zoneid=self.zone.id,
|
|
||||||
listall=True
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(storage_pools, list),
|
|
||||||
True,
|
|
||||||
"Check if listStoragePools returns a valid response"
|
|
||||||
)
|
|
||||||
for storage_pool in storage_pools:
|
|
||||||
self.assertEqual(
|
|
||||||
storage_pool.state,
|
|
||||||
'Up',
|
|
||||||
"storage pool should be in Up state and running"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def test_06_secondary_storage(self):
|
|
||||||
"""Check the status of secondary storage"""
|
|
||||||
|
|
||||||
# Validate the following
|
|
||||||
# 1. List secondary storage
|
|
||||||
# 2. Check state is "Up" or not
|
|
||||||
|
|
||||||
sec_storages = Host.list(
|
|
||||||
self.apiclient,
|
|
||||||
zoneid=self.zone.id,
|
|
||||||
type='SecondaryStorage',
|
|
||||||
listall=True
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(sec_storages, list),
|
|
||||||
True,
|
|
||||||
"Check if listHosts returns a valid response"
|
|
||||||
)
|
|
||||||
for sec_storage in sec_storages:
|
|
||||||
self.assertEqual(
|
|
||||||
sec_storage.state,
|
|
||||||
'Up',
|
|
||||||
"Secondary storage should be in Up state"
|
|
||||||
)
|
)
|
||||||
|
self.debug('Create network failed (as expected)')
|
||||||
return
|
return
|
||||||
|
|||||||
@ -18,12 +18,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from marvin import remoteSSHClient
|
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
|
|
||||||
#Import System modules
|
#Import System modules
|
||||||
import time
|
import time
|
||||||
@ -57,7 +58,7 @@ class Services:
|
|||||||
},
|
},
|
||||||
"host": {
|
"host": {
|
||||||
"username": "root",
|
"username": "root",
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
"publicport": 22,
|
"publicport": 22,
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
@ -80,14 +81,15 @@ class Services:
|
|||||||
# Algorithm used for load balancing
|
# Algorithm used for load balancing
|
||||||
"privateport": 22,
|
"privateport": 22,
|
||||||
"publicport": 2222,
|
"publicport": 2222,
|
||||||
|
"protocol": 'TCP',
|
||||||
},
|
},
|
||||||
"fw_rule":{
|
"fw_rule": {
|
||||||
"startport": 1,
|
"startport": 1,
|
||||||
"endport": 6000,
|
"endport": 6000,
|
||||||
"cidr": '55.55.0.0/11',
|
"cidr": '55.55.0.0/11',
|
||||||
# Any network (For creating FW rule
|
# Any network (For creating FW rule
|
||||||
},
|
},
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Used for Get_Template : CentOS 5.3 (64 bit)
|
# Used for Get_Template : CentOS 5.3 (64 bit)
|
||||||
"mode": 'advanced', # Networking mode: Advanced, basic
|
"mode": 'advanced', # Networking mode: Advanced, basic
|
||||||
}
|
}
|
||||||
@ -166,10 +168,10 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
self._cleanup = []
|
self._cleanup = []
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_01_AdvancedZoneRouterServices(self):
|
def test_01_AdvancedZoneRouterServices(self):
|
||||||
"""Test advanced zone router services
|
"""Test advanced zone router services
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Verify that list of services provided by this network are running
|
# 1. Verify that list of services provided by this network are running
|
||||||
# a. DNS
|
# a. DNS
|
||||||
@ -312,10 +314,11 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(configuration = "network.gc")
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_02_NetworkGarbageCollection(self):
|
def test_02_NetworkGarbageCollection(self):
|
||||||
"""Test network garbage collection
|
"""Test network garbage collection
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. wait for router to start and guest network to be created
|
# 1. wait for router to start and guest network to be created
|
||||||
# a.listRouters account=user, domainid=1 (router state=Running)
|
# a.listRouters account=user, domainid=1 (router state=Running)
|
||||||
@ -435,7 +438,7 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
self.debug("network.gc.wait: %s" % gcwait[0].value)
|
self.debug("network.gc.wait: %s" % gcwait[0].value)
|
||||||
|
|
||||||
total_wait = int(gcinterval[0].value) + int (gcwait[0].value)
|
total_wait = int(gcinterval[0].value) + int(gcwait[0].value)
|
||||||
# Router is stopped after (network.gc.interval *2) time. Wait for
|
# Router is stopped after (network.gc.interval *2) time. Wait for
|
||||||
# (network.gc.interval+network.gc.wait) * 2 for moving router to 'Stopped'
|
# (network.gc.interval+network.gc.wait) * 2 for moving router to 'Stopped'
|
||||||
time.sleep(total_wait * 2)
|
time.sleep(total_wait * 2)
|
||||||
@ -470,6 +473,7 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
self._cleanup.append(self.vm_2)
|
self._cleanup.append(self.vm_2)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced"])
|
||||||
def test_03_RouterStartOnVmDeploy(self):
|
def test_03_RouterStartOnVmDeploy(self):
|
||||||
"""Test router start on VM deploy
|
"""Test router start on VM deploy
|
||||||
"""
|
"""
|
||||||
@ -578,7 +582,6 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestRouterStopCreatePF(cloudstackTestCase):
|
class TestRouterStopCreatePF(cloudstackTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -645,10 +648,10 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||||||
self._cleanup = []
|
self._cleanup = []
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_RouterStopCreatePF(self):
|
def test_01_RouterStopCreatePF(self):
|
||||||
"""Test router stop create port forwarding
|
"""Test router stop create port forwarding
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# validate the following
|
# validate the following
|
||||||
# 1. wait for router to start, guest network to be implemented and
|
# 1. wait for router to start, guest network to be implemented and
|
||||||
# VM to report Running
|
# VM to report Running
|
||||||
@ -789,6 +792,7 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
class TestRouterStopCreateLB(cloudstackTestCase):
|
class TestRouterStopCreateLB(cloudstackTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -854,10 +858,10 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||||||
self._cleanup = []
|
self._cleanup = []
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_RouterStopCreateLB(self):
|
def test_01_RouterStopCreateLB(self):
|
||||||
"""Test router stop create Load balancing
|
"""Test router stop create Load balancing
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# validate the following
|
# validate the following
|
||||||
# 1. listLoadBalancerRules (publicipid=ipaddressid of source NAT)
|
# 1. listLoadBalancerRules (publicipid=ipaddressid of source NAT)
|
||||||
# 2. rule should be for port 2222 as applied and
|
# 2. rule should be for port 2222 as applied and
|
||||||
@ -1064,10 +1068,10 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||||||
self._cleanup = []
|
self._cleanup = []
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_RouterStopCreateFW(self):
|
def test_01_RouterStopCreateFW(self):
|
||||||
"""Test router stop create Firewall rule
|
"""Test router stop create Firewall rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# validate the following
|
# validate the following
|
||||||
# 1. 1. listFirewallRules (filter by ipaddressid of sourcenat)
|
# 1. 1. listFirewallRules (filter by ipaddressid of sourcenat)
|
||||||
# 2. rule should be for ports 1-600 and in state=Active
|
# 2. rule should be for ports 1-600 and in state=Active
|
||||||
@ -1221,4 +1225,3 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||||||
"Check public IP address"
|
"Check public IP address"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -19,12 +19,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from marvin import remoteSSHClient
|
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
|
|
||||||
#Import System modules
|
#Import System modules
|
||||||
import time
|
import time
|
||||||
@ -37,7 +38,7 @@ class Services:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.services = {
|
self.services = {
|
||||||
"disk_offering":{
|
"disk_offering": {
|
||||||
"displaytext": "Small",
|
"displaytext": "Small",
|
||||||
"name": "Small",
|
"name": "Small",
|
||||||
"disksize": 1
|
"disksize": 1
|
||||||
@ -49,7 +50,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended in create account to
|
# Random characters are appended in create account to
|
||||||
# ensure unique username generated each time
|
# ensure unique username generated each time
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"virtual_machine": {
|
"virtual_machine": {
|
||||||
# Create a small virtual machine instance with disk offering
|
# Create a small virtual machine instance with disk offering
|
||||||
@ -66,7 +67,7 @@ class Services:
|
|||||||
"host": {
|
"host": {
|
||||||
"publicport": 22,
|
"publicport": 22,
|
||||||
"username": "root", # Host creds for SSH
|
"username": "root", # Host creds for SSH
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -89,11 +90,11 @@ class Services:
|
|||||||
"endport": -1,
|
"endport": -1,
|
||||||
"cidrlist": '0.0.0.0/0',
|
"cidrlist": '0.0.0.0/0',
|
||||||
},
|
},
|
||||||
"ostypeid": '0c2c5d19-525b-41be-a8c3-c6607412f82b',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# CentOS 5.3 (64-bit)
|
# CentOS 5.3 (64-bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'basic',
|
"mode": 'basic',
|
||||||
# Networking mode: Basic or Advanced
|
# Networking mode: Basic or Advanced
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,10 +166,12 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_deployVM_InDefaultSecurityGroup(self):
|
def test_01_deployVM_InDefaultSecurityGroup(self):
|
||||||
"""Test deploy VM in default security group
|
"""Test deploy VM in default security group
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. deploy Virtual machine using admin user
|
# 1. deploy Virtual machine using admin user
|
||||||
# 2. listVM should show a VM in Running state
|
# 2. listVM should show a VM in Running state
|
||||||
@ -242,10 +245,12 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_02_listSecurityGroups(self):
|
def test_02_listSecurityGroups(self):
|
||||||
"""Test list security groups for admin account
|
"""Test list security groups for admin account
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. listSecurityGroups in admin account
|
# 1. listSecurityGroups in admin account
|
||||||
# 2. There should be one security group (default) listed for the admin account
|
# 2. There should be one security group (default) listed for the admin account
|
||||||
@ -275,10 +280,12 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_03_accessInDefaultSecurityGroup(self):
|
def test_03_accessInDefaultSecurityGroup(self):
|
||||||
"""Test access in default security group
|
"""Test access in default security group
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. deploy Virtual machine using admin user
|
# 1. deploy Virtual machine using admin user
|
||||||
# 2. listVM should show a VM in Running state
|
# 2. listVM should show a VM in Running state
|
||||||
@ -430,10 +437,12 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_authorizeIngressRule(self):
|
def test_01_authorizeIngressRule(self):
|
||||||
"""Test authorize ingress rule
|
"""Test authorize ingress rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
#1. Create Security group for the account.
|
#1. Create Security group for the account.
|
||||||
#2. Createsecuritygroup (ssh-incoming) for this account
|
#2. Createsecuritygroup (ssh-incoming) for this account
|
||||||
@ -564,10 +573,12 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_revokeIngressRule(self):
|
def test_01_revokeIngressRule(self):
|
||||||
"""Test revoke ingress rule
|
"""Test revoke ingress rule
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
#1. Create Security group for the account.
|
#1. Create Security group for the account.
|
||||||
#2. Createsecuritygroup (ssh-incoming) for this account
|
#2. Createsecuritygroup (ssh-incoming) for this account
|
||||||
@ -729,9 +740,12 @@ class TestDhcpOnlyRouter(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip", "basic"])
|
||||||
def test_01_dhcpOnlyRouter(self):
|
def test_01_dhcpOnlyRouter(self):
|
||||||
"""Test router services for user account
|
"""Test router services for user account
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
#1. List routers for any user account
|
#1. List routers for any user account
|
||||||
#2. The only service supported by this router should be dhcp
|
#2. The only service supported by this router should be dhcp
|
||||||
@ -754,7 +768,7 @@ class TestDhcpOnlyRouter(cloudstackTestCase):
|
|||||||
zoneid=router.zoneid,
|
zoneid=router.zoneid,
|
||||||
type='Routing',
|
type='Routing',
|
||||||
state='Up',
|
state='Up',
|
||||||
virtualmachineid=self.virtual_machine.id
|
id=router.hostid
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
isinstance(hosts, list),
|
isinstance(hosts, list),
|
||||||
@ -856,9 +870,11 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_deployVMWithUserData(self):
|
def test_01_deployVMWithUserData(self):
|
||||||
"""Test Deploy VM with User data"""
|
"""Test Deploy VM with User data"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. CreateAccount of type user
|
# 1. CreateAccount of type user
|
||||||
# 2. CreateSecurityGroup ssh-incoming
|
# 2. CreateSecurityGroup ssh-incoming
|
||||||
@ -1030,9 +1046,11 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_delete_security_grp_running_vm(self):
|
def test_01_delete_security_grp_running_vm(self):
|
||||||
"""Test delete security group with running VM"""
|
"""Test delete security group with running VM"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. createsecuritygroup (ssh-incoming) for this account
|
# 1. createsecuritygroup (ssh-incoming) for this account
|
||||||
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
||||||
@ -1112,9 +1130,11 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_02_delete_security_grp_withoout_running_vm(self):
|
def test_02_delete_security_grp_withoout_running_vm(self):
|
||||||
"""Test delete security group without running VM"""
|
"""Test delete security group without running VM"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. createsecuritygroup (ssh-incoming) for this account
|
# 1. createsecuritygroup (ssh-incoming) for this account
|
||||||
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
||||||
@ -1272,9 +1292,11 @@ class TestIngressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_01_authorizeIngressRule_AfterDeployVM(self):
|
def test_01_authorizeIngressRule_AfterDeployVM(self):
|
||||||
"""Test delete security group with running VM"""
|
"""Test delete security group with running VM"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
||||||
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
||||||
@ -1382,9 +1404,11 @@ class TestIngressRule(cloudstackTestCase):
|
|||||||
% (ingress_rule_2["id"], e))
|
% (ingress_rule_2["id"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_02_revokeIngressRule_AfterDeployVM(self):
|
def test_02_revokeIngressRule_AfterDeployVM(self):
|
||||||
"""Test Revoke ingress rule after deploy VM"""
|
"""Test Revoke ingress rule after deploy VM"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
||||||
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
||||||
@ -1511,7 +1535,7 @@ class TestIngressRule(cloudstackTestCase):
|
|||||||
|
|
||||||
result = security_group.revoke(
|
result = security_group.revoke(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
id = icmp_rule["ruleid"]
|
id=icmp_rule["ruleid"]
|
||||||
)
|
)
|
||||||
self.debug("Revoke ingress rule result: %s" % result)
|
self.debug("Revoke ingress rule result: %s" % result)
|
||||||
|
|
||||||
@ -1534,9 +1558,11 @@ class TestIngressRule(cloudstackTestCase):
|
|||||||
% (icmp_rule["ruleid"], e))
|
% (icmp_rule["ruleid"], e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["sg", "eip"])
|
||||||
def test_03_stopStartVM_verifyIngressAccess(self):
|
def test_03_stopStartVM_verifyIngressAccess(self):
|
||||||
"""Test Start/Stop VM and Verify ingress rule"""
|
"""Test Start/Stop VM and Verify ingress rule"""
|
||||||
|
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
# 1. createsecuritygroup (ssh-incoming, 22via22) for this account
|
||||||
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
# 2. authorizeSecurityGroupIngress to allow ssh access to the VM
|
||||||
|
|||||||
@ -18,12 +18,14 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Snapshots Services
|
"""Test Snapshots Services
|
||||||
@ -38,7 +40,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -65,7 +67,7 @@ class Services:
|
|||||||
"mgmt_server": {
|
"mgmt_server": {
|
||||||
"ipaddress": '192.168.100.21',
|
"ipaddress": '192.168.100.21',
|
||||||
"username": "root",
|
"username": "root",
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
"port": 22,
|
"port": 22,
|
||||||
},
|
},
|
||||||
"recurring_snapshot": {
|
"recurring_snapshot": {
|
||||||
@ -79,7 +81,7 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
"displaytext": 'Template',
|
"displaytext": 'Template',
|
||||||
"name": 'Template',
|
"name": 'Template',
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
},
|
},
|
||||||
"diskdevice": "/dev/xvda",
|
"diskdevice": "/dev/xvda",
|
||||||
@ -92,11 +94,11 @@ class Services:
|
|||||||
"sub_lvl_dir2": "test2",
|
"sub_lvl_dir2": "test2",
|
||||||
"random_data": "random.data",
|
"random_data": "random.data",
|
||||||
|
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode" : 'advanced', # Networking mode: Advanced, Basic
|
"mode": 'advanced', # Networking mode: Advanced, Basic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -162,10 +164,11 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_createVM_snapshotTemplate(self):
|
def test_01_createVM_snapshotTemplate(self):
|
||||||
"""Test create VM, Snapshot and Template
|
"""Test create VM, Snapshot and Template
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy VM using default template, small service offering
|
# 1. Deploy VM using default template, small service offering
|
||||||
# and small data disk offering.
|
# and small data disk offering.
|
||||||
@ -326,9 +329,13 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
@ -337,7 +344,7 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
time.sleep(self.services["sleep"])
|
time.sleep(self.services["sleep"])
|
||||||
try:
|
try:
|
||||||
# Login to VM to check snapshot present on sec disk
|
# Login to VM to check snapshot present on sec disk
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["mgmt_server"]["ipaddress"],
|
self.services["mgmt_server"]["ipaddress"],
|
||||||
self.services["mgmt_server"]["port"],
|
self.services["mgmt_server"]["port"],
|
||||||
self.services["mgmt_server"]["username"],
|
self.services["mgmt_server"]["username"],
|
||||||
@ -346,7 +353,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount %s/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -363,8 +371,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for Management server: %s" %
|
self.fail("SSH failed for Management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
uuids.append(result)
|
uuids.append(result)
|
||||||
# Unmount the Sec Storage
|
# Unmount the Sec Storage
|
||||||
cmds = [
|
cmds = [
|
||||||
@ -377,8 +385,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for Management server: %s" %
|
self.fail("SSH failed for Management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -470,10 +478,11 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_02_accountSnapshotClean(self):
|
def test_02_accountSnapshotClean(self):
|
||||||
"""Test snapshot cleanup after account deletion
|
"""Test snapshot cleanup after account deletion
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. listAccounts API should list out the newly created account
|
# 1. listAccounts API should list out the newly created account
|
||||||
# 2. listVirtualMachines() command should return the deployed VM.
|
# 2. listVirtualMachines() command should return the deployed VM.
|
||||||
@ -585,10 +594,15 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
@ -596,7 +610,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
time.sleep(self.services["sleep"])
|
time.sleep(self.services["sleep"])
|
||||||
try:
|
try:
|
||||||
# Login to Secondary storage VM to check snapshot present on sec disk
|
# Login to Secondary storage VM to check snapshot present on sec disk
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["mgmt_server"]["ipaddress"],
|
self.services["mgmt_server"]["ipaddress"],
|
||||||
self.services["mgmt_server"]["port"],
|
self.services["mgmt_server"]["port"],
|
||||||
self.services["mgmt_server"]["username"],
|
self.services["mgmt_server"]["username"],
|
||||||
@ -605,7 +619,8 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount %s/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -630,9 +645,9 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
]
|
]
|
||||||
for c in cmds:
|
for c in cmds:
|
||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -676,16 +691,22 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmds = [
|
cmds = [
|
||||||
"mount %s/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -712,9 +733,9 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertNotEqual(
|
self.assertNotEqual(
|
||||||
@ -801,10 +822,11 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_03_snapshot_detachedDisk(self):
|
def test_03_snapshot_detachedDisk(self):
|
||||||
"""Test snapshot from detached disk
|
"""Test snapshot from detached disk
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. login in VM and write some data on data disk(use fdisk to
|
# 1. login in VM and write some data on data disk(use fdisk to
|
||||||
# partition datadisk,fdisk /dev/sdb, and make filesystem using
|
# partition datadisk,fdisk /dev/sdb, and make filesystem using
|
||||||
@ -906,8 +928,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
"Check snapshot id in list resources call"
|
"Check snapshot id in list resources call"
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for VM with IP: %s" %
|
self.fail("SSH failed for VM with IP: %s - %s" %
|
||||||
self.virtual_machine.ipaddress)
|
(self.virtual_machine.ipaddress, e))
|
||||||
|
|
||||||
# Fetch values from database
|
# Fetch values from database
|
||||||
qresultset = self.dbclient.execute(
|
qresultset = self.dbclient.execute(
|
||||||
@ -948,10 +970,16 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
|
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
@ -960,7 +988,7 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
try:
|
try:
|
||||||
# Login to Management server to check snapshot present on
|
# Login to Management server to check snapshot present on
|
||||||
# sec disk
|
# sec disk
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["mgmt_server"]["ipaddress"],
|
self.services["mgmt_server"]["ipaddress"],
|
||||||
self.services["mgmt_server"]["port"],
|
self.services["mgmt_server"]["port"],
|
||||||
self.services["mgmt_server"]["username"],
|
self.services["mgmt_server"]["username"],
|
||||||
@ -969,7 +997,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount %s/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -992,8 +1021,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
for c in cmds:
|
for c in cmds:
|
||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -1073,10 +1102,11 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_04_snapshot_limit(self):
|
def test_04_snapshot_limit(self):
|
||||||
"""Test snapshot limit in snapshot policies
|
"""Test snapshot limit in snapshot policies
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Perform hourly recurring snapshot on the root disk of VM and keep
|
# 1. Perform hourly recurring snapshot on the root disk of VM and keep
|
||||||
# the maxsnapshots as 1
|
# the maxsnapshots as 1
|
||||||
@ -1201,15 +1231,20 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
try:
|
try:
|
||||||
# Login to VM to check snapshot present on sec disk
|
# Login to VM to check snapshot present on sec disk
|
||||||
ssh_client = remoteSSHClient.remoteSSHClient(
|
ssh_client = remoteSSHClient(
|
||||||
self.services["mgmt_server"]["ipaddress"],
|
self.services["mgmt_server"]["ipaddress"],
|
||||||
self.services["mgmt_server"]["port"],
|
self.services["mgmt_server"]["port"],
|
||||||
self.services["mgmt_server"]["username"],
|
self.services["mgmt_server"]["username"],
|
||||||
@ -1218,7 +1253,8 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount %s/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -1243,8 +1279,8 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"SSH access failed for management server: %s" %
|
"SSH access failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -1325,10 +1361,11 @@ class TestSnapshotEvents(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_05_snapshot_events(self):
|
def test_05_snapshot_events(self):
|
||||||
"""Test snapshot events
|
"""Test snapshot events
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Perform snapshot on the root disk of this VM and check the events/alerts.
|
# 1. Perform snapshot on the root disk of this VM and check the events/alerts.
|
||||||
# 2. delete the snapshots and check the events/alerts
|
# 2. delete the snapshots and check the events/alerts
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
@ -43,7 +44,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -73,13 +74,13 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
# Configs for different Template formats
|
# Configs for different Template formats
|
||||||
# For Eg. raw image, zip etc
|
# For Eg. raw image, zip etc
|
||||||
0:{
|
0: {
|
||||||
"displaytext": "Public Template",
|
"displaytext": "Public Template",
|
||||||
"name": "Public template",
|
"name": "Public template",
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||||
"hypervisor": 'XenServer',
|
"hypervisor": 'XenServer',
|
||||||
"format" : 'VHD',
|
"format": 'VHD',
|
||||||
"isfeatured": True,
|
"isfeatured": True,
|
||||||
"ispublic": True,
|
"ispublic": True,
|
||||||
"isextractable": True,
|
"isextractable": True,
|
||||||
@ -88,12 +89,12 @@ class Services:
|
|||||||
"template": {
|
"template": {
|
||||||
"displaytext": "Cent OS Template",
|
"displaytext": "Cent OS Template",
|
||||||
"name": "Cent OS Template",
|
"name": "Cent OS Template",
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
},
|
},
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
"destzoneid": 2, # For Copy template (Destination zone)
|
"destzoneid": 2, # For Copy template (Destination zone)
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode": 'advanced', # Networking mode: Advanced, basic
|
"mode": 'advanced', # Networking mode: Advanced, basic
|
||||||
@ -159,10 +160,10 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_create_template(self):
|
def test_01_create_template(self):
|
||||||
"""Test create public & private template
|
"""Test create public & private template
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following:
|
# Validate the following:
|
||||||
# 1. Upload a templates in raw img format. Create a Vm instances from
|
# 1. Upload a templates in raw img format. Create a Vm instances from
|
||||||
# raw img template.
|
# raw img template.
|
||||||
@ -331,7 +332,7 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
raise Exception("List volumes failed.")
|
raise Exception("List volumes failed.")
|
||||||
|
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
timeout = timeout -1
|
timeout = timeout - 1
|
||||||
|
|
||||||
cls.volume = list_volume[0]
|
cls.volume = list_volume[0]
|
||||||
|
|
||||||
@ -375,6 +376,7 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_create_template_volume(self):
|
def test_01_create_template_volume(self):
|
||||||
"""Test Create template from volume
|
"""Test Create template from volume
|
||||||
"""
|
"""
|
||||||
@ -414,6 +416,7 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "multizone"])
|
||||||
def test_02_copy_template(self):
|
def test_02_copy_template(self):
|
||||||
"""Test for copy template from one zone to another"""
|
"""Test for copy template from one zone to another"""
|
||||||
|
|
||||||
@ -471,6 +474,7 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
self.apiclient.deleteTemplate(cmd)
|
self.apiclient.deleteTemplate(cmd)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_03_delete_template(self):
|
def test_03_delete_template(self):
|
||||||
"""Test Delete template
|
"""Test Delete template
|
||||||
"""
|
"""
|
||||||
@ -525,6 +529,8 @@ class TestTemplates(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_04_template_from_snapshot(self):
|
def test_04_template_from_snapshot(self):
|
||||||
"""Create Template from snapshot
|
"""Create Template from snapshot
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -18,14 +18,16 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class Services:
|
class Services:
|
||||||
"""Test Snapshots Services
|
"""Test Snapshots Services
|
||||||
"""
|
"""
|
||||||
@ -39,7 +41,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -69,7 +71,7 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
"displaytext": 'Template',
|
"displaytext": 'Template',
|
||||||
"name": 'Template',
|
"name": 'Template',
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
||||||
},
|
},
|
||||||
@ -81,7 +83,7 @@ class Services:
|
|||||||
"isextractable": True,
|
"isextractable": True,
|
||||||
"isfeatured": True,
|
"isfeatured": True,
|
||||||
"ispublic": True,
|
"ispublic": True,
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
},
|
},
|
||||||
"lbrule": {
|
"lbrule": {
|
||||||
"name": "SSH",
|
"name": "SSH",
|
||||||
@ -99,11 +101,11 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
"password": "test",
|
"password": "test",
|
||||||
},
|
},
|
||||||
"ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3',
|
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
"mode":'advanced'
|
"mode": 'advanced'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -176,10 +178,10 @@ class TestVmUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_vm_usage(self):
|
def test_01_vm_usage(self):
|
||||||
"""Test Create/Destroy VM and verify usage calculation
|
"""Test Create/Destroy VM and verify usage calculation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a VM. Verify usage_events table contains VM .create,
|
# 1. Create a VM. Verify usage_events table contains VM .create,
|
||||||
# VM.start , Network.offering.assign , Volume.create events
|
# VM.start , Network.offering.assign , Volume.create events
|
||||||
@ -367,10 +369,10 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "eip", "advancedns", "simulator"])
|
||||||
def test_01_public_ip_usage(self):
|
def test_01_public_ip_usage(self):
|
||||||
"""Test Assign new IP and verify usage calculation
|
"""Test Assign new IP and verify usage calculation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Aquire a IP for the network of this account. Verify usage_event
|
# 1. Aquire a IP for the network of this account. Verify usage_event
|
||||||
# table has Acquire IP event for the IP for this account
|
# table has Acquire IP event for the IP for this account
|
||||||
@ -514,10 +516,10 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_volume_usage(self):
|
def test_01_volume_usage(self):
|
||||||
"""Test Create/delete a volume and verify correct usage is recorded
|
"""Test Create/delete a volume and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Volume.create event for both root and data disk is there for the
|
# 1. Volume.create event for both root and data disk is there for the
|
||||||
# created account in cloud.usage_event table
|
# created account in cloud.usage_event table
|
||||||
@ -695,11 +697,11 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_01_template_usage(self):
|
def test_01_template_usage(self):
|
||||||
"""Test Upload/ delete a template and verify correct usage is generated
|
"""Test Upload/ delete a template and verify correct usage is generated
|
||||||
for the template uploaded
|
for the template uploaded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a account
|
# 1. Create a account
|
||||||
# 2. Upload a template from this account. template.create event is
|
# 2. Upload a template from this account. template.create event is
|
||||||
@ -838,10 +840,10 @@ class TestISOUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"])
|
||||||
def test_01_ISO_usage(self):
|
def test_01_ISO_usage(self):
|
||||||
"""Test Create/Delete a ISO and verify its usage is generated correctly
|
"""Test Create/Delete a ISO and verify its usage is generated correctly
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create a account
|
# 1. Create a account
|
||||||
# 2. Upload a ISO from this account. ISO.create event is recorded in
|
# 2. Upload a ISO from this account. ISO.create event is recorded in
|
||||||
@ -989,10 +991,10 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "eip", "advancedns", "simulator"])
|
||||||
def test_01_lb_usage(self):
|
def test_01_lb_usage(self):
|
||||||
"""Test Create/Delete a LB rule and verify correct usage is recorded
|
"""Test Create/Delete a LB rule and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Acquire a IP for this account. lb.rule.create event is registered
|
# 1. Acquire a IP for this account. lb.rule.create event is registered
|
||||||
# for this account in cloud.usage_event table
|
# for this account in cloud.usage_event table
|
||||||
@ -1144,11 +1146,12 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(speed = "slow")
|
||||||
|
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
|
||||||
def test_01_snapshot_usage(self):
|
def test_01_snapshot_usage(self):
|
||||||
"""Test Create/Delete a manual snap shot and verify
|
"""Test Create/Delete a manual snap shot and verify
|
||||||
correct usage is recorded
|
correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Create snapshot of the root disk for this account.Snapshot.create
|
# 1. Create snapshot of the root disk for this account.Snapshot.create
|
||||||
# event is there for the created account in cloud.usage_event table
|
# event is there for the created account in cloud.usage_event table
|
||||||
@ -1315,10 +1318,10 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns", "simulator"])
|
||||||
def test_01_nat_usage(self):
|
def test_01_nat_usage(self):
|
||||||
"""Test Create/Delete a PF rule and verify correct usage is recorded
|
"""Test Create/Delete a PF rule and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Acquire a IP for this account
|
# 1. Acquire a IP for this account
|
||||||
# 2. Create a PF rule on the IP associated with this account.
|
# 2. Create a PF rule on the IP associated with this account.
|
||||||
@ -1477,10 +1480,10 @@ class TestVpnUsage(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_vpn_usage(self):
|
def test_01_vpn_usage(self):
|
||||||
"""Test Create/Delete a VPN and verify correct usage is recorded
|
"""Test Create/Delete a VPN and verify correct usage is recorded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Enable VPN for this IP. vpn.add.user event is registered for this
|
# 1. Enable VPN for this IP. vpn.add.user event is registered for this
|
||||||
# account in cloud.usage_event table
|
# account in cloud.usage_event table
|
||||||
|
|||||||
@ -18,12 +18,13 @@
|
|||||||
"""
|
"""
|
||||||
#Import Local Modules
|
#Import Local Modules
|
||||||
import marvin
|
import marvin
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.cloudstackTestCase import *
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.cloudstackAPI import *
|
||||||
from integration.lib.utils import *
|
from integration.lib.utils import *
|
||||||
from integration.lib.base import *
|
from integration.lib.base import *
|
||||||
from integration.lib.common import *
|
from integration.lib.common import *
|
||||||
from marvin import remoteSSHClient
|
from marvin.remoteSSHClient import remoteSSHClient
|
||||||
#Import System modules
|
#Import System modules
|
||||||
import os
|
import os
|
||||||
import urllib
|
import urllib
|
||||||
@ -44,7 +45,7 @@ class Services:
|
|||||||
"username": "test",
|
"username": "test",
|
||||||
# Random characters are appended for unique
|
# Random characters are appended for unique
|
||||||
# username
|
# username
|
||||||
"password": "fr3sca",
|
"password": "password",
|
||||||
},
|
},
|
||||||
"service_offering": {
|
"service_offering": {
|
||||||
"name": "Tiny Instance",
|
"name": "Tiny Instance",
|
||||||
@ -78,10 +79,14 @@ class Services:
|
|||||||
"name": "testISO",
|
"name": "testISO",
|
||||||
"url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso",
|
"url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso",
|
||||||
# Source URL where ISO is located
|
# Source URL where ISO is located
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||||
|
},
|
||||||
|
"custom_volume": {
|
||||||
|
"customdisksize": 2,
|
||||||
|
"diskname": "Custom disk",
|
||||||
},
|
},
|
||||||
"sleep": 50,
|
"sleep": 50,
|
||||||
"ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
|
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||||
"mode": 'advanced',
|
"mode": 'advanced',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,10 +145,10 @@ class TestAttachVolume(cloudstackTestCase):
|
|||||||
self.dbclient = self.testClient.getDbConnection()
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
self.cleanup = []
|
self.cleanup = []
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_volume_attach(self):
|
def test_01_volume_attach(self):
|
||||||
"""Test Attach volumes (max capacity)
|
"""Test Attach volumes (max capacity)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Validate the following
|
# Validate the following
|
||||||
# 1. Deploy a vm and create 5 data disk
|
# 1. Deploy a vm and create 5 data disk
|
||||||
# 2. Attach all the created Volume to the vm.
|
# 2. Attach all the created Volume to the vm.
|
||||||
@ -292,6 +297,7 @@ class TestAttachVolume(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_02_volume_attach_max(self):
|
def test_02_volume_attach_max(self):
|
||||||
"""Test attach volumes (more than max) to an instance
|
"""Test attach volumes (more than max) to an instance
|
||||||
"""
|
"""
|
||||||
@ -422,6 +428,7 @@ class TestAttachDetachVolume(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_volume_attach_detach(self):
|
def test_01_volume_attach_detach(self):
|
||||||
"""Test Volume attach/detach to VM (5 data volumes)
|
"""Test Volume attach/detach to VM (5 data volumes)
|
||||||
"""
|
"""
|
||||||
@ -669,6 +676,7 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_volume_iso_attach(self):
|
def test_01_volume_iso_attach(self):
|
||||||
"""Test Volumes and ISO attach
|
"""Test Volumes and ISO attach
|
||||||
"""
|
"""
|
||||||
@ -864,6 +872,7 @@ class TestVolumes(cloudstackTestCase):
|
|||||||
cleanup_resources(self.apiclient, self.cleanup)
|
cleanup_resources(self.apiclient, self.cleanup)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_01_attach_volume(self):
|
def test_01_attach_volume(self):
|
||||||
"""Attach a created Volume to a Running VM
|
"""Attach a created Volume to a Running VM
|
||||||
"""
|
"""
|
||||||
@ -947,6 +956,7 @@ class TestVolumes(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_02_detach_volume(self):
|
def test_02_detach_volume(self):
|
||||||
"""Detach a Volume attached to a VM
|
"""Detach a Volume attached to a VM
|
||||||
"""
|
"""
|
||||||
@ -994,6 +1004,7 @@ class TestVolumes(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
def test_03_delete_detached_volume(self):
|
def test_03_delete_detached_volume(self):
|
||||||
"""Delete a Volume unattached to an VM
|
"""Delete a Volume unattached to an VM
|
||||||
"""
|
"""
|
||||||
@ -1020,3 +1031,139 @@ class TestVolumes(cloudstackTestCase):
|
|||||||
"Check if volume exists in ListVolumes"
|
"Check if volume exists in ListVolumes"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.api_client = super(
|
||||||
|
TestDeployVmWithCustomDisk,
|
||||||
|
cls
|
||||||
|
).getClsTestClient().getApiClient()
|
||||||
|
cls.services = Services().services
|
||||||
|
|
||||||
|
# Get Zone, Domain and templates
|
||||||
|
cls.domain = get_domain(cls.api_client, cls.services)
|
||||||
|
cls.zone = get_zone(cls.api_client, cls.services)
|
||||||
|
cls.disk_offering = DiskOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["disk_offering"],
|
||||||
|
custom=True
|
||||||
|
)
|
||||||
|
template = get_template(
|
||||||
|
cls.api_client,
|
||||||
|
cls.zone.id,
|
||||||
|
cls.services["ostypeid"]
|
||||||
|
)
|
||||||
|
cls.services["zoneid"] = cls.zone.id
|
||||||
|
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||||
|
cls.services["virtual_machine"]["template"] = template.id
|
||||||
|
|
||||||
|
# Create VMs, NAT Rules etc
|
||||||
|
cls.account = Account.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["account"],
|
||||||
|
domainid=cls.domain.id
|
||||||
|
)
|
||||||
|
|
||||||
|
cls.services["account"] = cls.account.account.name
|
||||||
|
cls.service_offering = ServiceOffering.create(
|
||||||
|
cls.api_client,
|
||||||
|
cls.services["service_offering"]
|
||||||
|
)
|
||||||
|
cls._cleanup = [
|
||||||
|
cls.service_offering,
|
||||||
|
cls.disk_offering,
|
||||||
|
cls.account
|
||||||
|
]
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
|
||||||
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
self.dbclient = self.testClient.getDbConnection()
|
||||||
|
self.cleanup = []
|
||||||
|
|
||||||
|
@attr(tags=["advanced", "configuration", "advancedns", "simulator",
|
||||||
|
"api", "basic", "eip", "sg"])
|
||||||
|
def test_deployVmWithCustomDisk(self):
|
||||||
|
"""Test custom disk sizes beyond range
|
||||||
|
"""
|
||||||
|
# Steps for validation
|
||||||
|
# 1. listConfigurations - custom.diskoffering.size.min
|
||||||
|
# and custom.diskoffering.size.max
|
||||||
|
# 2. deployVm with custom disk offering size < min
|
||||||
|
# 3. deployVm with custom disk offering min< size < max
|
||||||
|
# 4. deployVm with custom disk offering size > max
|
||||||
|
# Validate the following
|
||||||
|
# 2. and 4. of deploy VM should fail.
|
||||||
|
# Only case 3. should succeed.
|
||||||
|
# cleanup all created data disks from the account
|
||||||
|
|
||||||
|
config = Configurations.list(
|
||||||
|
self.apiclient,
|
||||||
|
name="custom.diskoffering.size.min"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(config, list),
|
||||||
|
True,
|
||||||
|
"custom.diskoffering.size.min should be present in global config"
|
||||||
|
)
|
||||||
|
# minimum size of custom disk (in GBs)
|
||||||
|
min_size = int(config[0].value)
|
||||||
|
self.debug("custom.diskoffering.size.min: %s" % min_size)
|
||||||
|
|
||||||
|
config = Configurations.list(
|
||||||
|
self.apiclient,
|
||||||
|
name="custom.diskoffering.size.max"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
isinstance(config, list),
|
||||||
|
True,
|
||||||
|
"custom.diskoffering.size.min should be present in global config"
|
||||||
|
)
|
||||||
|
# maximum size of custom disk (in GBs)
|
||||||
|
max_size = int(config[0].value)
|
||||||
|
self.debug("custom.diskoffering.size.max: %s" % max_size)
|
||||||
|
|
||||||
|
self.debug("Creating a volume with size less than min cust disk size")
|
||||||
|
self.services["custom_volume"]["customdisksize"] = (min_size - 1)
|
||||||
|
self.services["custom_volume"]["zoneid"] = self.zone.id
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
Volume.create_custom_disk(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["custom_volume"],
|
||||||
|
account=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
diskofferingid=self.disk_offering.id
|
||||||
|
)
|
||||||
|
self.debug("Create volume failed!")
|
||||||
|
|
||||||
|
self.debug("Creating a volume with size more than max cust disk size")
|
||||||
|
self.services["custom_volume"]["customdisksize"] = (max_size + 1)
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
Volume.create_custom_disk(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["custom_volume"],
|
||||||
|
account=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
diskofferingid=self.disk_offering.id
|
||||||
|
)
|
||||||
|
self.debug("Create volume failed!")
|
||||||
|
|
||||||
|
self.debug("Creating a volume with size more than min cust disk " +
|
||||||
|
"but less than max cust disk size"
|
||||||
|
)
|
||||||
|
self.services["custom_volume"]["customdisksize"] = (min_size + 1)
|
||||||
|
try:
|
||||||
|
Volume.create_custom_disk(
|
||||||
|
self.apiclient,
|
||||||
|
self.services["custom_volume"],
|
||||||
|
account=self.account.account.name,
|
||||||
|
domainid=self.account.account.domainid,
|
||||||
|
diskofferingid=self.disk_offering.id
|
||||||
|
)
|
||||||
|
self.debug("Create volume of cust disk size succeeded")
|
||||||
|
except Exception as e:
|
||||||
|
self.fail("Create volume failed with exception: %s" % e)
|
||||||
|
return
|
||||||
|
|||||||
@ -158,6 +158,45 @@ class User:
|
|||||||
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
return(apiclient.listUsers(cmd))
|
return(apiclient.listUsers(cmd))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def registerUserKeys(cls, apiclient, userid):
|
||||||
|
cmd = registerUserKeys.registerUserKeysCmd()
|
||||||
|
cmd.id = userid
|
||||||
|
return apiclient.registerUserKeys(cmd)
|
||||||
|
|
||||||
|
def update(self, apiclient, **kwargs):
|
||||||
|
"""Updates the user details"""
|
||||||
|
|
||||||
|
cmd = updateUser.updateUserCmd()
|
||||||
|
cmd.id = self.id
|
||||||
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
|
return (apiclient.updateUser(cmd))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def update(cls, apiclient, id, **kwargs):
|
||||||
|
"""Updates the user details (class method)"""
|
||||||
|
|
||||||
|
cmd = updateUser.updateUserCmd()
|
||||||
|
cmd.id = id
|
||||||
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
|
return (apiclient.updateUser(cmd))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def login(cls, apiclient, username, password, domain=None, domainid=None):
|
||||||
|
"""Logins to the CloudStack"""
|
||||||
|
|
||||||
|
cmd = login.loginCmd()
|
||||||
|
cmd.username = username
|
||||||
|
# MD5 hashcoded password
|
||||||
|
mdf = hashlib.md5()
|
||||||
|
mdf.update(password)
|
||||||
|
cmd.password = mdf.hexdigest()
|
||||||
|
if domain:
|
||||||
|
cmd.domain = domain
|
||||||
|
if domainid:
|
||||||
|
cmd.domainid = domainid
|
||||||
|
return apiclient.login(cmd)
|
||||||
|
|
||||||
|
|
||||||
class VirtualMachine:
|
class VirtualMachine:
|
||||||
"""Manage virtual machine lifecycle"""
|
"""Manage virtual machine lifecycle"""
|
||||||
@ -174,7 +213,8 @@ class VirtualMachine:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, apiclient, services, templateid=None, accountid=None,
|
def create(cls, apiclient, services, templateid=None, accountid=None,
|
||||||
domainid=None, networkids=None, serviceofferingid=None,
|
domainid=None, networkids=None, serviceofferingid=None,
|
||||||
securitygroupids=None, projectid=None, mode='basic'):
|
securitygroupids=None, projectid=None, startvm=None,
|
||||||
|
diskofferingid=None, hostid=None, mode='basic'):
|
||||||
"""Create the instance"""
|
"""Create the instance"""
|
||||||
|
|
||||||
cmd = deployVirtualMachine.deployVirtualMachineCmd()
|
cmd = deployVirtualMachine.deployVirtualMachineCmd()
|
||||||
@ -219,6 +259,12 @@ class VirtualMachine:
|
|||||||
if projectid:
|
if projectid:
|
||||||
cmd.projectid = projectid
|
cmd.projectid = projectid
|
||||||
|
|
||||||
|
if startvm is not None:
|
||||||
|
cmd.startvm = startvm
|
||||||
|
|
||||||
|
if hostid:
|
||||||
|
cmd.hostid = hostid
|
||||||
|
|
||||||
virtual_machine = apiclient.deployVirtualMachine(cmd)
|
virtual_machine = apiclient.deployVirtualMachine(cmd)
|
||||||
|
|
||||||
# VM should be in Running state after deploy
|
# VM should be in Running state after deploy
|
||||||
@ -392,12 +438,17 @@ class Volume:
|
|||||||
return Volume(apiclient.createVolume(cmd).__dict__)
|
return Volume(apiclient.createVolume(cmd).__dict__)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_custom_disk(cls, apiclient, services,
|
def create_custom_disk(cls, apiclient, services, account=None,
|
||||||
account=None, domainid=None):
|
domainid=None, diskofferingid=None):
|
||||||
"""Create Volume from Custom disk offering"""
|
"""Create Volume from Custom disk offering"""
|
||||||
cmd = createVolume.createVolumeCmd()
|
cmd = createVolume.createVolumeCmd()
|
||||||
cmd.name = services["diskname"]
|
cmd.name = services["diskname"]
|
||||||
|
|
||||||
|
if diskofferingid:
|
||||||
|
cmd.diskofferingid = diskofferingid
|
||||||
|
elif "customdiskofferingid" in services:
|
||||||
cmd.diskofferingid = services["customdiskofferingid"]
|
cmd.diskofferingid = services["customdiskofferingid"]
|
||||||
|
|
||||||
cmd.size = services["customdisksize"]
|
cmd.size = services["customdisksize"]
|
||||||
cmd.zoneid = services["zoneid"]
|
cmd.zoneid = services["zoneid"]
|
||||||
|
|
||||||
@ -601,7 +652,9 @@ class Template:
|
|||||||
time.sleep(interval)
|
time.sleep(interval)
|
||||||
|
|
||||||
elif 'Installing' not in template.status:
|
elif 'Installing' not in template.status:
|
||||||
raise Exception("ErrorInDownload")
|
raise Exception(
|
||||||
|
"Error in downloading template: status - %s" %
|
||||||
|
template.status)
|
||||||
|
|
||||||
elif timeout == 0:
|
elif timeout == 0:
|
||||||
break
|
break
|
||||||
@ -693,10 +746,12 @@ class Iso:
|
|||||||
return
|
return
|
||||||
elif 'Downloaded' not in response.status and \
|
elif 'Downloaded' not in response.status and \
|
||||||
'Installing' not in response.status:
|
'Installing' not in response.status:
|
||||||
raise Exception("ErrorInDownload")
|
raise Exception(
|
||||||
|
"Error In Downloading ISO: ISO Status - %s" %
|
||||||
|
response.status)
|
||||||
|
|
||||||
elif timeout == 0:
|
elif timeout == 0:
|
||||||
raise Exception("TimeoutException")
|
raise Exception("ISO download Timeout Exception")
|
||||||
else:
|
else:
|
||||||
timeout = timeout - 1
|
timeout = timeout - 1
|
||||||
return
|
return
|
||||||
@ -728,12 +783,12 @@ class PublicIPAddress:
|
|||||||
if zoneid:
|
if zoneid:
|
||||||
cmd.zoneid = zoneid
|
cmd.zoneid = zoneid
|
||||||
elif "zoneid" in services:
|
elif "zoneid" in services:
|
||||||
services["zoneid"]
|
cmd.zoneid = services["zoneid"]
|
||||||
|
|
||||||
if domainid:
|
if domainid:
|
||||||
cmd.domainid = domainid
|
cmd.domainid = domainid
|
||||||
elif "domainid" in services:
|
elif "domainid" in services:
|
||||||
services["domainid"]
|
cmd.domainid = services["domainid"]
|
||||||
|
|
||||||
if networkid:
|
if networkid:
|
||||||
cmd.networkid = networkid
|
cmd.networkid = networkid
|
||||||
@ -1143,7 +1198,7 @@ class LoadBalancerRule:
|
|||||||
apiclient.removeFromLoadBalancerRule(cmd)
|
apiclient.removeFromLoadBalancerRule(cmd)
|
||||||
return
|
return
|
||||||
|
|
||||||
def update(self, apiclient, algorithm=None, description=None, name=None):
|
def update(self, apiclient, algorithm=None, description=None, name=None, **kwargs):
|
||||||
"""Updates the load balancing rule"""
|
"""Updates the load balancing rule"""
|
||||||
cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
|
cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
|
||||||
cmd.id = self.id
|
cmd.id = self.id
|
||||||
@ -1154,8 +1209,40 @@ class LoadBalancerRule:
|
|||||||
if name:
|
if name:
|
||||||
cmd.name = name
|
cmd.name = name
|
||||||
|
|
||||||
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
return apiclient.updateLoadBalancerRule(cmd)
|
return apiclient.updateLoadBalancerRule(cmd)
|
||||||
|
|
||||||
|
def createSticky(self, apiclient, methodname, name, description=None, param=None):
|
||||||
|
"""Creates a sticky policy for the LB rule"""
|
||||||
|
|
||||||
|
cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd()
|
||||||
|
cmd.lbruleid = self.id
|
||||||
|
cmd.methodname = methodname
|
||||||
|
cmd.name = name
|
||||||
|
if description:
|
||||||
|
cmd.description = description
|
||||||
|
if param:
|
||||||
|
cmd.param = []
|
||||||
|
for name, value in param.items():
|
||||||
|
cmd.param.append({'name': name, 'value': value})
|
||||||
|
return apiclient.createLBStickinessPolicy(cmd)
|
||||||
|
|
||||||
|
def deleteSticky(self, apiclient, id):
|
||||||
|
"""Deletes stickyness policy"""
|
||||||
|
|
||||||
|
cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd()
|
||||||
|
cmd.id = id
|
||||||
|
return apiclient.deleteLBStickinessPolicy(cmd)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def listStickyPolicies(cls, apiclient, lbruleid, **kwargs):
|
||||||
|
"""Lists stickiness policies for load balancing rule"""
|
||||||
|
|
||||||
|
cmd= listLBStickinessPolicies.listLBStickinessPoliciesCmd()
|
||||||
|
cmd.lbruleid = lbruleid
|
||||||
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
|
return apiclient.listLBStickinessPolicies(cmd)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def list(cls, apiclient, **kwargs):
|
def list(cls, apiclient, **kwargs):
|
||||||
"""List all Load balancing rules matching criteria"""
|
"""List all Load balancing rules matching criteria"""
|
||||||
@ -1404,6 +1491,15 @@ class Network:
|
|||||||
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
[setattr(cmd, k, v) for k, v in kwargs.items()]
|
||||||
return(apiclient.updateNetwork(cmd))
|
return(apiclient.updateNetwork(cmd))
|
||||||
|
|
||||||
|
def restart(self, apiclient, cleanup=None):
|
||||||
|
"""Restarts the network"""
|
||||||
|
|
||||||
|
cmd = restartNetwork.restartNetworkCmd()
|
||||||
|
cmd.id = self.id
|
||||||
|
if cleanup:
|
||||||
|
cmd.cleanup = cleanup
|
||||||
|
return(apiclient.restartNetwork(cmd))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def list(cls, apiclient, **kwargs):
|
def list(cls, apiclient, **kwargs):
|
||||||
"""List all Networks matching criteria"""
|
"""List all Networks matching criteria"""
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user