From cc1e97cc0de4967e549cefd00216a53b5776bed7 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Thu, 23 Aug 2012 22:43:06 +1000 Subject: [PATCH] External locking for image caching. If the instance storage is shared between compute nodes, then you need external locking which is also shared to avoid clobbering each other's attempts to cache base images. Resolves bug 1014227. Change-Id: Ic2ac87840904fa199c17774dae9556ad6c7a3eaf --- nova/tests/test_imagebackend.py | 3 ++- nova/tests/test_xenapi.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/nova/tests/test_imagebackend.py b/nova/tests/test_imagebackend.py index e34f35f7..f0bb7182 100644 --- a/nova/tests/test_imagebackend.py +++ b/nova/tests/test_imagebackend.py @@ -35,7 +35,8 @@ class _ImageTestCase(test.TestCase): def setUp(self): super(_ImageTestCase, self).setUp() - self.flags(instances_path=self.INSTANCES_PATH) + self.flags(disable_process_locking=True, + instances_path=self.INSTANCES_PATH) self.INSTANCE = 'instance' self.NAME = 'fake.vm' self.TEMPLATE = 'template' diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 098e4eee..ea6ed857 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -146,10 +146,11 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase): self.user_id = 'fake' self.project_id = 'fake' self.context = context.RequestContext(self.user_id, self.project_id) - self.flags(xenapi_connection_url='test_url', - xenapi_connection_password='test_pass', + self.flags(disable_process_locking=True, firewall_driver='nova.virt.xenapi.firewall.' - 'Dom0IptablesFirewallDriver') + 'Dom0IptablesFirewallDriver', + xenapi_connection_url='test_url', + xenapi_connection_password='test_pass') db_fakes.stub_out_db_instance_api(self.stubs) self.instance_values = {'id': 1, 'project_id': self.user_id, @@ -260,11 +261,12 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): def setUp(self): super(XenAPIVMTestCase, self).setUp() self.network = importutils.import_object(FLAGS.network_manager) - self.flags(xenapi_connection_url='test_url', - xenapi_connection_password='test_pass', + self.flags(disable_process_locking=True, instance_name_template='%d', firewall_driver='nova.virt.xenapi.firewall.' - 'Dom0IptablesFirewallDriver') + 'Dom0IptablesFirewallDriver', + xenapi_connection_url='test_url', + xenapi_connection_password='test_pass',) xenapi_fake.create_local_srs() xenapi_fake.create_local_pifs() db_fakes.stub_out_db_instance_api(self.stubs)