diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java
index a9595fe7574..e63fcece525 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -264,6 +264,8 @@ public interface ConfigurationService {
boolean removeLDAP(LDAPRemoveCmd cmd);
+ LDAPConfigCmd listLDAPConfig(LDAPConfigCmd cmd);
+
/**
* @param offering
* @return
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
index fbe8ab000e6..2976de4bf28 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
@@ -31,6 +31,7 @@ import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
@APICommand(name = "ldapConfig", description="Configure the LDAP context for this site.", responseObject=LDAPConfigResponse.class, since="3.0.0")
@@ -43,7 +44,10 @@ public class LDAPConfigCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, required=true, description="Hostname or ip address of the ldap server eg: my.ldap.com")
+ @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.STRING, description="Hostname or ip address of the ldap server eg: my.ldap.com")
+ private String listall;
+
+ @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, description="Hostname or ip address of the ldap server eg: my.ldap.com")
private String hostname;
@Parameter(name=ApiConstants.PORT, type=CommandType.INTEGER, description="Specify the LDAP port if required, default is 389.")
@@ -52,10 +56,10 @@ public class LDAPConfigCmd extends BaseCmd {
@Parameter(name=ApiConstants.USE_SSL, type=CommandType.BOOLEAN, description="Check Use SSL if the external LDAP server is configured for LDAP over SSL.")
private Boolean useSSL;
- @Parameter(name=ApiConstants.SEARCH_BASE, type=CommandType.STRING, required=true, description="The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com.")
+ @Parameter(name=ApiConstants.SEARCH_BASE, type=CommandType.STRING, description="The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com.")
private String searchBase;
- @Parameter(name=ApiConstants.QUERY_FILTER, type=CommandType.STRING, required=true, description="You specify a query filter here, which narrows down the users, who can be part of this domain.")
+ @Parameter(name=ApiConstants.QUERY_FILTER, type=CommandType.STRING, description="You specify a query filter here, which narrows down the users, who can be part of this domain.")
private String queryFilter;
@Parameter(name=ApiConstants.BIND_DN, type=CommandType.STRING, description="Specify the distinguished name of a user with the search permission on the directory.")
@@ -74,6 +78,10 @@ public class LDAPConfigCmd extends BaseCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
+ public String getListAll() {
+ return listall == null ? "false" : listall;
+ }
+
public String getBindPassword() {
return bindPassword;
}
@@ -82,30 +90,56 @@ public class LDAPConfigCmd extends BaseCmd {
return bindDN;
}
+ public void setBindDN(String bdn) {
+ this.bindDN=bdn;
+ }
+
public String getQueryFilter() {
return queryFilter;
}
+ public void setQueryFilter(String queryFilter) {
+ this.queryFilter=queryFilter;
+ }
public String getSearchBase() {
return searchBase;
}
+ public void setSearchBase(String searchBase) {
+ this.searchBase=searchBase;
+ }
+
public Boolean getUseSSL() {
- return useSSL == null ? Boolean.FALSE : Boolean.TRUE;
+ return useSSL == null ? Boolean.FALSE : useSSL;
+ }
+
+ public void setUseSSL(Boolean useSSL) {
+ this.useSSL=useSSL;
}
public String getHostname() {
return hostname;
}
+ public void setHostname(String hostname) {
+ this.hostname=hostname;
+ }
+
public Integer getPort() {
return port <= 0 ? 389 : port;
}
+ public void setPort(Integer port) {
+ this.port=port;
+ }
+
public String getTrustStore() {
return trustStore;
}
+ public void setTrustStore(String trustStore) {
+ this.trustStore=trustStore;
+ }
public String getTrustStorePassword() {
return trustStorePassword;
@@ -122,12 +156,25 @@ public class LDAPConfigCmd extends BaseCmd {
InsufficientCapacityException, ServerApiException,
ConcurrentOperationException, ResourceAllocationException {
try {
- boolean result = _configService.updateLDAP(this);
- if (result){
- LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(getHostname(), getPort(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN());
+ if ("true".equalsIgnoreCase(getListAll())){
+ // return the existing conf
+ LDAPConfigCmd cmd = _configService.listLDAPConfig(this);
+ LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(cmd.getHostname(), cmd.getPort(), cmd.getUseSSL(),
+ cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN());
lr.setResponseName(getCommandName());
this.setResponseObject(lr);
}
+ else if (getHostname()==null || getSearchBase() == null || getQueryFilter() == null) {
+ throw new InvalidParameterValueException("You need to provide hostname, serachbase and queryfilter to configure your LDAP server");
+ }
+ else {
+ boolean result = _configService.updateLDAP(this);
+ if (result){
+ LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(getHostname(), getPort(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN());
+ lr.setResponseName(getCommandName());
+ this.setResponseObject(lr);
+ }
+ }
}
catch (NamingException ne){
ne.printStackTrace();
diff --git a/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java b/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
index aa10229f2bd..bbeec630d81 100644
--- a/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
@@ -30,7 +30,7 @@ public class LDAPConfigResponse extends BaseResponse {
@SerializedName(ApiConstants.PORT) @Param(description="Specify the LDAP port if required, default is 389")
private String port;
- @SerializedName(ApiConstants.PORT) @Param(description="Check Use SSL if the external LDAP server is configured for LDAP over SSL")
+ @SerializedName(ApiConstants.USE_SSL) @Param(description="Check Use SSL if the external LDAP server is configured for LDAP over SSL")
private String useSSL;
@SerializedName(ApiConstants.SEARCH_BASE) @Param(description="The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com")
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index c45ab1bd91b..370c0fc1518 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -174,6 +174,13 @@
+
+
+
@@ -265,5 +272,11 @@
+
+
diff --git a/docs/en-US/console-proxy.xml b/docs/en-US/console-proxy.xml
index 3dd7b9fd692..697ee2e2146 100644
--- a/docs/en-US/console-proxy.xml
+++ b/docs/en-US/console-proxy.xml
@@ -24,11 +24,11 @@
console view via the web UI. It connects the user’s browser to the VNC port made available via
the hypervisor for the console of the guest. Both the administrator and end user web UIs offer a
console connection.
- Clicking on a console icon brings up a new window. The AJAX code downloaded into that window
+ Clicking a console icon brings up a new window. The AJAX code downloaded into that window
refers to the public IP address of a console proxy VM. There is exactly one public IP address
allocated per console proxy VM. The AJAX application connects to this IP. The console proxy then
- proxies the connection to the VNC port for the requested VM on the Host hosting the guest.
- .
+ proxies the connection to the VNC port for the requested VM on the Host hosting the
+ guest.
The hypervisors will have many ports assigned to VNC usage so that multiple VNC sessions
can occur simultaneously.
diff --git a/docs/en-US/working-with-system-vm.xml b/docs/en-US/working-with-system-vm.xml
index 97459f947bf..70f7dd1aa4e 100644
--- a/docs/en-US/working-with-system-vm.xml
+++ b/docs/en-US/working-with-system-vm.xml
@@ -1,33 +1,39 @@
-
%BOOK_ENTITIES;
]>
-
-
- Working with System Virtual Machines
- &PRODUCT; uses several types of system virtual machines to perform tasks in the cloud. In general &PRODUCT; manages these system VMs and creates, starts, and stops them as needed based on scale and immediate needs. However, the administrator should be aware of them and their roles to assist in debugging issues.
-
-
-
-
-
+ Working with System Virtual Machines
+ &PRODUCT; uses several types of system virtual machines to perform tasks in the cloud. In
+ general &PRODUCT; manages these system VMs and creates, starts, and stops them as needed based
+ on scale and immediate needs. However, the administrator should be aware of them and their roles
+ to assist in debugging issues.
+
+ You can configure the system.vm.random.password parameter to create a random system VM
+ password to ensure higher security. If you reset the value for system.vm.random.password to
+ true and restart the Management Server, a random password is generated and stored encrypted in
+ the database. You can view the decrypted password under the system.vm.password global
+ parameter on the &PRODUCT; UI or by calling the listConfigurations API.
+
+
+
+
+
+
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
index 2178651403e..8542de3bd9f 100755
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
@@ -62,7 +62,9 @@ import com.cloud.utils.db.DB;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.NetUtils;
+import org.springframework.stereotype.Component;
+@Component
@Local(value = { MockAgentManager.class })
public class MockAgentManagerImpl extends ManagerBase implements MockAgentManager {
private static final Logger s_logger = Logger.getLogger(MockAgentManagerImpl.class);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
index f445bb32900..859acc85958 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
@@ -97,7 +97,9 @@ import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.DiskProfile;
import com.cloud.vm.VirtualMachine.State;
+import org.springframework.stereotype.Component;
+@Component
@Local(value = { MockStorageManager.class })
public class MockStorageManagerImpl extends ManagerBase implements MockStorageManager {
private static final Logger s_logger = Logger.getLogger(MockStorageManagerImpl.class);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index 60e1a61a0bd..40a5b9846db 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -17,58 +17,12 @@
package com.cloud.agent.manager;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.BumpUpPriorityCommand;
-import com.cloud.agent.api.CheckRouterAnswer;
-import com.cloud.agent.api.CheckRouterCommand;
-import com.cloud.agent.api.CheckVirtualMachineAnswer;
-import com.cloud.agent.api.CheckVirtualMachineCommand;
-import com.cloud.agent.api.CleanupNetworkRulesCmd;
-import com.cloud.agent.api.GetDomRVersionAnswer;
-import com.cloud.agent.api.GetDomRVersionCmd;
-import com.cloud.agent.api.GetVmStatsAnswer;
-import com.cloud.agent.api.GetVmStatsCommand;
-import com.cloud.agent.api.GetVncPortAnswer;
-import com.cloud.agent.api.GetVncPortCommand;
-import com.cloud.agent.api.MigrateAnswer;
-import com.cloud.agent.api.MigrateCommand;
-import com.cloud.agent.api.NetworkUsageAnswer;
-import com.cloud.agent.api.NetworkUsageCommand;
-import com.cloud.agent.api.PrepareForMigrationAnswer;
-import com.cloud.agent.api.PrepareForMigrationCommand;
-import com.cloud.agent.api.RebootAnswer;
-import com.cloud.agent.api.RebootCommand;
-import com.cloud.agent.api.SecurityGroupRuleAnswer;
-import com.cloud.agent.api.SecurityGroupRulesCmd;
-import com.cloud.agent.api.StartAnswer;
-import com.cloud.agent.api.StartCommand;
-import com.cloud.agent.api.StopAnswer;
-import com.cloud.agent.api.StopCommand;
-import com.cloud.agent.api.VmStatsEntry;
+import com.cloud.agent.api.*;
import com.cloud.agent.api.check.CheckSshAnswer;
import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
-import com.cloud.agent.api.routing.DhcpEntryCommand;
-import com.cloud.agent.api.routing.IpAssocCommand;
-import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
-import com.cloud.agent.api.routing.NetworkElementCommand;
-import com.cloud.agent.api.routing.SavePasswordCommand;
-import com.cloud.agent.api.routing.SetFirewallRulesCommand;
-import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
-import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
-import com.cloud.agent.api.routing.VmDataCommand;
+import com.cloud.agent.api.routing.*;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.network.Networks.TrafficType;
@@ -86,7 +40,18 @@ import com.cloud.utils.component.ManagerBase;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.VirtualMachine.State;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Component
@Local(value = { MockVmManager.class })
public class MockVmManagerImpl extends ManagerBase implements MockVmManager {
private static final Logger s_logger = Logger.getLogger(MockVmManagerImpl.class);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index 41443572efd..c234cc5cb2e 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -16,73 +16,12 @@
// under the License.
package com.cloud.agent.manager;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.AttachIsoCommand;
-import com.cloud.agent.api.AttachVolumeCommand;
-import com.cloud.agent.api.BackupSnapshotCommand;
-import com.cloud.agent.api.BumpUpPriorityCommand;
-import com.cloud.agent.api.CheckHealthCommand;
-import com.cloud.agent.api.CheckNetworkCommand;
-import com.cloud.agent.api.CheckRouterCommand;
-import com.cloud.agent.api.CheckVirtualMachineCommand;
-import com.cloud.agent.api.CleanupNetworkRulesCmd;
-import com.cloud.agent.api.ClusterSyncCommand;
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.ComputeChecksumCommand;
-import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
-import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
-import com.cloud.agent.api.CreateStoragePoolCommand;
-import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
-import com.cloud.agent.api.DeleteSnapshotBackupCommand;
-import com.cloud.agent.api.DeleteStoragePoolCommand;
-import com.cloud.agent.api.GetDomRVersionCmd;
-import com.cloud.agent.api.GetHostStatsCommand;
-import com.cloud.agent.api.GetStorageStatsCommand;
-import com.cloud.agent.api.GetVmStatsCommand;
-import com.cloud.agent.api.GetVncPortCommand;
-import com.cloud.agent.api.MaintainCommand;
-import com.cloud.agent.api.ManageSnapshotCommand;
-import com.cloud.agent.api.MigrateCommand;
-import com.cloud.agent.api.ModifyStoragePoolCommand;
-import com.cloud.agent.api.NetworkUsageCommand;
-import com.cloud.agent.api.PingTestCommand;
-import com.cloud.agent.api.PrepareForMigrationCommand;
-import com.cloud.agent.api.RebootCommand;
-import com.cloud.agent.api.SecStorageSetupCommand;
-import com.cloud.agent.api.SecStorageVMSetupCommand;
-import com.cloud.agent.api.SecurityGroupRulesCmd;
-import com.cloud.agent.api.StartCommand;
-import com.cloud.agent.api.StopCommand;
-import com.cloud.agent.api.StoragePoolInfo;
+import com.cloud.agent.api.*;
import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
-import com.cloud.agent.api.routing.DhcpEntryCommand;
-import com.cloud.agent.api.routing.IpAssocCommand;
-import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
-import com.cloud.agent.api.routing.SavePasswordCommand;
-import com.cloud.agent.api.routing.SetFirewallRulesCommand;
-import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
-import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
-import com.cloud.agent.api.routing.VmDataCommand;
-import com.cloud.agent.api.storage.CopyVolumeCommand;
-import com.cloud.agent.api.storage.CreateCommand;
-import com.cloud.agent.api.storage.DeleteTemplateCommand;
-import com.cloud.agent.api.storage.DestroyCommand;
-import com.cloud.agent.api.storage.DownloadCommand;
-import com.cloud.agent.api.storage.DownloadProgressCommand;
-import com.cloud.agent.api.storage.ListTemplateCommand;
-import com.cloud.agent.api.storage.ListVolumeCommand;
-import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
+import com.cloud.agent.api.routing.*;
+import com.cloud.agent.api.storage.*;
import com.cloud.simulator.MockConfigurationVO;
import com.cloud.simulator.MockHost;
import com.cloud.simulator.MockVMVO;
@@ -95,7 +34,16 @@ import com.cloud.utils.db.DB;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.VirtualMachine.State;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.HashMap;
+import java.util.Map;
+
+@Component
@Local(value = { SimulatorManager.class })
public class SimulatorManagerImpl extends ManagerBase implements SimulatorManager {
private static final Logger s_logger = Logger.getLogger(SimulatorManagerImpl.class);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
index 5cb094184ba..00fe356103b 100755
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
@@ -53,7 +53,7 @@ import com.cloud.storage.VMTemplateZoneVO;
import com.cloud.storage.dao.VMTemplateDao;
import com.cloud.storage.dao.VMTemplateHostDao;
import com.cloud.storage.dao.VMTemplateZoneDao;
-
+import org.springframework.stereotype.Component;
@Local(value = Discoverer.class)
public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
index cd0cd2725c9..1dd71c5c27f 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
@@ -42,7 +42,9 @@ import com.cloud.storage.SnapshotVO;
import com.cloud.storage.dao.SnapshotDao;
import com.cloud.storage.secondary.SecondaryStorageDiscoverer;
import com.cloud.utils.exception.CloudRuntimeException;
+import org.springframework.stereotype.Component;
+@Component
@Local(value=Discoverer.class)
public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer implements ResourceStateAdapter, Listener {
private static final Logger s_logger = Logger.getLogger(SimulatorSecondaryDiscoverer.class);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
index c9d308023ed..57a38f1d3d8 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
@@ -16,9 +16,6 @@
// under the License.
package com.cloud.simulator;
-import javax.ejb.Local;
-import javax.inject.Inject;
-
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorGuru;
@@ -28,6 +25,10 @@ import com.cloud.storage.dao.GuestOSDao;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+
@Local(value=HypervisorGuru.class)
public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru {
@Inject GuestOSDao _guestOsDao;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java
index bd1b48dfde8..fd825b751ed 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java
@@ -16,18 +16,19 @@
// under the License.
package com.cloud.simulator.dao;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Formatter;
-
-import javax.ejb.Local;
-
import com.cloud.simulator.MockConfigurationVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Formatter;
+
+@Component
@Local(value={MockConfigurationDao.class})
public class MockConfigurationDaoImpl extends GenericDaoBase implements MockConfigurationDao {
private SearchBuilder _searchByDcIdName;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockHostDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockHostDaoImpl.java
index 8a566d79ed2..4b60bc02d47 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockHostDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockHostDaoImpl.java
@@ -16,14 +16,16 @@
// under the License.
package com.cloud.simulator.dao;
-import javax.ejb.Local;
-
import com.cloud.simulator.MockHost;
import com.cloud.simulator.MockHostVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+
+@Component
@Local(value={MockHostDao.class})
public class MockHostDaoImpl extends GenericDaoBase implements MockHostDao {
protected final SearchBuilder GuidSearch;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java
index 65a375f5843..d4903244179 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java
@@ -16,13 +16,15 @@
// under the License.
package com.cloud.simulator.dao;
-import javax.ejb.Local;
-
import com.cloud.simulator.MockSecStorageVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+
+@Component
@Local(value={MockSecStorageDao.class})
public class MockSecStorageDaoImpl extends GenericDaoBase implements MockSecStorageDao {
protected final SearchBuilder urlSearch;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java
index 8831efef2ec..d35607e0ebc 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java
@@ -16,16 +16,18 @@
// under the License.
package com.cloud.simulator.dao;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.naming.ConfigurationException;
-
import com.cloud.simulator.MockSecurityRulesVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+import java.util.List;
+import java.util.Map;
+
+@Component
@Local(value={MockSecurityRulesDao.class})
public class MockSecurityRulesDaoImpl extends GenericDaoBase implements MockSecurityRulesDao {
protected SearchBuilder vmIdSearch;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java
index 3a64d27e30d..0fc41abdc4c 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java
@@ -16,14 +16,16 @@
// under the License.
package com.cloud.simulator.dao;
-import javax.ejb.Local;
-
import com.cloud.simulator.MockStoragePoolVO;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+
+@Component
@Local(value={MockStoragePoolDao.class})
public class MockStoragePoolDaoImpl extends GenericDaoBase implements MockStoragePoolDao {
protected final SearchBuilder uuidSearch;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVMDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVMDaoImpl.java
index be7a98859e2..5a8c66d69ef 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVMDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVMDaoImpl.java
@@ -16,14 +16,6 @@
// under the License.
package com.cloud.simulator.dao;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
import com.cloud.simulator.MockHostVO;
import com.cloud.simulator.MockVMVO;
import com.cloud.utils.db.GenericDaoBase;
@@ -31,7 +23,16 @@ import com.cloud.utils.db.JoinBuilder;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.vm.VirtualMachine;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@Component
@Local(value={MockVMDao.class})
public class MockVMDaoImpl extends GenericDaoBase implements MockVMDao {
protected SearchBuilder GuidSearch;
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java
index a3a35179337..5d64a9fa246 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java
@@ -16,10 +16,6 @@
// under the License.
package com.cloud.simulator.dao;
-import java.util.List;
-
-import javax.ejb.Local;
-
import com.cloud.simulator.MockVolumeVO;
import com.cloud.simulator.MockVolumeVO.MockVolumeType;
import com.cloud.utils.db.GenericDaoBase;
@@ -27,7 +23,12 @@ import com.cloud.utils.db.GenericSearchBuilder;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Func;
+import org.springframework.stereotype.Component;
+import javax.ejb.Local;
+import java.util.List;
+
+@Component
@Local(value={MockVolumeDao.class})
public class MockVolumeDaoImpl extends GenericDaoBase implements MockVolumeDao {
protected final SearchBuilder idTypeSearch;
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
index 65a97a8de31..a0540637e95 100755
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
@@ -315,6 +315,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
params.put("wait", Integer.toString(_wait));
details.put("wait", Integer.toString(_wait));
params.put("migratewait", _configDao.getValue(Config.MigrateWait.toString()));
+ params.put(Config.XenMaxNics.toString().toLowerCase(), _configDao.getValue(Config.XenMaxNics.toString()));
params.put(Config.InstanceName.toString().toLowerCase(), _instance);
details.put(Config.InstanceName.toString().toLowerCase(), _instance);
try {
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 22f4ba9cb80..33ad18d0331 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -331,6 +331,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
protected boolean _isOvs = false;
protected List _tmpDom0Vif = new ArrayList();
protected XenServerStorageResource storageResource;
+ protected int _maxNics = 7;
public enum SRType {
NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT, FILE;
@@ -3842,22 +3843,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
throw new CloudRuntimeException("Could not find an available slot in VM with name to attach a new disk.");
}
-
- protected String getUnusedVIFNum(Connection conn, VM vm) {
- String vmName = "";
- try {
- vmName = vm.getNameLabel(conn);
- Set allowedVIFDevices = vm.getAllowedVIFDevices(conn);
- if (allowedVIFDevices.size() > 0) {
- return allowedVIFDevices.iterator().next();
- }
- } catch (Exception e) {
- String msg = "getUnusedVIFNum failed due to " + e.toString();
- s_logger.warn(msg, e);
- }
- throw new CloudRuntimeException("Could not find available VIF slot in VM with name: " + vmName + " to plug a VIF");
- }
-
protected String callHostPlugin(Connection conn, String plugin, String cmd, String... params) {
Map args = new HashMap();
String msg;
@@ -3989,22 +3974,29 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
protected String getLowestAvailableVIFDeviceNum(Connection conn, VM vm) {
+ String vmName = "";
try {
- Set availableDeviceNums = vm.getAllowedVIFDevices(conn);
- Iterator deviceNumsIterator = availableDeviceNums.iterator();
- List sortedDeviceNums = new ArrayList();
-
- while (deviceNumsIterator.hasNext()) {
- try {
- sortedDeviceNums.add(Integer.valueOf(deviceNumsIterator.next()));
+ vmName = vm.getNameLabel(conn);
+ List usedDeviceNums = new ArrayList();
+ Set vifs = vm.getVIFs(conn);
+ Iterator vifIter = vifs.iterator();
+ while(vifIter.hasNext()){
+ VIF vif = vifIter.next();
+ try{
+ usedDeviceNums.add(Integer.valueOf(vif.getDevice(conn)));
} catch (NumberFormatException e) {
- s_logger.debug("Obtained an invalid value for an available VIF device number for VM: " + vm.getNameLabel(conn));
- return null;
+ String msg = "Obtained an invalid value for an allocated VIF device number for VM: " + vmName;
+ s_logger.debug(msg, e);
+ throw new CloudRuntimeException(msg);
}
}
- Collections.sort(sortedDeviceNums);
- return String.valueOf(sortedDeviceNums.get(0));
+ for(Integer i=0; i< _maxNics; i++){
+ if(!usedDeviceNums.contains(i)){
+ s_logger.debug("Lowest available Vif device number: "+i+" for VM: " + vmName);
+ return i.toString();
+ }
+ }
} catch (XmlRpcException e) {
String msg = "Caught XmlRpcException: " + e.getMessage();
s_logger.warn(msg, e);
@@ -4013,7 +4005,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
s_logger.warn(msg, e);
}
- return null;
+ throw new CloudRuntimeException("Could not find available VIF slot in VM with name: " + vmName);
}
protected VDI mount(Connection conn, StoragePoolType pooltype, String volumeFolder, String volumePath) {
@@ -5655,6 +5647,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
value = (String) params.get("migratewait");
_migratewait = NumbersUtil.parseInt(value, 3600);
+ _maxNics = NumbersUtil.parseInt((String) params.get("xen.nics.max"), 7);
+
if (_pod == null) {
throw new ConfigurationException("Unable to get the pod");
}
@@ -7765,7 +7759,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
s_logger.warn(msg);
return new PlugNicAnswer(cmd, false, msg);
}
- String deviceId = getUnusedVIFNum(conn, vm);
+ String deviceId = getLowestAvailableVIFDeviceNum(conn, vm);
nic.setDeviceId(Integer.parseInt(deviceId));
vif = createVif(conn, vmName, vm, nic);
vif.plug(conn);
diff --git a/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
index fb0273e6ea3..61eebe5fc93 100644
--- a/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
+++ b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
@@ -66,7 +66,7 @@ public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
String port = _configDao.getValue(LDAPParams.port.toString());
String queryFilter = _configDao.getValue(LDAPParams.queryfilter.toString());
String searchBase = _configDao.getValue(LDAPParams.searchbase.toString());
- String useSSL = _configDao.getValue(LDAPParams.usessl.toString());
+ Boolean useSSL = Boolean.valueOf(_configDao.getValue(LDAPParams.usessl.toString()));
String bindDN = _configDao.getValue(LDAPParams.dn.toString());
String bindPasswd = _configDao.getValue(LDAPParams.passwd.toString());
String trustStore = _configDao.getValue(LDAPParams.truststore.toString());
@@ -77,7 +77,7 @@ public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
String protocol = "ldap://" ;
- if (new Boolean(useSSL)){
+ if (useSSL){
env.put(Context.SECURITY_PROTOCOL, "ssl");
protocol="ldaps://" ;
System.setProperty("javax.net.ssl.trustStore", trustStore);
@@ -123,7 +123,7 @@ public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
protocol = "ldap://" ;
- if (new Boolean(useSSL)){
+ if (useSSL){
env.put(Context.SECURITY_PROTOCOL, "ssl");
protocol="ldaps://" ;
}
@@ -135,8 +135,7 @@ public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
ctx.close();
} catch (NamingException ne) {
- ne.printStackTrace();
- s_logger.warn("Authentication failed due to " + ne.getMessage());
+ s_logger.warn("Authentication Failed ! " + ne.getMessage() + (ne.getCause() != null ? ("; Caused by:" + ne.getCause().getMessage()) : ""));
return false;
}
catch (Exception e){
diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
index 96b91df79f9..3b780ee83ef 100644
--- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
@@ -68,7 +68,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
String protocol = "ldap://";
- if (new Boolean(useSSL)) {
+ if (useSSL) {
env.put(Context.SECURITY_PROTOCOL, "ssl");
protocol = "ldaps://";
if (trustStore == null || trustStorePassword == null) {
@@ -1288,7 +1314,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
DirContext ctx = new InitialDirContext(env);
ctx.close();
- // store the result in DB COnfiguration
+ // store the result in DB Configuration
ConfigurationVO cvo = _configDao.findByName(LDAPParams.hostname.toString());
if (cvo == null) {
cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.hostname.toString(), null, "Hostname or ip address of the ldap server eg: my.ldap.com");
@@ -1356,8 +1382,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
s_logger.debug("The ldap server is configured: " + hostname);
} catch (NamingException ne) {
- ne.printStackTrace();
- throw new InvalidParameterValueException("Naming Exception, check you ldap data ! " + ne.getMessage() + (ne.getCause() != null ? ("Caused by:" + ne.getCause().getMessage()) : ""));
+ throw new InvalidParameterValueException("Naming Exception, check you ldap data ! " + ne.getMessage() + (ne.getCause() != null ? ("; Caused by:" + ne.getCause().getMessage()) : ""));
}
return true;
}
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index d7fe3e05d97..4d1968d9f94 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -341,11 +341,11 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
_agentMgr.send(dest.getHost().getId(), cmds);
PlugNicAnswer plugNicAnswer = cmds.getAnswer(PlugNicAnswer.class);
if (!(plugNicAnswer != null && plugNicAnswer.getResult())) {
- s_logger.warn("Unable to plug nic for vm " + vm.getHostName());
+ s_logger.warn("Unable to plug nic for vm " + vm.getName());
result = false;
}
} catch (OperationTimedoutException e) {
- throw new AgentUnavailableException("Unable to plug nic for router " + vm.getHostName() + " in network " + network,
+ throw new AgentUnavailableException("Unable to plug nic for router " + vm.getName() + " in network " + network,
dest.getHost().getId(), e);
}
} else {
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 7197c363264..fbb5788d362 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1233,13 +1233,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager{
ex.addProxyObject("vpc", vpcId, "VPC");
throw ex;
}
-
- //allow only one private gateway per vpc
- VpcGatewayVO gatewayVO = _vpcGatewayDao.getPrivateGatewayForVpc(vpcId);
- if (gatewayVO != null) {
- throw new InvalidParameterValueException("Private ip address already exists for vpc " + vpc);
- }
-
+
//Validate physical network
if (physicalNetworkId == null) {
List extends PhysicalNetwork> pNtwks = _ntwkModel.getPhysicalNtwksSupportingTrafficType(vpc.getZoneId(), TrafficType.Guest);
@@ -1258,7 +1252,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager{
vlan, ipAddress, null, gateway, netmask, gatewayOwnerId, vpcId);
//2) create gateway entry
- gatewayVO = new VpcGatewayVO(ipAddress, VpcGateway.Type.Private, vpcId, privateNtwk.getDataCenterId(),
+ VpcGatewayVO gatewayVO = new VpcGatewayVO(ipAddress, VpcGateway.Type.Private, vpcId, privateNtwk.getDataCenterId(),
privateNtwk.getId(), vlan, gateway, netmask, vpc.getAccountId(), vpc.getDomainId());
_vpcGatewayDao.persist(gatewayVO);
diff --git a/server/src/com/cloud/resource/DiscovererBase.java b/server/src/com/cloud/resource/DiscovererBase.java
index 940608c4419..b7c5b6f58de 100644
--- a/server/src/com/cloud/resource/DiscovererBase.java
+++ b/server/src/com/cloud/resource/DiscovererBase.java
@@ -128,6 +128,7 @@ public abstract class DiscovererBase extends AdapterBase implements Discoverer {
params.put("secondary.storage.vm", "false");
params.put("max.template.iso.size", _configDao.getValue(Config.MaxTemplateAndIsoSize.toString()));
params.put("migratewait", _configDao.getValue(Config.MigrateWait.toString()));
+ params.put(Config.XenMaxNics.toString().toLowerCase(), _configDao.getValue(Config.XenMaxNics.toString()));
return params;
}
diff --git a/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index f831a032385..f48709452b1 100755
--- a/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -83,81 +83,81 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
- new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.1.8", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(), new UpgradeSnapshot217to224(),
new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
- new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.1.9", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(), new UpgradeSnapshot217to224(),
new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
- new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.1", new DbUpgrade[] { new Upgrade221to222(), new UpgradeSnapshot223to224(), new Upgrade222to224(),
new Upgrade224to225(), new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
- new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.2", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(), new Upgrade224to225(),
new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
- new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.3", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(), new Upgrade224to225(),
new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
- new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.4", new DbUpgrade[] { new Upgrade224to225(), new Upgrade225to226(), new Upgrade227to228(),
new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(),
- new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.5", new DbUpgrade[] { new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(),
- new Upgrade302to40() });
+ new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.6", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
- new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.7", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
- new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.8", new DbUpgrade[] { new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30()
- , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.9", new DbUpgrade[] { new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(),
- new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.10", new DbUpgrade[] { new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
- new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.11", new DbUpgrade[] { new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
- new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.12", new DbUpgrade[] { new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
- new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.13", new DbUpgrade[] { new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(),
- new Upgrade301to302(), new Upgrade302to40() });
+ new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("2.2.14", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(),
- new Upgrade302to40() });
+ new Upgrade302to40(), new Upgrade40to41() });
- _upgradeMap.put("3.0.0", new DbUpgrade[] { new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
+ _upgradeMap.put("3.0.0", new DbUpgrade[] { new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
- _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40() });
+ _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41() });
- _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40() });
+ _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40(), new Upgrade40to41() });
_upgradeMap.put("4.0.0", new DbUpgrade[] { new Upgrade40to41() });
}
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index 574ce0a0352..180138ac136 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -365,6 +365,15 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu
return false;
}
+ /* (non-Javadoc)
+ * @see com.cloud.configuration.ConfigurationService#listLDAPConfig(org.apache.cloudstack.api.commands.LDAPConfigCmd)
+ */
+ @Override
+ public LDAPConfigCmd listLDAPConfig(LDAPConfigCmd cmd) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
/* (non-Javadoc)
* @see com.cloud.configuration.ConfigurationService#isOfferingForVpc(com.cloud.offering.NetworkOffering)
*/
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 8bd9bfd353e..65add75294b 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -23,3 +23,4 @@ ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster`
UPDATE `cloud`.`hypervisor_capabilities` SET `max_hosts_per_cluster`=32 WHERE `hypervisor_type`='VMware';
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_hosts_per_cluster) VALUES ('VMware', '5.1', 128, 0, 32);
DELETE FROM `cloud`.`configuration` where name='vmware.percluster.host.max';
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'xen.nics.max', '7', 'Maximum allowed nics for Vms created on Xen');
\ No newline at end of file
diff --git a/tools/appliance/README.md b/tools/appliance/README.md
index aa1001e1b1b..2f6f656212d 100644
--- a/tools/appliance/README.md
+++ b/tools/appliance/README.md
@@ -19,6 +19,8 @@ under the License.
# Setting up Tools and Environment
+ - Install VirtualBox 4.2 or latest
+ - Tool for exporting appliances: qemu-img, vboxmanage, vhd-util
- Install [RVM](https://rvm.io/rvm/install)
- Setup paths:
export PATH=~/.rvm/bin:$PATH
@@ -36,7 +38,14 @@ Note, gem may require gcc-4.2, make sure link exists:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
-# How to build SystemVM template appliance
+# How to build SystemVMs automatically
+
+Just run build.sh, it will export archived appliances for KVM, Xen,
+VMWare and HyperV in `dist`:
+
+ sh build.sh
+
+# Building SystemVM template appliance manually
List available appliances one can build:
@@ -50,3 +59,9 @@ Build systemvm template appliance:
Start the box:
veewee vbox up 'systemvmtemplate'
+
+Halt the box:
+
+ veewee vbox halt 'systemvmtemplate'
+
+Now VirtualBox can be used to export appliance.
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index cfd4e8b2349..366b246fbe2 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -1,3 +1,4 @@
+#!/bin/bash -xl
# 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
@@ -16,12 +17,53 @@
# under the License.
set -x
+set -e
appliance="systemvmtemplate"
+build_date=`date +%Y-%m-%d`
+branch="master"
+rootdir=$PWD
# Initialize veewee and dependencies
bundle
-# Start building the appliance
+# Clean and start building the appliance
+veewee vbox destroy $appliance
veewee vbox build $appliance --nogui
veewee vbox halt $appliance
+
+while [[ `vboxmanage list runningvms | grep $appliance | wc -l` -ne 0 ]];
+do
+ echo "Waiting for $appliance to shutdown"
+ sleep 2;
+done
+
+# Get appliance uuids
+machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'`
+hdd_uuid=`vboxmanage showvminfo $appliance | grep vmdk | head -1 | awk '{print $8}' | cut -d ')' -f 1`
+
+# Start exporting
+rm -fr dist
+mkdir dist
+
+# Export for VMWare vSphere
+vboxmanage export $machine_uuid --output dist/$appliance-$build_date-$branch-vmware.ova
+echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova"
+
+# Export for HyperV
+vboxmanage clonehd $hdd_uuid dist/$appliance-$build_date-$branch-hyperv.vhd --format VHD
+bzip2 dist/$appliance-$build_date-$branch-hyperv.vhd
+echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd.bz2"
+
+# Export for KVM
+vboxmanage clonehd $hdd_uuid dist/raw.img --format RAW
+qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2
+bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2
+echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
+
+# Export for Xen
+# This will be an overwrite convert so, do it at the end
+vhd-util convert -s 0 -t 1 -i dist/raw.img -o dist/$appliance-$build_date-$branch-xen.vhd
+bzip2 dist/$appliance-$build_date-$branch-xen.vhd
+echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
+
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index 204d573a9d0..b4d28955473 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -99,29 +99,28 @@ d-i clock-setup/ntp boolean true
d-i partman-auto/disk string /dev/sda
# In addition, you'll need to specify the method to use.
# The presently available methods are: "regular", "lvm" and "crypto"
-d-i partman-auto/method string lvm
+d-i partman-auto/method string regular
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
-d-i partman-lvm/device_remove_lvm boolean true
+#d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
-d-i partman-md/device_remove_md boolean true
+#d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
-d-i partman-lvm/confirm boolean true
-d-i partman-lvm/confirm_nooverwrite boolean true
+#d-i partman-lvm/confirm boolean true
+#d-i partman-lvm/confirm_nooverwrite boolean true
-
-d-i partman/choose_partition select finish
-d-i partman-auto-lvm/guided_size string max
+#d-i partman/choose_partition select finish
+#d-i partman-auto-lvm/guided_size string max
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /usr, /var, and /tmp partitions
-d-i partman-auto/choose_recipe select multi
-d-i partman/default_filesystem string ext3
+d-i partman-auto/choose_recipe select atomic
+#d-i partman/default_filesystem string ext3
# Or provide a recipe of your own...
# The recipe format is documented in the file devel/partman-auto-recipe.txt.
@@ -129,6 +128,48 @@ d-i partman/default_filesystem string ext3
# just point at it.
#d-i partman-auto/expert_recipe_file string /hd-media/recipe
+d-i partman-auto/expert_recipe string \
+ boot-root :: \
+ 40 50 100 ext4 \
+ $primary{ } $bootable{ } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /boot } \
+ . \
+ 400 40 500 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ / } \
+ . \
+ 60 100 200 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /home } \
+ . \
+ 500 30 1000 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /usr } \
+ . \
+ 400 40 500 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /opt } \
+ . \
+ 500 60 1000 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /var } \
+ . \
+ 100 70 400 ext4 \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /tmp } \
+ . \
+ 64 512 300% linux-swap \
+ method{ swap } format{ } \
+ .
+
# If not, you can put an entire recipe into the preconfiguration file in one
# (logical) line. This example creates a small /boot partition, suitable
# swap, and uses the rest of the space for the root partition:
@@ -154,11 +195,12 @@ d-i partman/default_filesystem string ext3
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
+#d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
-
### Base system installation
# Select the initramfs generator used to generate the initrd for 2.6 kernels.
#d-i base-installer/kernel/linux/initramfs-generators string yaird