diff --git a/nova/conf/workarounds.py b/nova/conf/workarounds.py index e819a8cd2da6..a53247759019 100644 --- a/nova/conf/workarounds.py +++ b/nova/conf/workarounds.py @@ -66,7 +66,7 @@ Interdependencies to other options: cfg.BoolOpt( 'disable_libvirt_livesnapshot', - default=True, + default=False, help=""" Disable live snapshots when using the libvirt driver. diff --git a/nova/tests/unit/virt/libvirt/fake_libvirt_utils.py b/nova/tests/unit/virt/libvirt/fake_libvirt_utils.py index 0b56cbdc71c6..e6de57c4f4c5 100644 --- a/nova/tests/unit/virt/libvirt/fake_libvirt_utils.py +++ b/nova/tests/unit/virt/libvirt/fake_libvirt_utils.py @@ -30,7 +30,7 @@ def create_image(disk_format, path, size): pass -def create_cow_image(backing_file, path): +def create_cow_image(backing_file, path, size=None): pass diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index fe54dc75e7f9..8e63fd5d8791 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -454,6 +454,7 @@ class FakeVirtDomain(object): else: self._fake_dom_xml = """ + testinstance1 @@ -510,6 +511,9 @@ class FakeVirtDomain(object): def blockJobInfo(self, path, flags): pass + def blockJobAbort(self, path, flags): + pass + def resume(self): pass @@ -528,6 +532,9 @@ class FakeVirtDomain(object): def isPersistent(self): return True + def undefine(self): + return True + class CacheConcurrencyTestCase(test.NoDBTestCase): def setUp(self): @@ -18998,6 +19005,14 @@ class _BaseSnapshotTests(test.NoDBTestCase): class LibvirtSnapshotTests(_BaseSnapshotTests): + + def setUp(self): + super(LibvirtSnapshotTests, self).setUp() + # All paths through livesnapshot trigger a chown behind privsep + self.privsep_chown = mock.patch.object(nova.privsep.path, 'chown') + self.addCleanup(self.privsep_chown.stop) + self.privsep_chown.start() + def test_ami(self): # Assign different image_ref from nova/images/fakes for testing ami self.instance_ref.image_ref = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77' diff --git a/releasenotes/notes/live_snapshot_by_default-f231485fc2bf77f1.yaml b/releasenotes/notes/live_snapshot_by_default-f231485fc2bf77f1.yaml new file mode 100644 index 000000000000..4dd334426082 --- /dev/null +++ b/releasenotes/notes/live_snapshot_by_default-f231485fc2bf77f1.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + Nova now defaults to using the live snapshot feature of libvirt + when taking snapshots. This was previously disabled by default due + to crashes on load seen with older libvirt versions. It has been + used in production by many clouds, and appears stable in real + world environments. If you see crashes of guests during snapshots, + you can disable this with the ``disable_libvirt_livesnapshot`` + config value in ``[workarounds]``.