cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 9be404a
Date Tue, 23 Dec 2014 15:25:34 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 145b4a1f2 -> 9be404a93


CLOUDSTACK-8107. Failed to create snapshot from volume when the task is performed repeatedly
in zone wide primary Storage.
While taking a snapshot of a volume, CS chooses the endpoint to perform backup snapshot operation
by selecting any host that has the storage containing the volume mounted on it.
Instead, if the volume is attached to a VM, the endpoint chosen by CS should be the host that
contains the VM.

(cherry picked from commit a75a43137316a60b20760aa5015d97f55520fd16)


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

Branch: refs/heads/4.4
Commit: 9be404a93ed0ca99df4fa60d7943a4598ab9fe91
Parents: 145b4a1
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Mon Oct 13 16:26:47 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Dec 23 16:25:00 2014 +0100

----------------------------------------------------------------------
 .../storage/endpoint/DefaultEndPointSelector.java       | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9be404a9/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index 304f959..16c537f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -215,13 +215,21 @@ public class DefaultEndPointSelector implements EndPointSelector {
     public EndPoint select(DataObject srcData, DataObject destData, StorageAction action)
{
         if (action == StorageAction.BACKUPSNAPSHOT && srcData.getDataStore().getRole()
== DataStoreRole.Primary) {
             SnapshotInfo srcSnapshot = (SnapshotInfo)srcData;
+            VolumeInfo volumeInfo = srcSnapshot.getBaseVolume();
+            VirtualMachine vm = volumeInfo.getAttachedVM();
             if (srcSnapshot.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
-                VolumeInfo volumeInfo = srcSnapshot.getBaseVolume();
-                VirtualMachine vm = volumeInfo.getAttachedVM();
                 if (vm != null && vm.getState() == VirtualMachine.State.Running)
{
                     return getEndPointFromHostId(vm.getHostId());
                 }
             }
+            if (srcSnapshot.getHypervisorType() == Hypervisor.HypervisorType.VMware) {
+                if (vm != null) {
+                    Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
+                    if (hostId != null) {
+                        return getEndPointFromHostId(hostId);
+                    }
+                }
+            }
         }
         return select(srcData, destData);
     }


Mime
View raw message