|
Lines 403-408
Link Here
|
| 403 |
# for all architectures/hypervisors, as this value rises to |
403 |
# for all architectures/hypervisors, as this value rises to |
| 404 |
# meet them. |
404 |
# meet them. |
| 405 |
MIN_LIBVIRT_VERSION = (0, 10, 2) |
405 |
MIN_LIBVIRT_VERSION = (0, 10, 2) |
|
|
406 |
MIN_QEMU_VERSION = (2, 1, 0) |
| 406 |
# TODO(berrange): Re-evaluate this at start of each release cycle |
407 |
# TODO(berrange): Re-evaluate this at start of each release cycle |
| 407 |
# to decide if we want to plan a future min version bump. |
408 |
# to decide if we want to plan a future min version bump. |
| 408 |
# MIN_LIBVIRT_VERSION can be updated to match this after |
409 |
# MIN_LIBVIRT_VERSION can be updated to match this after |
|
Lines 482-487
Link Here
|
| 482 |
# libvirt 1.3 fix f391889f4e942e22b9ef8ecca492de05106ce41e |
483 |
# libvirt 1.3 fix f391889f4e942e22b9ef8ecca492de05106ce41e |
| 483 |
MIN_LIBVIRT_PF_WITH_NO_VFS_CAP_VERSION = (1, 3, 0) |
484 |
MIN_LIBVIRT_PF_WITH_NO_VFS_CAP_VERSION = (1, 3, 0) |
| 484 |
|
485 |
|
|
|
486 |
# qemu >= 2.10.0 |
| 487 |
# Use '--force-share' to skip image locking during qemu-img info |
| 488 |
# execution as running qemu process owns the write lock. |
| 489 |
MIN_QEMU_FORCE_SHARE = (2, 10, 0) |
| 490 |
|
| 485 |
# ppc64/ppc64le architectures with KVM |
491 |
# ppc64/ppc64le architectures with KVM |
| 486 |
# NOTE(rfolco): Same levels for Libvirt/Qemu on Big Endian and Little |
492 |
# NOTE(rfolco): Same levels for Libvirt/Qemu on Big Endian and Little |
| 487 |
# Endian giving the nuance around guest vs host architectures |
493 |
# Endian giving the nuance around guest vs host architectures |
|
Lines 580-585
Link Here
|
| 580 |
self._remotefs = remotefs.RemoteFilesystem() |
586 |
self._remotefs = remotefs.RemoteFilesystem() |
| 581 |
|
587 |
|
| 582 |
self._live_migration_flags = self._block_migration_flags = None |
588 |
self._live_migration_flags = self._block_migration_flags = None |
|
|
589 |
|
| 590 |
# Assume pre 2.10 version of qemu is in use |
| 591 |
self._force_share = False |
| 583 |
|
592 |
|
| 584 |
def _get_volume_drivers(self): |
593 |
def _get_volume_drivers(self): |
| 585 |
return libvirt_volume_drivers |
594 |
return libvirt_volume_drivers |
|
Lines 664-669
Link Here
|
| 664 |
_('Nova requires libvirt version %s or greater.') % |
673 |
_('Nova requires libvirt version %s or greater.') % |
| 665 |
self._version_to_string(MIN_LIBVIRT_VERSION)) |
674 |
self._version_to_string(MIN_LIBVIRT_VERSION)) |
| 666 |
|
675 |
|
|
|
676 |
if CONF.libvirt.virt_type in ("qemu", "kvm"): |
| 677 |
if self._host.has_min_version(hv_ver=MIN_QEMU_VERSION): |
| 678 |
self._force_share = ( |
| 679 |
self._host.has_min_version(hv_ver=MIN_QEMU_FORCE_SHARE) |
| 680 |
) |
| 681 |
else: |
| 682 |
raise exception.InternalError( |
| 683 |
_('Nova requires QEMU version %s or greater.') % |
| 684 |
self._version_to_string(MIN_QEMU_VERSION)) |
| 685 |
|
| 667 |
if (CONF.libvirt.virt_type == 'parallels' and |
686 |
if (CONF.libvirt.virt_type == 'parallels' and |
| 668 |
not self._host.has_min_version(MIN_LIBVIRT_PARALLELS_VERSION)): |
687 |
not self._host.has_min_version(MIN_LIBVIRT_PARALLELS_VERSION)): |
| 669 |
raise exception.NovaException( |
688 |
raise exception.NovaException( |
|
Lines 1858-1871
Link Here
|
| 1858 |
# in QEMU 1.3. In order to do this, we need to create |
1877 |
# in QEMU 1.3. In order to do this, we need to create |
| 1859 |
# a destination image with the original backing file |
1878 |
# a destination image with the original backing file |
| 1860 |
# and matching size of the instance root disk. |
1879 |
# and matching size of the instance root disk. |
| 1861 |
src_disk_size = libvirt_utils.get_disk_size(disk_path, |
1880 |
src_disk_size = libvirt_utils.get_disk_size( |
| 1862 |
format=source_format) |
1881 |
disk_path, |
| 1863 |
src_back_path = libvirt_utils.get_disk_backing_file(disk_path, |
1882 |
format=source_format, |
| 1864 |
format=source_format, |
1883 |
force_share=self._force_share |
| 1865 |
basename=False) |
1884 |
) |
|
|
1885 |
src_back_path = libvirt_utils.get_disk_backing_file( |
| 1886 |
disk_path, |
| 1887 |
format=source_format, |
| 1888 |
basename=False, |
| 1889 |
force_share=self._force_share |
| 1890 |
) |
| 1866 |
disk_delta = out_path + '.delta' |
1891 |
disk_delta = out_path + '.delta' |
| 1867 |
libvirt_utils.create_cow_image(src_back_path, disk_delta, |
1892 |
libvirt_utils.create_cow_image( |
| 1868 |
src_disk_size) |
1893 |
src_back_path, disk_delta, |
|
|
1894 |
src_disk_size, |
| 1895 |
force_share=self._force_share |
| 1896 |
) |
| 1869 |
|
1897 |
|
| 1870 |
quiesced = False |
1898 |
quiesced = False |
| 1871 |
try: |
1899 |
try: |
|
Lines 6996-7003
Link Here
|
| 6996 |
|
7024 |
|
| 6997 |
disk_type = driver_nodes[cnt].get('type') |
7025 |
disk_type = driver_nodes[cnt].get('type') |
| 6998 |
if disk_type == "qcow2": |
7026 |
if disk_type == "qcow2": |
| 6999 |
backing_file = libvirt_utils.get_disk_backing_file(path) |
7027 |
backing_file = libvirt_utils.get_disk_backing_file( |
| 7000 |
virt_size = disk.get_disk_size(path) |
7028 |
path, |
|
|
7029 |
force_share=self._force_share |
| 7030 |
) |
| 7031 |
virt_size = disk.get_disk_size( |
| 7032 |
path, |
| 7033 |
force_share=self._force_share |
| 7034 |
) |
| 7001 |
over_commit_size = int(virt_size) - dk_size |
7035 |
over_commit_size = int(virt_size) - dk_size |
| 7002 |
else: |
7036 |
else: |
| 7003 |
backing_file = "" |
7037 |
backing_file = "" |