You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/08/20 20:19:42 UTC

git commit: add recreate.systemvm.enabled parameter to control recreating systemvm

Updated Branches:
  refs/heads/master ba2b0c397 -> 481aae1eb


add recreate.systemvm.enabled parameter to control recreating systemvm


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

Branch: refs/heads/master
Commit: 481aae1ebc353db149c7d997ece2ce0ffcbde52f
Parents: ba2b0c3
Author: Edison Su <su...@gmail.com>
Authored: Mon Aug 20 11:19:26 2012 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Mon Aug 20 11:19:26 2012 -0700

----------------------------------------------------------------------
 .../network/lb/ElasticLoadBalancerManagerImpl.java |    8 --------
 server/src/com/cloud/configuration/Config.java     |    1 +
 .../AgentBasedConsoleProxyManager.java             |    8 --------
 .../consoleproxy/ConsoleProxyManagerImpl.java      |    9 ---------
 .../router/VirtualNetworkApplianceManagerImpl.java |   13 -------------
 server/src/com/cloud/storage/StorageManager.java   |    2 +-
 .../src/com/cloud/storage/StorageManagerImpl.java  |    9 ++++++++-
 .../secondary/SecondaryStorageManagerImpl.java     |    9 ---------
 server/src/com/cloud/vm/UserVmManagerImpl.java     |    9 ---------
 server/src/com/cloud/vm/VirtualMachineGuru.java    |    3 ---
 .../com/cloud/vm/VirtualMachineManagerImpl.java    |   10 ++--------
 .../test/com/cloud/vm/MockUserVmManagerImpl.java   |    8 --------
 12 files changed, 12 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 1c40516..1cd830c 100644
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -1025,14 +1025,6 @@ public class ElasticLoadBalancerManagerImpl implements
         throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
      }
 
-
-    @Override
-    public boolean recreateNeeded(
-        VirtualMachineProfile<DomainRouterVO> profile, long hostId, Commands cmds, ReservationContext context) {
-	// TODO Auto-generated method stub
-	return false;
-    }
-
     @Override
     public void prepareStop(VirtualMachineProfile<DomainRouterVO> profile) {
     } 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 6537c9b..9fea7fb 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -230,6 +230,7 @@ public enum Config {
     SortKeyAlgorithm("Advanced", ManagementServer.class, Boolean.class, "sortkey.algorithm", "false", "Sort algorithm for those who use sort key(template, disk offering, service offering, network offering), true means ascending sort while false means descending sort", null),
     EnableEC2API("Advanced", ManagementServer.class, Boolean.class, "enable.ec2.api", "false", "enable EC2 API on CloudStack", null),
     EnableS3API("Advanced", ManagementServer.class, Boolean.class, "enable.s3.api", "false", "enable Amazon S3 API on CloudStack", null),
+    RecreateSystemVmEnabled("Advanced", ManagementServer.class, Boolean.class, "recreate.systemvm.enabled", "false", "If true, will recreate system vm root disk whenever starting system vm", "true,false"),
     
     // Ovm
     OvmPublicNetwork("Hidden", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null),

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
index f833e98..01b4720 100755
--- a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
@@ -368,14 +368,6 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
         throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
     }
     
-    @Override
-	public boolean recreateNeeded(
-			VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
-			Commands cmds, ReservationContext context) {
-		// TODO Auto-generated method stub
-		return false;
-    }
-
     @Override 
     public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 72d48b4..6de1463 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -2023,15 +2023,6 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
         //not supported
         throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
     }
-    
-    
-    @Override
-    public boolean recreateNeeded(
-			VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
-			Commands cmds, ReservationContext context) {
-		// TODO Auto-generated method stub
-		return false;
-    }
 	
 	@Override
 	public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 7cd9704..082c630 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3386,17 +3386,4 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
     		}
     	}
     }
-
-	@Override
-	public boolean recreateNeeded(
-			VirtualMachineProfile<DomainRouterVO> profile, long hostId,
-			Commands cmds, ReservationContext context) {
-		//asssume that if failed to ssh into router, meaning router is crashed
-		CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh");
-		if (answer == null || !answer.getResult()) {
-			return true;
-		}
-
-		return false;
-	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManager.java b/server/src/com/cloud/storage/StorageManager.java
index 59a0221..d535af4 100755
--- a/server/src/com/cloud/storage/StorageManager.java
+++ b/server/src/com/cloud/storage/StorageManager.java
@@ -180,7 +180,7 @@ public interface StorageManager extends StorageService, Manager {
 	void createCapacityEntry(StoragePoolVO storagePool, short capacityType, long allocated);
 
     
-    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
+    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
 
 	void release(VirtualMachineProfile<? extends VMInstanceVO> profile);
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 3fe4605..9d4ba0c 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -358,6 +358,8 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
     private double _storageAllocatedThreshold = 1.0d;
     protected BigDecimal _storageOverprovisioningFactor = new BigDecimal(1);
 
+	private boolean _recreateSystemVmEnabled;
+
     public boolean share(VMInstanceVO vm, List<VolumeVO> vols, HostVO host, boolean cancelPreviousShare) throws StorageUnavailableException {
 
         // if pool is in maintenance and it is the ONLY pool available; reject
@@ -958,6 +960,9 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
         value = configDao.getValue(Config.CopyVolumeWait.toString());
         _copyvolumewait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
 
+        value = configDao.getValue(Config.RecreateSystemVmEnabled.key());
+        _recreateSystemVmEnabled = Boolean.parseBoolean(value);
+        
         value = configDao.getValue(Config.StorageTemplateCleanupEnabled.key());
         _templateCleanupEnabled = (value == null ? true : Boolean.parseBoolean(value));
 
@@ -3217,7 +3222,7 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
     }
 
     @Override
-    public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException {
+    public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException {
 
         if (dest == null) {
             if (s_logger.isDebugEnabled()) {
@@ -3229,6 +3234,8 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
         }
+        
+        boolean recreate = _recreateSystemVmEnabled;
 
         List<VolumeVO> recreateVols = new ArrayList<VolumeVO>(vols.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 95eb7f6..8662000 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -1469,15 +1469,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
         throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
     }
 
-    
-    @Override
-    public boolean recreateNeeded(
-			VirtualMachineProfile<SecondaryStorageVmVO> profile, long hostId,
-			Commands cmds, ReservationContext context) {
-		// TODO Auto-generated method stub
-		return false;
-    }
-
 	@Override
 	public void prepareStop(VirtualMachineProfile<SecondaryStorageVmVO> profile) {
 		

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 6f6a754..b7c1c0e 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3620,15 +3620,6 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
         return vm;
     }
 
-
-    @Override
-    public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
-            long hostId, Commands cmds, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-
     @Override
     public UserVm restoreVM(RestoreVMCmd cmd) {
         // Input validation

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/vm/VirtualMachineGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineGuru.java b/server/src/com/cloud/vm/VirtualMachineGuru.java
index 2b9114d..b59584d 100644
--- a/server/src/com/cloud/vm/VirtualMachineGuru.java
+++ b/server/src/com/cloud/vm/VirtualMachineGuru.java
@@ -69,8 +69,6 @@ public interface VirtualMachineGuru<T extends VirtualMachine> {
     
     void finalizeExpunge(T vm);
     
-    boolean recreateNeeded(VirtualMachineProfile<T> profile, long hostId, Commands cmds, ReservationContext context);
-    
     /**
      * Returns the id parsed from the name.  If it cannot parse the name,
      * then return null.  This method is used to determine if this is
@@ -82,7 +80,6 @@ public interface VirtualMachineGuru<T extends VirtualMachine> {
     Long convertToId(String vmName);
     
     /**
-<<<<<<< HEAD
      * Prepare for a nic to be plugged into the network.
      * @param network
      * @param nic

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/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 6421015..605ce57 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -657,7 +657,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
             DataCenterDeployment originalPlan = plan;
 
             int retry = _retry;
-            boolean recreate = false;
             while (retry-- != 0) { // It's != so that it can match -1.
 
                 if(reuseVolume){
@@ -752,8 +751,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
                     }
                     _networkMgr.prepare(vmProfile, dest, ctx); 
                     if (vm.getHypervisorType() != HypervisorType.BareMetal) {
-                        _storageMgr.prepare(vmProfile, dest, recreate);
-                        recreate = false;
+                        _storageMgr.prepare(vmProfile, dest);
                     }
                     //since StorageMgr succeeded in volume creation, reuse Volume for further tries until current cluster has capacity
                     if(!reuseVolume){
@@ -813,11 +811,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
                                 _haMgr.scheduleStop(vm, destHostId, WorkType.ForceStop);
                                 throw new ExecutionException("Unable to stop " + vm + " so we are unable to retry the start operation");
                             }
-                            if (vmGuru.recreateNeeded(vmProfile, destHostId, cmds, ctx)) {
-                            	recreate = true;
-                            } else {
-                            	throw new ExecutionException("Unable to start " + vm + " due to error in finalizeStart, not retrying");
-                            }
+                            throw new ExecutionException("Unable to start " + vm + " due to error in finalizeStart, not retrying");
                         }
                     }
                     s_logger.info("Unable to start VM on " + dest.getHost() + " due to " + (startAnswer == null ? " no start answer" : startAnswer.getDetails()));

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/test/com/cloud/vm/MockUserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/MockUserVmManagerImpl.java b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
index e890262..efc6916 100644
--- a/server/test/com/cloud/vm/MockUserVmManagerImpl.java
+++ b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
@@ -292,14 +292,6 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
         return null;
     }
 
-
-        @Override
-       public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
-                       long hostId, Commands cmds, ReservationContext context) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
     @Override
     public UserVm startVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
         // TODO Auto-generated method stub


RE: git commit: add recreate.systemvm.enabled parameter to control recreating systemvm

Posted by Edison Su <Ed...@citrix.com>.
No preference, setting to false, so it has the same behavior as before.


> -----Original Message-----
> From: David Nalley [mailto:david@gnsa.us]
> Sent: Monday, August 20, 2012 11:27 AM
> To: cloudstack-dev@incubator.apache.org
> Subject: Re: git commit: add recreate.systemvm.enabled parameter to
> control recreating systemvm
>
> Why is this set to false by default?
> From an design decision point of view, not doing so, encourages
> thinking of sysVMs as more stateful than they are IMO.
>
> --David
>
> On Mon, Aug 20, 2012 at 2:19 PM,  <ed...@apache.org> wrote:
> > Updated Branches:
> >   refs/heads/master ba2b0c397 -> 481aae1eb
> >
> >
> > add recreate.systemvm.enabled parameter to control recreating
> systemvm
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/commit/481aae1e
> > Tree: http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/tree/481aae1e
> > Diff: http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/diff/481aae1e
> >
> > Branch: refs/heads/master
> > Commit: 481aae1ebc353db149c7d997ece2ce0ffcbde52f
> > Parents: ba2b0c3
> > Author: Edison Su <su...@gmail.com>
> > Authored: Mon Aug 20 11:19:26 2012 -0700
> > Committer: Edison Su <su...@gmail.com>
> > Committed: Mon Aug 20 11:19:26 2012 -0700
> >
> > ---------------------------------------------------------------------
> -
> >  .../network/lb/ElasticLoadBalancerManagerImpl.java |    8 --------
> >  server/src/com/cloud/configuration/Config.java     |    1 +
> >  .../AgentBasedConsoleProxyManager.java             |    8 --------
> >  .../consoleproxy/ConsoleProxyManagerImpl.java      |    9 ---------
> >  .../router/VirtualNetworkApplianceManagerImpl.java |   13 ----------
> ---
> >  server/src/com/cloud/storage/StorageManager.java   |    2 +-
> >  .../src/com/cloud/storage/StorageManagerImpl.java  |    9 ++++++++-
> >  .../secondary/SecondaryStorageManagerImpl.java     |    9 ---------
> >  server/src/com/cloud/vm/UserVmManagerImpl.java     |    9 ---------
> >  server/src/com/cloud/vm/VirtualMachineGuru.java    |    3 ---
> >  .../com/cloud/vm/VirtualMachineManagerImpl.java    |   10 ++--------
> >  .../test/com/cloud/vm/MockUserVmManagerImpl.java   |    8 --------
> >  12 files changed, 12 insertions(+), 77 deletions(-)
> > ---------------------------------------------------------------------
> -
> >
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/plugins/network-elements/elastic-
> loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.ja
> va
> > ---------------------------------------------------------------------
> -
> > diff --git a/plugins/network-elements/elastic-
> loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.ja
> va b/plugins/network-elements/elastic-
> loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.ja
> va
> > index 1c40516..1cd830c 100644
> > --- a/plugins/network-elements/elastic-
> loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.ja
> va
> > +++ b/plugins/network-elements/elastic-
> loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.ja
> va
> > @@ -1025,14 +1025,6 @@ public class ElasticLoadBalancerManagerImpl
> implements
> >          throw new UnsupportedOperationException("Unplug nic is not
> supported for vm of type " + vm.getType());
> >       }
> >
> > -
> > -    @Override
> > -    public boolean recreateNeeded(
> > -        VirtualMachineProfile<DomainRouterVO> profile, long hostId,
> Commands cmds, ReservationContext context) {
> > -       // TODO Auto-generated method stub
> > -       return false;
> > -    }
> > -
> >      @Override
> >      public void prepareStop(VirtualMachineProfile<DomainRouterVO>
> profile) {
> >      }
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/configuration/Config.java
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/configuration/Config.java
> b/server/src/com/cloud/configuration/Config.java
> > index 6537c9b..9fea7fb 100755
> > --- a/server/src/com/cloud/configuration/Config.java
> > +++ b/server/src/com/cloud/configuration/Config.java
> > @@ -230,6 +230,7 @@ public enum Config {
> >      SortKeyAlgorithm("Advanced", ManagementServer.class,
> Boolean.class, "sortkey.algorithm", "false", "Sort algorithm for those
> who use sort key(template, disk offering, service offering, network
> offering), true means ascending sort while false means descending sort",
> null),
> >      EnableEC2API("Advanced", ManagementServer.class, Boolean.class,
> "enable.ec2.api", "false", "enable EC2 API on CloudStack", null),
> >      EnableS3API("Advanced", ManagementServer.class, Boolean.class,
> "enable.s3.api", "false", "enable Amazon S3 API on CloudStack", null),
> > +    RecreateSystemVmEnabled("Advanced", ManagementServer.class,
> Boolean.class, "recreate.systemvm.enabled", "false", "If true, will
> recreate system vm root disk whenever starting system vm",
> "true,false"),
> >
> >      // Ovm
> >      OvmPublicNetwork("Hidden", ManagementServer.class, String.class,
> "ovm.public.network.device", null, "Specify the public bridge on host
> for public network", null),
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/AgentBasedCo
> nsoleProxyManager.java
> > ---------------------------------------------------------------------
> -
> > diff --git
> a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> > index f833e98..01b4720 100755
> > ---
> a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> > +++
> b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> > @@ -368,14 +368,6 @@ public class AgentBasedConsoleProxyManager
> implements ConsoleProxyManager, Virtu
> >          throw new UnsupportedOperationException("Unplug nic is not
> supported for vm of type " + vm.getType());
> >      }
> >
> > -    @Override
> > -       public boolean recreateNeeded(
> > -                       VirtualMachineProfile<ConsoleProxyVO> profile,
> long hostId,
> > -                       Commands cmds, ReservationContext context) {
> > -               // TODO Auto-generated method stub
> > -               return false;
> > -    }
> > -
> >      @Override
> >      public void prepareStop(VirtualMachineProfile<ConsoleProxyVO>
> profile) {
> >      }
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/ConsoleProxy
> ManagerImpl.java
> > ---------------------------------------------------------------------
> -
> > diff --git
> a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> > index 72d48b4..6de1463 100755
> > --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> > +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> > @@ -2023,15 +2023,6 @@ public class ConsoleProxyManagerImpl
> implements ConsoleProxyManager, ConsoleProx
> >          //not supported
> >          throw new UnsupportedOperationException("Unplug nic is not
> supported for vm of type " + vm.getType());
> >      }
> > -
> > -
> > -    @Override
> > -    public boolean recreateNeeded(
> > -                       VirtualMachineProfile<ConsoleProxyVO> profile,
> long hostId,
> > -                       Commands cmds, ReservationContext context) {
> > -               // TODO Auto-generated method stub
> > -               return false;
> > -    }
> >
> >         @Override
> >         public void prepareStop(VirtualMachineProfile<ConsoleProxyVO>
> profile) {
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/network/router/VirtualNet
> workApplianceManagerImpl.java
> > ---------------------------------------------------------------------
> -
> > diff --git
> a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImp
> l.java
> b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImp
> l.java
> > index 7cd9704..082c630 100755
> > ---
> a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImp
> l.java
> > +++
> b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImp
> l.java
> > @@ -3386,17 +3386,4 @@ public class
> VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
> >                 }
> >         }
> >      }
> > -
> > -       @Override
> > -       public boolean recreateNeeded(
> > -                       VirtualMachineProfile<DomainRouterVO> profile,
> long hostId,
> > -                       Commands cmds, ReservationContext context) {
> > -               //asssume that if failed to ssh into router, meaning
> router is crashed
> > -               CheckSshAnswer answer = (CheckSshAnswer)
> cmds.getAnswer("checkSsh");
> > -               if (answer == null || !answer.getResult()) {
> > -                       return true;
> > -               }
> > -
> > -               return false;
> > -       }
> >  }
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManager.ja
> va
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/storage/StorageManager.java
> b/server/src/com/cloud/storage/StorageManager.java
> > index 59a0221..d535af4 100755
> > --- a/server/src/com/cloud/storage/StorageManager.java
> > +++ b/server/src/com/cloud/storage/StorageManager.java
> > @@ -180,7 +180,7 @@ public interface StorageManager extends
> StorageService, Manager {
> >         void createCapacityEntry(StoragePoolVO storagePool, short
> capacityType, long allocated);
> >
> >
> > -    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm,
> DeployDestination dest, boolean recreate) throws
> StorageUnavailableException, InsufficientStorageCapacityException,
> ConcurrentOperationException;
> > +    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm,
> DeployDestination dest) throws StorageUnavailableException,
> InsufficientStorageCapacityException, ConcurrentOperationException;
> >
> >         void release(VirtualMachineProfile<? extends VMInstanceVO>
> profile);
> >
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManagerImp
> l.java
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java
> b/server/src/com/cloud/storage/StorageManagerImpl.java
> > index 3fe4605..9d4ba0c 100755
> > --- a/server/src/com/cloud/storage/StorageManagerImpl.java
> > +++ b/server/src/com/cloud/storage/StorageManagerImpl.java
> > @@ -358,6 +358,8 @@ public class StorageManagerImpl implements
> StorageManager, Manager, ClusterManag
> >      private double _storageAllocatedThreshold = 1.0d;
> >      protected BigDecimal _storageOverprovisioningFactor = new
> BigDecimal(1);
> >
> > +       private boolean _recreateSystemVmEnabled;
> > +
> >      public boolean share(VMInstanceVO vm, List<VolumeVO> vols,
> HostVO host, boolean cancelPreviousShare) throws
> StorageUnavailableException {
> >
> >          // if pool is in maintenance and it is the ONLY pool
> available; reject
> > @@ -958,6 +960,9 @@ public class StorageManagerImpl implements
> StorageManager, Manager, ClusterManag
> >          value = configDao.getValue(Config.CopyVolumeWait.toString());
> >          _copyvolumewait = NumbersUtil.parseInt(value,
> Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
> >
> > +        value =
> configDao.getValue(Config.RecreateSystemVmEnabled.key());
> > +        _recreateSystemVmEnabled = Boolean.parseBoolean(value);
> > +
> >          value =
> configDao.getValue(Config.StorageTemplateCleanupEnabled.key());
> >          _templateCleanupEnabled = (value == null ? true :
> Boolean.parseBoolean(value));
> >
> > @@ -3217,7 +3222,7 @@ public class StorageManagerImpl implements
> StorageManager, Manager, ClusterManag
> >      }
> >
> >      @Override
> > -    public void prepare(VirtualMachineProfile<? extends
> VirtualMachine> vm, DeployDestination dest, boolean recreate) throws
> StorageUnavailableException, InsufficientStorageCapacityException {
> > +    public void prepare(VirtualMachineProfile<? extends
> VirtualMachine> vm, DeployDestination dest) throws
> StorageUnavailableException, InsufficientStorageCapacityException {
> >
> >          if (dest == null) {
> >              if (s_logger.isDebugEnabled()) {
> > @@ -3229,6 +3234,8 @@ public class StorageManagerImpl implements
> StorageManager, Manager, ClusterManag
> >          if (s_logger.isDebugEnabled()) {
> >              s_logger.debug("Checking if we need to prepare " +
> vols.size() + " volumes for " + vm);
> >          }
> > +
> > +        boolean recreate = _recreateSystemVmEnabled;
> >
> >          List<VolumeVO> recreateVols = new
> ArrayList<VolumeVO>(vols.size());
> >
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/storage/secondary/Seconda
> ryStorageManagerImpl.java
> > ---------------------------------------------------------------------
> -
> > diff --git
> a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.ja
> va
> b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.ja
> va
> > index 95eb7f6..8662000 100755
> > ---
> a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.ja
> va
> > +++
> b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.ja
> va
> > @@ -1469,15 +1469,6 @@ public class SecondaryStorageManagerImpl
> implements SecondaryStorageVmManager, V
> >          throw new UnsupportedOperationException("Unplug nic is not
> supported for vm of type " + vm.getType());
> >      }
> >
> > -
> > -    @Override
> > -    public boolean recreateNeeded(
> > -                       VirtualMachineProfile<SecondaryStorageVmVO>
> profile, long hostId,
> > -                       Commands cmds, ReservationContext context) {
> > -               // TODO Auto-generated method stub
> > -               return false;
> > -    }
> > -
> >         @Override
> >         public void
> prepareStop(VirtualMachineProfile<SecondaryStorageVmVO> profile) {
> >
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/vm/UserVmManagerImpl.java
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java
> b/server/src/com/cloud/vm/UserVmManagerImpl.java
> > index 6f6a754..b7c1c0e 100755
> > --- a/server/src/com/cloud/vm/UserVmManagerImpl.java
> > +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
> > @@ -3620,15 +3620,6 @@ public class UserVmManagerImpl implements
> UserVmManager, UserVmService, Manager
> >          return vm;
> >      }
> >
> > -
> > -    @Override
> > -    public boolean recreateNeeded(VirtualMachineProfile<UserVmVO>
> profile,
> > -            long hostId, Commands cmds, ReservationContext context)
> {
> > -        // TODO Auto-generated method stub
> > -        return false;
> > -    }
> > -
> > -
> >      @Override
> >      public UserVm restoreVM(RestoreVMCmd cmd) {
> >          // Input validation
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/vm/VirtualMachineGuru.jav
> a
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/vm/VirtualMachineGuru.java
> b/server/src/com/cloud/vm/VirtualMachineGuru.java
> > index 2b9114d..b59584d 100644
> > --- a/server/src/com/cloud/vm/VirtualMachineGuru.java
> > +++ b/server/src/com/cloud/vm/VirtualMachineGuru.java
> > @@ -69,8 +69,6 @@ public interface VirtualMachineGuru<T extends
> VirtualMachine> {
> >
> >      void finalizeExpunge(T vm);
> >
> > -    boolean recreateNeeded(VirtualMachineProfile<T> profile, long
> hostId, Commands cmds, ReservationContext context);
> > -
> >      /**
> >       * Returns the id parsed from the name.  If it cannot parse the
> name,
> >       * then return null.  This method is used to determine if this
> is
> > @@ -82,7 +80,6 @@ public interface VirtualMachineGuru<T extends
> VirtualMachine> {
> >      Long convertToId(String vmName);
> >
> >      /**
> > -<<<<<<< HEAD
> >       * Prepare for a nic to be plugged into the network.
> >       * @param network
> >       * @param nic
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/src/com/cloud/vm/VirtualMachineManagerI
> mpl.java
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> > index 6421015..605ce57 100755
> > --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> > +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> > @@ -657,7 +657,6 @@ public class VirtualMachineManagerImpl implements
> VirtualMachineManager, Listene
> >              DataCenterDeployment originalPlan = plan;
> >
> >              int retry = _retry;
> > -            boolean recreate = false;
> >              while (retry-- != 0) { // It's != so that it can match -
> 1.
> >
> >                  if(reuseVolume){
> > @@ -752,8 +751,7 @@ public class VirtualMachineManagerImpl implements
> VirtualMachineManager, Listene
> >                      }
> >                      _networkMgr.prepare(vmProfile, dest, ctx);
> >                      if (vm.getHypervisorType() !=
> HypervisorType.BareMetal) {
> > -                        _storageMgr.prepare(vmProfile, dest,
> recreate);
> > -                        recreate = false;
> > +                        _storageMgr.prepare(vmProfile, dest);
> >                      }
> >                      //since StorageMgr succeeded in volume creation,
> reuse Volume for further tries until current cluster has capacity
> >                      if(!reuseVolume){
> > @@ -813,11 +811,7 @@ public class VirtualMachineManagerImpl
> implements VirtualMachineManager, Listene
> >                                  _haMgr.scheduleStop(vm, destHostId,
> WorkType.ForceStop);
> >                                  throw new ExecutionException("Unable
> to stop " + vm + " so we are unable to retry the start operation");
> >                              }
> > -                            if (vmGuru.recreateNeeded(vmProfile,
> destHostId, cmds, ctx)) {
> > -                               recreate = true;
> > -                            } else {
> > -                               throw new ExecutionException("Unable
> to start " + vm + " due to error in finalizeStart, not retrying");
> > -                            }
> > +                            throw new ExecutionException("Unable to
> start " + vm + " due to error in finalizeStart, not retrying");
> >                          }
> >                      }
> >                      s_logger.info("Unable to start VM on " +
> dest.getHost() + " due to " + (startAnswer == null ? " no start
> answer" : startAnswer.getDetails()));
> >
> > http://git-wip-us.apache.org/repos/asf/incubator-
> cloudstack/blob/481aae1e/server/test/com/cloud/vm/MockUserVmManagerImpl
> .java
> > ---------------------------------------------------------------------
> -
> > diff --git a/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> > index e890262..efc6916 100644
> > --- a/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> > +++ b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> > @@ -292,14 +292,6 @@ public class MockUserVmManagerImpl implements
> UserVmManager, UserVmService, Mana
> >          return null;
> >      }
> >
> > -
> > -        @Override
> > -       public boolean recreateNeeded(VirtualMachineProfile<UserVmVO>
> profile,
> > -                       long hostId, Commands cmds,
> ReservationContext context) {
> > -               // TODO Auto-generated method stub
> > -               return false;
> > -       }
> > -
> >      @Override
> >      public UserVm startVirtualMachine(DeployVMCmd cmd) throws
> InsufficientCapacityException, ConcurrentOperationException,
> ResourceUnavailableException {
> >          // TODO Auto-generated method stub
> >

Re: git commit: add recreate.systemvm.enabled parameter to control recreating systemvm

Posted by David Nalley <da...@gnsa.us>.
Why is this set to false by default?
>From an design decision point of view, not doing so, encourages
thinking of sysVMs as more stateful than they are IMO.

--David

On Mon, Aug 20, 2012 at 2:19 PM,  <ed...@apache.org> wrote:
> Updated Branches:
>   refs/heads/master ba2b0c397 -> 481aae1eb
>
>
> add recreate.systemvm.enabled parameter to control recreating systemvm
>
>
> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
> Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/481aae1e
> Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/481aae1e
> Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/481aae1e
>
> Branch: refs/heads/master
> Commit: 481aae1ebc353db149c7d997ece2ce0ffcbde52f
> Parents: ba2b0c3
> Author: Edison Su <su...@gmail.com>
> Authored: Mon Aug 20 11:19:26 2012 -0700
> Committer: Edison Su <su...@gmail.com>
> Committed: Mon Aug 20 11:19:26 2012 -0700
>
> ----------------------------------------------------------------------
>  .../network/lb/ElasticLoadBalancerManagerImpl.java |    8 --------
>  server/src/com/cloud/configuration/Config.java     |    1 +
>  .../AgentBasedConsoleProxyManager.java             |    8 --------
>  .../consoleproxy/ConsoleProxyManagerImpl.java      |    9 ---------
>  .../router/VirtualNetworkApplianceManagerImpl.java |   13 -------------
>  server/src/com/cloud/storage/StorageManager.java   |    2 +-
>  .../src/com/cloud/storage/StorageManagerImpl.java  |    9 ++++++++-
>  .../secondary/SecondaryStorageManagerImpl.java     |    9 ---------
>  server/src/com/cloud/vm/UserVmManagerImpl.java     |    9 ---------
>  server/src/com/cloud/vm/VirtualMachineGuru.java    |    3 ---
>  .../com/cloud/vm/VirtualMachineManagerImpl.java    |   10 ++--------
>  .../test/com/cloud/vm/MockUserVmManagerImpl.java   |    8 --------
>  12 files changed, 12 insertions(+), 77 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
> index 1c40516..1cd830c 100644
> --- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
> +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
> @@ -1025,14 +1025,6 @@ public class ElasticLoadBalancerManagerImpl implements
>          throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
>       }
>
> -
> -    @Override
> -    public boolean recreateNeeded(
> -        VirtualMachineProfile<DomainRouterVO> profile, long hostId, Commands cmds, ReservationContext context) {
> -       // TODO Auto-generated method stub
> -       return false;
> -    }
> -
>      @Override
>      public void prepareStop(VirtualMachineProfile<DomainRouterVO> profile) {
>      }
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/configuration/Config.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
> index 6537c9b..9fea7fb 100755
> --- a/server/src/com/cloud/configuration/Config.java
> +++ b/server/src/com/cloud/configuration/Config.java
> @@ -230,6 +230,7 @@ public enum Config {
>      SortKeyAlgorithm("Advanced", ManagementServer.class, Boolean.class, "sortkey.algorithm", "false", "Sort algorithm for those who use sort key(template, disk offering, service offering, network offering), true means ascending sort while false means descending sort", null),
>      EnableEC2API("Advanced", ManagementServer.class, Boolean.class, "enable.ec2.api", "false", "enable EC2 API on CloudStack", null),
>      EnableS3API("Advanced", ManagementServer.class, Boolean.class, "enable.s3.api", "false", "enable Amazon S3 API on CloudStack", null),
> +    RecreateSystemVmEnabled("Advanced", ManagementServer.class, Boolean.class, "recreate.systemvm.enabled", "false", "If true, will recreate system vm root disk whenever starting system vm", "true,false"),
>
>      // Ovm
>      OvmPublicNetwork("Hidden", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null),
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> index f833e98..01b4720 100755
> --- a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> +++ b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
> @@ -368,14 +368,6 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
>          throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
>      }
>
> -    @Override
> -       public boolean recreateNeeded(
> -                       VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
> -                       Commands cmds, ReservationContext context) {
> -               // TODO Auto-generated method stub
> -               return false;
> -    }
> -
>      @Override
>      public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
>      }
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> index 72d48b4..6de1463 100755
> --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
> @@ -2023,15 +2023,6 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
>          //not supported
>          throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
>      }
> -
> -
> -    @Override
> -    public boolean recreateNeeded(
> -                       VirtualMachineProfile<ConsoleProxyVO> profile, long hostId,
> -                       Commands cmds, ReservationContext context) {
> -               // TODO Auto-generated method stub
> -               return false;
> -    }
>
>         @Override
>         public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
> index 7cd9704..082c630 100755
> --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
> +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
> @@ -3386,17 +3386,4 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
>                 }
>         }
>      }
> -
> -       @Override
> -       public boolean recreateNeeded(
> -                       VirtualMachineProfile<DomainRouterVO> profile, long hostId,
> -                       Commands cmds, ReservationContext context) {
> -               //asssume that if failed to ssh into router, meaning router is crashed
> -               CheckSshAnswer answer = (CheckSshAnswer) cmds.getAnswer("checkSsh");
> -               if (answer == null || !answer.getResult()) {
> -                       return true;
> -               }
> -
> -               return false;
> -       }
>  }
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManager.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/storage/StorageManager.java b/server/src/com/cloud/storage/StorageManager.java
> index 59a0221..d535af4 100755
> --- a/server/src/com/cloud/storage/StorageManager.java
> +++ b/server/src/com/cloud/storage/StorageManager.java
> @@ -180,7 +180,7 @@ public interface StorageManager extends StorageService, Manager {
>         void createCapacityEntry(StoragePoolVO storagePool, short capacityType, long allocated);
>
>
> -    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
> +    void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
>
>         void release(VirtualMachineProfile<? extends VMInstanceVO> profile);
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/StorageManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
> index 3fe4605..9d4ba0c 100755
> --- a/server/src/com/cloud/storage/StorageManagerImpl.java
> +++ b/server/src/com/cloud/storage/StorageManagerImpl.java
> @@ -358,6 +358,8 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
>      private double _storageAllocatedThreshold = 1.0d;
>      protected BigDecimal _storageOverprovisioningFactor = new BigDecimal(1);
>
> +       private boolean _recreateSystemVmEnabled;
> +
>      public boolean share(VMInstanceVO vm, List<VolumeVO> vols, HostVO host, boolean cancelPreviousShare) throws StorageUnavailableException {
>
>          // if pool is in maintenance and it is the ONLY pool available; reject
> @@ -958,6 +960,9 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
>          value = configDao.getValue(Config.CopyVolumeWait.toString());
>          _copyvolumewait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
>
> +        value = configDao.getValue(Config.RecreateSystemVmEnabled.key());
> +        _recreateSystemVmEnabled = Boolean.parseBoolean(value);
> +
>          value = configDao.getValue(Config.StorageTemplateCleanupEnabled.key());
>          _templateCleanupEnabled = (value == null ? true : Boolean.parseBoolean(value));
>
> @@ -3217,7 +3222,7 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
>      }
>
>      @Override
> -    public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, boolean recreate) throws StorageUnavailableException, InsufficientStorageCapacityException {
> +    public void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException {
>
>          if (dest == null) {
>              if (s_logger.isDebugEnabled()) {
> @@ -3229,6 +3234,8 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
>          if (s_logger.isDebugEnabled()) {
>              s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
>          }
> +
> +        boolean recreate = _recreateSystemVmEnabled;
>
>          List<VolumeVO> recreateVols = new ArrayList<VolumeVO>(vols.size());
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
> index 95eb7f6..8662000 100755
> --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
> +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
> @@ -1469,15 +1469,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
>          throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
>      }
>
> -
> -    @Override
> -    public boolean recreateNeeded(
> -                       VirtualMachineProfile<SecondaryStorageVmVO> profile, long hostId,
> -                       Commands cmds, ReservationContext context) {
> -               // TODO Auto-generated method stub
> -               return false;
> -    }
> -
>         @Override
>         public void prepareStop(VirtualMachineProfile<SecondaryStorageVmVO> profile) {
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/vm/UserVmManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
> index 6f6a754..b7c1c0e 100755
> --- a/server/src/com/cloud/vm/UserVmManagerImpl.java
> +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
> @@ -3620,15 +3620,6 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
>          return vm;
>      }
>
> -
> -    @Override
> -    public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
> -            long hostId, Commands cmds, ReservationContext context) {
> -        // TODO Auto-generated method stub
> -        return false;
> -    }
> -
> -
>      @Override
>      public UserVm restoreVM(RestoreVMCmd cmd) {
>          // Input validation
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/src/com/cloud/vm/VirtualMachineGuru.java
> ----------------------------------------------------------------------
> diff --git a/server/src/com/cloud/vm/VirtualMachineGuru.java b/server/src/com/cloud/vm/VirtualMachineGuru.java
> index 2b9114d..b59584d 100644
> --- a/server/src/com/cloud/vm/VirtualMachineGuru.java
> +++ b/server/src/com/cloud/vm/VirtualMachineGuru.java
> @@ -69,8 +69,6 @@ public interface VirtualMachineGuru<T extends VirtualMachine> {
>
>      void finalizeExpunge(T vm);
>
> -    boolean recreateNeeded(VirtualMachineProfile<T> profile, long hostId, Commands cmds, ReservationContext context);
> -
>      /**
>       * Returns the id parsed from the name.  If it cannot parse the name,
>       * then return null.  This method is used to determine if this is
> @@ -82,7 +80,6 @@ public interface VirtualMachineGuru<T extends VirtualMachine> {
>      Long convertToId(String vmName);
>
>      /**
> -<<<<<<< HEAD
>       * Prepare for a nic to be plugged into the network.
>       * @param network
>       * @param nic
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/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 6421015..605ce57 100755
> --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
> @@ -657,7 +657,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
>              DataCenterDeployment originalPlan = plan;
>
>              int retry = _retry;
> -            boolean recreate = false;
>              while (retry-- != 0) { // It's != so that it can match -1.
>
>                  if(reuseVolume){
> @@ -752,8 +751,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
>                      }
>                      _networkMgr.prepare(vmProfile, dest, ctx);
>                      if (vm.getHypervisorType() != HypervisorType.BareMetal) {
> -                        _storageMgr.prepare(vmProfile, dest, recreate);
> -                        recreate = false;
> +                        _storageMgr.prepare(vmProfile, dest);
>                      }
>                      //since StorageMgr succeeded in volume creation, reuse Volume for further tries until current cluster has capacity
>                      if(!reuseVolume){
> @@ -813,11 +811,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
>                                  _haMgr.scheduleStop(vm, destHostId, WorkType.ForceStop);
>                                  throw new ExecutionException("Unable to stop " + vm + " so we are unable to retry the start operation");
>                              }
> -                            if (vmGuru.recreateNeeded(vmProfile, destHostId, cmds, ctx)) {
> -                               recreate = true;
> -                            } else {
> -                               throw new ExecutionException("Unable to start " + vm + " due to error in finalizeStart, not retrying");
> -                            }
> +                            throw new ExecutionException("Unable to start " + vm + " due to error in finalizeStart, not retrying");
>                          }
>                      }
>                      s_logger.info("Unable to start VM on " + dest.getHost() + " due to " + (startAnswer == null ? " no start answer" : startAnswer.getDetails()));
>
> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/481aae1e/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> ----------------------------------------------------------------------
> diff --git a/server/test/com/cloud/vm/MockUserVmManagerImpl.java b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> index e890262..efc6916 100644
> --- a/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> +++ b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
> @@ -292,14 +292,6 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
>          return null;
>      }
>
> -
> -        @Override
> -       public boolean recreateNeeded(VirtualMachineProfile<UserVmVO> profile,
> -                       long hostId, Commands cmds, ReservationContext context) {
> -               // TODO Auto-generated method stub
> -               return false;
> -       }
> -
>      @Override
>      public UserVm startVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
>          // TODO Auto-generated method stub
>