Zhiteng Huang [Thu, 21 Nov 2013 09:02:23 +0000 (17:02 +0800)]
Pull latest service module from Oslo
Get latest service module from Oslo to prepare for multi-process API service implementation.
Below are the commits included in this pull.
Changes being pulled into in service module are:
* e7bc8c9 2013-11-20 | Merge "os._exit in _start_child may cause unexpected exception"
* 96a2d4e 2013-11-07 | os._exit in _start_child may cause unexpected exception
* 1771a77 2013-11-05 | Adjust import order according to PEP8 imports rule
* 3110c0f 2013-10-17 | Use multiprocessing.Event to ensure services have started
* b5fba9e 2013-09-18 | Move comment in service.py to correct location
* 11cc74f 2013-08-26 | Fixes issue with SUGHUP in services on Windows
* 825ace5 2013-06-17 | Add service restart function in oslo-incubator
* c935d1c 2013-07-16 | Merge "Allow launchers to be stopped multiple times"
* dc8aa79 2013-07-08 | Allow launchers to be stopped multiple times
* 1a2df89 2013-06-25 | Enable H302 hacking check
* 52e857a 2013-06-19 | Ignore any exceptions from rpc.cleanup().
* 5518ad3 2013-05-16 | Add graceful service shutdown support to Launcher
And these dependent modules
- cinder/openstack/common/eventlet_backdoor.py
* 1dcc747 2013-07-15 | Fix stylistic problems with help text
* 1a2df89 2013-06-25 | Enable H302 hacking check
* c7c55b2 2013-06-20 | Improve usability when backdoor_port is nonzero
- cinder/openstack/common/gettextutils.py
* 3970d46 2013-11-02 | Fix typos in oslo
* 88db9c8 2013-10-03 | When translating if no locale is given use default locale
- cinder/openstack/common/jsonutils.py
* 3d7504b 2013-09-23 | Ensure that Message objects will be sent via RPC in unicode format
* 1807d32 2013-08-22 | jsonutils: make types py3 compatible
* bdef862 2013-08-22 | jsonutils: do not require xmlrpclib
* ded9bd6 2013-08-04 | Make dependency on netaddr optional
* 7b7566b 2013-06-25 | Add netaddr.IPAddress support to to_primitive()
- cinder/openstack/common/local.py
* cb2a2b6 2013-06-28 | Modify local.py to not be dependent on Eventlet
* 547ab34 2013-03-11 | Fix Copyright Headers - Rename LLC to Foundation
- cinder/openstack/common/log.py
* a82e889 2013-11-14 | Merge "Do not name variables as builtins"
* 2251cb5 2013-11-13 | Do not name variables as builtins
* 25c5854 2013-11-13 | Adds admin_password as key to be sanitized when logging
* cbfded9 2013-11-11 | Default iso8601 logging to WARN
* 76b0cd1 2013-11-04 | Add mask password impl from other projects
- cinder/openstack/common/loopingcall.py
* 1a2df89 2013-06-25 | Enable H302 hacking check
- cinder/openstack/common/threadgroup.py
* 9d3c34b 2013-10-25 | Add a link method to Thread
* 1a2df89 2013-06-25 | Enable H302 hacking check
- cinder/openstack/common/timeutils.py
* f3b5f17 2013-11-12 | Add helper method total_seconds in timeutils.py
* 53ebd30 2013-10-18 | python3: use six.text_types for unicode()
* 3bc6f79 2013-09-19 | Fix timeutils.set_override_time not defaulting to current wall time
* af76064 2013-08-29 | Optimize timeutils.utcnow_ts()
* df3f2ba 2013-07-26 | BaseException.message is deprecated since Python 2.6
* d28fa69 2013-06-27 | python3: Add python3 compatibility.
Jon Bernard [Tue, 19 Nov 2013 17:06:52 +0000 (12:06 -0500)]
Remove suffixes from LVM brick test vgs output
When fake_execute() is called to retrieve volume group information, the
--nosuffix flag is passed but ignored. This patch honors the nosuffix
flag and removes the unit suffix from the volume group sizes in the
returned output.
John Griffith [Mon, 11 Nov 2013 21:57:44 +0000 (14:57 -0700)]
Subclass vendor specific exceptions.
Up until now drivers have been able to define their
own custom exception classes. In most cases these are
inherited from either a native python exception class
or at best the base cinder exception class.
The problem with this is that it makes it very difficult
for higher layers (such as volume manager) to do any intelligent
exception handling and the base Cinder.exception class is too broad.
This change takes the first step in cleaning this up. We create
new exception classes for all drivers to inherit from:
VolumeDriverException
VolumeBackendAPIException
BackupDriverException
This still allows the freedom to create custom exceptions for a
particular driver, however it also gives us a common exception
class to catch and check in higher levels. Further refinement
and standardization will be helpful going forward but this
should give us a good start.
Eric Harney [Thu, 14 Nov 2013 20:51:15 +0000 (15:51 -0500)]
GlusterFS: Synchronize operations that manipulate qcow2 data
Operations that modify qcow2 chains or the GlusterFS driver's
snapshot info file should use locking so that more than one thread
cannot run these operations at the same time.
Without this it is possible for multiple threads to concurrently
modify snapshot information resulting in an incomplete snapshot
chain.
Luis A. Garcia [Tue, 5 Nov 2013 20:41:02 +0000 (20:41 +0000)]
Use cached volumes in REST API extensions
This patch caches db volumes in the core volumes API so that they can be
used in the host and tenant attribute API extensions in order to lower
the response time by avoiding costly individual db queries for each
volume in the REST API contributions.
Luis A. Garcia [Tue, 5 Nov 2013 19:37:27 +0000 (19:37 +0000)]
Enable object caching in cinder REST API requests
Allow the core API to cache resources, such as DB results, so that
extensions can use data already retrieved within the same API request
eliminating additional expensive DB calls.
Xavier Queralt [Tue, 22 Oct 2013 18:37:53 +0000 (20:37 +0200)]
Fail when image is bigger than the volume
When creating a new volume from a qcow2 image stored in glance, we will
be given the physical size of the image instead of the virtual size.
Most drivers will convert that image to raw after downloading for
resizing it to the requested volume size afterwards.
If the virtual size of the image is bigger than the requested one, the
resulting volume might end up being unusable after the resize even
though the creation went good.
This patch will make the volume creation fail if the virtual size of
the image exceeds the one of the requested volume.
Joe Gordon [Mon, 11 Nov 2013 19:28:18 +0000 (11:28 -0800)]
Update URL for global HACKING document and remove duplicate section
* Related to I579e7c889f3addc2cd40bce0c584bbc70bf435e2
* Remove section on locals since its already in global hacking doc
(http://git.openstack.org/cgit/openstack-dev/hacking/tree/doc/source/index.rst#n154)
Luis A. Garcia [Tue, 5 Nov 2013 02:22:30 +0000 (02:22 +0000)]
Retrieve volume image metadata using single query
The image metadata REST API contributions are making an individual db
call for each of the available volumes. When the number of volumes is
large the volume details call can take several minutes.
This patch changes the image metadata API contributions to take
advantage of the new db query to retrieve metadata in bulk.
Luis A. Garcia [Tue, 5 Nov 2013 02:19:02 +0000 (02:19 +0000)]
Add call to retrieve image metadata for volumes in bulk
When using the GET volume details REST API call, the image metadata API
contribution is making an individual db call for each of the available
volumes. When the number of volumes is large the details call can take
several minutes.
This patch adds a call to the volume.API to retrieve image metadata in
bulk, very similar to the one used to retrieve individual volume image
metadata.
zhaoqin [Fri, 8 Nov 2013 18:27:49 +0000 (02:27 +0800)]
Do not remove volume silently if GPFS is unmounted
When GPFS is not mounted, delete_volume() will complete successfully, so that
volume record is removed by cinder but volume file still resides on GPFS. This
change will prevent cinder to remove volume when GPFS is not mounted.
zhaoqin [Fri, 8 Nov 2013 17:45:02 +0000 (01:45 +0800)]
Report zero capacity if GPFS is unmounted
_get_available_capacity() calls df command to gather the capacity of GPFS
filesystem. If GPFS is unmounted, df command will return the capacity of
root file system. This change will let get_volume_stats() to report zero
capacity, so that Cinder can schedule the volume request to another volume
service After GPFS is mounted again, the correct capacity will be reported.
LiuSheng [Thu, 7 Nov 2013 01:27:05 +0000 (09:27 +0800)]
RequestContext initialization failed in cinder.
RequestContext initialization failed in cinder because of the following
error:
"TypeError: 'in <string>' requires string as left operand, not NoneType"
It must traverses in tuple not in string when find the "compute"
service_catalog.
keystone [Mon, 28 Oct 2013 19:29:24 +0000 (12:29 -0700)]
Nexenta: Remove snapshot after volume-clone deletion.
Detect if volume was created via cloning and remove a snapshot from the
appliance if so. Return 'provider_location' to update the volume DB record
after creating a volume via cloning.
Chang Bo Guo [Wed, 6 Nov 2013 12:19:37 +0000 (04:19 -0800)]
Don't use deprecated module commands
The commands module was deprecated since version 2.6 and it has been
removed in Python 3. Use the subprocess module instead.
See http://docs.python.org/2/library/commands#module-commands
zhangyanzi [Sat, 26 Oct 2013 01:39:58 +0000 (09:39 +0800)]
Support volume_readonly_update using XML format
Almost all API support JSON and XML format together,
But this API does not support xml format.
In the request of xml format,
the type of parameter "readonly" in the body is string.
In the request of JSON format,
the type of parameter "readonly" in the body is bool.
But the code only support bool, not support string.
This branch is to solve this problem.
John Griffith [Thu, 31 Oct 2013 16:14:57 +0000 (10:14 -0600)]
Remove lvm-thin pool_size config option
The pool_size config option when using thin LVM
is never actually checked/honored. It's also unlikely
that users will want to do something other than use the
entire VG for their thin pool.
Rather than have the unused option going forward let's
remove it from the config and just go with the default
behavior of utilizing the entire Cinder VG.
For folks that would like to only use a portion of the
VG for some reason, they can do an lvcreate pool on their
own (just like we have them do for the VG itself) and get
the same flexibility that way.
This is done simply by:
lvcreate -T -L ${size} ${vg-name}/${vg_name}-pool
Qin Zhao [Wed, 30 Oct 2013 16:37:43 +0000 (00:37 +0800)]
Examine if GPFS is mounted before writing data.
If GPFS is not mounted, throw an exception and log the error message. That will
prevent create_volume(), copy_image_to_volume() or _clone_image() to create
file on local disk, which can not be removed by the driver code itself.
Chang Bo Guo [Thu, 31 Oct 2013 02:21:22 +0000 (19:21 -0700)]
Sync log from oslo
5fef5a8105 allow keeping of existing loggers with fileConfig fb8075a19d Add amqp=WARN,qpid=WARN to default_log_levels 4654a5d247 Don't override default value for eventlet.wsgi.server logging 41ddd7a975 _get_log_file_path explictly return, when logfile/logdire unset e12e6b45f8 Make openstack.common.log Python 3 compatible 572cfecb4d Make Messages unicode before hitting logging 3243cdfbe9 python3: handle module moves in log
Luis A. Garcia [Tue, 29 Oct 2013 18:44:12 +0000 (18:44 +0000)]
Allow spaces in quoted SSH command arguments
The check_ssh_injection() method was rejecting arguments with spaces
even when they were quoted, this was causing problems with some volume
driver commands such as commands for a storage pool with spaces in the
name.
We now use a piped transfer between the rbd export-diff
and import-diff for incremental backups/restores as
opposed to holding the entire diff in memory.
Dan Prince [Mon, 28 Oct 2013 14:11:24 +0000 (10:11 -0400)]
Add cinder.db.migration.db_initial_version()
Updates Cinder to use a new function called db_initial_version()
instead of the INIT_VERSION constant. This allows us to
move the top level INIT_VERSION constant into the
sqlalchemy migration.py implementation where it belongs.