You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ni...@apache.org on 2013/09/11 08:52:13 UTC

[1/2] git commit: updated refs/heads/4.2 to 9162b3c

Updated Branches:
  refs/heads/4.2 8d043c0e4 -> 9162b3c91
  refs/heads/4.2-forward a0c8fdf26 -> 17a186557


CLOUDSTACK-2813 - Some deployment failures do not release the resources.
Applying the short term fix of force cleaning up if the answer recieved from startcommand is not valid
Signed off by : nitin mehta<ni...@citrix.com>


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

Branch: refs/heads/4.2
Commit: 9162b3c91fbe408fe89ca338e12d7eca741ec076
Parents: 8d043c0
Author: Nitin Mehta <ni...@citrix.com>
Authored: Sun Jun 30 14:51:36 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Sep 11 11:58:38 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/VirtualMachineManagerImpl.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9162b3c9/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 11904b9..d46bbb0 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -870,6 +870,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                 }
                 vmProfile.setCpuOvercommitRatio(Float.parseFloat(cluster_detail_cpu.getValue()));
                 vmProfile.setMemoryOvercommitRatio(Float.parseFloat(cluster_detail_ram.getValue()));
+                StartAnswer startAnswer = null;
 
                 try {
                     if (!changeState(vm, Event.OperationRetry, destHostId, work, Step.Prepare)) {
@@ -917,7 +918,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                     _workDao.updateStep(work, Step.Started);
 
 
-                    StartAnswer startAnswer = cmds.getAnswer(StartAnswer.class);
+                    startAnswer = cmds.getAnswer(StartAnswer.class);
                     if (startAnswer != null && startAnswer.getResult()) {
                         String host_guid = startAnswer.getHost_guid();
                         if( host_guid != null ) {
@@ -933,6 +934,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                             if (!changeState(vm, Event.OperationSucceeded, destHostId, work, Step.Done)) {
                                 throw new ConcurrentOperationException("Unable to transition to a new state.");
                             }
+
                             startedVm = vm;
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Start completed for VM " + vm);
@@ -988,7 +990,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                     if (startedVm == null && canRetry) {
                         Step prevStep = work.getStep();
                         _workDao.updateStep(work, Step.Release);
-                        if (prevStep == Step.Started || prevStep == Step.Starting) {
+                        // If previous step was started/ing && we got a valid answer
+                        if((prevStep == Step.Started || prevStep == Step.Starting) && (startAnswer != null && startAnswer.getResult())){  //TODO check the response of cleanup and record it in DB for retry
                             cleanup(vmGuru, vmProfile, work, Event.OperationFailed, false, caller, account);
                         } else {
                             //if step is not starting/started, send cleanup command with force=true


[2/2] git commit: updated refs/heads/4.2-forward to 17a1865

Posted by ni...@apache.org.
CLOUDSTACK-2813 - Some deployment failures do not release the resources.
Applying the short term fix of force cleaning up if the answer recieved from startcommand is not valid
Signed off by : nitin mehta<ni...@citrix.com>


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

Branch: refs/heads/4.2-forward
Commit: 17a186557d2903fdd32cd3ed0cc6bd9a046d4853
Parents: a0c8fdf
Author: Nitin Mehta <ni...@citrix.com>
Authored: Sun Jun 30 14:51:36 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Sep 11 12:19:23 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/VirtualMachineManagerImpl.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/17a18655/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 11904b9..d46bbb0 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -870,6 +870,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                 }
                 vmProfile.setCpuOvercommitRatio(Float.parseFloat(cluster_detail_cpu.getValue()));
                 vmProfile.setMemoryOvercommitRatio(Float.parseFloat(cluster_detail_ram.getValue()));
+                StartAnswer startAnswer = null;
 
                 try {
                     if (!changeState(vm, Event.OperationRetry, destHostId, work, Step.Prepare)) {
@@ -917,7 +918,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                     _workDao.updateStep(work, Step.Started);
 
 
-                    StartAnswer startAnswer = cmds.getAnswer(StartAnswer.class);
+                    startAnswer = cmds.getAnswer(StartAnswer.class);
                     if (startAnswer != null && startAnswer.getResult()) {
                         String host_guid = startAnswer.getHost_guid();
                         if( host_guid != null ) {
@@ -933,6 +934,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                             if (!changeState(vm, Event.OperationSucceeded, destHostId, work, Step.Done)) {
                                 throw new ConcurrentOperationException("Unable to transition to a new state.");
                             }
+
                             startedVm = vm;
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Start completed for VM " + vm);
@@ -988,7 +990,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                     if (startedVm == null && canRetry) {
                         Step prevStep = work.getStep();
                         _workDao.updateStep(work, Step.Release);
-                        if (prevStep == Step.Started || prevStep == Step.Starting) {
+                        // If previous step was started/ing && we got a valid answer
+                        if((prevStep == Step.Started || prevStep == Step.Starting) && (startAnswer != null && startAnswer.getResult())){  //TODO check the response of cleanup and record it in DB for retry
                             cleanup(vmGuru, vmProfile, work, Event.OperationFailed, false, caller, account);
                         } else {
                             //if step is not starting/started, send cleanup command with force=true