cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anim...@apache.org
Subject [07/12] git commit: updated refs/heads/4.2 to f09afea
Date Tue, 03 Sep 2013 23:11:36 GMT
CLOUDSTACK-4458: Volume attach/detach command needs to sent to hypervisor resource even when
target VM is in Stopped state
(cherry picked from commit 995e193be2a1aad8ffe0eeb03357e23fb5c63769)

Signed-off-by: animesh <animesh@apache.org>


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

Branch: refs/heads/4.2
Commit: 34ee6f90bb5f69b619116d2c61a3f61fbdbca536
Parents: 2b12088
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Aug 28 18:37:45 2013 -0700
Committer: animesh <animesh@apache.org>
Committed: Tue Sep 3 15:59:25 2013 -0700

----------------------------------------------------------------------
 .../storage/snapshot/SnapshotServiceImpl.java           |  1 -
 .../src/com/cloud/hypervisor/guru/VMwareGuru.java       |  2 +-
 .../cloud/storage/resource/VmwareStorageProcessor.java  |  2 +-
 server/src/com/cloud/storage/VolumeManagerImpl.java     | 12 +++++++++++-
 .../cloud/hypervisor/vmware/mo/VirtualMachineMO.java    |  3 +--
 5 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/34ee6f90/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
index e53bf9c..00d9631 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -247,7 +247,6 @@ public class SnapshotServiceImpl implements SnapshotService {
         AsyncCallFuture<SnapshotResult> future = new AsyncCallFuture<SnapshotResult>();
         SnapshotResult result = new SnapshotResult(snapshot, null);
         try {
-
             snapObj.processEvent(Snapshot.Event.BackupToSecondary);
 
             DataStore imageStore = this.findSnapshotImageStore(snapshot);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/34ee6f90/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index c8e82ab..73cc8e3 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -351,7 +351,7 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
                 }
             }
         }
-
+        
         if(!needDelegation) {
             return new Pair<Boolean, Long>(Boolean.FALSE, new Long(hostId));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/34ee6f90/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
index 20c26fb..14fca3a 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
@@ -969,7 +969,7 @@ public class VmwareStorageProcessor implements StorageProcessor {
                     throw new Exception("unable to prepare snapshot backup directory");
                 }
             }
-        }
+        }	
 
         VirtualMachineMO clonedVm = null;
         try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/34ee6f90/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 35fe72a..85a19ca 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -2026,6 +2026,16 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
         String errorMsg = "Failed to detach volume: " + volume.getName()
                 + " from VM: " + vm.getHostName();
         boolean sendCommand = (vm.getState() == State.Running);
+        Long hostId = vm.getHostId();
+        if (hostId == null) {
+            hostId = vm.getLastHostId();
+            HostVO host = _hostDao.findById(hostId);
+            if (host != null
+                    && host.getHypervisorType() == HypervisorType.VMware) {
+                sendCommand = true;
+            }
+        }
+        
         Answer answer = null;
 
         if (sendCommand) {
@@ -2044,7 +2054,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
             cmd.set_iScsiName(volume.get_iScsiName());
 
             try {
-                answer = _agentMgr.send(vm.getHostId(), cmd);
+                answer = _agentMgr.send(hostId, cmd);
             } catch (Exception e) {
                 throw new CloudRuntimeException(errorMsg + " due to: "
                         + e.getMessage());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/34ee6f90/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 7dd947c..6007bf0 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -1055,8 +1055,7 @@ public class VirtualMachineMO extends BaseMO {
 		// VirtualDisk, we only perform prefix matching
 		Pair<VirtualDisk, String> deviceInfo = getDiskDevice(vmdkDatastorePath, false);
 		if(deviceInfo == null) {
-			if(s_logger.isTraceEnabled())
-				s_logger.trace("vCenter API trace - detachDisk() done (failed)");
+			s_logger.warn("vCenter API trace - detachDisk() done (failed)");
 			throw new Exception("No such disk device: " + vmdkDatastorePath);
 		}
 


Mime
View raw message