Comment 15 for bug 1785827

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/604295
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b58805753ab54e02d8377ba80c740eebe7a34ddd
Submitter: Zuul
Branch: stable/queens

commit b58805753ab54e02d8377ba80c740eebe7a34ddd
Author: Lee Yarwood <email address hidden>
Date: Thu Aug 9 13:45:13 2018 +0100

    libvirt: Use os.stat and os.path.getsize for RAW disk inspection

    At present when inspecting a file based image we always use ``qemu-img`` to
    determine the virtual size of the image. This works well but can lead to
    the resource tracker taking considerable time to update on hosts with
    a large number of instances/images.

    This change switches to using os.stat and os.path.getsize to determine
    the allocated and virtual disk sizes of RAW disks.

    Future changes will look into caching the virtual size of the disk
    within disk.info locally on the host to also improve this for qcow2 and
    ploop, further simplifying this code path.

    Closes-bug: #1785827
    Change-Id: Ic5c41493dcdcd807209be2beaae0dbbdf5d2ba3f
    (cherry picked from commit e6af812865553fbc49114a419170693ff15d5545)
    (cherry picked from commit bda6173a8430c3bb83f52195d4ffd0bfee050e19)