Nir Soffer has uploaded a new change for review.

Change subject: vm: Add error logging in diskReplicateFinish
......................................................................

vm: Add error logging in diskReplicateFinish

On failures of diskReplicateFinish we had mostly no logs, making
debugging much harder. Log error for each failure explaining the error,
and include the source disk, drive name, and the libvirt job info.

Change-Id: Ibcfe5a6e2f3dcd03ea07df523723e8134239fd59
Bug-Url: https://bugzilla.redhat.com/1325791
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/55939/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ffac65c..3689e9a 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3451,15 +3451,23 @@
         try:
             drive = self._findDriveByUUIDs(srcDisk)
         except LookupError:
+            self.log.error("Drive not found (srcDisk: %r)", srcDisk)
             return response.error('imageErr')
 
         if drive.hasVolumeLeases:
+            self.log.error("Drive has volume leases, replication not "
+                           "supported (drive: %r, srcDisk: %r)",
+                           drive.name, srcDisk)
             return response.error('noimpl')
 
         if drive.transientDisk:
+            self.log.error("Transient disk, replication not supported "
+                           "(drive: %r, srcDisk: %r)", drive.name, srcDisk)
             return response.error('transientErr')
 
         if not drive.isDiskReplicationInProgress():
+            self.log.error("No replication in progress (drive: %r, "
+                           "srcDisk: %r)", drive.name, srcDisk)
             return response.error('replicaErr')
 
         # Looking for the replication blockJob info (checking its presence)
@@ -3467,8 +3475,9 @@
 
         if (not isinstance(blkJobInfo, dict)
                 or 'cur' not in blkJobInfo or 'end' not in blkJobInfo):
-            self.log.error("Replication job not found for disk %s (%s)",
-                           drive.name, srcDisk)
+            self.log.error("Replication job not found (drive: %r, "
+                           "srcDisk: %r, job: %r)",
+                           drive.name, srcDisk, blkJobInfo)
 
             # Making sure that we don't have any stale information
             self._delDiskReplica(drive)
@@ -3477,6 +3486,9 @@
         # Checking if we reached the replication mode ("mirroring" in libvirt
         # and qemu terms)
         if blkJobInfo['cur'] != blkJobInfo['end']:
+            self.log.error("Replication job unfinished (drive: %r, "
+                           "srcDisk: %r, job: %r)",
+                           drive.name, srcDisk, blkJobInfo)
             return response.error('unavail')
 
         dstDiskCopy = dstDisk.copy()


-- 
To view, visit https://gerrit.ovirt.org/55939
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcfe5a6e2f3dcd03ea07df523723e8134239fd59
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to