Merge branch 'master' into ui-template-uploader

This commit is contained in:
Brian Federle 2015-01-06 11:25:21 -08:00
commit 6d9542ff36
12 changed files with 69 additions and 51 deletions

View File

@ -308,8 +308,6 @@ public class ImplicitDedicationPlanner extends FirstFitPlanner implements Deploy
// But the host where system vms are running is marked as shared and still be part of empty Hosts.
// The scenario will fail where actual Empty hosts and uservms not running host.
return PlannerResourceUsage.Dedicated;
} else if (!preferred) {
return PlannerResourceUsage.Dedicated;
} else {
if (!allOtherHosts.isEmpty() && (hostsToAvoid == null || !hostsToAvoid.containsAll(allOtherHosts))) {
return PlannerResourceUsage.Shared;

View File

@ -70,7 +70,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<mainClass>com.cloud.agent.AgentShell</mainClass>
@ -124,7 +123,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>compile</phase>
@ -144,7 +142,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<excludes>
<exclude>none</exclude>

View File

@ -24,7 +24,7 @@
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<version>1.5</version>
<configuration>
<providerSelection>1.7</providerSelection>
</configuration>

38
pom.xml
View File

@ -32,6 +32,10 @@
<system>jira</system>
<url>https://issues.apache.org/jira/browse/CLOUDSTACK</url>
</issueManagement>
<prerequisites>
<maven>3.0.4</maven>
</prerequisites>
<properties>
<cs.jdk.version>1.7</cs.jdk.version>
@ -93,9 +97,9 @@
<cs.daemon.version>1.0.15</cs.daemon.version>
<cs.jna.version>4.0.0</cs.jna.version>
<cs.checkstyle.version>2.11</cs.checkstyle.version>
<cs.mycila.license.version>2.5</cs.mycila.license.version>
<cs.findbugs.version>2.5.3</cs.findbugs.version>
<cs.javadoc.version>2.9.1</cs.javadoc.version>
<cs.mycila.license.version>2.7</cs.mycila.license.version>
<cs.findbugs.version>3.0.0</cs.findbugs.version>
<cs.javadoc.version>2.10.1</cs.javadoc.version>
<cs.opensaml.version>2.6.1</cs.opensaml.version>
</properties>
@ -612,7 +616,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<version>2.5.1</version>
<executions>
<execution>
<id>default</id>
@ -695,12 +699,12 @@
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<version>1.8</version>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
@ -837,7 +841,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<version>3.2</version>
<configuration>
<source>${cs.jdk.version}</source>
<target>${cs.jdk.version}</target>
@ -850,7 +854,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<version>2.5</version>
<configuration>
<archive>
<manifest>
@ -863,7 +867,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<version>1.9.1</version>
<executions>
<execution>
<id>remove-old-installers</id>
@ -879,7 +883,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@ -922,7 +926,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.1</version>
<version>3.3</version>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
@ -946,6 +950,16 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
@ -983,7 +997,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<version>3.4</version>
</plugin>
</plugins>
</reporting>

View File

@ -1804,7 +1804,7 @@ public enum Config {
ConsoleProxyServiceOffering(
"Advanced",
ManagementServer.class,
Long.class,
String.class,
"consoleproxy.service.offering",
null,
"Uuid of the service offering used by console proxy; if NULL - system offering will be used",
@ -1812,10 +1812,10 @@ public enum Config {
SecondaryStorageServiceOffering(
"Advanced",
ManagementServer.class,
Long.class,
String.class,
"secstorage.service.offering",
null,
"Service offering used by secondary storage; if NULL - system offering will be used",
"Uuid of the service offering used by secondary storage; if NULL - system offering will be used",
null),
HaTag("Advanced", ManagementServer.class, String.class, "ha.tag", null, "HA tag defining that the host marked with this tag can be used for HA purposes only", null),
ImplicitHostTags(

View File

@ -2020,14 +2020,14 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
}
if ((cpuNumber != null) && ((cpuNumber.intValue() <= 0) || (cpuNumber.intValue() > 2147483647))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu number value between 1 and 2147483647");
if ((cpuNumber != null) && ((cpuNumber.intValue() <= 0) || (cpuNumber.longValue() > Integer.MAX_VALUE))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu number value between 1 and " + Integer.MAX_VALUE);
}
if ((cpuSpeed != null) && ((cpuSpeed.intValue() < 0) || (cpuSpeed.intValue() > 2147483647))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu speed value between 1 and 2147483647");
if ((cpuSpeed != null) && ((cpuSpeed.intValue() < 0) || (cpuSpeed.longValue() > Integer.MAX_VALUE))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu speed value between 0 and " + Integer.MAX_VALUE);
}
if ((memory != null) && ((memory.intValue() < 32) || (memory.intValue() > 2147483647))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the memory value between 32 and 2147483647 MB");
if ((memory != null) && ((memory.intValue() < 32) || (memory.longValue() > Integer.MAX_VALUE))) {
throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the memory value between 32 and " + Integer.MAX_VALUE + " MB");
}
// check if valid domain

View File

@ -91,7 +91,6 @@ import com.cloud.network.dao.IPAddressVO;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
import com.cloud.network.rules.RulesManager;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.NetworkOffering;
import com.cloud.offering.ServiceOffering;
import com.cloud.offerings.dao.NetworkOfferingDao;
@ -105,7 +104,6 @@ import com.cloud.storage.Storage;
import com.cloud.storage.StoragePoolStatus;
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.storage.dao.VMTemplateDao;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
@ -196,8 +194,6 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
@Inject
private ServiceOfferingDao _offeringDao;
@Inject
private DiskOfferingDao _diskOfferingDao;
@Inject
private NetworkOfferingDao _networkOfferingDao;
@Inject
private PrimaryDataStoreDao _storagePoolDao;
@ -1267,13 +1263,15 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
//check if there is a default service offering configured
String cpvmSrvcOffIdStr = configs.get(Config.ConsoleProxyServiceOffering.key());
if (cpvmSrvcOffIdStr != null) {
DiskOffering diskOffering = _diskOfferingDao.findByUuid(cpvmSrvcOffIdStr);
if (diskOffering == null) {
diskOffering = _diskOfferingDao.findById(Long.parseLong(cpvmSrvcOffIdStr));
_serviceOffering = _offeringDao.findByUuid(cpvmSrvcOffIdStr);
if (_serviceOffering == null) {
try {
_serviceOffering = _offeringDao.findById(Long.parseLong(cpvmSrvcOffIdStr));
} catch (NumberFormatException ex) {
s_logger.debug("The system service offering specified by global config is not id, but uuid=" + cpvmSrvcOffIdStr + " for console proxy vm");
}
}
if (diskOffering != null) {
_serviceOffering = _offeringDao.findById(diskOffering.getId());
} else {
if (_serviceOffering == null) {
s_logger.warn("Can't find system service offering specified by global config, uuid=" + cpvmSrvcOffIdStr + " for console proxy vm");
}
}

View File

@ -266,9 +266,6 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements RemoteAcc
Integer pskLength = _pskLength;
if (pskLength != null && (pskLength < 8 || pskLength > 256)) {
throw new ConfigurationException("Remote Access VPN: IPSec preshared key length should be between 8 and 256");
} else if (pskLength == null) {
s_logger.warn("Remote Access VPN configuration missing Preshared Key Length -- ignoring");
return;
}
String[] range = ipRange.split("-");

View File

@ -882,7 +882,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (serviceOffering.getCpu() == null) {
String cpuNumber = customParameters.get(UsageEventVO.DynamicParameters.cpuNumber.name());
if ((cpuNumber == null) || (NumbersUtil.parseInt(cpuNumber, -1) <= 0)) {
throw new InvalidParameterValueException("Invalid cpu cores value, specify a value between 1 and 2147483647");
throw new InvalidParameterValueException("Invalid cpu cores value, specify a value between 1 and " + Integer.MAX_VALUE);
}
} else if (customParameters.containsKey(UsageEventVO.DynamicParameters.cpuNumber.name())) {
throw new InvalidParameterValueException("The cpu cores of this offering id:" + serviceOffering.getId()
@ -892,7 +892,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (serviceOffering.getSpeed() == null) {
String cpuSpeed = customParameters.get(UsageEventVO.DynamicParameters.cpuSpeed.name());
if ((cpuSpeed == null) || (NumbersUtil.parseInt(cpuSpeed, -1) <= 0)) {
throw new InvalidParameterValueException("Invalid cpu speed value, specify a value between 1 and 2147483647");
throw new InvalidParameterValueException("Invalid cpu speed value, specify a value between 1 and " + Integer.MAX_VALUE);
}
} else if (customParameters.containsKey(UsageEventVO.DynamicParameters.cpuSpeed.name())) {
throw new InvalidParameterValueException("The cpu speed of this offering id:" + serviceOffering.getId()
@ -902,7 +902,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (serviceOffering.getRamSize() == null) {
String memory = customParameters.get(UsageEventVO.DynamicParameters.memory.name());
if (memory == null || (NumbersUtil.parseInt(memory, -1) < 32)) {
throw new InvalidParameterValueException("Invalid memory value, specify a value between 32 and 2147483647 MB");
throw new InvalidParameterValueException("Invalid memory value, specify a value between 32 and " + Integer.MAX_VALUE + " MB");
}
} else if (customParameters.containsKey(UsageEventVO.DynamicParameters.memory.name())) {
throw new InvalidParameterValueException("The memory of this offering id:" + serviceOffering.getId() + " is not customizable. This is predefined in the template.");

View File

@ -853,14 +853,20 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
//check if there is a default service offering configured
String ssvmSrvcOffIdStr = configs.get(Config.SecondaryStorageServiceOffering.key());
if (ssvmSrvcOffIdStr != null) {
Long ssvmSrvcOffId = Long.parseLong(ssvmSrvcOffIdStr);
_serviceOffering = _offeringDao.findById(ssvmSrvcOffId);
if (_serviceOffering == null || !_serviceOffering.getSystemUse()) {
String msg = "Can't find system service offering id=" + ssvmSrvcOffId + " for secondary storage vm";
s_logger.error(msg);
throw new ConfigurationException(msg);
_serviceOffering = _offeringDao.findByUuid(ssvmSrvcOffIdStr);
if (_serviceOffering == null) {
try {
_serviceOffering = _offeringDao.findById(Long.parseLong(ssvmSrvcOffIdStr));
} catch (NumberFormatException ex) {
s_logger.debug("The system service offering specified by global config is not id, but uuid=" + ssvmSrvcOffIdStr + " for secondary storage vm");
}
}
} else {
if (_serviceOffering == null) {
s_logger.warn("Can't find system service offering specified by global config, uuid=" + ssvmSrvcOffIdStr + " for secondary storage vm");
}
}
if(_serviceOffering == null || !_serviceOffering.getSystemUse()){
int ramSize = NumbersUtil.parseInt(_configDao.getValue("ssvm.ram.size"), DEFAULT_SS_VM_RAMSIZE);
int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("ssvm.cpu.mhz"), DEFAULT_SS_VM_CPUMHZ);
_useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));

View File

@ -1005,3 +1005,5 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervis
INSERT IGNORE INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `default_value`, `description`) VALUES ('Advanced', 'DEFAULT', 'ManagementServer', 'xen.heartbeat.timeout' , '180', '120', 'Timeout value to send to the xenheartbeat script for guarding the self fencing functionality');
UPDATE `cloud`.`configuration` SET description='Uuid of the service offering used by secondary storage; if NULL - system offering will be used' where name='secstorage.service.offering';

View File

@ -25,12 +25,18 @@
<groupId>org.apache.cloudstack</groupId>
<artifactId>checkstyle</artifactId>
<version>4.6.0-SNAPSHOT</version>
<prerequisites>
<maven>3.0.4</maven>
</prerequisites>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.11</version>
<version>2.13</version>
<executions>
<execution>
<phase>none</phase>