Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/4.4-6460 [created] 536ec0578


CLOUDSTACK-6460 - Force RAW when storage type is CLVM. Fixes primary storage 
migration for CLVM

Signed-off-by: Daan Hoogland <[email protected]>


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

Branch: refs/heads/hotfix/4.4-6460
Commit: 536ec0578111cf85e93122deaf9a95270d66f778
Parents: 4c82594
Author: Simon Weller <[email protected]>
Authored: Tue Jun 24 11:47:55 2014 -0500
Committer: Daan Hoogland <[email protected]>
Committed: Fri Aug 8 10:31:08 2014 +0200

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/536ec057/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index f62a07d..73a798f 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -1039,9 +1039,15 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
          */
 
         KVMStoragePool srcPool = disk.getPool();
-        PhysicalDiskFormat sourceFormat = disk.getFormat();
         String sourcePath = disk.getPath();
+        PhysicalDiskFormat sourceFormat;
 
+        if (srcPool.getType() == StoragePoolType.CLVM) {
+         /* CLVM is always RAW, so it should be treated as such */
+            sourceFormat = PhysicalDiskFormat.RAW;
+        } else {
+            sourceFormat = disk.getFormat();
+        }
         KVMPhysicalDisk newDisk;
         s_logger.debug("copyPhysicalDisk: disk size:" + disk.getSize() + ", 
virtualsize:" + disk.getVirtualSize()+" format:"+disk.getFormat());
         if (destPool.getType() != StoragePoolType.RBD) {

Reply via email to