diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 95a3340394b231b006af0d757de2a1815abcfce2..941a25fc3478681b7589bf695895986fb83a5e91 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -202,8 +202,9 @@ class NodeHttpServer(http.server.HttpServer): """ disks = [objects.Disk.FromDict(dsk_s) - for dsk_s in params] - return backend.BlockdevGetmirrorstatus(disks) + for dsk_s in params] + return [status.ToDict() + for status in backend.BlockdevGetmirrorstatus(disks)] @staticmethod def perspective_blockdev_find(params): diff --git a/lib/backend.py b/lib/backend.py index 05198f399ca748364eda3f2cf15b49fa4cfa938f..af741ff02427abeb76ea62cbc8b8d5fa83bf6bc8 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -1385,10 +1385,7 @@ def BlockdevGetmirrorstatus(disks): if rbd is None: _Fail("Can't find device %s", dsk) - dstatus = rbd.CombinedSyncStatus() - - stats.append((dstatus.sync_percent, dstatus.estimated_time, - dstatus.is_degraded, dstatus.ldisk_degraded)) + stats.append(rbd.CombinedSyncStatus()) return stats diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 23d4ae1c0076ab8c3549652a8396e32a21962a84..9ef79ede9586c1e2aaef935612c715bd3e1a88f0 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -1833,18 +1833,18 @@ def _WaitForSync(lu, instance, oneshot=False, unlock=False): lu.LogWarning("Can't compute data for node %s/%s", node, instance.disks[i].iv_name) continue - # we ignore the ldisk parameter - perc_done, est_time, is_degraded, _ = mstat - cumul_degraded = cumul_degraded or (is_degraded and perc_done is None) - if perc_done is not None: + + cumul_degraded = (cumul_degraded or + (mstat.is_degraded and mstat.sync_percent is None)) + if mstat.sync_percent is not None: done = False - if est_time is not None: - rem_time = "%d estimated seconds remaining" % est_time - max_time = est_time + if mstat.estimated_time is not None: + rem_time = "%d estimated seconds remaining" % mstat.estimated_time + max_time = mstat.estimated_time else: rem_time = "no time estimate" lu.proc.LogInfo("- device %s: %5.2f%% done, %s" % - (instance.disks[i].iv_name, perc_done, rem_time)) + (instance.disks[i].iv_name, mstat.sync_percent, rem_time)) # if we're done but degraded, let's do a few small retries, to # make sure we see a stable and not transient situation; therefore diff --git a/lib/rpc.py b/lib/rpc.py index bb665bfb8128ee7e9e117c712bf6a8891dc39dab..289b9fb2aab92eec62cfc6af3950349ce64e57f5 100644 --- a/lib/rpc.py +++ b/lib/rpc.py @@ -799,8 +799,12 @@ class RpcRunner(object): This is a single-node call. """ - return self._SingleNodeCall(node, "blockdev_getmirrorstatus", - [dsk.ToDict() for dsk in disks]) + result = self._SingleNodeCall(node, "blockdev_getmirrorstatus", + [dsk.ToDict() for dsk in disks]) + if not result.failed: + result.payload = [objects.BlockDevStatus.FromDict(i) + for i in result.payload] + return result def call_blockdev_find(self, node, disk): """Request identification of a given block device.