Change livesnapshot to true by default

Because of past qemu bugs we set this to default off and required a
workaround to enable it. However these issues appear to be fixed, and
we should enable this by default for people (with the ability to turn
it off if it's causing crashes in their environment). Metacloud/Cisco
has been running default this way the entire time without issue.

Change-Id: I4545cc99683d311c41c8d6d8dc9787ea6ec6cbc9
This commit is contained in:
Sean Dague 2017-04-06 16:00:42 -04:00
parent 902a374012
commit 980d0fcd75
4 changed files with 27 additions and 2 deletions

View File

@ -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.

View File

@ -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

View File

@ -454,6 +454,7 @@ class FakeVirtDomain(object):
else:
self._fake_dom_xml = """
<domain type='kvm'>
<name>testinstance1</name>
<devices>
<disk type='file'>
<source file='filename'/>
@ -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'

View File

@ -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]``.