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)
Reviewed: https:/ /review. openstack. org/604295 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b58805753ab 54e02d8377ba80c 740eebe7a34ddd
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit b58805753ab54e0 2d8377ba80c740e ebe7a34ddd
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 07209be2beaae0d bbdf5d2ba3f c49114a41917069 3ff15d5545) b83f52195d4ffd0 bfee050e19)
Change-Id: Ic5c41493dcdcd8
(cherry picked from commit e6af812865553fb
(cherry picked from commit bda6173a8430c3b