You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2014/03/18 00:42:35 UTC

[1/6] git commit: updated refs/heads/4.3 to 0810029

Repository: cloudstack
Updated Branches:
  refs/heads/4.3 6a6ec6480 -> 0810029f2


CLOUDSTACK-6211: Xenserver - HA - SSVM fails to start due to running out of management Ip ranges when testing host down scenarios

Signed-off-by: Koushik Das <ko...@apache.org>
(cherry picked from commit 15bf144f1a89ee024f087427a3c72cf233e49356)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e11bbe76
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e11bbe76
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e11bbe76

Branch: refs/heads/4.3
Commit: e11bbe7651b76cbbbc0fdc4824cfc7746e52d7c6
Parents: 6a6ec64
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Fri Mar 7 15:36:26 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:18:49 2014 -0700

----------------------------------------------------------------------
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 83 ++++++++++----------
 1 file changed, 43 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e11bbe76/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index efbf5b1..6d18f86 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1233,62 +1233,65 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         VirtualMachine vm = profile.getVirtualMachine();
         State state = vm.getState();
         s_logger.debug("Cleaning up resources for the vm " + vm + " in " + state + " state");
-        if (state == State.Starting) {
-            Step step = work.getStep();
-            if (step == Step.Starting && !cleanUpEvenIfUnableToStop) {
-                s_logger.warn("Unable to cleanup vm " + vm + "; work state is incorrect: " + step);
-                return false;
-            }
+        try {
+            if (state == State.Starting) {
+                Step step = work.getStep();
+                if (step == Step.Starting && !cleanUpEvenIfUnableToStop) {
+                    s_logger.warn("Unable to cleanup vm " + vm + "; work state is incorrect: " + step);
+                    return false;
+                }
 
-            if (step == Step.Started || step == Step.Starting || step == Step.Release) {
+                if (step == Step.Started || step == Step.Starting || step == Step.Release) {
+                    if (vm.getHostId() != null) {
+                        if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
+                            s_logger.warn("Failed to stop vm " + vm + " in " + State.Starting + " state as a part of cleanup process");
+                            return false;
+                        }
+                    }
+                }
+
+                if (step != Step.Release && step != Step.Prepare && step != Step.Started && step != Step.Starting) {
+                    s_logger.debug("Cleanup is not needed for vm " + vm + "; work state is incorrect: " + step);
+                    return true;
+                }
+            } else if (state == State.Stopping) {
                 if (vm.getHostId() != null) {
                     if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
-                        s_logger.warn("Failed to stop vm " + vm + " in " + State.Starting + " state as a part of cleanup process");
+                        s_logger.warn("Failed to stop vm " + vm + " in " + State.Stopping + " state as a part of cleanup process");
                         return false;
                     }
                 }
-            }
-
-            if (step != Step.Release && step != Step.Prepare && step != Step.Started && step != Step.Starting) {
-                s_logger.debug("Cleanup is not needed for vm " + vm + "; work state is incorrect: " + step);
-                return true;
-            }
-        } else if (state == State.Stopping) {
-            if (vm.getHostId() != null) {
-                if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
-                    s_logger.warn("Failed to stop vm " + vm + " in " + State.Stopping + " state as a part of cleanup process");
-                    return false;
+            } else if (state == State.Migrating) {
+                if (vm.getHostId() != null) {
+                    if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
+                        s_logger.warn("Failed to stop vm " + vm + " in " + State.Migrating + " state as a part of cleanup process");
+                        return false;
+                    }
                 }
-            }
-        } else if (state == State.Migrating) {
-            if (vm.getHostId() != null) {
-                if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
-                    s_logger.warn("Failed to stop vm " + vm + " in " + State.Migrating + " state as a part of cleanup process");
-                    return false;
+                if (vm.getLastHostId() != null) {
+                    if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
+                        s_logger.warn("Failed to stop vm " + vm + " in " + State.Migrating + " state as a part of cleanup process");
+                        return false;
+                    }
                 }
-            }
-            if (vm.getLastHostId() != null) {
+            } else if (state == State.Running) {
                 if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
-                    s_logger.warn("Failed to stop vm " + vm + " in " + State.Migrating + " state as a part of cleanup process");
+                    s_logger.warn("Failed to stop vm " + vm + " in " + State.Running + " state as a part of cleanup process");
                     return false;
                 }
             }
-        } else if (state == State.Running) {
-            if (!sendStop(guru, profile, cleanUpEvenIfUnableToStop)) {
-                s_logger.warn("Failed to stop vm " + vm + " in " + State.Running + " state as a part of cleanup process");
-                return false;
+        } finally {
+            try {
+                _networkMgr.release(profile, cleanUpEvenIfUnableToStop);
+                s_logger.debug("Successfully released network resources for the vm " + vm);
+            } catch (Exception e) {
+                s_logger.warn("Unable to release some network resources.", e);
             }
-        }
 
-        try {
-            _networkMgr.release(profile, cleanUpEvenIfUnableToStop);
-            s_logger.debug("Successfully released network resources for the vm " + vm);
-        } catch (Exception e) {
-            s_logger.warn("Unable to release some network resources.", e);
+            volumeMgr.release(profile);
+            s_logger.debug("Successfully cleanued up resources for the vm " + vm + " in " + state + " state");
         }
 
-        volumeMgr.release(profile);
-        s_logger.debug("Successfully cleanued up resources for the vm " + vm + " in " + state + " state");
         return true;
     }
 


[5/6] git commit: updated refs/heads/4.3 to 0810029

Posted by an...@apache.org.
CLOUDSTACK-6245: the security group rule is lagging behind the rules in DB, due to there is a worker thread launched inside a transaction Reviewed-by: Alex
(cherry picked from commit d4fdc184fe9c6717d2ed4e4fe4c39d9759a90608)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d2bec2e1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d2bec2e1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d2bec2e1

Branch: refs/heads/4.3
Commit: d2bec2e14f3720e944de345b569ee2bfb78f0347
Parents: 7b32e3d
Author: Edison Su <su...@gmail.com>
Authored: Mon Mar 17 14:34:53 2014 -0700
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:27:25 2014 -0700

----------------------------------------------------------------------
 .../security/SecurityGroupManagerImpl.java      | 33 ++++++++++++++------
 1 file changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2bec2e1/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
index e48bb34..51c93b7 100755
--- a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
+++ b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
@@ -713,7 +713,7 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
         final Integer startPortOrTypeFinal = startPortOrType;
         final Integer endPortOrCodeFinal = endPortOrCode;
         final String protocolFinal = protocol;
-        return Transaction.execute(new TransactionCallback<List<SecurityGroupRuleVO>>() {
+        List<SecurityGroupRuleVO> newRules = Transaction.execute(new TransactionCallback<List<SecurityGroupRuleVO>>() {
             @Override
             public List<SecurityGroupRuleVO> doInTransaction(TransactionStatus status) {
                 // Prevents other threads/management servers from creating duplicate security rules
@@ -756,9 +756,6 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
                     if (s_logger.isDebugEnabled()) {
                         s_logger.debug("Added " + newRules.size() + " rules to security group " + securityGroup.getName());
                     }
-                    final ArrayList<Long> affectedVms = new ArrayList<Long>();
-                    affectedVms.addAll(_securityGroupVMMapDao.listVmIdsBySecurityGroup(securityGroup.getId()));
-                    scheduleRulesetUpdateToHosts(affectedVms, true, null);
                     return newRules;
                 } catch (Exception e) {
                     s_logger.warn("Exception caught when adding security group rules ", e);
@@ -771,6 +768,15 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
             }
         });
 
+        try {
+            final ArrayList<Long> affectedVms = new ArrayList<Long>();
+            affectedVms.addAll(_securityGroupVMMapDao.listVmIdsBySecurityGroup(securityGroup.getId()));
+            scheduleRulesetUpdateToHosts(affectedVms, true, null);
+        } catch (Exception e) {
+            s_logger.debug("can't update rules on host, ignore", e);
+        }
+
+        return newRules;
     }
 
     @Override
@@ -810,7 +816,8 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
         SecurityGroup securityGroup = _securityGroupDao.findById(rule.getSecurityGroupId());
         _accountMgr.checkAccess(caller, null, true, securityGroup);
 
-        return Transaction.execute(new TransactionCallback<Boolean>() {
+        long securityGroupId = rule.getSecurityGroupId();
+        Boolean result = Transaction.execute(new TransactionCallback<Boolean>() {
             @Override
             public Boolean doInTransaction(TransactionStatus status) {
                 SecurityGroupVO groupHandle = null;
@@ -825,11 +832,7 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
         
                     _securityGroupRuleDao.remove(id);
                     s_logger.debug("revokeSecurityGroupRule succeeded for security rule id: " + id);
-        
-                    final ArrayList<Long> affectedVms = new ArrayList<Long>();
-                    affectedVms.addAll(_securityGroupVMMapDao.listVmIdsBySecurityGroup(groupHandle.getId()));
-                    scheduleRulesetUpdateToHosts(affectedVms, true, null);
-        
+
                     return true;
                 } catch (Exception e) {
                     s_logger.warn("Exception caught when deleting security rules ", e);
@@ -841,6 +844,16 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
                 }
             }
         });
+
+        try {
+            final ArrayList<Long> affectedVms = new ArrayList<Long>();
+            affectedVms.addAll(_securityGroupVMMapDao.listVmIdsBySecurityGroup(securityGroupId));
+            scheduleRulesetUpdateToHosts(affectedVms, true, null);
+        } catch (Exception e) {
+            s_logger.debug("Can't update rules for host, ignore", e);
+        }
+
+        return result;
     }
 
     @Override


[2/6] git commit: updated refs/heads/4.3 to 0810029

Posted by an...@apache.org.
CLOUDSTACK-5986: Fix dnsmasq lease for VPC
(cherry picked from commit 657d042953e40e3220c5b0b86511f3bf6a1e186f)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5973a426
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5973a426
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5973a426

Branch: refs/heads/4.3
Commit: 5973a4269143679693fc5f1fe89c7b3d70c26b6f
Parents: e11bbe7
Author: Sheng Yang <sh...@citrix.com>
Authored: Wed Mar 12 18:02:31 2014 -0700
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:19:34 2014 -0700

----------------------------------------------------------------------
 systemvm/patches/debian/config/root/edithosts.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5973a426/systemvm/patches/debian/config/root/edithosts.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/edithosts.sh b/systemvm/patches/debian/config/root/edithosts.sh
index 8e7ddac..d6ff983 100755
--- a/systemvm/patches/debian/config/root/edithosts.sh
+++ b/systemvm/patches/debian/config/root/edithosts.sh
@@ -95,7 +95,7 @@ wait_for_dnsmasq () {
   return 1
 }
 
-if [ $dnsmasq_managed_lease ]
+if [ $dnsmasq_managed_lease -eq 1 ]
 then
   #release previous dhcp lease if present
   logger -t cloud "edithosts: releasing $ipv4"
@@ -212,7 +212,7 @@ pid=$(pidof dnsmasq)
 if [ "$pid" != "" ]
 then
   # use SIGHUP to avoid service outage if dhcp_release is available.
-  if [ $dnsmasq_managed_lease ]
+  if [ $dnsmasq_managed_lease -eq 1 ]
   then
     kill -HUP $pid
   else


[3/6] git commit: updated refs/heads/4.3 to 0810029

Posted by an...@apache.org.
CLOUDSTACK-6241: Fix default route for IPv6 network when IPv4 not used
(cherry picked from commit e406adc0810b22ded0964080946f019be1337b52)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cd2ba90f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cd2ba90f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cd2ba90f

Branch: refs/heads/4.3
Commit: cd2ba90fae7acd31e6f459154ef096b65c7345f2
Parents: 5973a42
Author: Sheng Yang <sh...@citrix.com>
Authored: Fri Mar 14 13:36:43 2014 -0700
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:20:09 2014 -0700

----------------------------------------------------------------------
 systemvm/patches/debian/config/root/edithosts.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd2ba90f/systemvm/patches/debian/config/root/edithosts.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/edithosts.sh b/systemvm/patches/debian/config/root/edithosts.sh
index d6ff983..57ee7dc 100755
--- a/systemvm/patches/debian/config/root/edithosts.sh
+++ b/systemvm/patches/debian/config/root/edithosts.sh
@@ -184,7 +184,7 @@ then
   echo "$ipv6 $host" >> $HOSTS
 fi
 
-if [ "$dflt" != "" ]
+if [ "$dflt" != "" -a "$ipv4" != "" ]
 then
   #make sure dnsmasq looks into options file
   sed -i /dhcp-optsfile/d /etc/dnsmasq.conf


[6/6] git commit: updated refs/heads/4.3 to 0810029

Posted by an...@apache.org.
CLOUDSTACK-6246: UI > Infrastructure > SSL Certificate > update (1) mouse-over hint of SSL Certificate button. (2) description in SSL Certificate dialog.
(cherry picked from commit 33476b87351d10252911a4191986d5a5342d5597)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0810029f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0810029f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0810029f

Branch: refs/heads/4.3
Commit: 0810029f274878eca8fd74b44ab1117054e929a5
Parents: d2bec2e
Author: Jessica Wang <je...@apache.org>
Authored: Mon Mar 17 15:41:48 2014 -0700
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:28:15 2014 -0700

----------------------------------------------------------------------
 client/WEB-INF/classes/resources/messages.properties | 2 +-
 ui/index.jsp                                         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0810029f/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 4032253..bccf71d 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -1567,7 +1567,7 @@ message.tooltip.reserved.system.netmask=The network prefix that defines the pod
 message.tooltip.zone.name=A name for the zone.
 message.update.os.preference=Please choose a OS preference for this host.  All virtual instances with similar preferences will be first allocated to this host before choosing another.
 message.update.resource.count=Please confirm that you want to update resource counts for this account.
-message.update.ssl=Please submit a new X.509 compliant SSL certificate to be updated to each console proxy virtual instance\:
+message.update.ssl=Please submit a new X.509 compliant SSL certificate to be updated to each console proxy and secondary storage virtual instance\:
 message.validate.instance.name=Instance name can not be longer than 63 characters. Only ASCII letters a~z, A~Z, digits 0~9, hyphen are allowed. Must start with a letter and end with a letter or a digit.
 message.virtual.network.desc=A dedicated virtualized network for your account.  The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router.
 message.vm.create.template.confirm=Create Template will reboot the VM automatically.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0810029f/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index 096747b..0cd5dc5a 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -1044,7 +1044,7 @@
                     <div class="button refresh" id="refresh_button">
                         <span><fmt:message key="label.refresh"/></span>
                     </div>
-                    <div id="update_ssl_button" class="button action main-action reduced-hide lock" title="Updates your Console Proxy SSL Certificate">
+                    <div id="update_ssl_button" class="button action main-action reduced-hide lock" title="Updates your SSL Certificate">
                         <span class="icon">&nbsp;</span>
                         <span><fmt:message key="label.update.ssl.cert"/></span>
                     </div>


[4/6] git commit: updated refs/heads/4.3 to 0810029

Posted by an...@apache.org.
KVM security bug: no forwarding rule applied
(cherry picked from commit e5c391fcf3852e50ebd99d4a72fd51d1753b05eb)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7b32e3da
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7b32e3da
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7b32e3da

Branch: refs/heads/4.3
Commit: 7b32e3da2d1fa2b08fec929252d15a36dd57bdd1
Parents: cd2ba90
Author: Edison Su <su...@gmail.com>
Authored: Fri Mar 14 14:40:48 2014 -0700
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Mon Mar 17 16:21:12 2014 -0700

----------------------------------------------------------------------
 scripts/vm/network/security_group.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b32e3da/scripts/vm/network/security_group.py
----------------------------------------------------------------------
diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py
index 1d94de3..704b279 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -978,7 +978,7 @@ def addFWFramework(brname):
         execute("iptables -N " + brfwin)
 
     try:
-        refs = execute("""iptables -n -L " + brfw + " | awk '/%s(.*)references/ {gsub(/\(/, "") ;print $3}'""" % brfw).strip()
+        refs = execute("""iptables -n -L %s | awk '/%s(.*)references/ {gsub(/\(/, "") ;print $3}'""" % (brfw,brfw)).strip()
         if refs == "0":
             execute("iptables -I FORWARD -i " + brname + " -j DROP")
             execute("iptables -I FORWARD -o " + brname + " -j DROP")