diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-02 06:05:47 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-02 06:05:47 +0000 |
| commit | ed7bce81383db458ea79a2ce18e8b18478cfe7ec (patch) | |
| tree | bf4def28430d94452c49b24efd33b07e7a5e8ff5 /nova/virt | |
| parent | 44884cf18778995c3fa92297e143e31ec26e9901 (diff) | |
| parent | a4cb456631f0e70685fbc361eced9baa477a8c56 (diff) | |
| download | nova-ed7bce81383db458ea79a2ce18e8b18478cfe7ec.tar.gz nova-ed7bce81383db458ea79a2ce18e8b18478cfe7ec.tar.xz nova-ed7bce81383db458ea79a2ce18e8b18478cfe7ec.zip | |
Merge "Volume IO usage gets reset to 0 after a reboot / crash"
Diffstat (limited to 'nova/virt')
| -rwxr-xr-x | nova/virt/libvirt/driver.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index c365c5fdd..e8a0a46eb 100755 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2731,20 +2731,28 @@ class LibvirtDriver(driver.ComputeDriver): mountpoint = bdm['device_name'] if mountpoint.startswith('/dev/'): mountpoint = mountpoint[5:] + volume_id = bdm['volume_id'] LOG.debug(_("Trying to get stats for the volume %s"), - bdm['volume_id']) + volume_id) vol_stats = self.block_stats(instance['name'], mountpoint) if vol_stats: - rd_req, rd_bytes, wr_req, wr_bytes, flush_ops = vol_stats - vol_usage.append(dict(volume=bdm['volume_id'], - instance=instance, - rd_req=rd_req, - rd_bytes=rd_bytes, - wr_req=wr_req, - wr_bytes=wr_bytes, - flush_operations=flush_ops)) + stats = dict(volume=volume_id, + instance=instance, + rd_req=vol_stats[0], + rd_bytes=vol_stats[1], + wr_req=vol_stats[2], + wr_bytes=vol_stats[3], + flush_operations=vol_stats[4]) + LOG.debug( + _("Got volume usage stats for the volume=%(volume)s," + " instance=%(instance)s, rd_req=%(rd_req)d," + " rd_bytes=%(rd_bytes)d, wr_req=%(wr_req)d," + " wr_bytes=%(wr_bytes)d") + % stats) + vol_usage.append(stats) + return vol_usage def block_stats(self, instance_name, disk): @@ -2757,7 +2765,8 @@ class LibvirtDriver(driver.ComputeDriver): except libvirt.libvirtError as e: errcode = e.get_error_code() LOG.info(_("Getting block stats failed, device might have " - "been detached. Code=%(errcode)s Error=%(e)s") + "been detached. Instance=%(instance_name)s " + "Disk=%(disk)s Code=%(errcode)s Error=%(e)s") % locals()) except exception.InstanceNotFound: LOG.info(_("Could not find domain in libvirt for instance %s. " |
