You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/04/25 22:26:41 UTC
[01/16] git commit: updated refs/heads/4.4 to 6b342ff
Repository: cloudstack
Updated Branches:
refs/heads/4.4 33c0d6c7b -> 6b342ffce
CLOUDSTACK-6478: Failed to download Template when having 3 SSVM's in one
zone on Vmware.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/65bdf2c9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/65bdf2c9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/65bdf2c9
Branch: refs/heads/4.4
Commit: 65bdf2c9ca6a2d46b9504f8647ec08ffb29f0a89
Parents: 33c0d6c
Author: Min Chen <mi...@citrix.com>
Authored: Tue Apr 22 19:14:55 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:26:27 2014 +0200
----------------------------------------------------------------------
.../cloudstack/storage/RemoteHostEndPoint.java | 43 +++++++++++++++-----
1 file changed, 32 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65bdf2c9/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
index 34f9c9d..c54430f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
@@ -25,8 +25,7 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import org.apache.log4j.Logger;
-import com.cloud.vm.SecondaryStorageVmVO;
-import com.cloud.vm.dao.SecondaryStorageVmDao;
+
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
@@ -43,11 +42,15 @@ import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.ConnectionException;
import com.cloud.exception.OperationTimedoutException;
import com.cloud.host.Host;
+import com.cloud.host.HostVO;
import com.cloud.host.Status;
+import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.HypervisorGuruManager;
import com.cloud.utils.component.ComponentContext;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.vm.SecondaryStorageVmVO;
+import com.cloud.vm.dao.SecondaryStorageVmDao;
public class RemoteHostEndPoint implements EndPoint {
private static final Logger s_logger = Logger.getLogger(RemoteHostEndPoint.class);
@@ -60,6 +63,8 @@ public class RemoteHostEndPoint implements EndPoint {
protected HypervisorGuruManager _hvGuruMgr;
@Inject
protected SecondaryStorageVmDao vmDao;
+ @Inject
+ protected HostDao _hostDao;
private ScheduledExecutorService executor;
public RemoteHostEndPoint() {
@@ -67,14 +72,14 @@ public class RemoteHostEndPoint implements EndPoint {
}
private void configure(Host host) {
- this.hostId = host.getId();
- this.hostAddress = host.getPrivateIpAddress();
- this.publicAddress = host.getPublicIpAddress();
+ hostId = host.getId();
+ hostAddress = host.getPrivateIpAddress();
+ publicAddress = host.getPublicIpAddress();
if (Host.Type.SecondaryStorageVM == host.getType()) {
String vmName = host.getName();
SecondaryStorageVmVO ssvm = vmDao.findByInstanceName(vmName);
if (ssvm != null) {
- this.publicAddress = ssvm.getPublicIpAddress();
+ publicAddress = ssvm.getPublicIpAddress();
}
}
}
@@ -87,17 +92,25 @@ public class RemoteHostEndPoint implements EndPoint {
@Override
public String getHostAddr() {
- return this.hostAddress;
+ return hostAddress;
}
@Override
public String getPublicAddr() {
- return this.publicAddress;
+ return publicAddress;
}
@Override
public long getId() {
- return this.hostId;
+ return hostId;
+ }
+
+ // used when HypervisorGuruManager choose a different host to send command
+ private void setId(long id) {
+ HostVO host = _hostDao.findById(hostId);
+ if (host != null) {
+ configure(host);
+ }
}
@Override
@@ -105,6 +118,10 @@ public class RemoteHostEndPoint implements EndPoint {
String errMsg = null;
try {
long newHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(hostId, cmd);
+ if (newHostId != hostId) {
+ // update endpoint with new host if changed
+ setId(newHostId);
+ }
return agentMgr.send(newHostId, cmd);
} catch (AgentUnavailableException e) {
errMsg = e.toString();
@@ -126,7 +143,7 @@ public class RemoteHostEndPoint implements EndPoint {
@Override
public boolean processAnswers(long agentId, long seq, Answer[] answers) {
- this.answer = answers[0];
+ answer = answers[0];
executor.schedule(this, 10, TimeUnit.SECONDS);
return true;
}
@@ -182,7 +199,11 @@ public class RemoteHostEndPoint implements EndPoint {
@Override
public void sendMessageAsync(Command cmd, AsyncCompletionCallback<Answer> callback) {
try {
- long newHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(this.hostId, cmd);
+ long newHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(hostId, cmd);
+ if (newHostId != hostId) {
+ // update endpoint with new host if changed
+ setId(newHostId);
+ }
if (s_logger.isDebugEnabled()) {
s_logger.debug("Sending command " + cmd.toString() + " to host: " + newHostId);
}
[12/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6499:
Made changes so that uploading custom certificate works for ssvm.
1. Reboot ssvm only when private key is passed meaning the server cert is passed. This is because while uploading the server cert is the last to be uploaded. And we want to propagate the entire chain once uploading is done.
2. Change the SecStorageSetupCommand sent to ssvm so that it also carries the root cert apart from having the chain and the server cert and key.
3. Change ssvm agent code to be able to configure root cert to the java key store.
4. Change ssvm configure ssl script to insert the chain certs correctly.
5. Fix order of chain certificates for apache webserver in SSVM
6. Remove double encoding and decoding for uploadCustomCertificate API from UI and server code respectively, so that API call without UI works fine
7. Java 1.7 - disable using SNI since copyTemplate doesnt work for SSL.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2f96d430
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2f96d430
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2f96d430
Branch: refs/heads/4.4
Commit: 2f96d430c80121a4e1f5714915c30609f38fb11a
Parents: 35767d1
Author: Nitin Mehta <ni...@citrix.com>
Authored: Thu Apr 24 17:20:41 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:03:46 2014 +0200
----------------------------------------------------------------------
.../security/keystore/KeystoreDao.java | 2 ++
.../security/keystore/KeystoreDaoImpl.java | 19 +++++++++++
.../security/keystore/KeystoreManager.java | 11 +++++--
.../security/keystore/KeystoreManagerImpl.java | 19 +++++++----
.../com/cloud/server/ManagementServerImpl.java | 26 ++++++---------
.../resource/NfsSecondaryStorageResource.java | 33 ++++++++++++++++++--
systemvm/scripts/_run.sh | 2 +-
systemvm/scripts/config_ssl.sh | 15 +++++++--
ui/scripts/ui-custom/physicalResources.js | 4 +--
9 files changed, 98 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDao.java
----------------------------------------------------------------------
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDao.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDao.java
index e60e4b0..67eea92 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDao.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDao.java
@@ -28,4 +28,6 @@ public interface KeystoreDao extends GenericDao<KeystoreVO, Long> {
void save(String alias, String certificate, Integer index, String domainSuffix);
List<KeystoreVO> findCertChain();
+
+ List<KeystoreVO> findCertChain(String domainSuffix);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java
index cd24611..b856582 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java
@@ -38,6 +38,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class KeystoreDaoImpl extends GenericDaoBase<KeystoreVO, Long> implements KeystoreDao {
protected final SearchBuilder<KeystoreVO> FindByNameSearch;
protected final SearchBuilder<KeystoreVO> CertChainSearch;
+ protected final SearchBuilder<KeystoreVO> CertChainSearchForDomainSuffix;
public KeystoreDaoImpl() {
FindByNameSearch = createSearchBuilder();
@@ -47,6 +48,11 @@ public class KeystoreDaoImpl extends GenericDaoBase<KeystoreVO, Long> implements
CertChainSearch = createSearchBuilder();
CertChainSearch.and("key", CertChainSearch.entity().getKey(), Op.NULL);
CertChainSearch.done();
+
+ CertChainSearchForDomainSuffix = createSearchBuilder();
+ CertChainSearchForDomainSuffix.and("key", CertChainSearchForDomainSuffix.entity().getKey(), Op.NULL);
+ CertChainSearchForDomainSuffix.and("domainSuffix", CertChainSearchForDomainSuffix.entity().getDomainSuffix(), Op.EQ);
+ CertChainSearchForDomainSuffix.done();
}
@Override
@@ -65,6 +71,19 @@ public class KeystoreDaoImpl extends GenericDaoBase<KeystoreVO, Long> implements
}
@Override
+ public List<KeystoreVO> findCertChain(String domainSuffix) {
+ SearchCriteria<KeystoreVO> sc = CertChainSearchForDomainSuffix.create();
+ sc.setParameters("domainSuffix", domainSuffix);
+ List<KeystoreVO> ks = listBy(sc);
+ Collections.sort(ks, new Comparator() { public int compare(Object o1, Object o2) {
+ Integer seq1 = ((KeystoreVO)o1).getIndex();
+ Integer seq2 = ((KeystoreVO)o2).getIndex();
+ return seq1.compareTo(seq2);
+ }});
+ return ks;
+ }
+
+ @Override
public KeystoreVO findByName(String name) {
assert (name != null);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManager.java
----------------------------------------------------------------------
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManager.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManager.java
index 3b99947..c44347c 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManager.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManager.java
@@ -28,15 +28,18 @@ public interface KeystoreManager extends Manager {
private String privCert;
@LogLevel(Log4jLevel.Off)
private String certChain;
+ @LogLevel(Log4jLevel.Off)
+ private String rootCACert;
public Certificates() {
}
- public Certificates(String prvKey, String privCert, String certChain) {
- privKey = prvKey;
+ public Certificates(String prvKey, String privCert, String certChain, String rootCACert) {
+ this.privKey = prvKey;
this.privCert = privCert;
this.certChain = certChain;
+ this.rootCACert = rootCACert;
}
public String getPrivKey() {
@@ -50,6 +53,10 @@ public interface KeystoreManager extends Manager {
public String getCertChain() {
return certChain;
}
+
+ public String getRootCACert() {
+ return rootCACert;
+ }
}
boolean validateCertificate(String certificate, String key, String domainSuffix);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
index 3060834..374c080 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
@@ -23,6 +23,7 @@ import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -30,6 +31,7 @@ import java.util.regex.Pattern;
import javax.ejb.Local;
import javax.inject.Inject;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
@@ -129,17 +131,22 @@ public class KeystoreManagerImpl extends ManagerBase implements KeystoreManager
}
String prvKey = ksVo.getKey();
String prvCert = ksVo.getCertificate();
+ String domainSuffix = ksVo.getDomainSuffix();
String certChain = null;
- List<KeystoreVO> certchains = _ksDao.findCertChain();
+ String rootCert = null;
+ List<KeystoreVO> certchains = _ksDao.findCertChain(domainSuffix);
if (certchains.size() > 0) {
- StringBuilder chains = new StringBuilder();
+ ArrayList<String> chains = new ArrayList<String>();
for (KeystoreVO cert : certchains) {
- chains.append(cert.getCertificate());
- chains.append("\n");
+ if (chains.size() == 0) {// For the first time it will be length 0
+ rootCert = cert.getCertificate();
+ }
+ chains.add(cert.getCertificate());
}
- certChain = chains.toString();
+ Collections.reverse(chains);
+ certChain = StringUtils.join(chains, "\n");
}
- Certificates certs = new Certificates(prvKey, prvCert, certChain);
+ Certificates certs = new Certificates(prvKey, prvCert, certChain, rootCert);
return certs;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index b6fc280..6b37f45 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -16,9 +16,7 @@
// under the License.
package com.cloud.server;
-import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
-import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -3450,16 +3448,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
String certificate = cmd.getCertificate();
String key = cmd.getPrivateKey();
- try {
- if (certificate != null) {
- certificate = URLDecoder.decode(certificate, "UTF-8");
- }
- if (key != null) {
- key = URLDecoder.decode(key, "UTF-8");
- }
- } catch (UnsupportedEncodingException e) {
- } finally {
- }
if (cmd.getPrivateKey() != null && !_ksMgr.validateCertificate(certificate, key, cmd.getDomainSuffix())) {
throw new InvalidParameterValueException("Failed to pass certificate validation check");
@@ -3467,16 +3455,20 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
if (cmd.getPrivateKey() != null) {
_ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME, certificate, key, cmd.getDomainSuffix());
+
+ // Reboot ssvm here since private key is present - meaning server cert being passed
+ List<SecondaryStorageVmVO> alreadyRunning = _secStorageVmDao.getSecStorageVmListInStates(null, State.Running, State.Migrating, State.Starting);
+ for (SecondaryStorageVmVO ssVmVm : alreadyRunning) {
+ _secStorageVmMgr.rebootSecStorageVm(ssVmVm.getId());
+ }
} else {
_ksMgr.saveCertificate(cmd.getAlias(), certificate, cmd.getCertIndex(), cmd.getDomainSuffix());
}
_consoleProxyMgr.setManagementState(ConsoleProxyManagementState.ResetSuspending);
- List<SecondaryStorageVmVO> alreadyRunning = _secStorageVmDao.getSecStorageVmListInStates(null, State.Running, State.Migrating, State.Starting);
- for (SecondaryStorageVmVO ssVmVm : alreadyRunning) {
- _secStorageVmMgr.rebootSecStorageVm(ssVmVm.getId());
- }
- return "Certificate has been updated, we will stop all running console proxy VMs and secondary storage VMs to propagate the new certificate, please give a few minutes for console access service to be up again";
+ return "Certificate has been successfully updated, if its the server certificate we would reboot all " +
+ "running console proxy VMs and secondary storage VMs to propagate the new certificate, " +
+ "please give a few minutes for console access and storage services service to be up and working again";
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index f35b3f5..6927f02 100755
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -1188,6 +1188,8 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
} else {
String prvKey = certs.getPrivKey();
String pubCert = certs.getPrivCert();
+ String certChain = certs.getCertChain();
+ String rootCACert = certs.getRootCACert();
try {
File prvKeyFile = File.createTempFile("prvkey", null);
@@ -1203,10 +1205,34 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
out.write(pubCert);
out.close();
- configureSSL(prvkeyPath, pubCertFilePath, null);
+ String certChainFilePath = null, rootCACertFilePath = null;
+ File certChainFile = null, rootCACertFile = null;
+ if(certChain != null){
+ certChainFile = File.createTempFile("certchain", null);
+ certChainFilePath = certChainFile.getAbsolutePath();
+ out = new BufferedWriter(new FileWriter(certChainFile));
+ out.write(certChain);
+ out.close();
+ }
+
+ if(rootCACert != null){
+ rootCACertFile = File.createTempFile("rootcert", null);
+ rootCACertFilePath = rootCACertFile.getAbsolutePath();
+ out = new BufferedWriter(new FileWriter(rootCACertFile));
+ out.write(rootCACert);
+ out.close();
+ }
+
+ configureSSL(prvkeyPath, pubCertFilePath, certChainFilePath, rootCACertFilePath);
prvKeyFile.delete();
pubCertFile.delete();
+ if(certChainFile != null){
+ certChainFile.delete();
+ }
+ if(rootCACertFile != null){
+ rootCACertFile.delete();
+ }
} catch (IOException e) {
s_logger.debug("Failed to config ssl: " + e.toString());
@@ -2064,7 +2090,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
}
}
- private void configureSSL(String prvkeyPath, String prvCertPath, String certChainPath) {
+ private void configureSSL(String prvkeyPath, String prvCertPath, String certChainPath, String rootCACert) {
if (!_inSystemVM) {
return;
}
@@ -2076,6 +2102,9 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
if (certChainPath != null) {
command.add("-t", certChainPath);
}
+ if (rootCACert != null) {
+ command.add("-u", rootCACert);
+ }
String result = command.execute();
if (result != null) {
s_logger.warn("Unable to configure httpd to use ssl");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/systemvm/scripts/_run.sh
----------------------------------------------------------------------
diff --git a/systemvm/scripts/_run.sh b/systemvm/scripts/_run.sh
index 1a37c7d..3792261 100755
--- a/systemvm/scripts/_run.sh
+++ b/systemvm/scripts/_run.sh
@@ -68,4 +68,4 @@ if [ "$(uname -m | grep '64')" == "" ]; then
fi
fi
-java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Dlog.home=$LOGHOME -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@
+java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -Djsse.enableSNIExtension=false -Dlog.home=$LOGHOME -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/systemvm/scripts/config_ssl.sh
----------------------------------------------------------------------
diff --git a/systemvm/scripts/config_ssl.sh b/systemvm/scripts/config_ssl.sh
index e474787..6971055 100755
--- a/systemvm/scripts/config_ssl.sh
+++ b/systemvm/scripts/config_ssl.sh
@@ -24,6 +24,7 @@ help() {
printf " -k path of private key\n"
printf " -p path of certificate of public key\n"
printf " -t path of certificate chain\n"
+ printf " -u path of root ca certificate \n"
}
@@ -53,6 +54,10 @@ config_apache2_conf() {
sed -i -e "s/NameVirtualHost .*:80/NameVirtualHost $ip:80/g" /etc/apache2/ports.conf
sed -i 's/ssl-cert-snakeoil.key/cert_apache.key/' /etc/apache2/sites-available/default-ssl
sed -i 's/ssl-cert-snakeoil.pem/cert_apache.crt/' /etc/apache2/sites-available/default-ssl
+ if [ -f /etc/ssl/certs/cert_apache_chain.crt ]
+ then
+ sed -i -e "s/#SSLCertificateChainFile.*/SSLCertificateChainFile \/etc\/ssl\/certs\/cert_apache_chain.crt/" /etc/apache2/sites-available/default-ssl
+ fi
}
copy_certs() {
@@ -88,12 +93,13 @@ cccflag=
customPrivKey=$(dirname $0)/certs/realhostip.key
customPrivCert=$(dirname $0)/certs/realhostip.crt
customCertChain=
+customCACert=
publicIp=
hostName=
keyStore=$(dirname $0)/certs/realhostip.keystore
aliasName="CPVMCertificate"
storepass="vmops.com"
-while getopts 'i:h:k:p:t:c' OPTION
+while getopts 'i:h:k:p:t:u:c' OPTION
do
case $OPTION in
c) cflag=1
@@ -107,6 +113,9 @@ do
t) cccflag=1
customCertChain="$OPTARG"
;;
+ u) ccacflag=1
+ customCACert="$OPTARG"
+ ;;
i) publicIp="$OPTARG"
;;
h) hostName="$OPTARG"
@@ -165,10 +174,10 @@ then
exit 2
fi
-if [ -f "$customPrivCert" ]
+if [ -f "$customCACert" ]
then
keytool -delete -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt
- keytool -import -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt -file $customPrivCert
+ keytool -import -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt -file $customCACert
fi
if [ -d /etc/apache2 ]
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f96d430/ui/scripts/ui-custom/physicalResources.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/physicalResources.js b/ui/scripts/ui-custom/physicalResources.js
index fcc2f6a..06fcca7 100644
--- a/ui/scripts/ui-custom/physicalResources.js
+++ b/ui/scripts/ui-custom/physicalResources.js
@@ -117,8 +117,8 @@
type: "POST",
url: createURL('uploadCustomCertificate'),
data: {
- certificate: encodeURIComponent(args.data.certificate),
- privatekey: encodeURIComponent(args.data.privatekey),
+ certificate: args.data.certificate,
+ privatekey: args.data.privatekey,
domainsuffix: args.data.domainsuffix
},
dataType: 'json',
[15/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6431: OVS migrating vm to a new host added to the cluster
does not create gre tunnel port on the new host
ensure OveElement gets a chance to setup tunnel network on the host
before VM is migrated.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5ba7f6c0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5ba7f6c0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5ba7f6c0
Branch: refs/heads/4.4
Commit: 5ba7f6c00628dc971a338e4b5ecab49ef1965b37
Parents: 61fc571
Author: Murali Reddy <mu...@gmail.com>
Authored: Fri Apr 25 17:18:24 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:13:03 2014 +0200
----------------------------------------------------------------------
.../com/cloud/network/element/OvsElement.java | 39 +++++++++++++++++++-
1 file changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ba7f6c0/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
index d767834..faf58fc 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
@@ -54,6 +54,7 @@ import com.cloud.network.PublicIpAddress;
import com.cloud.network.dao.NetworkServiceMapDao;
import com.cloud.network.lb.LoadBalancingRule;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
+import com.cloud.network.NetworkMigrationResponder;
import com.cloud.network.ovs.OvsTunnelManager;
import com.cloud.network.router.VirtualRouter.Role;
import com.cloud.network.router.VpcVirtualNetworkApplianceManager;
@@ -79,10 +80,10 @@ import com.cloud.vm.VirtualMachine;
@Local(value = {NetworkElement.class, ConnectivityProvider.class,
SourceNatServiceProvider.class, StaticNatServiceProvider.class,
- PortForwardingServiceProvider.class, IpDeployer.class})
+ PortForwardingServiceProvider.class, IpDeployer.class, NetworkMigrationResponder.class})
public class OvsElement extends AdapterBase implements NetworkElement,
OvsElementService, ConnectivityProvider, ResourceStateAdapter,
-PortForwardingServiceProvider, LoadBalancingServiceProvider,
+PortForwardingServiceProvider, LoadBalancingServiceProvider, NetworkMigrationResponder,
StaticNatServiceProvider, IpDeployer {
@Inject
OvsTunnelManager _ovsTunnelMgr;
@@ -658,4 +659,38 @@ StaticNatServiceProvider, IpDeployer {
}
return true;
}
+
+ @Override
+ public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) {
+ if (!canHandle(network, Service.Connectivity)) {
+ return false;
+ }
+
+ if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
+ return false;
+ }
+
+ if (nic.getTrafficType() != Networks.TrafficType.Guest) {
+ return false;
+ }
+
+ if (vm.getType() != VirtualMachine.Type.User && vm.getType() != VirtualMachine.Type.DomainRouter) {
+ return false;
+ }
+
+ // prepare the tunnel network on the host, in order for VM to get launched
+ _ovsTunnelMgr.checkAndPrepareHostForTunnelNetwork(network, dest.getHost());
+
+ return true;
+ }
+
+ @Override
+ public void rollbackMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) {
+ return;
+ }
+
+ @Override
+ public void commitMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) {
+ return;
+ }
}
[09/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6458: IAM - When a domain is deleted , the group created for this domian is not removed.
Changes:
- When domain is deleted or is removed during account cleanup, send message to IAM to remove the domain group
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3d072b0d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3d072b0d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3d072b0d
Branch: refs/heads/4.4
Commit: 3d072b0d029389aa883d2881215bc16ea7b33c9f
Parents: 9aab604
Author: Prachi Damle <pr...@cloud.com>
Authored: Tue Apr 22 18:34:01 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:57:18 2014 +0200
----------------------------------------------------------------------
server/src/com/cloud/user/DomainManagerImpl.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d072b0d/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index fbbe0c2..fe6e530 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -227,7 +227,11 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
@Override
public boolean removeDomain(long domainId) {
- return _domainDao.remove(domainId);
+ boolean removed = _domainDao.remove(domainId);
+ if (removed) {
+ _messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domainId);
+ }
+ return removed;
}
@Override
@@ -324,6 +328,9 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
" because it can't be removed due to resources referencing to it");
domain.setState(Domain.State.Active);
_domainDao.update(domain.getId(), domain);
+ } else {
+ // succeeded in removing the domain
+ _messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domain.getId());
}
}
}
[06/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6494: Typing a pipe '|' character in VM console returns a question mark and pipe '?|'.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8b56182e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8b56182e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8b56182e
Branch: refs/heads/4.4
Commit: 8b56182e0f00f5700505e76f8e2983de9abc8123
Parents: 66fcfee
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Thu Apr 24 13:27:21 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:44:37 2014 +0200
----------------------------------------------------------------------
systemvm/js/ajaxkeys.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b56182e/systemvm/js/ajaxkeys.js
----------------------------------------------------------------------
diff --git a/systemvm/js/ajaxkeys.js b/systemvm/js/ajaxkeys.js
index 60c9798..8f78cc8 100644
--- a/systemvm/js/ajaxkeys.js
+++ b/systemvm/js/ajaxkeys.js
@@ -169,8 +169,7 @@ KEYBOARD_TYPE_UK = "uk";
var keyboardTables = [
{tindex: 0, keyboardType: KEYBOARD_TYPE_COOKED, mappingTable:
- {X11: [ {keycode: 220, entry: X11_KEY_YEN_MARK},
- {keycode: 226, entry: X11_KEY_REVERSE_SOLIUS},
+ {X11: [ {keycode: 226, entry: X11_KEY_REVERSE_SOLIUS},
{keycode: 240, entry: [
{type: KEY_DOWN, code: X11_KEY_CAPSLOCK, modifiers: 0 },
[10/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6458: IAM - When a domain is deleted , the group created for this domian is not removed.
Changes:
- When domain is deleted, IAM service will not find it unless it selects using 'removed' column
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0233bc88
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0233bc88
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0233bc88
Branch: refs/heads/4.4
Commit: 0233bc88ba08f03e0eb26105ab8b94c2800283ea
Parents: 3d072b0
Author: Prachi Damle <pr...@cloud.com>
Authored: Thu Apr 24 12:42:40 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:57:41 2014 +0200
----------------------------------------------------------------------
.../plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0233bc88/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java
index 77e588b..f9f76c1 100644
--- a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java
+++ b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java
@@ -243,7 +243,7 @@ public class IAMApiServiceImpl extends ManagerBase implements IAMApiService, Man
Long domainId = ((Long) obj);
if (domainId != null) {
s_logger.debug("MessageBus message: Domain removed: " + domainId + ", removing the domain group");
- Domain domain = _domainDao.findById(domainId);
+ Domain domain = _domainDao.findByIdIncludingRemoved(domainId);
List<IAMGroup> groups = listDomainGroup(domain);
for (IAMGroup group : groups) {
_iamSrv.deleteIAMGroup(group.getId());
[13/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6507: ensure sequence numbers are honoured while processing
OvsVpcPhysicalTopologyConfigCommand and OvsVpcRoutingPolicyConfigCommand
fix ensures only latest updates are applied (new openflow rules) to the
bidge enabled for distributed routing.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cbe32683
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cbe32683
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cbe32683
Branch: refs/heads/4.4
Commit: cbe326838d77c0f4d22010ce9419a2854ad07e82
Parents: 2f96d43
Author: Murali Reddy <mu...@gmail.com>
Authored: Fri Apr 25 14:44:43 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:07:37 2014 +0200
----------------------------------------------------------------------
.../cloud/network/ovs/OvsTunnelManagerImpl.java | 2 +-
.../xenserver/cloudstack_pluginlib.py | 81 +++++++++++++++++++-
.../vm/hypervisor/xenserver/ovs-vif-flows.py | 80 +++----------------
scripts/vm/hypervisor/xenserver/ovstunnel | 37 +++++++--
4 files changed, 123 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbe32683/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
index c755d72..6fd7d6d 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
@@ -912,7 +912,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
seqVo = new VpcDistributedRouterSeqNoVO(vpcId);
_vpcDrSeqNoDao.persist(seqVo);
}
- _vpcDrSeqNoDao.lockRow(seqVo.getId(), true);
+ seqVo = _vpcDrSeqNoDao.lockRow(seqVo.getId(), true);
seqVo.incrSequenceNo();
_vpcDrSeqNoDao.update(seqVo.getId(), seqVo);
return seqVo.getSequenceNo();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbe32683/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py
index cda3645..bcb9540 100644
--- a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py
+++ b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py
@@ -22,6 +22,7 @@ import logging
import os
import subprocess
import simplejson as json
+import copy
from time import localtime, asctime
@@ -349,7 +350,6 @@ def configure_bridge_for_network_topology(bridge, this_host_id, json_config, seq
action_str = "table=0, in_port=%s," % of_port + " ip, dl_dst=%s," %network.gatewaymac +\
"nw_dst=%s," %vpconfig.cidr + "actions=resubmit(,3)"
addflow = [OFCTL_PATH, "add-flow", bridge, action_str]
-
do_cmd(addflow)
# get the list of hosts on which VPC spans from the JSON config
@@ -510,4 +510,83 @@ def configure_ovs_bridge_for_routing_policies(bridge, json_config, sequence_no):
except:
logging.debug("An unexpected error occurred while configuring bridge as per VPC's routing policies.")
+ raise
+
+def update_flooding_rules_on_port_plug_unplug(bridge, interface, command, if_network_id):
+
+ vnet_vif_ofports = []
+ vnet_tunnelif_ofports = []
+ vnet_all_ofports = []
+
+ logging.debug("Updating the flooding rules as interface %s" %interface + " is %s"%command + " now.")
+ try:
+ vsctl_output = do_cmd([VSCTL_PATH, 'list-ports', bridge])
+ ports = vsctl_output.split('\n')
+
+ for port in ports:
+ if_ofport = do_cmd([VSCTL_PATH, 'get', 'Interface', port, 'ofport'])
+ if port.startswith('vif'):
+ # check VIF is in same network as that of plugged vif
+ if if_network_id != get_network_id_for_vif(port):
+ continue
+ vnet_vif_ofports.append(if_ofport)
+ vnet_all_ofports.append(if_ofport)
+
+ if port.startswith('t'):
+ # check tunnel port is in same network as that of plugged vif
+ if if_network_id != get_network_id_for_tunnel_port(port)[1:-1]:
+ continue
+ vnet_tunnelif_ofports.append(if_ofport)
+ vnet_all_ofports.append(if_ofport)
+
+ if command == 'online':
+
+ if len(vnet_all_ofports) == 1 :
+ return
+
+ for port in vnet_all_ofports:
+ clear_flooding_rules_for_port(bridge, port)
+
+ # for a packet arrived from tunnel port, flood only on VIF ports
+ for port in vnet_tunnelif_ofports:
+ add_flooding_rules_for_port(bridge, port, vnet_vif_ofports)
+
+ # for a packet arrived from VIF port send on all VIF and tunnel port excluding the port
+ # on which packet arrived
+ for port in vnet_vif_ofports:
+ vnet_all_ofports_copy = copy.copy(vnet_all_ofports)
+ vnet_all_ofports_copy.remove(port)
+ add_flooding_rules_for_port(bridge, port, vnet_all_ofports_copy)
+
+ this_if_ofport = do_cmd([VSCTL_PATH, 'get', 'Interface', interface, 'ofport'])
+
+ #learn that MAC is reachable through the VIF port
+ if interface.startswith('vif'):
+ mac = get_macaddress_of_vif(interface)
+ add_mac_lookup_table_entry(bridge, mac, this_if_ofport)
+
+ if command == 'offline':
+ for port in vnet_all_ofports:
+ clear_flooding_rules_for_port(bridge, port)
+
+ vnet_all_ofports.remove(this_if_ofport)
+ vnet_vif_ofports.remove(this_if_ofport)
+
+ # for a packet arrived from tunnel port, flood only on VIF ports
+ for port in vnet_tunnelif_ofports:
+ add_flooding_rules_for_port(bridge, port, vnet_vif_ofports)
+
+ # for a packet from VIF port send on all VIF's and tunnel ports excluding the port on which packet arrived
+ for port in vnet_vif_ofports:
+ vnet_all_ofports_copy = copy.copy(vnet_all_ofports)
+ vnet_all_ofports_copy.remove(port)
+ add_flooding_rules_for_port(bridge, port, vnet_all_ofports_copy)
+
+ #un-learn that MAC is reachable through the VIF port
+ if interface.startswith('vif'):
+ mac = get_macaddress_of_vif(interface)
+ delete_mac_lookup_table_entry(bridge, mac)
+ except:
+ logging.debug("An unexpected error occurred while updating the flooding rules when interface "
+ + " %s" %interface + " is %s"%command)
raise
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbe32683/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py b/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py
index b2fe11c..ba5f41a 100644
--- a/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py
+++ b/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py
@@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-# A simple script for enabling and disabling per-vif rules for explicitly
-# allowing broadcast/multicast traffic on the port where the VIF is attached
+# A simple script for enabling and disabling per-vif and tunnel interface rules for explicitly
+# allowing broadcast/multicast traffic from the tunnel ports and on the port where the VIF is attached
import copy
import os
@@ -28,9 +28,11 @@ import cloudstack_pluginlib as pluginlib
pluginlib.setup_logging("/var/log/cloud/ovstunnel.log")
def clear_flows(bridge, this_vif_ofport, vif_ofports):
+ action = "".join("output:%s," %ofport
+ for ofport in vif_ofports)[:-1]
# Remove flow entries originating from given ofport
pluginlib.del_flows(bridge, in_port=this_vif_ofport)
- # The following will remove the port being delete from actions
+ # The following will remove the port being delete from actions
pluginlib.add_flow(bridge, priority=1100,
dl_dst='ff:ff:ff:ff:ff:ff', actions=action)
pluginlib.add_flow(bridge, priority=1100,
@@ -40,7 +42,7 @@ def clear_flows(bridge, this_vif_ofport, vif_ofports):
def apply_flows(bridge, this_vif_ofport, vif_ofports):
action = "".join("output:%s," %ofport
for ofport in vif_ofports)[:-1]
- # Ensure {b|m}casts sent from VIF ports are always allowed
+ # Ensure {b|m}casts sent from VIF ports are always allowed
pluginlib.add_flow(bridge, priority=1200,
in_port=this_vif_ofport,
dl_dst='ff:ff:ff:ff:ff:ff',
@@ -49,7 +51,7 @@ def apply_flows(bridge, this_vif_ofport, vif_ofports):
in_port=this_vif_ofport,
nw_dst='224.0.0.0/24',
actions='NORMAL')
- # Ensure {b|m}casts are always propagated to VIF ports
+ # Ensure {b|m}casts are always propagated to VIF ports
pluginlib.add_flow(bridge, priority=1100,
dl_dst='ff:ff:ff:ff:ff:ff', actions=action)
pluginlib.add_flow(bridge, priority=1100,
@@ -116,6 +118,7 @@ def main(command, vif_raw):
'list-ports', bridge])
vifs = vsctl_output.split('\n')
vif_ofports = []
+ vif_other_ofports = []
for vif in vifs:
vif_ofport = pluginlib.do_cmd([pluginlib.VSCTL_PATH, 'get',
'Interface', vif, 'ofport'])
@@ -125,7 +128,9 @@ def main(command, vif_raw):
vif_ofports.append(vif_ofport)
if command == 'offline':
- clear_flows(bridge, this_vif_ofport, vif_ofports)
+ vif_other_ofports = copy.copy(vif_ofports)
+ vif_other_ofports.remove(this_vif_ofport)
+ clear_flows(bridge, this_vif_ofport, vif_other_ofports)
if command == 'online':
apply_flows(bridge, this_vif_ofport, vif_ofports)
@@ -138,69 +143,8 @@ def main(command, vif_raw):
# We need the REAL bridge name
bridge = pluginlib.do_cmd([pluginlib.VSCTL_PATH,
'br-to-parent', bridge])
- vsctl_output = pluginlib.do_cmd([pluginlib.VSCTL_PATH,
- 'list-ports', bridge])
vif_network_id = pluginlib.get_network_id_for_vif(this_vif)
- vnet_vif_ofports = []
- vnet_tunnelif_ofports = []
- vnet_all_ofports = []
-
- ports = vsctl_output.split('\n')
- for port in ports:
- if_ofport = pluginlib.do_cmd([pluginlib.VSCTL_PATH, 'get', 'Interface', port, 'ofport'])
- if port.startswith('vif'):
- # check VIF is in same network as that of plugged vif
- if vif_network_id != pluginlib.get_network_id_for_vif(port):
- continue
- vnet_vif_ofports.append(if_ofport)
- vnet_all_ofports.append(if_ofport)
-
- if port.startswith('t'):
- # check tunnel port is in same network as that of plugged vif
- if vif_network_id != pluginlib.get_network_id_for_tunnel_port(port)[1:-1]:
- continue
- vnet_tunnelif_ofports.append(if_ofport)
- vnet_all_ofports.append(if_ofport)
-
- if command == 'online':
- for port in vnet_all_ofports:
- pluginlib.clear_flooding_rules_for_port(bridge, port)
-
- # for a packet arrived from tunnel port, flood only on VIF ports
- for port in vnet_tunnelif_ofports:
- pluginlib.add_flooding_rules_for_port(bridge, port, vnet_vif_ofports)
-
- # for a packet arrived from VIF port send on all VIF and tunnel port excluding the port
- # on which packet arrived
- for port in vnet_vif_ofports:
- vnet_all_ofports_copy = copy.copy(vnet_all_ofports)
- vnet_all_ofports_copy.remove(port)
- pluginlib.add_flooding_rules_for_port(bridge, port, vnet_all_ofports_copy)
-
- #learn that MAC is reachable through the VIF port
- mac = pluginlib.get_macaddress_of_vif(this_vif)
- this_vif_ofport = pluginlib.do_cmd([pluginlib.VSCTL_PATH, 'get', 'Interface', this_vif, 'ofport'])
- pluginlib.add_mac_lookup_table_entry(bridge, mac, this_vif_ofport)
-
- if command == 'offline':
- for port in vnet_all_ofports:
- pluginlib.clear_flooding_rules_for_port(bridge, port)
- vnet_all_ofports.remove(this_vif_ofport)
- vnet_vif_ofports.remove(this_vif_ofport)
-
- # for a packet arrived from tunnel port, flood only on VIF ports
- for port in vnet_tunnelif_ofports:
- pluginlib.add_flooding_rules_for_port(bridge, port, vnet_vif_ofports)
-
- # for a packet from VIF port send on all VIF's and tunnel ports excluding the port on which packet arrived
- for port in vnet_vif_ofports:
- vnet_all_ofports_copy = copy.copy(vnet_all_ofports)
- vnet_all_ofports_copy.remove(port)
- pluginlib.add_flooding_rules_for_port(bridge, port, vnet_all_ofports_copy)
-
- #un-learn that MAC is reachable through the VIF port
- mac = pluginlib.get_macaddress_of_vif(this_vif)
- pluginlib.delete_mac_lookup_table_entry(bridge, mac)
+ pluginlib.update_flooding_rules_on_port_plug_unplug(bridge, this_vif, command, vif_network_id)
return
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbe32683/scripts/vm/hypervisor/xenserver/ovstunnel
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/ovstunnel b/scripts/vm/hypervisor/xenserver/ovstunnel
index a97df9b..db3216b 100755
--- a/scripts/vm/hypervisor/xenserver/ovstunnel
+++ b/scripts/vm/hypervisor/xenserver/ovstunnel
@@ -165,9 +165,12 @@ def setup_ovs_bridge_for_distributed_routing(session, args):
lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid,
"other-config:ovs-host-setup=%s" % conf_hosts])
+ # first clear the default rule (i.e rule for NORMAL processing)
+ lib.del_flows(bridge, table=0)
+
# add a default flow rule to send broadcast and multi-cast packets to L2 flooding table
- lib.add_flow(bridge, priority=1000, dl_dst='ff:ff:ff:ff:ff:ff', table=0, actions='resubmit(,2)')
- lib.add_flow(bridge, priority=1000, nw_dst='224.0.0.0/24', table=0, actions='resubmit(,2)')
+ lib.add_flow(bridge, priority=1200, dl_dst='ff:ff:ff:ff:ff:ff', table=0, actions='resubmit(,2)')
+ lib.add_flow(bridge, priority=1200, nw_dst='224.0.0.0/24', table=0, actions='resubmit(,2)')
# add a default flow rule to send uni-cast traffic to L2 lookup table
lib.add_flow(bridge, priority=0, table=0, actions='resubmit(,1)')
@@ -178,7 +181,7 @@ def setup_ovs_bridge_for_distributed_routing(session, args):
# add a default rule in L2 flood table to drop packet
lib.add_flow(bridge, priority=0, table=2, actions='drop')
- # add a default rule in egress table to forward packet to L3 lookup table
+ # add a default rule in egress ACL table to forward packet to L3 lookup table
lib.add_flow(bridge, priority=0, table=3, actions='resubmit(,4)')
# add a default rule in L3 lookup table to forward packet to L2 lookup table
@@ -187,6 +190,9 @@ def setup_ovs_bridge_for_distributed_routing(session, args):
# add a default rule in ingress table to drop in bound packets
lib.add_flow(bridge, priority=0, table=5, actions='drop')
+ # initialize the sequence number for the bridge
+ lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=0"])
+
result = "SUCCESS: successfully setup bridge with flow rules"
logging.debug("Setup_ovs_bridge completed with result:%s" % result)
@@ -326,8 +332,11 @@ def create_tunnel(session, args):
nw_dst='224.0.0.0/24', actions='drop')
# add flow rule to send the traffic from tunnel ports to L2 switching table only
- lib.add_flow(bridge, priority=1000, in_port=tun_ofport, table=0, actions='resubmit(,1)')
+ lib.add_flow(bridge, priority=1100, in_port=tun_ofport, table=0, actions='resubmit(,1)')
+
+ # mark tunnel interface with network id for which this tunnel was created
lib.do_cmd([lib.VSCTL_PATH, "set", "interface", name, "options:cloudstack-network-id=%s" % network_uuid])
+ lib.update_flooding_rules_on_port_plug_unplug(bridge, name, 'online', network_uuid)
return "SUCCESS:%s" % name
except:
@@ -402,15 +411,29 @@ def configure_ovs_bridge_for_network_topology(session, args):
this_host_id = args.pop("host-id")
sequence_no = args.pop("seq-no")
- return lib.configure_bridge_for_network_topology(bridge, this_host_id, json_config, sequence_no)
+ # get the last update sequence number
+ last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, "other-config:sequence-number"])
+ last_seq_no = last_seq_no[1:-1]
+ if sequence_no > last_seq_no:
+ lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=%s"%sequence_no])
+ return lib.configure_bridge_for_network_topology(bridge, this_host_id, json_config, sequence_no)
+ else:
+ return "SUCCESS: Ignoring the update as there is already recent update received and applied"
+
@echo
def configure_ovs_bridge_for_routing_policies(session, args):
bridge = args.pop("bridge")
json_config = args.pop("config")
sequence_no = args.pop("seq-no")
-
- return lib.configure_ovs_bridge_for_routing_policies(bridge, json_config, sequence_no)
+ # get the last update sequence number
+ last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, "other-config:sequence-number"])
+ last_seq_no = last_seq_no[1:-1]
+ if sequence_no > last_seq_no:
+ lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=%s"%sequence_no])
+ return lib.configure_ovs_bridge_for_routing_policies(bridge, json_config, sequence_no)
+ else:
+ return "SUCCESS: Ignoring the update as there is already recent update received and applied"
if __name__ == "__main__":
XenAPIPlugin.dispatch({"create_tunnel": create_tunnel,
[08/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
improved ldap logging. added stacktrace in debug level incase of exceptions.
Conflicts:
plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java
Signed-off-by: Abhinandan Prateek <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9aab6046
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9aab6046
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9aab6046
Branch: refs/heads/4.4
Commit: 9aab6046aefebe6bdd9c4e648208f4812f62f7cc
Parents: 234f7e4
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Tue Apr 22 11:37:31 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:48:31 2014 +0200
----------------------------------------------------------------------
.../src/org/apache/cloudstack/ldap/LdapContextFactory.java | 9 ++++++---
.../src/org/apache/cloudstack/ldap/LdapManagerImpl.java | 7 ++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9aab6046/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java
index 4f6bb61..491faa3 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapContextFactory.java
@@ -53,9 +53,12 @@ public class LdapContextFactory {
return createInitialDirContext(principal, password, null, isSystemContext);
}
- private DirContext createInitialDirContext(final String principal, final String password, final String providerUrl, final boolean isSystemContext)
- throws NamingException {
- return new InitialDirContext(getEnvironment(principal, password, providerUrl, isSystemContext));
+ private DirContext createInitialDirContext(final String principal,
+ final String password, final String providerUrl,
+ final boolean isSystemContext) throws NamingException {
+ Hashtable<String, String> environment = getEnvironment(principal, password, providerUrl, isSystemContext);
+ s_logger.debug("initializing ldap with provider url: "+ environment.get(Context.PROVIDER_URL));
+ return new InitialDirContext(environment);
}
public DirContext createUserContext(final String principal, final String password) throws NamingException {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9aab6046/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java
index 6d71f4f..0e3bde8 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java
@@ -81,6 +81,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
s_logger.info("Added new ldap server with hostname: " + hostname);
return new LdapConfigurationResponse(hostname, port);
} catch (final NamingException e) {
+ s_logger.debug("NamingException while doing an LDAP bind", e);
throw new InvalidParameterValueException("Unable to bind to the given LDAP server");
}
} else {
@@ -98,6 +99,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
closeContext(context);
return true;
} catch (final NamingException e) {
+ s_logger.debug("NamingException: while doing an LDAP bind for user "+" "+username, e);
s_logger.info("Failed to authenticate user: " + username + ". incorrect password.");
return false;
}
@@ -109,7 +111,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
context.close();
}
} catch (final NamingException e) {
- s_logger.warn(e.getMessage());
+ s_logger.warn(e.getMessage(),e);
}
}
@@ -183,6 +185,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
context = _ldapContextFactory.createBindContext();
return _ldapUserManager.getUsers(context);
} catch (final NamingException e) {
+ s_logger.debug("ldap NamingException: ",e);
throw new NoLdapUserMatchingQueryException("*");
} finally {
closeContext(context);
@@ -196,6 +199,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
context = _ldapContextFactory.createBindContext();
return _ldapUserManager.getUsersInGroup(groupName, context);
} catch (final NamingException e) {
+ s_logger.debug("ldap NamingException: ",e);
throw new NoLdapUserMatchingQueryException("groupName=" + groupName);
} finally {
closeContext(context);
@@ -223,6 +227,7 @@ public class LdapManagerImpl implements LdapManager, LdapValidator {
final String escapedUsername = LdapUtils.escapeLDAPSearchFilter(username);
return _ldapUserManager.getUsers("*" + escapedUsername + "*", context);
} catch (final NamingException e) {
+ s_logger.debug("ldap NamingException: ",e);
throw new NoLdapUserMatchingQueryException(username);
} finally {
closeContext(context);
[11/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6436: listResourceDetails - don't return entries set with display=false, by default
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/35767d1e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/35767d1e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/35767d1e
Branch: refs/heads/4.4
Commit: 35767d1ee95765aafa826b38f4a9127d1c477ee4
Parents: 0233bc8
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Apr 24 14:28:31 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:00:17 2014 +0200
----------------------------------------------------------------------
.../cloudstack/api/command/user/vm/ListNicsCmd.java | 7 +++----
.../command/user/volume/ListResourceDetailsCmd.java | 14 +++++++-------
server/src/com/cloud/api/query/QueryManagerImpl.java | 2 +-
3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/35767d1e/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
index 408497c..49402dc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
@@ -99,11 +99,10 @@ public class ListNicsCmd extends BaseListCmd {
public Boolean getDisplay() {
- Account caller = CallContext.current().getCallingAccount();
- if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
- return true;
+ if (display != null) {
+ return display;
}
- return display;
+ return true;
}
/////////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/35767d1e/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
index ebec4b1..93dc29d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.user.volume;
import java.util.List;
+import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ResourceDetailResponse;
import org.apache.cloudstack.api.response.ResourceTagResponse;
-import org.apache.cloudstack.context.CallContext;
import com.cloud.server.ResourceTag;
@@ -45,7 +45,7 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
private String key;
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "if set to true, only details marked with display=true, are returned."
- + " Always false is the call is made by the regular user", since = "4.3")
+ + " False by default", since = "4.3", authorized = { RoleType.Admin })
private Boolean forDisplay;
public String getResourceId() {
@@ -61,12 +61,12 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
return s_name;
}
- public Boolean forDisplay() {
- if (!_accountService.isAdmin(CallContext.current().getCallingAccount().getId())) {
- return true;
+ @Override
+ public Boolean getDisplay() {
+ if (forDisplay != null) {
+ return forDisplay;
}
-
- return forDisplay;
+ return super.getDisplay();
}
/////////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/35767d1e/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 4450be8..fb8b020 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -3320,7 +3320,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
@Override
public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd) {
String key = cmd.getKey();
- Boolean forDisplay = cmd.forDisplay();
+ Boolean forDisplay = cmd.getDisplay();
ResourceTag.ResourceObjectType resourceType = cmd.getResourceType();
String resourceIdStr = cmd.getResourceId();
Long resourceId = null;
[07/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6338 [Automation] Failed to NetScaler Device with error
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/234f7e4b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/234f7e4b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/234f7e4b
Branch: refs/heads/4.4
Commit: 234f7e4b76ec47c733b226a75daf5311c6d778a2
Parents: 8b56182
Author: Rajesh Battala <ra...@citrix.com>
Authored: Thu Apr 24 17:09:18 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:45:54 2014 +0200
----------------------------------------------------------------------
.../src/com/cloud/network/resource/NetscalerResource.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/234f7e4b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
index 043997e..97a0787 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
@@ -295,6 +295,8 @@ public class NetscalerResource implements ServerResource {
_netscalerService = new nitro_service(_ip, "https");
_netscalerService.set_credential(_username, _password);
_netscalerService.set_timeout(_timeout);
+ _netscalerService.set_certvalidation(false);
+ _netscalerService.set_hostnameverification(false);
apiCallResult = _netscalerService.login();
if (apiCallResult.errorcode != 0) {
throw new ExecutionException("Failed to log in to Netscaler device at " + _ip + " due to error " + apiCallResult.errorcode + " and message " +
[14/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6505: XenServer bridge for the OVS tunnel network gets reset
on the hosts in the xenserver cluster
this fix ensures that brige is created only once so that openflow rules
configured on the bridge are not lost.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/61fc5712
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/61fc5712
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/61fc5712
Branch: refs/heads/4.4
Commit: 61fc57121c0edfd77afc2096eb93b9341634f91b
Parents: cbe3268
Author: Murali Reddy <mu...@gmail.com>
Authored: Fri Apr 25 14:36:31 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:08:03 2014 +0200
----------------------------------------------------------------------
.../hypervisor/xen/resource/CitrixResourceBase.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61fc5712/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index ecdfb5c..ad37973 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
@@ -936,14 +936,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
synchronized (_tmpDom0Vif) {
_tmpDom0Vif.add(dom0vif);
}
+ try {
+ dom0vif.plug(conn);
+ } catch (Exception e) {
+ // though an exception is thrown here, VIF actually gets plugged-in to dom0, so just ignore the exception
+ }
+ dom0vif.unplug(conn);
}
- // At this stage we surely have a VIF
- try {
- dom0vif.plug(conn);
- } catch (Exception e) {
- // though an exception is thrown here, VIF actually gets plugged-in to dom0, so just ignore the exception
- }
- dom0vif.unplug(conn);
}
private synchronized Network setupvSwitchNetwork(Connection conn) {
[04/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6477: UI - Load Balancing - add VMs => fix error 'Unable to decode parameter vmidipmap[0].vmip[]; if specifying an object array, please use parameter[index].field=XXX, ~ '
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c6d1e10c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c6d1e10c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c6d1e10c
Branch: refs/heads/4.4
Commit: c6d1e10cb654e6fa1ac7ade90e03c41d5c7c9284
Parents: 2bba381
Author: Jessica Wang <je...@apache.org>
Authored: Wed Apr 23 14:39:02 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:33:26 2014 +0200
----------------------------------------------------------------------
ui/scripts/network.js | 105 +++++++++++++++++++++++++++------------------
1 file changed, 64 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6d1e10c/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 6494704..6462d2a 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3583,6 +3583,7 @@
var stickyData = $.extend(true, {}, args.data.sticky);
+ //***** create new LB rule > Add VMs *****
$.ajax({
url: createURL('createLoadBalancerRule'),
data: data,
@@ -3593,6 +3594,10 @@
var jobID = data.createloadbalancerruleresponse.jobid;
var lbID = data.createloadbalancerruleresponse.id;
+ var inputData = {
+ id: data.createloadbalancerruleresponse.id
+ };
+
/*
var inputData = {
id: data.createloadbalancerruleresponse.id,
@@ -3600,36 +3605,37 @@
return elem.id;
}).join(',')
};
- */
- //when server-side change of adding new parameter "vmidipmap" to assignToLoadBalancerRule API is in, remove the above 6 lines and uncomment the commented section below.
-
- var inputData = {
- id: data.createloadbalancerruleresponse.id
- };
- if (args.context.ipAddresses[0].isportable) {
- if (args.itemData != null) {
- for (var k = 0; k < args.itemData.length; k++) {
- inputData['vmidipmap[' + k + '].vmid'] = args.itemData[k].id;
- inputData['vmidipmap[' + k + '].vmip'] = args.itemData[k]._subselect.split(',')[1];
- }
- }
-
- } else {
- if (args.itemData != null) {
- for (var k = 0; k < args.itemData.length; k++) {
- inputData['vmidipmap[' + k + '].vmid'] = args.itemData[k].id;
-
- // NOTE - multiple IP support not ready for API integration yet
- // for now, just use the first selected IP
- //
- // Please change this to pass multiple IPs
- inputData['vmidipmap[' + k + '].vmip'] = args.itemData[k]._subselect[0];
- }
- }
- }
-
- //http://localhost:8080/client/api?command=assignToLoadBalancerRule&response=json&sessionkey=M6I8h6gBXuEMeBMb4pjSDTjYprc=&id=da97bae5-9389-4bbb-aef3-ccca8408a852&vmidipmap[0].vmid=667d1450-3cd9-4670-b22e-aebb77f521a3&vmidipmap[0].ip=10.1.1.23&vmidipmap[1].vmid=5128d30b-7747-4a05-bdbc-6262191d7642&vmidipmap[1].ip=10.1.1.82&vmidipmap[2].vmid=48c61d00-28d2-4048-aed5-774289470804&vmidipmap[2].ip=10.1.1.5&_=1393451067671
-
+ */
+ //virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the 6 lines above.
+
+
+ /*
+ * e.g. first VM(xxx) has two IPs(10.1.1.~), second VM(yyy) has three IPs(10.2.2.~):
+ * vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
+ * vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
+ * vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
+ * vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
+ * vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
+ */
+ var selectedVMs = args.itemData;
+ if (selectedVMs != null) {
+ var vmidipmapIndex = 0;
+ for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
+ var selectedIPs = selectedVMs[vmIndex]._subselect;
+ for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
+
+ if (args.context.ipAddresses[0].isportable) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
+ } else {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
+ }
+
+ vmidipmapIndex++;
+ }
+ }
+ }
+
$.ajax({
url: createURL('assignToLoadBalancerRule'),
data: inputData,
@@ -3739,21 +3745,38 @@
},
itemActions: {
- add: {
+ //***** update existing LB rule > Add VMs *****
+ add: {
label: 'label.add.vms.to.lb',
action: function(args) {
var inputData = {
id: args.multiRule.id
- };
- if (args.data != null) {
- for (var k = 0; k < args.data.length; k++) {
- inputData['vmidipmap[' + k + '].vmid'] = args.data[k].id;
-
- if (args.context.ipAddresses[0].isportable) {
- inputData['vmidipmap[' + k + '].vmip'] = args.data[k]._subselect.split(',')[1];
- } else {
- inputData['vmidipmap[' + k + '].vmip'] = args.data[k]._subselect;
- }
+ };
+
+ /*
+ * e.g. first VM(xxx) has two IPs(10.1.1.~), second VM(yyy) has three IPs(10.2.2.~):
+ * vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
+ * vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
+ * vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
+ * vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
+ * vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
+ */
+ var selectedVMs = args.data;
+ if (selectedVMs != null) {
+ var vmidipmapIndex = 0;
+ for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
+ var selectedIPs = selectedVMs[vmIndex]._subselect;
+ for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
+
+ if (args.context.ipAddresses[0].isportable) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
+ } else {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
+ }
+
+ vmidipmapIndex++;
+ }
}
}
[05/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6488 Fixed an issue where the "path" field was not being set properly in the DB when the volume had a snapshot taken of it
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/66fcfee2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/66fcfee2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/66fcfee2
Branch: refs/heads/4.4
Commit: 66fcfee22017d5c0314f4109913fa962274819b1
Parents: c6d1e10
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Apr 23 10:32:55 2014 -0600
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:35:24 2014 +0200
----------------------------------------------------------------------
.../manager/VmwareStorageManagerImpl.java | 27 ++++++++++++--------
1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66fcfee2/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index e37bf38..fbba322 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -1169,21 +1169,28 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
if (input == null) {
return null;
}
+
String result = input;
- if (result.endsWith(".vmdk")) { // get rid of vmdk file extension
- result = result.substring(0, result.length() - (".vmdk").length());
+
+ final String fileType = ".vmdk";
+
+ if (result.endsWith(fileType)) {
+ // get rid of fileType
+ result = result.substring(0, result.length() - (fileType).length());
}
- if (result.split("-").length == 1) {
+
+ String[] str = result.split("-");
+ int length = str.length;
+
+ if (length == 1 || length == 2) {
return result;
}
- if (result.split("-").length > 2) {
- return result.split("-")[0] + "-" + result.split("-")[1];
- }
- if (result.split("-").length == 2) {
- return result.split("-")[0];
- } else {
- return result;
+
+ if (length > 2) {
+ return str[0] + "-" + str[1];
}
+
+ return result;
}
@Override
[16/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6170 Updated logic to more accurately calculate how much space is currently allocated for a managed storage pool
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6b342ffc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6b342ffc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6b342ffc
Branch: refs/heads/4.4
Commit: 6b342ffce74dcd5d0d3562b3ee7ccfb7626e3ace
Parents: 5ba7f6c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Apr 24 22:18:56 2014 -0600
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 22:23:54 2014 +0200
----------------------------------------------------------------------
server/src/com/cloud/capacity/CapacityManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6b342ffc/server/src/com/cloud/capacity/CapacityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java
index cef019d..14fbe7f 100755
--- a/server/src/com/cloud/capacity/CapacityManagerImpl.java
+++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java
@@ -548,7 +548,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
// if the storage pool is managed, the used bytes can be larger than the sum of the sizes of all of the non-destroyed volumes
// in this case, call getUsedBytes(StoragePoolVO)
if (pool.isManaged()) {
- totalAllocatedSize = getUsedBytes(pool);
+ return getUsedBytes(pool);
}
else {
// Get size for all the non-destroyed volumes
[03/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6501:IAM - DomainAdmin - When listVirtualMachines is used
with listall=true and account and domainId , Vms owned by the account
account is not listed.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2bba381a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2bba381a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2bba381a
Branch: refs/heads/4.4
Commit: 2bba381a631347cc53a3ce106dfd10a2eb137519
Parents: e811e61
Author: Min Chen <mi...@citrix.com>
Authored: Thu Apr 24 18:13:59 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:27:13 2014 +0200
----------------------------------------------------------------------
server/src/com/cloud/user/AccountManagerImpl.java | 6 +++++-
.../apache/cloudstack/iam/RoleBasedEntityQuerySelector.java | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bba381a/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 37e4b43..227c611 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -2283,7 +2283,11 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
if (accountId != null) {
// specific account filter is specified
- if (grantedAccounts.contains(accountId)) {
+ if (grantedDomains.contains(domainId)) {
+ // the account domain is granted to the caller
+ permittedAccounts.add(accountId);
+ }
+ else if (grantedAccounts.contains(accountId)) {
permittedAccounts.add(accountId);
} else {
//TODO: we should also filter granted resources based on accountId passed.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bba381a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityQuerySelector.java
----------------------------------------------------------------------
diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityQuerySelector.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityQuerySelector.java
index 40c8549..b7c3d35 100644
--- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityQuerySelector.java
+++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityQuerySelector.java
@@ -73,8 +73,8 @@ public class RoleBasedEntityQuerySelector extends AdapterBase implements QuerySe
domainId = p.getScopeId();
//domainIds.add(p.getScopeId());
}
- domainIds.add(domainId);
- // add all the domain children from this domain. Like RoleBasedEntityAccessChecker, we made an assumption, if DOMAIN scope is granted, it means that
+ //domainIds.add(domainId);
+ // add all the domain children from this domain (including this domain itself). Like RoleBasedEntityAccessChecker, we made an assumption, if DOMAIN scope is granted, it means that
// the whole domain tree is granted access.
DomainVO domain = _domainDao.findById(domainId);
List<Long> childDomains = _domainDao.getDomainChildrenIds(domain.getPath());
[02/16] git commit: updated refs/heads/4.4 to 6b342ff
Posted by da...@apache.org.
CLOUDSTACK-6502:IAMGroup.list and IAMPolicy.list in marvin base.py are
not working.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e811e61d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e811e61d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e811e61d
Branch: refs/heads/4.4
Commit: e811e61ded4351c639f8f80754fce5ad80c7f202
Parents: 65bdf2c
Author: Min Chen <mi...@citrix.com>
Authored: Thu Apr 24 18:20:13 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:26:55 2014 +0200
----------------------------------------------------------------------
tools/marvin/marvin/integration/lib/base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e811e61d/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 775b289..91e277c 100755
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -3735,7 +3735,7 @@ class IAMGroup:
def list(cls, apiclient, **kwargs):
cmd = listIAMGroups.listIAMGroupsCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
- return apiclient.listIAMGroupsCmd(cmd)
+ return apiclient.listIAMGroups(cmd)
def addAccount(self, apiclient, accts):
"""Add accounts to iam group"""
@@ -3796,7 +3796,7 @@ class IAMPolicy:
def list(cls, apiclient, **kwargs):
cmd = listIAMPolicies.listIAMPoliciesCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
- return apiclient.listIAMPoliciesCmd(cmd)
+ return apiclient.listIAMPolicies(cmd)
def addPermission(self, apiclient, permission):
"""Add permission to iam policy"""