You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/12/16 14:33:47 UTC

git commit: updated refs/heads/4.3 to df16623

Updated Branches:
  refs/heads/4.3 e2805b802 -> df1662353


CLOUDSTACK-4616: When system Vms fail to start when host is down , link
local Ip addresses do not get released resulting in all the link local
Ip addresses being consumed eventually.

fix ensure Nics with reservation strategy 'Start' should go through
release phase in the Nic life cycle so that release is performed before
Nic is removed to avoid resource leaks.


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

Branch: refs/heads/4.3
Commit: df16623533b1968e33afa89cd52fb231730ca3bc
Parents: e2805b8
Author: Murali Reddy <mu...@gmail.com>
Authored: Mon Dec 16 19:00:29 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Mon Dec 16 19:03:16 2013 +0530

----------------------------------------------------------------------
 .../engine/orchestration/NetworkOrchestrator.java        | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df166235/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index c647f8e..bb02cc9 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -1497,6 +1497,17 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     }
 
     protected void removeNic(VirtualMachineProfile vm, NicVO nic) {
+
+        if (nic.getReservationStrategy() == Nic.ReservationStrategy.Start && nic.getState() != Nic.State.Allocated) {
+            // Nics with reservation strategy 'Start' should go through release phase in the Nic life cycle.
+            // Ensure that release is performed before Nic is to be removed to avoid resource leaks.
+            try {
+                releaseNic(vm, nic.getId());
+            } catch (Exception ex) {
+                s_logger.warn("Failed to release nic: " + nic.toString() + " as part of remove operation due to", ex );
+            }
+        }
+
         nic.setState(Nic.State.Deallocating);
         _nicDao.update(nic.getId(), nic);
         NetworkVO network = _networksDao.findById(nic.getNetworkId());