cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [3/4] git commit: updated refs/heads/4.5 to 45ebdf3
Date Tue, 20 Jan 2015 10:20:25 GMT
CLOUDSTACK-7534: ResetVM for VM with attached datadisk fails when enable.ha.storage.migration
is false

Separate global config to enable/disable Storage Migration during normal deployment
Introduced a configuration parameter named enable.storage.migration

(cherry picked from commit c55bc0b2d11be4820a24af426e23da3db54a0cb1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 9cf05dc842f3fb4649746ad536eca1855184e15b
Parents: bf8db0c
Author: Harikrishna Patnala <harikrishna.patnala@citrix.com>
Authored: Thu Sep 11 11:07:43 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Jan 20 14:43:10 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/vm/VirtualMachineProfile.java     |  1 +
 .../engine/orchestration/VolumeOrchestrator.java    | 16 +++++++++++++---
 .../com/cloud/ha/HighAvailabilityManagerImpl.java   |  4 ++++
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/api/src/com/cloud/vm/VirtualMachineProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java
index 29f3164..d0fea49 100644
--- a/api/src/com/cloud/vm/VirtualMachineProfile.java
+++ b/api/src/com/cloud/vm/VirtualMachineProfile.java
@@ -41,6 +41,7 @@ public interface VirtualMachineProfile {
         public static final Param ReProgramGuestNetworks = new Param("RestartNetwork");
         public static final Param PxeSeverType = new Param("PxeSeverType");
         public static final Param HaTag = new Param("HaTag");
+        public static final Param HaOperation = new Param("HaOperation");
 
         private String name;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index fd4883b..1a3c0b6 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1101,7 +1101,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
     }
 
-    private List<VolumeTask> getTasks(List<VolumeVO> vols, Map<Volume, StoragePool>
destVols) throws StorageUnavailableException {
+    private List<VolumeTask> getTasks(List<VolumeVO> vols, Map<Volume, StoragePool>
destVols, VirtualMachineProfile vm) throws StorageUnavailableException {
         boolean recreate = RecreatableSystemVmEnabled.value();
         List<VolumeTask> tasks = new ArrayList<VolumeTask>();
         for (VolumeVO vol : vols) {
@@ -1141,7 +1141,14 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                                 throw new CloudRuntimeException("Local volume " + vol + "
cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
                             } else {
                                 //Check if storage migration is enabled in config
-                                if (StorageHAMigrationEnabled.value()) {
+                                Boolean isHAOperation = (Boolean)vm.getParameter(VirtualMachineProfile.Param.HaOperation);
+                                Boolean storageMigrationEnabled = true;
+                                if (isHAOperation != null && isHAOperation) {
+                                    storageMigrationEnabled = StorageHAMigrationEnabled.value();
+                                } else {
+                                    storageMigrationEnabled = StorageMigrationEnabled.value();
+                                }
+                                if(storageMigrationEnabled){
                                     if (s_logger.isDebugEnabled()) {
                                         s_logger.debug("Shared volume " + vol + " will be
migrated on storage pool " + assignedPool + " assigned by deploymentPlanner");
                                     }
@@ -1299,7 +1306,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for
" + vm);
         }
 
-        List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks());
+        List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks(), vm);
         Volume vol = null;
         StoragePool pool = null;
         for (VolumeTask task : tasks) {
@@ -1350,6 +1357,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     public static final ConfigKey<Boolean> StorageHAMigrationEnabled = new ConfigKey<Boolean>(Boolean.class,
"enable.ha.storage.migration", "Storage", "true",
             "Enable/disable storage migration across primary storage during HA", true);
 
+    public static final ConfigKey<Boolean> StorageMigrationEnabled = new ConfigKey<Boolean>(Boolean.class,
"enable.storage.migration", "Storage", "true",
+            "Enable/disable storage migration across primary storage", true);
+
     @Override
     public ConfigKey<?>[] getConfigKeys() {
         return new ConfigKey<?>[] {RecreatableSystemVmEnabled, MaxVolumeSize, StorageHAMigrationEnabled,
CustomDiskOfferingMaxSize, CustomDiskOfferingMinSize};

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
index a305543..a278750 100755
--- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
+++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
@@ -578,6 +578,10 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements
HighAvai
             if (_haTag != null) {
                 params.put(VirtualMachineProfile.Param.HaTag, _haTag);
             }
+            WorkType wt = work.getWorkType();
+            if (wt.equals(WorkType.HA)) {
+                params.put(VirtualMachineProfile.Param.HaOperation, true);
+            }
 
             try{
                 // First try starting the vm with its original planner, if it doesn't succeed
send HAPlanner as its an emergency.


Mime
View raw message