OpenStack Compute (Nova)
Go to file
Matthew Booth a8b52c05ed VMware: Fix race in spawn() when resizing cached image
spawn() guards against multiple threads simultaneously attempting to
cache the same image, but it wasn't guarding against them
simultanously trying to create a resized copy in the cache. Attempting
to create a large number of images simultaneously of an uncached image
would result in a race to create the resized image. This resulted in 2
classes of failed instance:

1. Instances whose disk was a linked clone of a copy which had been
   subsequently overwritten. These were corrupt.
2. Instances whose spawn() failed in ExtendVirtualDisk_Task due to a
   locked image.

This patch creates a Nova-local lock for the resized image. The image
is in a per-Nova directory on the datastore, so inter-Nova locking is
not a concern. The lock guards both testing for the existence of the
image, and its creation. Therefore when multiple processes race, only
1 will create the resized copy, and all others will find and use it.
In normal usage this will add the overhead of an additional
uncontended local lock creation and deletion in spawn().

In wrapping this code in a lock, we also make certain that any failure
to create the resized image is appropriately cleaned up. Otherwise
subsequent users will attempt to use a corrupt copy.

Conflicts:
	nova/virt/vmwareapi/vmops.py

Required changes:
  datastore.build_path -> ds_util.build_datastore_path
  No datastore object
  vm_util.copy_virtual_disk -> _copy_virtual_disk
  self.fake_image_uuid -> 'fake_image_uuid'
  removed use of _LE() for log message

This change includes a test which depends on change
I2025bffa887582eaa9e9072d0400f90ca97d1898.

Change-Id: I3df3d614656e511c909b6c1837582c0d34bf84c6
Closes-bug: 1333587
(cherry picked from commit 994cdb234b)
2014-07-15 13:31:31 +01:00
contrib Merge "changed quantum to neutron in vif-openstack" 2014-03-05 10:45:05 +00:00
doc Revert "Remove broken quota-classes API" 2014-06-10 13:13:25 -07:00
etc/nova Revert "Remove broken quota-classes API" 2014-06-10 13:13:25 -07:00
nova VMware: Fix race in spawn() when resizing cached image 2014-07-15 13:31:31 +01:00
plugins/xenserver Merge "Rename Openstack to OpenStack" 2014-03-18 01:17:47 +00:00
tools Re-work how debugger CLI opts are registered 2014-03-25 06:44:50 -04:00
.coveragerc Port Cheetah templates to Jinja2 2013-09-02 16:03:34 +02:00
.gitignore Add nova.conf.sample to gitignore 2014-03-27 11:57:42 -07:00
.gitreview Opening stable/icehouse 2014-04-17 14:41:19 +02:00
.mailmap Update the mailmap 2014-02-15 09:59:26 +08:00
.testr.conf Fix tests to work with mysql+postgres concurrently 2013-10-27 09:46:45 +11:00
CONTRIBUTING.rst Fix the section name in CONTRIBUTING.rst 2014-03-28 12:12:11 +01:00
HACKING.rst Replace assertEqual(None, *) with assertIsNone in tests 2014-02-16 17:31:28 +08:00
LICENSE initial commit 2010-05-27 23:05:26 -07:00
MANIFEST.in Finish AUTHORS transition. 2012-07-05 09:11:37 -05:00
README.rst Update references with new Mailing List location 2013-07-28 11:28:46 -07:00
babel.cfg Get rid of distutils.extra. 2012-02-08 19:30:39 -08:00
openstack-common.conf notifier middleware broken by oslo.messaging 2014-03-04 16:58:50 -05:00
pylintrc Don't warn about C0111 (No docstrings) 2011-03-16 15:28:09 -07:00
requirements.txt Updated from global requirements 2014-03-27 16:37:27 +00:00
run_tests.sh Fix run_tests.sh lockutils when run with -d 2014-02-10 14:16:13 +01:00
setup.cfg Bump stable/icehouse next version to 2014.1.2 2014-06-24 01:10:22 +02:00
setup.py Updated from global requirements 2013-09-05 11:12:57 -04:00
test-requirements.txt Updated from global requirements 2014-02-24 22:28:31 +00:00
tox.ini Tell pip to install packages it sees globally 2014-03-25 12:16:48 -07:00

README.rst

OpenStack Nova README

OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of virtualization technologies, including KVM, Xen, LXC, VMware, and more. In addition to its native API, it includes compatibility with the commonly encountered Amazon EC2 and S3 APIs.

OpenStack Nova is distributed under the terms of the Apache License, Version 2.0. The full terms and conditions of this license are detailed in the LICENSE file.

Nova primarily consists of a set of Python daemons, though it requires and integrates with a number of native system components for databases, messaging and virtualization capabilities.

To keep updated with new developments in the OpenStack project follow @openstack on Twitter.

To learn how to deploy OpenStack Nova, consult the documentation available online at:

http://docs.openstack.org

For information about the different compute (hypervisor) drivers supported by Nova, read this page on the wiki:

https://wiki.openstack.org/wiki/HypervisorSupportMatrix

In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:

http://bugs.launchpad.net/nova

Developers wishing to work on the OpenStack Nova project should always base their work on the latest Nova code, available from the master GIT repository at:

http://github.com/openstack/nova

Developers should also join the discussion on the mailing list, at:

http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests. Further developer focused documentation is available at:

http://nova.openstack.org/

For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst file.

-- End of broadcast