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.
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.
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.
Eric Harney [Thu, 24 Oct 2013 20:18:54 +0000 (16:18 -0400)]
GlusterFS: set correct filename when cloning volume
When cloning a volume, the volume[name] field was populated
with incorrect data, resulting in an unexpected filename containing
the volume data. This results in failures of later operations on
that cloned volume.
John Griffith [Wed, 23 Oct 2013 20:08:30 +0000 (20:08 +0000)]
Handle NotFound exceptions in API
There were a number of calls in the API that
weren't catching NotFound exceptions. The result is
unhandled exception traces and errors in the logs on good
runs in tempest.
Basicly any negative test that requests a non-existent element
would result in an unhandled exception. This patch adds try/except
around the volume_api.getxxx calls in cinder/api/... methods to
clean this up.
Michael Kerrin [Thu, 24 Oct 2013 15:17:47 +0000 (15:17 +0000)]
Unit test fails in pbuilder environment
When running tests inside a pbuilder environment we don't
have /dev/disk/by-path directory and so the test_host_driver
test fails. Fix test by overriding the isdir method to
return True and pretend that the directory is there.
John Griffith [Thu, 24 Oct 2013 00:04:51 +0000 (18:04 -0600)]
Check if dir exists before calling listdir
Changes along the way to how we clean up and detach after
copying an image to a volume exposed a problem in the cleanup
of the brick/initiator routines.
The clean up in the initiator detach was doing a blind listdir
of /dev/disk/by-path, however due to detach and cleanup being
called upon completion of the image download to the volume if
there are no other devices mapped in this directory the directory
is removed.
The result was that even though the create and copy of the image
was succesful, the HostDriver code called os.lisdir on a directory
that doesn't exist any longer and raises an unhandled exception that
cause the taskflow mechanism to mark the volume as failed.
Victor Rodionov [Wed, 16 Oct 2013 18:00:16 +0000 (11:00 -0700)]
Nexenta drivers ignore "does not exist" exception
Ignore "does not exist" exception in NFS and iSCSI driver,
delete_volume and delete_snapshot methods.
This exceptions means that the volume or the snapshot not exists in the
backend, so we can avoid "delete" errors, when the resource was already
deleted.
liudong [Tue, 22 Oct 2013 10:37:50 +0000 (18:37 +0800)]
Fix volume transfer href issue
The volume transfer collection in url defined as "os-volume-tranfer",
but I got another define "tranfers" in href url. They are different.
So it should be modify.
Navneet Singh [Mon, 21 Oct 2013 20:11:11 +0000 (01:41 +0530)]
NetApp unit test fail fix for http_proxy
The environment having http_proxy settings caused
the unit tests to fail with 404 error. This fix
handles both situations with proxy or without
proxy settings.
Navneet Singh [Sun, 20 Oct 2013 13:00:36 +0000 (18:30 +0530)]
Brick connector fix for NFS drivers
This change fixes the error that comes
while getting brick connector and attaching volumes
in case of NFS drivers in cinder. The attribute for
mount point base was not passed to attach_volume method
as the connector initialization logic is common for all
types of protocols. It is fixed by populating
the required parameter in the RemoteFsConnector
for NFS drivers.
Navneet Singh [Sun, 20 Oct 2013 00:55:55 +0000 (06:25 +0530)]
NetApp fix ssc volume filtering inconsistency
This fixes the situation when the actual netapp
volume data structure becomes inconsistent
because of operating on the actual object
than the copy of it. It also introduces some checks
before calculating volume stats.
Navneet Singh [Sat, 19 Oct 2013 18:04:15 +0000 (23:34 +0530)]
NetApp fix mirrored stats
This fixes the incorrect reporting of mirrorred
statistics for NetApp iscsi and nfs backend.
The uninitialized and broken snapmirror is
not reported and only snapmirrored state
is reported back.
zhangchao010 [Fri, 18 Oct 2013 08:32:56 +0000 (16:32 +0800)]
Add extend_volume for Huawei drivers
This patch adds extend_volume function for Huawei drivers.
Huawei T driver needs to create a slave LUN for the extended LUN.
And accordingly it needs to delete all these slave LUNs before deleting
the extended LUN.
HVS driver just sends a rest command to finish extending volume.
John Griffith [Wed, 16 Oct 2013 02:51:07 +0000 (20:51 -0600)]
Provide gettext _ in missing locations
A while back a change was merged that moved
our shortcut for gettext out of __init__
(change here: If4125d6bcbde63df95de129ac5c83b4a6d6f130a)
This worked out fine for the most part but broke the sphinx doc
builder for a number of files. This patch just adds the proper
import to each of these files to get the builder working correctly
again.