cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [17/50] [abbrv] git commit: updated refs/heads/feature/systemvm-persistent-config to 4fe7264
Date Wed, 04 Feb 2015 20:28:37 GMT
TK-3135 fixes for VPC restart

* removed the "is redundant" flag form the addVpcRouterToGuestNetwork() method
* removed the "is redundant" flag from the removeVpcRouterFromGuestNetwork() method
* changed the path of the master.py file in the keepalived.conf.temp file
* the call to routerDao.addRouterToGuestNetwork() in the VpcRouterDeploymentDefinition is not needed. That step will be performed once a VM is created
  - In addition, when restarting a VPC the routers will have the guest net configured, if any exists.

* Pushing the POM.xml as well, to use the old Jetty for now. Could not fix the logging problem. Will replace the POM with master version after VPC is done.


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

Branch: refs/heads/feature/systemvm-persistent-config
Commit: 63d48322c6aab3af4e29559087c930f5564ed5ab
Parents: 5f83ac8
Author: wilderrodrigues <wrodrigues@schubergphilis.com>
Authored: Wed Jan 7 08:59:39 2015 +0100
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Wed Feb 4 18:47:05 2015 +0100

----------------------------------------------------------------------
 .../VpcVirtualNetworkApplianceService.java      |   4 +-
 client/pom.xml                                  |  31 +-
 .../com/cloud/vm/VirtualMachineManagerImpl.java |   2 +-
 .../element/VpcVirtualRouterElement.java        |  28 +-
 .../com/cloud/network/router/NetworkHelper.java |   9 +-
 .../cloud/network/router/NetworkHelperImpl.java |   7 +-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |   6 +-
 .../RouterDeploymentDefinitionBuilder.java      |  20 +-
 .../VpcRouterDeploymentDefinition.java          |   1 -
 .../MockVpcVirtualNetworkApplianceManager.java  |   4 +-
 .../RouterDeploymentDefinitionTest.java         | 504 +++++++++----------
 .../RouterDeploymentDefinitionTestBase.java     |  14 +-
 .../VpcRouterDeploymentDefinitionTest.java      |  30 +-
 .../opt/cloud/templates/keepalived.conf.templ   |   6 +-
 14 files changed, 331 insertions(+), 335 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java b/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
index 382c460..5c3ee3f 100644
--- a/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
+++ b/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
@@ -36,7 +36,7 @@ public interface VpcVirtualNetworkApplianceService extends VirtualNetworkApplian
      * @throws ResourceUnavailableException
      * @throws InsufficientCapacityException
      */
-    boolean addVpcRouterToGuestNetwork(VirtualRouter router, Network network, boolean isRedundant, Map<VirtualMachineProfile.Param, Object> params)
+    boolean addVpcRouterToGuestNetwork(VirtualRouter router, Network network, Map<VirtualMachineProfile.Param, Object> params)
             throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
 
     /**
@@ -47,6 +47,6 @@ public interface VpcVirtualNetworkApplianceService extends VirtualNetworkApplian
      * @throws ConcurrentOperationException
      * @throws ResourceUnavailableException
      */
-    boolean removeVpcRouterFromGuestNetwork(VirtualRouter router, Network network, boolean isRedundant) throws ConcurrentOperationException, ResourceUnavailableException;
+    boolean removeVpcRouterFromGuestNetwork(VirtualRouter router, Network network) throws ConcurrentOperationException, ResourceUnavailableException;
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 590a9ad..0529acb 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -404,23 +404,23 @@
         </configuration>
       </plugin>
       <plugin>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-maven-plugin</artifactId>
-            <version>9.2.6.v20141205</version>
-             <dependencies>
-              <!-- specify the dependent jdbc driver here -->
-              <dependency>
-                <groupId>mysql</groupId>
-                <artifactId>mysql-connector-java</artifactId>
-                <version>${cs.mysql.version}</version>
-              </dependency>
-            </dependencies>
+         <groupId>org.mortbay.jetty</groupId>
+         <artifactId>maven-jetty-plugin</artifactId>
+         <version>6.1.26</version>
+         <dependencies>
+          <!-- specify the dependent jdbc driver here -->
+          <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${cs.mysql.version}</version>
+          </dependency>
+        </dependencies>
         <configuration>
           <scanIntervalSeconds>0</scanIntervalSeconds>
           <stopPort>9966</stopPort>
           <stopKey>stop-jetty</stopKey>
           <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
               <port>8080</port>
               <maxIdleTime>60000</maxIdleTime>
             </connector>
@@ -431,6 +431,13 @@
             <contextPath>/client</contextPath>
             <extraClasspath>${project.build.directory}/utilities/scripts/db/;${project.build.directory}/utilities/scripts/db/db/</extraClasspath>
           </webAppConfig>
+          
+          <systemProperties>
+              <systemProperty>
+                 <name>log4j.configuration</name>
+                 <value>log4j-cloud.xml</value>
+              </systemProperty>
+          </systemProperties>
         </configuration>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/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 17a3a1c..18b2ea4 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -943,7 +943,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                     if (planChangedByVolume) {
                         plan = originalPlan;
                         planChangedByVolume = false;
-                        //do not enter volume reuse for next retry, since we want to look for resorces outside the volume's cluster
+                        //do not enter volume reuse for next retry, since we want to look for resources outside the volume's cluster
                         reuseVolume = false;
                         continue;
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
index 76a7721..f44d7aa 100644
--- a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
@@ -188,11 +188,6 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
             throw new ResourceUnavailableException("Can't find at least one running router!", DataCenter.class, network.getDataCenterId());
         }
 
-        // [FIXME] Comment added by Wilder Rodrigues - This exception has to be removed once we are able to test multiple routers.
-        //        if (routers.size() > 1) {
-        //            throw new CloudRuntimeException("Found more than one router in vpc " + vpc);
-        //        }
-
         s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         for (final DomainRouterVO domainRouterVO : routers) {
@@ -201,7 +196,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                 if (network.getState() == State.Setup) {
                     paramsForRouter.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
                 }
-                if (!_vpcRouterMgr.addVpcRouterToGuestNetwork(domainRouterVO, network, false, paramsForRouter)) {
+                if (!_vpcRouterMgr.addVpcRouterToGuestNetwork(domainRouterVO, network, paramsForRouter)) {
                     s_logger.error("Failed to add VPC router " + domainRouterVO + " to guest network " + network);
                 } else {
                     s_logger.debug("Successfully added VPC router " + domainRouterVO + " to guest network " + network);
@@ -240,11 +235,6 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                 throw new ResourceUnavailableException("Can't find at least one running router!", DataCenter.class, network.getDataCenterId());
             }
 
-            // [FIXME] Comment added by Wilder Rodrigues - This exception has to be removed once we are able to test multiple routers.
-            //        if (routers.size() > 1) {
-            //            throw new CloudRuntimeException("Found more than one router in vpc " + vpc);
-            //        }
-
             s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
             for (final DomainRouterVO domainRouterVO : routers) {
@@ -255,7 +245,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                     if (network.getState() == State.Setup) {
                         paramsForRouter.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
                     }
-                    if (!_vpcRouterMgr.addVpcRouterToGuestNetwork(domainRouterVO, network, false, paramsForRouter)) {
+                    if (!_vpcRouterMgr.addVpcRouterToGuestNetwork(domainRouterVO, network, paramsForRouter)) {
                         s_logger.error("Failed to add VPC router " + domainRouterVO + " to guest network " + network);
                     } else {
                         s_logger.debug("Successfully added VPC router " + domainRouterVO + " to guest network " + network);
@@ -284,7 +274,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                 continue;
             }
             // 2) Call unplugNics in the network service
-            success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, network, false);
+            success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, network);
             if (!success) {
                 s_logger.warn("Failed to unplug nic in network " + network + " for virtual router " + router);
             } else {
@@ -312,7 +302,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                 continue;
             }
             // 2) Call unplugNics in the network service
-            success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, config, false);
+            success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, config);
             if (!success) {
                 s_logger.warn("Failed to unplug nic in network " + config + " for virtual router " + router);
             } else {
@@ -372,11 +362,6 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
             return true;
         }
 
-        // [FIXME] Comment added by Wilder Rodrigues - This exception has to be removed once we are able to test multiple routers.
-        //        if (routers.size() > 1) {
-        //            throw new CloudRuntimeException("Found more than one router in vpc " + vpc);
-        //        }
-
         s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         final DataCenterVO dcVO = _dcDao.findById(gateway.getZoneId());
@@ -416,11 +401,6 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
             return true;
         }
 
-        // [FIXME] Comment added by Wilder Rodrigues - This exception has to be removed once we are able to test multiple routers.
-        //        if (routers.size() > 1) {
-        //            throw new CloudRuntimeException("Found more than one router in vpc " + vpc);
-        //        }
-
         s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         int result = 0;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/com/cloud/network/router/NetworkHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkHelper.java b/server/src/com/cloud/network/router/NetworkHelper.java
index 6c61016..4ee5b85 100644
--- a/server/src/com/cloud/network/router/NetworkHelper.java
+++ b/server/src/com/cloud/network/router/NetworkHelper.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.network.router;
 
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -30,9 +31,11 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InsufficientServerCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
+import com.cloud.network.Network;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.vm.DomainRouterVO;
+import com.cloud.vm.NicProfile;
 import com.cloud.vm.VirtualMachineProfile.Param;
 
 public interface NetworkHelper {
@@ -73,9 +76,11 @@ public interface NetworkHelper {
                     ConcurrentOperationException, ResourceUnavailableException;
 
     public abstract DomainRouterVO deployRouter(
-            RouterDeploymentDefinition routerDeploymentDefinition,
-            boolean startRouter)
+            RouterDeploymentDefinition routerDeploymentDefinition, boolean startRouter)
                     throws InsufficientAddressCapacityException,
                     InsufficientServerCapacityException, InsufficientCapacityException,
                     StorageUnavailableException, ResourceUnavailableException;
+
+    public abstract LinkedHashMap<Network, List<? extends NicProfile>> createRouterNetworks(RouterDeploymentDefinition routerDeploymentDefinition)
+            throws ConcurrentOperationException, InsufficientAddressCapacityException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/com/cloud/network/router/NetworkHelperImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java b/server/src/com/cloud/network/router/NetworkHelperImpl.java
index 7019ef3..5e0386b 100644
--- a/server/src/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java
@@ -469,8 +469,8 @@ public class NetworkHelperImpl implements NetworkHelper {
     }
 
     @Override
-    public DomainRouterVO deployRouter(final RouterDeploymentDefinition routerDeploymentDefinition, final boolean startRouter) throws InsufficientAddressCapacityException,
-    InsufficientServerCapacityException, InsufficientCapacityException, StorageUnavailableException, ResourceUnavailableException {
+    public DomainRouterVO deployRouter(final RouterDeploymentDefinition routerDeploymentDefinition, final boolean startRouter)
+            throws InsufficientAddressCapacityException, InsufficientServerCapacityException, InsufficientCapacityException, StorageUnavailableException, ResourceUnavailableException {
 
         final ServiceOfferingVO routerOffering = _serviceOfferingDao.findById(routerDeploymentDefinition.getServiceOfferingId());
         final Account owner = routerDeploymentDefinition.getOwner();
@@ -520,7 +520,9 @@ public class NetworkHelperImpl implements NetworkHelper {
                 router.setDynamicallyScalable(template.isDynamicallyScalable());
                 router.setRole(Role.VIRTUAL_ROUTER);
                 router = _routerDao.persist(router);
+
                 final LinkedHashMap<Network, List<? extends NicProfile>> networks = createRouterNetworks(routerDeploymentDefinition);
+
                 _itMgr.allocate(router.getInstanceName(), template, routerOffering, networks, routerDeploymentDefinition.getPlan(), null);
                 router = _routerDao.findById(router.getId());
             } catch (final InsufficientCapacityException ex) {
@@ -632,6 +634,7 @@ public class NetworkHelperImpl implements NetworkHelper {
         throw new CloudRuntimeException(errMsg);
     }
 
+    @Override
     public LinkedHashMap<Network, List<? extends NicProfile>> createRouterNetworks(final RouterDeploymentDefinition routerDeploymentDefinition)
             throws ConcurrentOperationException, InsufficientAddressCapacityException {
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 5da93c4..e74f022 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -127,7 +127,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
     }
 
     @Override
-    public boolean addVpcRouterToGuestNetwork(final VirtualRouter router, final Network network, final boolean isRedundant, final Map<VirtualMachineProfile.Param, Object> params)
+    public boolean addVpcRouterToGuestNetwork(final VirtualRouter router, final Network network, final Map<VirtualMachineProfile.Param, Object> params)
             throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
         if (network.getTrafficType() != TrafficType.Guest) {
             s_logger.warn("Network " + network + " is not of type " + TrafficType.Guest);
@@ -159,7 +159,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
         } finally {
             if (!result) {
                 s_logger.debug("Removing the router " + router + " from network " + network + " as a part of cleanup");
-                if (removeVpcRouterFromGuestNetwork(router, network, isRedundant)) {
+                if (removeVpcRouterFromGuestNetwork(router, network)) {
                     s_logger.debug("Removed the router " + router + " from network " + network + " as a part of cleanup");
                 } else {
                     s_logger.warn("Failed to remove the router " + router + " from network " + network + " as a part of cleanup");
@@ -173,7 +173,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
     }
 
     @Override
-    public boolean removeVpcRouterFromGuestNetwork(final VirtualRouter router, final Network network, final boolean isRedundant) throws ConcurrentOperationException,
+    public boolean removeVpcRouterFromGuestNetwork(final VirtualRouter router, final Network network) throws ConcurrentOperationException,
     ResourceUnavailableException {
         if (network.getTrafficType() != TrafficType.Guest) {
             s_logger.warn("Network " + network + " is not of type " + TrafficType.Guest);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinitionBuilder.java
----------------------------------------------------------------------
diff --git a/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinitionBuilder.java b/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinitionBuilder.java
index 84bbd8b..2ad9483 100644
--- a/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinitionBuilder.java
+++ b/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinitionBuilder.java
@@ -16,6 +16,16 @@
 // under the License.
 package org.cloud.network.router.deployment;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+
 import com.cloud.dc.dao.HostPodDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.deploy.DeployDestination;
@@ -42,14 +52,6 @@ import com.cloud.vm.VirtualMachineProfile.Param;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.VMInstanceDao;
-import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
 
 public class RouterDeploymentDefinitionBuilder {
 
@@ -170,7 +172,7 @@ public class RouterDeploymentDefinitionBuilder {
         }
 
         public IntermediateStateBuilder setGuestNetwork(final Network nw) {
-            this.guestNetwork = nw;
+            guestNetwork = nw;
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
----------------------------------------------------------------------
diff --git a/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java b/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
index 672838a..8452d7f 100644
--- a/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
+++ b/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
@@ -186,7 +186,6 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
             final DomainRouterVO router = nwHelper.deployRouter(this, false);
 
             if (router != null) {
-                // TODO this.routerDao.addRouterToGuestNetwork(router, this.guestNetwork);
                 routers.add(router);
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
index 9fab707..f6bd997 100644
--- a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
+++ b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
@@ -191,7 +191,7 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement
      * @see com.cloud.network.VpcVirtualNetworkApplianceService#addVpcRouterToGuestNetwork(com.cloud.network.router.VirtualRouter, com.cloud.network.Network, boolean)
      */
     @Override
-    public boolean addVpcRouterToGuestNetwork(final VirtualRouter router, final Network network, final boolean isRedundant, final Map<VirtualMachineProfile.Param, Object> params)
+    public boolean addVpcRouterToGuestNetwork(final VirtualRouter router, final Network network, final Map<VirtualMachineProfile.Param, Object> params)
             throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
         // TODO Auto-generated method stub
         return false;
@@ -201,7 +201,7 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement
      * @see com.cloud.network.VpcVirtualNetworkApplianceService#removeVpcRouterFromGuestNetwork(com.cloud.network.router.VirtualRouter, com.cloud.network.Network, boolean)
      */
     @Override
-    public boolean removeVpcRouterFromGuestNetwork(final VirtualRouter router, final Network network, final boolean isRedundant) throws ConcurrentOperationException {
+    public boolean removeVpcRouterFromGuestNetwork(final VirtualRouter router, final Network network) throws ConcurrentOperationException {
         // TODO Auto-generated method stub
         return false;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTest.java b/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTest.java
index 97355a7..23b195b 100644
--- a/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTest.java
+++ b/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTest.java
@@ -81,91 +81,91 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
 
     @Override
     protected void initMocks() {
-        when(this.mockDestination.getDataCenter()).thenReturn(this.mockDataCenter);
-        when(this.mockDataCenter.getId()).thenReturn(DATA_CENTER_ID);
-        when(this.mockPod.getId()).thenReturn(POD_ID1);
-        when(this.mockHostPodVO1.getId()).thenReturn(POD_ID1);
-        when(this.mockHostPodVO2.getId()).thenReturn(POD_ID2);
-        when(this.mockHostPodVO3.getId()).thenReturn(POD_ID3);
-        when(this.mockNw.getId()).thenReturn(NW_ID_1);
+        when(mockDestination.getDataCenter()).thenReturn(mockDataCenter);
+        when(mockDataCenter.getId()).thenReturn(DATA_CENTER_ID);
+        when(mockPod.getId()).thenReturn(POD_ID1);
+        when(mockHostPodVO1.getId()).thenReturn(POD_ID1);
+        when(mockHostPodVO2.getId()).thenReturn(POD_ID2);
+        when(mockHostPodVO3.getId()).thenReturn(POD_ID3);
+        when(mockNw.getId()).thenReturn(NW_ID_1);
     }
 
     @Before
     public void initTest() {
-        this.initMocks();
+        initMocks();
 
-        this.deployment = this.builder.create()
-                .setGuestNetwork(this.mockNw)
-                .setDeployDestination(this.mockDestination)
-                .setAccountOwner(this.mockOwner)
-                .setParams(this.params)
+        deployment = builder.create()
+                .setGuestNetwork(mockNw)
+                .setDeployDestination(mockDestination)
+                .setAccountOwner(mockOwner)
+                .setParams(params)
                 .build();
     }
 
     @Test
     public void testRedundancyProperty() {
         // Set and confirm is redundant
-        when(this.mockNw.isRedundant()).thenReturn(true);
-        RouterDeploymentDefinition deployment = this.builder.create()
-                .setGuestNetwork(this.mockNw)
-                .setDeployDestination(this.mockDestination)
+        when(mockNw.isRedundant()).thenReturn(true);
+        final RouterDeploymentDefinition deployment = builder.create()
+                .setGuestNetwork(mockNw)
+                .setDeployDestination(mockDestination)
                 .build();
         assertTrue("The builder ignored redundancy from its inner network", deployment.isRedundant());
-        when(this.mockNw.isRedundant()).thenReturn(false);
+        when(mockNw.isRedundant()).thenReturn(false);
         assertFalse("The builder ignored redundancy from its inner network", deployment.isRedundant());
     }
 
     @Test
     public void testConstructionFieldsAndFlags() {
         // Vpc type
-        assertFalse(this.deployment.isVpcRouter());
+        assertFalse(deployment.isVpcRouter());
         // Offering null
-        this.deployment.serviceOfferingId = null;
-        assertNull(this.deployment.getServiceOfferingId());
-        this.deployment.serviceOfferingId = OFFERING_ID;
-        assertEquals(OFFERING_ID, this.deployment.getServiceOfferingId().longValue());
-        assertNotNull(this.deployment.getRouters());
-        assertNotNull(this.deployment.getGuestNetwork());
-        assertNotNull(this.deployment.getDest());
-        assertNotNull(this.deployment.getOwner());
-        this.deployment.plan = mock(DeploymentPlan.class);
-        assertNotNull(this.deployment.getPlan());
-        assertFalse(this.deployment.isPublicNetwork());
-        this.deployment.isPublicNetwork = true;
-        assertTrue(this.deployment.isPublicNetwork());
+        deployment.serviceOfferingId = null;
+        assertNull(deployment.getServiceOfferingId());
+        deployment.serviceOfferingId = OFFERING_ID;
+        assertEquals(OFFERING_ID, deployment.getServiceOfferingId().longValue());
+        assertNotNull(deployment.getRouters());
+        assertNotNull(deployment.getGuestNetwork());
+        assertNotNull(deployment.getDest());
+        assertNotNull(deployment.getOwner());
+        deployment.plan = mock(DeploymentPlan.class);
+        assertNotNull(deployment.getPlan());
+        assertFalse(deployment.isPublicNetwork());
+        deployment.isPublicNetwork = true;
+        assertTrue(deployment.isPublicNetwork());
         // This could never be a Vpc deployment
-        assertNull(this.deployment.getVpc());
-        assertEquals(this.params, this.deployment.getParams());
+        assertNull(deployment.getVpc());
+        assertEquals(params, deployment.getParams());
     }
 
     @Test
     public void testLock() {
         // Prepare
-        when(this.mockNwDao.acquireInLockTable(NW_ID_1, NetworkOrchestrationService.NetworkLockTimeout.value()))
+        when(mockNwDao.acquireInLockTable(NW_ID_1, NetworkOrchestrationService.NetworkLockTimeout.value()))
         .thenReturn(mockNw);
 
         // Execute
-        this.deployment.lock();
+        deployment.lock();
 
         // Assert
-        verify(this.mockNwDao, times(1)).acquireInLockTable(NW_ID_1, 600);
-        assertNotNull(LOCK_NOT_CORRECTLY_GOT, this.deployment.tableLockId);
-        assertEquals(LOCK_NOT_CORRECTLY_GOT, NW_ID_1, NW_ID_1, this.deployment.tableLockId.longValue());
+        verify(mockNwDao, times(1)).acquireInLockTable(NW_ID_1, 600);
+        assertNotNull(LOCK_NOT_CORRECTLY_GOT, deployment.tableLockId);
+        assertEquals(LOCK_NOT_CORRECTLY_GOT, NW_ID_1, NW_ID_1, deployment.tableLockId.longValue());
     }
 
     @Test(expected = ConcurrentOperationException.class)
     public void testLockFails() {
         // Prepare
-        when(this.mockNwDao.acquireInLockTable(NW_ID_1, NetworkOrchestrationService.NetworkLockTimeout.value()))
+        when(mockNwDao.acquireInLockTable(NW_ID_1, NetworkOrchestrationService.NetworkLockTimeout.value()))
         .thenReturn(null);
 
         // Execute
         try {
-            this.deployment.lock();
+            deployment.lock();
         } finally {
             // Assert
-            verify(this.mockNwDao, times(1)).acquireInLockTable(NW_ID_1, 600);
-            assertNull(this.deployment.tableLockId);
+            verify(mockNwDao, times(1)).acquireInLockTable(NW_ID_1, 600);
+            assertNull(deployment.tableLockId);
         }
 
     }
@@ -173,25 +173,25 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testUnlock() {
         // Prepare
-        this.deployment.tableLockId = NW_ID_1;
+        deployment.tableLockId = NW_ID_1;
 
         // Execute
-        this.deployment.unlock();
+        deployment.unlock();
 
         // Assert
-        verify(this.mockNwDao, times(1)).releaseFromLockTable(NW_ID_1);
+        verify(mockNwDao, times(1)).releaseFromLockTable(NW_ID_1);
     }
 
     @Test
     public void testUnlockWithoutLock() {
         // Prepare
-        this.deployment.tableLockId = null;
+        deployment.tableLockId = null;
 
         // Execute
-        this.deployment.unlock();
+        deployment.unlock();
 
         // Assert
-        verify(this.mockNwDao, times(0)).releaseFromLockTable(anyLong());
+        verify(mockNwDao, times(0)).releaseFromLockTable(anyLong());
     }
 
     /**
@@ -203,13 +203,13 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
         when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Advanced);
 
         // Execute
-        this.deployment.generateDeploymentPlan();
+        deployment.generateDeploymentPlan();
 
         // Assert
-        assertEquals("", DATA_CENTER_ID, (Long) this.deployment.plan.getDataCenterId());
-        assertEquals("", mockDestination, this.deployment.dest);
-        assertEquals("", null, this.deployment.getPod());
-        assertEquals("", null, this.deployment.getPodId());
+        assertEquals("", DATA_CENTER_ID, (Long) deployment.plan.getDataCenterId());
+        assertEquals("", mockDestination, deployment.dest);
+        assertEquals("", null, deployment.getPod());
+        assertEquals("", null, deployment.getPodId());
     }
 
     /**
@@ -218,17 +218,17 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testGenerateDeploymentPlanBasic() {
         // Prepare
-        when(this.mockDestination.getPod()).thenReturn(this.mockPod);
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
+        when(mockDestination.getPod()).thenReturn(mockPod);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
 
         // Execute
-        this.deployment.generateDeploymentPlan();
+        deployment.generateDeploymentPlan();
 
         // Assert
-        assertEquals("", DATA_CENTER_ID, (Long) this.deployment.plan.getDataCenterId());
-        assertEquals("", mockDestination, this.deployment.dest);
-        assertEquals("", mockPod, this.deployment.getPod());
-        assertEquals("", POD_ID1, this.deployment.getPodId());
+        assertEquals("", DATA_CENTER_ID, (Long) deployment.plan.getDataCenterId());
+        assertEquals("", mockDestination, deployment.dest);
+        assertEquals("", mockPod, deployment.getPod());
+        assertEquals("", POD_ID1, deployment.getPodId());
     }
 
     /**
@@ -238,39 +238,39 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test(expected = CloudRuntimeException.class)
     public void testGenerateDeploymentPlanBasicFailNoPod() {
         // Prepare
-        when(this.mockDestination.getPod()).thenReturn(null);
+        when(mockDestination.getPod()).thenReturn(null);
         when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
 
         // Execute
-        this.deployment.generateDeploymentPlan();
+        deployment.generateDeploymentPlan();
 
         // Assert
-        assertEquals("", DATA_CENTER_ID, (Long) this.deployment.plan.getDataCenterId());
-        assertEquals("", mockDestination, this.deployment.dest);
+        assertEquals("", DATA_CENTER_ID, (Long) deployment.plan.getDataCenterId());
+        assertEquals("", mockDestination, deployment.dest);
     }
 
     @Test
     public void testCheckPreconditions() throws ResourceUnavailableException {
         // Prepare
-        Network.State states[] = {
+        final Network.State states[] = {
                 Network.State.Implemented,
                 Network.State.Setup,
                 Network.State.Implementing
         };
-        when(this.deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Guest);
+        when(deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Guest);
 
         // Drive specific tests
-        for (Network.State state : states) {
-            this.driveTestCheckPreconditionsCorrectNwState(state);
+        for (final Network.State state : states) {
+            driveTestCheckPreconditionsCorrectNwState(state);
         }
     }
 
-    public void driveTestCheckPreconditionsCorrectNwState(Network.State state) throws ResourceUnavailableException {
+    public void driveTestCheckPreconditionsCorrectNwState(final Network.State state) throws ResourceUnavailableException {
         // Prepare
-        when(this.deployment.guestNetwork.getState()).thenReturn(state);
+        when(deployment.guestNetwork.getState()).thenReturn(state);
 
         // Execute
-        this.deployment.checkPreconditions();
+        deployment.checkPreconditions();
 
         // Assert : It just should raise no exceptions
     }
@@ -278,127 +278,127 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test(expected = ResourceUnavailableException.class)
     public void testCheckPreconditionsWrongTrafficType() throws ResourceUnavailableException {
         // Prepare wrong traffic type to trigger error
-        when(this.deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Public);
+        when(deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Public);
 
         // Execute
-        this.driveTestCheckPreconditionsCorrectNwState(Network.State.Implemented);
+        driveTestCheckPreconditionsCorrectNwState(Network.State.Implemented);
     }
 
     @Test(expected = ResourceUnavailableException.class)
     public void testCheckPreconditionsWrongState() throws ResourceUnavailableException {
         // Prepare wrong traffic type to trigger error
-        when(this.deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Guest);
+        when(deployment.guestNetwork.getTrafficType()).thenReturn(TrafficType.Guest);
 
         // Execute
-        this.driveTestCheckPreconditionsCorrectNwState(Network.State.Shutdown);
+        driveTestCheckPreconditionsCorrectNwState(Network.State.Shutdown);
     }
 
     @Test
     public void testFindDestinationsNonBasicZone() {
         // Prepare
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Advanced);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Advanced);
 
         // Execute
-        List<DeployDestination> destinations = this.deployment.findDestinations();
+        final List<DeployDestination> destinations = deployment.findDestinations();
 
         // Assert
         assertEquals(ONLY_THE_PROVIDED_AS_DEFAULT_DESTINATION_WAS_EXPECTED,
                 1, destinations.size());
         assertEquals(ONLY_THE_PROVIDED_AS_DEFAULT_DESTINATION_WAS_EXPECTED,
-                this.mockDestination, destinations.get(0));
+                mockDestination, destinations.get(0));
     }
 
     @Test
     public void testFindDestinationsPredefinedPod() {
         // Prepare
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
-        when(this.mockDestination.getPod()).thenReturn(this.mockPod);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
+        when(mockDestination.getPod()).thenReturn(mockPod);
 
         // Execute
-        List<DeployDestination> destinations = this.deployment.findDestinations();
+        final List<DeployDestination> destinations = deployment.findDestinations();
 
         // Assert
         assertEquals(ONLY_THE_PROVIDED_AS_DEFAULT_DESTINATION_WAS_EXPECTED,
                 1, destinations.size());
         assertEquals(ONLY_THE_PROVIDED_AS_DEFAULT_DESTINATION_WAS_EXPECTED,
-                this.mockDestination, destinations.get(0));
+                mockDestination, destinations.get(0));
     }
 
     @Test
     public void testFindDestinations() {
         // Prepare
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
-        when(this.mockDestination.getPod()).thenReturn(null);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
+        when(mockDestination.getPod()).thenReturn(null);
 
         // Stub local method listByDataCenterIdVMTypeAndStates
-        this.mockPods.add(this.mockHostPodVO1);
-        this.mockPods.add(this.mockHostPodVO2);
-        this.mockPods.add(this.mockHostPodVO3);
-        RouterDeploymentDefinition deployment = spy(this.deployment);
+        mockPods.add(mockHostPodVO1);
+        mockPods.add(mockHostPodVO2);
+        mockPods.add(mockHostPodVO3);
+        final RouterDeploymentDefinition deployment = spy(this.deployment);
         doReturn(mockPods).when(deployment).listByDataCenterIdVMTypeAndStates(
                 DATA_CENTER_ID, VirtualMachine.Type.User,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running);
 
         // Leave this one empty to force adding add destination for this pod
-        List<DomainRouterVO> virtualRouters1 = new ArrayList<>();
-        when(this.mockRouterDao.listByPodIdAndStates(POD_ID1,
+        final List<DomainRouterVO> virtualRouters1 = new ArrayList<>();
+        when(mockRouterDao.listByPodIdAndStates(POD_ID1,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running)).thenReturn(virtualRouters1);
 
         // This list is not empty, so it will not add any for this pod, and continue with next pod
-        List<DomainRouterVO> virtualRouters2 = new ArrayList<>();
-        DomainRouterVO domainRouterVO1 = mock(DomainRouterVO.class);
+        final List<DomainRouterVO> virtualRouters2 = new ArrayList<>();
+        final DomainRouterVO domainRouterVO1 = mock(DomainRouterVO.class);
         virtualRouters2.add(domainRouterVO1);
-        when(this.mockRouterDao.listByPodIdAndStates(POD_ID2,
+        when(mockRouterDao.listByPodIdAndStates(POD_ID2,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running)).thenReturn(virtualRouters2);
 
         // Leave this last one empty to check we finally added more than one afterwards
-        List<DomainRouterVO> virtualRouters3 = new ArrayList<>();
-        when(this.mockRouterDao.listByPodIdAndStates(POD_ID3,
+        final List<DomainRouterVO> virtualRouters3 = new ArrayList<>();
+        when(mockRouterDao.listByPodIdAndStates(POD_ID3,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running)).thenReturn(virtualRouters3);
 
         // Execute
-        List<DeployDestination> destinations = deployment.findDestinations();
+        final List<DeployDestination> destinations = deployment.findDestinations();
 
         // Assert that 2 were added (for the 1st and 3rd
         assertEquals("",
                 2, destinations.size());
         assertEquals("",
-                this.mockDataCenter, destinations.get(0).getDataCenter());
+                mockDataCenter, destinations.get(0).getDataCenter());
         assertEquals("",
-                this.mockHostPodVO1, destinations.get(0).getPod());
+                mockHostPodVO1, destinations.get(0).getPod());
         assertEquals("",
-                this.mockDataCenter, destinations.get(1).getDataCenter());
+                mockDataCenter, destinations.get(1).getDataCenter());
         assertEquals("",
-                this.mockHostPodVO3, destinations.get(1).getPod());
+                mockHostPodVO3, destinations.get(1).getPod());
     }
 
     @Test(expected = CloudRuntimeException.class)
     public void testFindDestinationsMoreThan1PodPerBasicZone() {
         // Prepare
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
-        when(this.mockDestination.getPod()).thenReturn(null);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
+        when(mockDestination.getPod()).thenReturn(null);
 
         // Stub local method listByDataCenterIdVMTypeAndStates
-        this.mockPods.add(this.mockHostPodVO1);
-        this.mockPods.add(this.mockHostPodVO2);
+        mockPods.add(mockHostPodVO1);
+        mockPods.add(mockHostPodVO2);
         // Deployment under test is a Mockito spy
-        RouterDeploymentDefinition deploymentUT = spy(this.deployment);
+        final RouterDeploymentDefinition deploymentUT = spy(deployment);
         doReturn(mockPods).when(deploymentUT).listByDataCenterIdVMTypeAndStates(
                 DATA_CENTER_ID, VirtualMachine.Type.User,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running);
 
         // Leave this one empty to force adding add destination for this pod
-        List<DomainRouterVO> virtualRouters1 = new ArrayList<>();
-        when(this.mockRouterDao.listByPodIdAndStates(POD_ID1,
+        final List<DomainRouterVO> virtualRouters1 = new ArrayList<>();
+        when(mockRouterDao.listByPodIdAndStates(POD_ID1,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running)).thenReturn(virtualRouters1);
 
         // This list is not empty, so it will not add any for this pod, and continue with next pod
-        List<DomainRouterVO> virtualRouters2 = new ArrayList<>();
-        DomainRouterVO domainRouterVO1 = mock(DomainRouterVO.class);
-        DomainRouterVO domainRouterVO2 = mock(DomainRouterVO.class);
+        final List<DomainRouterVO> virtualRouters2 = new ArrayList<>();
+        final DomainRouterVO domainRouterVO1 = mock(DomainRouterVO.class);
+        final DomainRouterVO domainRouterVO2 = mock(DomainRouterVO.class);
         virtualRouters2.add(domainRouterVO1);
         virtualRouters2.add(domainRouterVO2);
-        when(this.mockRouterDao.listByPodIdAndStates(POD_ID2,
+        when(mockRouterDao.listByPodIdAndStates(POD_ID2,
                 VirtualMachine.State.Starting, VirtualMachine.State.Running)).thenReturn(virtualRouters2);
 
         // Execute
@@ -410,14 +410,14 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testPlanDeploymentRoutersBasic() {
         // Prepare
-        when(this.mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
-        when(this.mockDestination.getPod()).thenReturn(this.mockPod);
+        when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Basic);
+        when(mockDestination.getPod()).thenReturn(mockPod);
 
         // Execute
-        this.deployment.planDeploymentRouters();
+        deployment.planDeploymentRouters();
 
         // Assert
-        verify(this.mockRouterDao, times(1)).listByNetworkAndPodAndRole(this.mockNw.getId(),
+        verify(mockRouterDao, times(1)).listByNetworkAndPodAndRole(mockNw.getId(),
                 POD_ID1, Role.VIRTUAL_ROUTER);
     }
 
@@ -425,41 +425,41 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     public void testPlanDeploymentRoutersNonBasic() {
         // Prepare
         when(mockDataCenter.getNetworkType()).thenReturn(NetworkType.Advanced);
-        when(this.mockDestination.getPod()).thenReturn(this.mockPod);
+        when(mockDestination.getPod()).thenReturn(mockPod);
 
         // Execute
-        this.deployment.planDeploymentRouters();
+        deployment.planDeploymentRouters();
 
         // Assert
-        verify(this.mockRouterDao, times(1)).listByNetworkAndRole(
-                this.mockNw.getId(), Role.VIRTUAL_ROUTER);
+        verify(mockRouterDao, times(1)).listByNetworkAndRole(
+                mockNw.getId(), Role.VIRTUAL_ROUTER);
     }
 
     @Test
     public void testListByDataCenterIdVMTypeAndStates() {
         // Prepare
-        VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
+        final VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
         final SearchBuilder<VMInstanceVO> vmInstanceSearch = mock(SearchBuilder.class);
-        when(this.mockVmDao.createSearchBuilder()).thenReturn(vmInstanceSearch);
+        when(mockVmDao.createSearchBuilder()).thenReturn(vmInstanceSearch);
         when(vmInstanceSearch.entity()).thenReturn(vmInstanceVO);
         when(vmInstanceVO.getType()).thenReturn(VirtualMachine.Type.Instance);
         when(vmInstanceVO.getState()).thenReturn(VirtualMachine.State.Stopped);
         when(vmInstanceVO.getPodIdToDeployIn()).thenReturn(POD_ID1);
 
         final SearchBuilder<HostPodVO> podIdSearch = mock(SearchBuilder.class);
-        when(this.mockPodDao.createSearchBuilder()).thenReturn(podIdSearch);
+        when(mockPodDao.createSearchBuilder()).thenReturn(podIdSearch);
         final SearchCriteria<HostPodVO> sc = mock(SearchCriteria.class);
-        HostPodVO hostPodVO = mock(HostPodVO.class);
+        final HostPodVO hostPodVO = mock(HostPodVO.class);
         when(podIdSearch.entity()).thenReturn(hostPodVO);
         when(hostPodVO.getId()).thenReturn(POD_ID1);
         when(hostPodVO.getDataCenterId()).thenReturn(DATA_CENTER_ID);
         when(podIdSearch.create()).thenReturn(sc);
 
         final List<HostPodVO> expectedPods = mock(List.class);
-        when(this.mockPodDao.search(sc, null)).thenReturn(expectedPods);
+        when(mockPodDao.search(sc, null)).thenReturn(expectedPods);
 
         // Execute
-        final List<HostPodVO> pods = this.deployment.listByDataCenterIdVMTypeAndStates(DATA_CENTER_ID,
+        final List<HostPodVO> pods = deployment.listByDataCenterIdVMTypeAndStates(DATA_CENTER_ID,
                 VirtualMachine.Type.User,
                 VirtualMachine.State.Starting,
                 VirtualMachine.State.Running);
@@ -471,40 +471,40 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
         verify(sc, times(1)).setJoinParameters("vmInstanceSearch", "type", VirtualMachine.Type.User);
         verify(sc, times(1)).setJoinParameters("vmInstanceSearch", "states",
                 VirtualMachine.State.Starting, VirtualMachine.State.Running);
-        verify(this.mockPodDao, times(1)).search(sc, null);
+        verify(mockPodDao, times(1)).search(sc, null);
     }
 
     @Test
     public void testFindOrDeployVirtualRouter() throws ConcurrentOperationException,
     InsufficientCapacityException, ResourceUnavailableException {
         // Prepare
-        RouterDeploymentDefinition deploymentUT = spy(this.deployment);
+        final RouterDeploymentDefinition deploymentUT = spy(deployment);
         doNothing().when(deploymentUT).findOrDeployVirtualRouter();
 
         // Execute
         deploymentUT.deployVirtualRouter();
 
         // Assert
-        verify(this.mockNetworkHelper, times(1)).startRouters(deploymentUT);
+        verify(mockNetworkHelper, times(1)).startRouters(deploymentUT);
     }
 
     @Test(expected = ConcurrentOperationException.class)
     public void testDeployVirtualRouter() throws ConcurrentOperationException,
-            InsufficientCapacityException, ResourceUnavailableException {
+    InsufficientCapacityException, ResourceUnavailableException {
 
         // Prepare
-        List<DeployDestination> mockDestinations = new ArrayList<>();
+        final List<DeployDestination> mockDestinations = new ArrayList<>();
         mockDestinations.add(mock(DeployDestination.class));
         mockDestinations.add(mock(DeployDestination.class));
 
-        RouterDeploymentDefinition deploymentUT = spy(this.deployment);
+        final RouterDeploymentDefinition deploymentUT = spy(deployment);
         doNothing().when(deploymentUT).lock();
         doNothing().when(deploymentUT).checkPreconditions();
         doReturn(mockDestinations).when(deploymentUT).findDestinations();
         doNothing().when(deploymentUT).planDeploymentRouters();
         doNothing().when(deploymentUT).generateDeploymentPlan();
         // Let's test that if the last step fails in the last iteration it unlocks the table
-        ConcurrentOperationException exception =
+        final ConcurrentOperationException exception =
                 new ConcurrentOperationException(null);
         doNothing().doThrow(exception).when(deploymentUT).executeDeployment();
         doNothing().when(deploymentUT).unlock();
@@ -532,25 +532,25 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testSetupPriorityOfRedundantRouterWithNonRedundantRouters() {
         // Prepare
-        this.deployment.routers = new ArrayList<>();
+        deployment.routers = new ArrayList<>();
         final DomainRouterVO routerVO1 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO1);
+        deployment.routers.add(routerVO1);
         when(routerVO1.getIsRedundantRouter()).thenReturn(true);
         when(routerVO1.getState()).thenReturn(VirtualMachine.State.Stopped);
         final DomainRouterVO routerVO2 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO2);
+        deployment.routers.add(routerVO2);
         when(routerVO2.getIsRedundantRouter()).thenReturn(false);
         when(routerVO2.getState()).thenReturn(VirtualMachine.State.Stopped);
         // If this deployment is not redundant nothing will be executed
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        when(mockNw.isRedundant()).thenReturn(true);
 
         // Execute
-        this.deployment.setupPriorityOfRedundantRouter();
+        deployment.setupPriorityOfRedundantRouter();
 
         // Assert
         verify(routerVO1, times(0)).setPriority(anyInt());
         verify(routerVO1, times(0)).setIsPriorityBumpUp(anyBoolean());
-        verify(this.mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
+        verify(mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
     }
 
     /**
@@ -559,25 +559,25 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testSetupPriorityOfRedundantRouterWithRunningRouters() {
         // Prepare
-        this.deployment.routers = new ArrayList<>();
+        deployment.routers = new ArrayList<>();
         final DomainRouterVO routerVO1 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO1);
+        deployment.routers.add(routerVO1);
         when(routerVO1.getIsRedundantRouter()).thenReturn(true);
         when(routerVO1.getState()).thenReturn(VirtualMachine.State.Stopped);
         final DomainRouterVO routerVO2 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO2);
+        deployment.routers.add(routerVO2);
         when(routerVO2.getIsRedundantRouter()).thenReturn(true);
         when(routerVO2.getState()).thenReturn(VirtualMachine.State.Running);
         // If this deployment is not redundant nothing will be executed
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        when(mockNw.isRedundant()).thenReturn(true);
 
         // Execute
-        this.deployment.setupPriorityOfRedundantRouter();
+        deployment.setupPriorityOfRedundantRouter();
 
         // Assert
         verify(routerVO1, times(0)).setPriority(anyInt());
         verify(routerVO1, times(0)).setIsPriorityBumpUp(anyBoolean());
-        verify(this.mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
+        verify(mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
     }
 
     /**
@@ -586,30 +586,30 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testSetupPriorityOfRedundantRouter() {
         // Prepare
-        this.deployment.routers = new ArrayList<>();
+        deployment.routers = new ArrayList<>();
         final DomainRouterVO routerVO1 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO1);
+        deployment.routers.add(routerVO1);
         when(routerVO1.getId()).thenReturn(ROUTER1_ID);
         when(routerVO1.getIsRedundantRouter()).thenReturn(true);
         when(routerVO1.getState()).thenReturn(VirtualMachine.State.Stopped);
         final DomainRouterVO routerVO2 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO2);
+        deployment.routers.add(routerVO2);
         when(routerVO2.getId()).thenReturn(ROUTER2_ID);
         when(routerVO2.getIsRedundantRouter()).thenReturn(true);
         when(routerVO2.getState()).thenReturn(VirtualMachine.State.Stopped);
         // If this deployment is not redundant nothing will be executed
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        when(mockNw.isRedundant()).thenReturn(true);
 
         // Execute
-        this.deployment.setupPriorityOfRedundantRouter();
+        deployment.setupPriorityOfRedundantRouter();
 
         // Assert
         verify(routerVO1, times(1)).setPriority(0);
         verify(routerVO1, times(1)).setIsPriorityBumpUp(false);
-        verify(this.mockRouterDao, times(1)).update(ROUTER1_ID, routerVO1);
+        verify(mockRouterDao, times(1)).update(ROUTER1_ID, routerVO1);
         verify(routerVO2, times(1)).setPriority(0);
         verify(routerVO2, times(1)).setIsPriorityBumpUp(false);
-        verify(this.mockRouterDao, times(1)).update(ROUTER2_ID, routerVO2);
+        verify(mockRouterDao, times(1)).update(ROUTER2_ID, routerVO2);
     }
 
     /**
@@ -618,166 +618,166 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testSetupPriorityOfRedundantRouterWithNonRedundantDeployment() {
         // Prepare
-        this.deployment.routers = new ArrayList<>();
+        deployment.routers = new ArrayList<>();
         final DomainRouterVO routerVO1 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO1);
+        deployment.routers.add(routerVO1);
         when(routerVO1.getIsRedundantRouter()).thenReturn(true);
         when(routerVO1.getState()).thenReturn(VirtualMachine.State.Stopped);
         final DomainRouterVO routerVO2 = mock(DomainRouterVO.class);
-        this.deployment.routers.add(routerVO2);
+        deployment.routers.add(routerVO2);
         when(routerVO2.getIsRedundantRouter()).thenReturn(true);
         when(routerVO2.getState()).thenReturn(VirtualMachine.State.Stopped);
 
         // Execute
-        this.deployment.setupPriorityOfRedundantRouter();
+        deployment.setupPriorityOfRedundantRouter();
 
         // Assert
         verify(routerVO1, times(0)).setPriority(anyInt());
         verify(routerVO1, times(0)).setIsPriorityBumpUp(anyBoolean());
-        verify(this.mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
+        verify(mockRouterDao, times(0)).update(anyLong(), (DomainRouterVO) anyObject());
     }
 
     @Test
     public void testGetNumberOfRoutersToDeploy() {
         // Prepare
-        this.deployment.routers = new ArrayList<>(); // Empty list
+        deployment.routers = new ArrayList<>(); // Empty list
 
         // Execute and assert
         assertEquals(NUMBER_OF_ROUTERS_TO_DEPLOY_IS_NOT_THE_EXPECTED,
-                1, this.deployment.getNumberOfRoutersToDeploy());
+                1, deployment.getNumberOfRoutersToDeploy());
 
         // Execute and assert, just the same but for redundant deployment
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        when(mockNw.isRedundant()).thenReturn(true);
         assertEquals(NUMBER_OF_ROUTERS_TO_DEPLOY_IS_NOT_THE_EXPECTED,
-                2, this.deployment.getNumberOfRoutersToDeploy());
+                2, deployment.getNumberOfRoutersToDeploy());
 
         // Just the same, instead of an empty list, a 1 items list
-        this.deployment.routers.add(mock(DomainRouterVO.class));
-        when(this.mockNw.isRedundant()).thenReturn(false);
+        deployment.routers.add(mock(DomainRouterVO.class));
+        when(mockNw.isRedundant()).thenReturn(false);
         assertEquals(NUMBER_OF_ROUTERS_TO_DEPLOY_IS_NOT_THE_EXPECTED,
-                0, this.deployment.getNumberOfRoutersToDeploy());
+                0, deployment.getNumberOfRoutersToDeploy());
 
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        when(mockNw.isRedundant()).thenReturn(true);
         assertEquals(NUMBER_OF_ROUTERS_TO_DEPLOY_IS_NOT_THE_EXPECTED,
-                1, this.deployment.getNumberOfRoutersToDeploy());
+                1, deployment.getNumberOfRoutersToDeploy());
     }
 
     @Test
     public void testFindVirtualProvider() {
         // Prepare
-        when(this.mockNetworkModel.getPhysicalNetworkId(this.deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
-        Type type = Type.VirtualRouter;
-        PhysicalNetworkServiceProviderVO physicalNwSrvProvider = mock(PhysicalNetworkServiceProviderVO.class);
-        when(this.physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
-            .thenReturn(physicalNwSrvProvider);
+        when(mockNetworkModel.getPhysicalNetworkId(deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
+        final Type type = Type.VirtualRouter;
+        final PhysicalNetworkServiceProviderVO physicalNwSrvProvider = mock(PhysicalNetworkServiceProviderVO.class);
+        when(physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
+        .thenReturn(physicalNwSrvProvider);
         when(physicalNwSrvProvider.getId()).thenReturn(PROVIDER_ID);
 
-        VirtualRouterProviderVO vrProvider = mock(VirtualRouterProviderVO.class);
-        when(this.mockVrProviderDao.findByNspIdAndType(PROVIDER_ID, type))
-            .thenReturn(vrProvider);
+        final VirtualRouterProviderVO vrProvider = mock(VirtualRouterProviderVO.class);
+        when(mockVrProviderDao.findByNspIdAndType(PROVIDER_ID, type))
+        .thenReturn(vrProvider);
 
         // Execute
-        this.deployment.findVirtualProvider();
+        deployment.findVirtualProvider();
 
         // Assert
         assertEquals("Didn't find and set the VirtualRouterProvider as expected",
-                vrProvider, this.deployment.getVirtualProvider());
+                vrProvider, deployment.getVirtualProvider());
     }
 
     @Test(expected = CloudRuntimeException.class)
     public void testFindVirtualProviderWithNullPhyNwSrvProvider() {
         // Prepare
-        when(this.mockNetworkModel.getPhysicalNetworkId(this.deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
-        Type type = Type.VirtualRouter;
-        when(this.physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
-            .thenReturn(null);
+        when(mockNetworkModel.getPhysicalNetworkId(deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
+        final Type type = Type.VirtualRouter;
+        when(physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
+        .thenReturn(null);
 
         // Execute
-        this.deployment.findVirtualProvider();
+        deployment.findVirtualProvider();
     }
 
     @Test(expected = CloudRuntimeException.class)
     public void testFindVirtualProviderWithNullVrProvider() {
         // Prepare
-        when(this.mockNetworkModel.getPhysicalNetworkId(this.deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
-        Type type = Type.VirtualRouter;
-        PhysicalNetworkServiceProviderVO physicalNwSrvProvider = mock(PhysicalNetworkServiceProviderVO.class);
-        when(this.physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
-            .thenReturn(physicalNwSrvProvider);
+        when(mockNetworkModel.getPhysicalNetworkId(deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID);
+        final Type type = Type.VirtualRouter;
+        final PhysicalNetworkServiceProviderVO physicalNwSrvProvider = mock(PhysicalNetworkServiceProviderVO.class);
+        when(physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString()))
+        .thenReturn(physicalNwSrvProvider);
         when(physicalNwSrvProvider.getId()).thenReturn(PROVIDER_ID);
 
-        when(this.mockVrProviderDao.findByNspIdAndType(PROVIDER_ID, type))
-            .thenReturn(null);
+        when(mockVrProviderDao.findByNspIdAndType(PROVIDER_ID, type))
+        .thenReturn(null);
 
         // Execute
-        this.deployment.findVirtualProvider();
+        deployment.findVirtualProvider();
     }
 
     @Test
     public void testFindSourceNatIPPublicNw() throws InsufficientAddressCapacityException, ConcurrentOperationException {
         // Prepare
-        PublicIp sourceNatIp = mock(PublicIp.class);
-        when(this.mockIpAddrMgr.assignSourceNatIpAddressToGuestNetwork(
-                this.mockOwner, this.mockNw)).thenReturn(sourceNatIp);
-        this.deployment.isPublicNetwork = true;
+        final PublicIp sourceNatIp = mock(PublicIp.class);
+        when(mockIpAddrMgr.assignSourceNatIpAddressToGuestNetwork(
+                mockOwner, mockNw)).thenReturn(sourceNatIp);
+        deployment.isPublicNetwork = true;
 
         // It should be null until this method finds it
-        assertNull(this.deployment.sourceNatIp);
+        assertNull(deployment.sourceNatIp);
         // Execute
-        this.deployment.findSourceNatIP();
+        deployment.findSourceNatIP();
 
         // Assert
-        assertEquals("SourceNatIP was not correctly found and set", sourceNatIp, this.deployment.sourceNatIp);
+        assertEquals("SourceNatIP was not correctly found and set", sourceNatIp, deployment.sourceNatIp);
     }
 
     @Test
     public void testFindSourceNatIPNonPublicNw() throws InsufficientAddressCapacityException, ConcurrentOperationException {
         // Prepare
-        PublicIp sourceNatIp = mock(PublicIp.class);
-        when(this.mockIpAddrMgr.assignSourceNatIpAddressToGuestNetwork(
-                this.mockOwner, this.mockNw)).thenReturn(sourceNatIp);
-        this.deployment.isPublicNetwork = false;
+        final PublicIp sourceNatIp = mock(PublicIp.class);
+        when(mockIpAddrMgr.assignSourceNatIpAddressToGuestNetwork(
+                mockOwner, mockNw)).thenReturn(sourceNatIp);
+        deployment.isPublicNetwork = false;
 
         // It should be null until this method finds it
-        assertNull(this.deployment.sourceNatIp);
+        assertNull(deployment.sourceNatIp);
         // Execute
-        this.deployment.findSourceNatIP();
+        deployment.findSourceNatIP();
 
         // Assert
         assertEquals("SourceNatIP should remain null given a non public network",
-                null, this.deployment.sourceNatIp);
+                null, deployment.sourceNatIp);
     }
 
     @Test
     public void testFindOfferingIdReceivingNewOne() {
         // Prepare
-        this.deployment.serviceOfferingId = 1L;
-        when(this.mockNw.getNetworkOfferingId()).thenReturn(OFFERING_ID);
-        when(this.mockNetworkOfferingDao.findById(OFFERING_ID)).thenReturn(this.mockNwOfferingVO);
-        when(this.mockNwOfferingVO.getServiceOfferingId()).thenReturn(OFFERING_ID);
+        deployment.serviceOfferingId = 1L;
+        when(mockNw.getNetworkOfferingId()).thenReturn(OFFERING_ID);
+        when(mockNetworkOfferingDao.findById(OFFERING_ID)).thenReturn(mockNwOfferingVO);
+        when(mockNwOfferingVO.getServiceOfferingId()).thenReturn(OFFERING_ID);
 
         // Execute
-        this.deployment.findServiceOfferingId();
+        deployment.findServiceOfferingId();
 
         // Assert
         assertEquals("Given that no Offering was found, the previous Offering Id should be kept",
-                OFFERING_ID, this.deployment.serviceOfferingId.longValue());
+                OFFERING_ID, deployment.serviceOfferingId.longValue());
     }
 
     @Test
     public void testFindOfferingIdReceivingKeepingPrevious() {
         // Prepare
-        this.deployment.serviceOfferingId = 1L;
-        when(this.mockNw.getNetworkOfferingId()).thenReturn(OFFERING_ID);
-        when(this.mockNetworkOfferingDao.findById(OFFERING_ID)).thenReturn(this.mockNwOfferingVO);
-        when(this.mockNwOfferingVO.getServiceOfferingId()).thenReturn(null);
+        deployment.serviceOfferingId = 1L;
+        when(mockNw.getNetworkOfferingId()).thenReturn(OFFERING_ID);
+        when(mockNetworkOfferingDao.findById(OFFERING_ID)).thenReturn(mockNwOfferingVO);
+        when(mockNwOfferingVO.getServiceOfferingId()).thenReturn(null);
 
         // Execute
-        this.deployment.findServiceOfferingId();
+        deployment.findServiceOfferingId();
 
         // Assert
         assertEquals("Found Offering Id didn't replace previous one",
-                1L, this.deployment.serviceOfferingId.longValue());
+                1L, deployment.serviceOfferingId.longValue());
     }
 
     @Test
@@ -785,64 +785,64 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
 
         // Prepare
-        this.deployment.routers = new ArrayList<>();
-        when(this.mockNw.isRedundant()).thenReturn(true);
+        deployment.routers = new ArrayList<>();
+        when(mockNw.isRedundant()).thenReturn(true);
         //this.deployment.routers.add(routerVO1);
-        RouterDeploymentDefinition deploymentUT = spy(this.deployment);
+        final RouterDeploymentDefinition deploymentUT = spy(deployment);
         doReturn(2).when(deploymentUT).getNumberOfRoutersToDeploy();
 
         final DomainRouterVO routerVO1 = mock(DomainRouterVO.class);
         final DomainRouterVO routerVO2 = mock(DomainRouterVO.class);
-        when(this.mockNetworkHelper.deployRouter(deploymentUT, false))
-            .thenReturn(routerVO1).thenReturn(routerVO2);
+        when(mockNetworkHelper.deployRouter(deploymentUT, false))
+        .thenReturn(routerVO1).thenReturn(routerVO2);
 
         // Execute
         deploymentUT.deployAllVirtualRouters();
 
         // Assert
-        verify(this.mockRouterDao, times(1)).addRouterToGuestNetwork(routerVO1, this.mockNw);
-        verify(this.mockRouterDao, times(1)).addRouterToGuestNetwork(routerVO2, this.mockNw);
+        verify(mockRouterDao, times(1)).addRouterToGuestNetwork(routerVO1, mockNw);
+        verify(mockRouterDao, times(1)).addRouterToGuestNetwork(routerVO2, mockNw);
         assertEquals("First router to deploy was not added to list of available routers",
-                routerVO1, this.deployment.routers.get(0));
+                routerVO1, deployment.routers.get(0));
         assertEquals("Second router to deploy was not added to list of available routers",
-                routerVO2, this.deployment.routers.get(1));
+                routerVO2, deployment.routers.get(1));
     }
 
     @Test
     public void testSetupAccountOwner() {
         // Prepare
-        when(this.mockNetworkModel.isNetworkSystem(this.mockNw)).thenReturn(true);
-        Account newAccountOwner = mock(Account.class);
-        when(this.mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(newAccountOwner);
+        when(mockNetworkModel.isNetworkSystem(mockNw)).thenReturn(true);
+        final Account newAccountOwner = mock(Account.class);
+        when(mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(newAccountOwner);
         //Execute
-        this.deployment.setupAccountOwner();
+        deployment.setupAccountOwner();
         // Assert
-        assertEquals("New account owner not properly set", newAccountOwner, this.deployment.owner);
+        assertEquals("New account owner not properly set", newAccountOwner, deployment.owner);
     }
 
     @Test
     public void testSetupAccountOwnerNotNetworkSystem() {
         // Prepare
-        when(this.mockNetworkModel.isNetworkSystem(this.mockNw)).thenReturn(false);
-        when(this.mockNw.getGuestType()).thenReturn(Network.GuestType.Shared);
-        Account newAccountOwner = mock(Account.class);
-        when(this.mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(newAccountOwner);
+        when(mockNetworkModel.isNetworkSystem(mockNw)).thenReturn(false);
+        when(mockNw.getGuestType()).thenReturn(Network.GuestType.Shared);
+        final Account newAccountOwner = mock(Account.class);
+        when(mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(newAccountOwner);
         //Execute
-        this.deployment.setupAccountOwner();
+        deployment.setupAccountOwner();
         // Assert
-        assertEquals("New account owner not properly set", newAccountOwner, this.deployment.owner);
+        assertEquals("New account owner not properly set", newAccountOwner, deployment.owner);
     }
 
     @Test
     public void testSetupAccountOwnerNotSharedNeitherNetworkSystem() {
         // Prepare
-        when(this.mockNetworkModel.isNetworkSystem(this.mockNw)).thenReturn(false);
-        when(this.mockNw.getGuestType()).thenReturn(Network.GuestType.Isolated);
-        when(this.mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(null);
+        when(mockNetworkModel.isNetworkSystem(mockNw)).thenReturn(false);
+        when(mockNw.getGuestType()).thenReturn(Network.GuestType.Isolated);
+        when(mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(null);
         //Execute
-        this.deployment.setupAccountOwner();
+        deployment.setupAccountOwner();
         // Assert
-        assertEquals("New account shouldn't have been updated", this.mockOwner, this.deployment.owner);
+        assertEquals("New account shouldn't have been updated", mockOwner, deployment.owner);
     }
 
 
@@ -850,11 +850,11 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
 
     protected void driveTestPrepareDeployment(final boolean isRedundant, final boolean isPublicNw) {
         // Prepare
-        when(this.mockNw.isRedundant()).thenReturn(isRedundant);
-        when(this.mockNetworkModel.isProviderSupportServiceInNetwork(
+        when(mockNw.isRedundant()).thenReturn(isRedundant);
+        when(mockNetworkModel.isProviderSupportServiceInNetwork(
                 NW_ID_1, Service.SourceNat, Provider.VirtualRouter)).thenReturn(isPublicNw);
         // Execute
-        final boolean canProceedDeployment = this.deployment.prepareDeployment();
+        final boolean canProceedDeployment = deployment.prepareDeployment();
         // Assert
         boolean shouldProceedDeployment = true;
         if (isRedundant && !isPublicNw) {
@@ -863,29 +863,29 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
         assertEquals(shouldProceedDeployment, canProceedDeployment);
         if (!shouldProceedDeployment) {
             assertEquals("Since deployment cannot proceed we should empty the list of routers",
-                    0, this.deployment.routers.size());
+                    0, deployment.routers.size());
         }
     }
 
     @Test
     public void testPrepareDeploymentPublicNw() {
-        this.driveTestPrepareDeployment(true, true);
+        driveTestPrepareDeployment(true, true);
     }
 
     @Test
     public void testPrepareDeploymentNonRedundant() {
-        this.driveTestPrepareDeployment(false, true);
+        driveTestPrepareDeployment(false, true);
     }
 
     @Test
     public void testPrepareDeploymentRedundantNonPublicNw() {
-        this.driveTestPrepareDeployment(true, false);
+        driveTestPrepareDeployment(true, false);
     }
 
-    protected void driveTestExecuteDeployment(final int noOfRoutersToDeploy, boolean passPreparation)
+    protected void driveTestExecuteDeployment(final int noOfRoutersToDeploy, final boolean passPreparation)
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
         // Prepare
-        RouterDeploymentDefinition deploymentUT = spy(this.deployment);
+        final RouterDeploymentDefinition deploymentUT = spy(deployment);
         doNothing().when(deploymentUT).setupPriorityOfRedundantRouter();
         doReturn(noOfRoutersToDeploy).when(deploymentUT).getNumberOfRoutersToDeploy();
         doReturn(passPreparation).when(deploymentUT).prepareDeployment();
@@ -916,18 +916,18 @@ public class RouterDeploymentDefinitionTest extends RouterDeploymentDefinitionTe
     @Test
     public void testExecuteDeploymentNoRoutersToDeploy()
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
-        this.driveTestExecuteDeployment(0, true);
+        driveTestExecuteDeployment(0, true);
     }
 
     @Test
     public void testExecuteDeploymentFailPreparation()
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
-        this.driveTestExecuteDeployment(2, false);
+        driveTestExecuteDeployment(2, false);
     }
 
     @Test
     public void testExecuteDeployment()
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
-        this.driveTestExecuteDeployment(2, true);
+        driveTestExecuteDeployment(2, true);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTestBase.java
----------------------------------------------------------------------
diff --git a/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTestBase.java b/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTestBase.java
index 678a30c..0978ac9 100644
--- a/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTestBase.java
+++ b/server/test/org/cloud/network/router/deployment/RouterDeploymentDefinitionTestBase.java
@@ -123,12 +123,12 @@ public class RouterDeploymentDefinitionTestBase {
 
 
     protected void initMocks() {
-        when(this.mockDestination.getDataCenter()).thenReturn(this.mockDataCenter);
-        when(this.mockDataCenter.getId()).thenReturn(DATA_CENTER_ID);
-        when(this.mockPod.getId()).thenReturn(POD_ID1);
-        when(this.mockHostPodVO1.getId()).thenReturn(POD_ID1);
-        when(this.mockHostPodVO2.getId()).thenReturn(POD_ID2);
-        when(this.mockHostPodVO3.getId()).thenReturn(POD_ID3);
-        when(this.mockNw.getId()).thenReturn(NW_ID_1);
+        when(mockDestination.getDataCenter()).thenReturn(mockDataCenter);
+        when(mockDataCenter.getId()).thenReturn(DATA_CENTER_ID);
+        when(mockPod.getId()).thenReturn(POD_ID1);
+        when(mockHostPodVO1.getId()).thenReturn(POD_ID1);
+        when(mockHostPodVO2.getId()).thenReturn(POD_ID2);
+        when(mockHostPodVO3.getId()).thenReturn(POD_ID3);
+        when(mockNw.getId()).thenReturn(NW_ID_1);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/server/test/org/cloud/network/router/deployment/VpcRouterDeploymentDefinitionTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/cloud/network/router/deployment/VpcRouterDeploymentDefinitionTest.java b/server/test/org/cloud/network/router/deployment/VpcRouterDeploymentDefinitionTest.java
index a63a395..4ef3593 100644
--- a/server/test/org/cloud/network/router/deployment/VpcRouterDeploymentDefinitionTest.java
+++ b/server/test/org/cloud/network/router/deployment/VpcRouterDeploymentDefinitionTest.java
@@ -17,17 +17,16 @@
 package org.cloud.network.router.deployment;
 
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertNull;
 import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import com.cloud.network.vpc.VpcOfferingVO;
 import java.util.List;
 
 import org.junit.Before;
@@ -46,6 +45,7 @@ import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
 import com.cloud.network.router.NicProfileHelper;
 import com.cloud.network.vpc.VpcManager;
+import com.cloud.network.vpc.VpcOfferingVO;
 import com.cloud.network.vpc.VpcVO;
 import com.cloud.network.vpc.dao.VpcDao;
 import com.cloud.network.vpc.dao.VpcOfferingDao;
@@ -154,7 +154,7 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     @Test
     public void testFindDestinations() {
         // Execute
-        List<DeployDestination> foundDestinations = deployment.findDestinations();
+        final List<DeployDestination> foundDestinations = deployment.findDestinations();
         // Assert
         assertEquals(FOR_VPC_ONLY_THE_GIVEN_DESTINATION_SHOULD_BE_USED, deployment.dest, foundDestinations.get(0));
         assertEquals(FOR_VPC_ONLY_THE_GIVEN_DESTINATION_SHOULD_BE_USED, 1, foundDestinations.size());
@@ -180,8 +180,8 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     @Test
     public void testFindOfferingIdLeavingPrevious() {
         // Prepare
-        Long initialOfferingId = deployment.serviceOfferingId;
-        VpcOfferingVO vpcOffering = mock(VpcOfferingVO.class);
+        final Long initialOfferingId = deployment.serviceOfferingId;
+        final VpcOfferingVO vpcOffering = mock(VpcOfferingVO.class);
         when(mockVpcOffDao.findById(VPC_OFFERING_ID)).thenReturn(vpcOffering);
         when(vpcOffering.getServiceOfferingId()).thenReturn(null);
 
@@ -196,7 +196,7 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     @Test
     public void testFindOfferingIdSettingNewOne() {
         // Prepare
-        VpcOfferingVO vpcOffering = mock(VpcOfferingVO.class);
+        final VpcOfferingVO vpcOffering = mock(VpcOfferingVO.class);
         when(mockVpcOffDao.findById(VPC_OFFERING_ID)).thenReturn(vpcOffering);
         when(vpcOffering.getServiceOfferingId()).thenReturn(VPC_OFFERING_ID);
 
@@ -215,7 +215,7 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
 
     @Test
     public void testDeployAllVirtualRoutersWithNoDeployedRouter() throws InsufficientAddressCapacityException, InsufficientServerCapacityException, StorageUnavailableException,
-            InsufficientCapacityException, ResourceUnavailableException {
+    InsufficientCapacityException, ResourceUnavailableException {
 
         driveTestDeployAllVirtualRouters(null);
 
@@ -225,9 +225,9 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     }
 
     public void driveTestDeployAllVirtualRouters(final DomainRouterVO router) throws InsufficientAddressCapacityException, InsufficientServerCapacityException,
-            StorageUnavailableException, InsufficientCapacityException, ResourceUnavailableException {
+    StorageUnavailableException, InsufficientCapacityException, ResourceUnavailableException {
         // Prepare
-        VpcRouterDeploymentDefinition vpcDeployment = (VpcRouterDeploymentDefinition) deployment;
+        final VpcRouterDeploymentDefinition vpcDeployment = (VpcRouterDeploymentDefinition) deployment;
         when(vpcDeployment.nwHelper.deployRouter(vpcDeployment, true)).thenReturn(router);
 
         // Execute
@@ -242,7 +242,7 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     @Test
     public void testFindSourceNatIP() throws InsufficientAddressCapacityException, ConcurrentOperationException {
         // Prepare
-        PublicIp publicIp = mock(PublicIp.class);
+        final PublicIp publicIp = mock(PublicIp.class);
         when(vpcMgr.assignSourceNatIpAddressToVpc(mockOwner, mockVpc)).thenReturn(publicIp);
 
         // Execute
@@ -255,13 +255,13 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
     @Test
     public void testRedundancyProperty() {
         // Set and confirm is redundant
-        when(this.mockVpc.isRedundant()).thenReturn(true);
-        RouterDeploymentDefinition deployment = this.builder.create()
-                .setVpc(this.mockVpc)
-                .setDeployDestination(this.mockDestination)
+        when(mockVpc.isRedundant()).thenReturn(true);
+        final RouterDeploymentDefinition deployment = builder.create()
+                .setVpc(mockVpc)
+                .setDeployDestination(mockDestination)
                 .build();
         assertTrue("The builder ignored redundancy from its inner network", deployment.isRedundant());
-        when(this.mockVpc.isRedundant()).thenReturn(false);
+        when(mockVpc.isRedundant()).thenReturn(false);
         assertFalse("The builder ignored redundancy from its inner network", deployment.isRedundant());
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d48322/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ b/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ
index 81acc7a..34d233c 100644
--- a/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ
+++ b/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ
@@ -52,7 +52,7 @@ vrrp_instance inside_network {
     }
 
     !That's the correct path of the master.py file.
-    notify_master "/cloud_scripts/opt/cloud/bin/master.py --master"
-    notify_backup "/cloud_scripts/opt/cloud/bin/master.py --backup"
-    notify_fault "/cloud_scripts/opt/cloud/bin/master.py --fault"
+    notify_master "/root/cloud_scripts/opt/cloud/bin/master.py --master"
+    notify_backup "/root/cloud_scripts/opt/cloud/bin/master.py --backup"
+    notify_fault "/root/cloud_scripts/opt/cloud/bin/master.py --fault"
 }


Mime
View raw message