Updated Branches:
  refs/heads/rbd-snap-clone a1c8a0f67 -> 2f1d4e5df

rbd: Add more debugging to the StorageAdaptor


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

Branch: refs/heads/rbd-snap-clone
Commit: 2f1d4e5df11ea115a7231a74b4857f60ccc0defc
Parents: a1c8a0f
Author: Wido den Hollander <w...@widodh.nl>
Authored: Fri May 17 12:57:18 2013 +0200
Committer: Wido den Hollander <w...@widodh.nl>
Committed: Fri May 17 12:57:18 2013 +0200

----------------------------------------------------------------------
 .../kvm/storage/LibvirtStorageAdaptor.java         |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2f1d4e5d/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 179faf9..fa2f670 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
@@ -772,10 +772,14 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
                             Rados rSrc = new Rados(srcPool.getAuthUserName());
                             rSrc.confSet("mon_host", srcPool.getSourceHost() + 
":" + srcPool.getSourcePort());
                             rSrc.confSet("key", srcPool.getAuthSecret());
+                            rSrc.connect();
+                            s_logger.debug("Succesfully connected to source 
Ceph cluster at " + rSrc.confGet("mon_host"));
 
                             Rados rDest = new 
Rados(destPool.getAuthUserName());
                             rDest.confSet("mon_host", destPool.getSourceHost() 
+ ":" + destPool.getSourcePort());
                             rDest.confSet("key", destPool.getAuthSecret());
+                            rDest.connect();
+                            s_logger.debug("Succesfully connected to source 
Ceph cluster at " + rDest.confGet("mon_host"));
 
                             IoCTX sIO = 
rSrc.ioCtxCreate(srcPool.getSourceDir());
                             Rbd sRbd = new Rbd(sIO);
@@ -941,9 +945,10 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 
                 // We now convert the temporary file to a RBD image with 
format 2
                 Rados r = new Rados(destPool.getAuthUserName());
-                r.confSet("mon_host", destPool.getSourceHost());
+                r.confSet("mon_host", destPool.getSourceHost() + ":" + 
destPool.getSourcePort());
                 r.confSet("key", destPool.getAuthSecret());
                 r.connect();
+                s_logger.debug("Succesfully connected to Ceph cluster at " + 
r.confGet("mon_host"));
 
                 IoCTX io = r.ioCtxCreate(destPool.getSourceDir());
                 Rbd rbd = new Rbd(io);
@@ -959,7 +964,7 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 
                 int chunkSize = 4194304;
                 long offset = 0;
-                s_logger.debug("Reading temporary file " + tmpFile + " into 
RBD image " + name + " in chunks of " + chunkSize + " bytes");
+                s_logger.debug("Reading temporary file " + tmpFile + " (" + 
fh.length() + " bytes) into RBD image " + name + " in chunks of " + chunkSize + 
" bytes");
                 while(true) {
                     byte[] buf = new byte[chunkSize];
 
@@ -970,6 +975,7 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
                     image.write(buf, offset, bytes);
                     offset += bytes;
                 }
+                s_logger.debug("Completed writing " + tmpFile + " to RBD image 
" + name + ". Bytes written: " + offset);
                 bis.close();
                 s_logger.debug("Removing temporary file " + tmpFile);
                 fh.delete();

Reply via email to