zhangyanzi [Fri, 22 Nov 2013 08:41:39 +0000 (16:41 +0800)]
Ensure 'status' in update_snapshot_status
The function os-update_snapshot_status doesn't check whether the param
"status" is in request body. It throws 500 error. We should catch the
KeyError and return 400 (HTTPBadRequest) instead.
huangtianhua [Fri, 22 Nov 2013 09:02:32 +0000 (17:02 +0800)]
Initialize and terminate connection raise 500 err
Initialize and terminate connection should check whether "connector" is
in request body. It throws 500 error if "connector" is not present. We
should catch the KeyError and transfer it to 400 (HTTPBadRequest)
instead of.
scott-dangelo [Fri, 22 Nov 2013 16:28:07 +0000 (16:28 +0000)]
Add greenthread.sleep() to parent wait()
Add an eventlet.greenthread.sleep() to wait() to keep
cinder-volume parent from looping after catching SIGTERM
and hogging the CPU. This was already added to the running
state but is missing from the SIGTERM caught state when
the parent waits to reap the child.
Xavier Queralt [Fri, 22 Nov 2013 09:39:37 +0000 (10:39 +0100)]
Pass the size when fetching image in xenapi driver
In commit 6e287c0f2bb7d4994d50f1763f412277e4dac6f7 the fetch_to_raw
method was changed to accept the volume size so it can fail when the
image doesn't fit in the destination volume. In this commit we also
updated all the volume drivers to pass the volume size to that method so
it could perform the check. The xenapi driver missed that change.
This commit updates the xenapi driver to pass the volume size when
fetching the image to enable the introduced check.
Jon Bernard [Fri, 15 Nov 2013 22:38:31 +0000 (17:38 -0500)]
Remove dead code from test_get_volume_stats()
The _emulate_vgs_execute() routine is never called because the function
that calls it (get_all_volume_groups) is overridden to return fake
output without executing vgs.
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.
Jay S. Bryant [Sat, 16 Nov 2013 01:01:58 +0000 (19:01 -0600)]
Add default quota class into DB during migration
For some time now use_default_quota_class has been the
default setting for Cinder. Cinder, however, has not been putting
any defaults for the default quota class into the database. This
resulted in any command that queried for the default quotas to cause
the message "Deprecated: Default quota for resource: <resource> is set
by the default quota flag: <quota flag>, it is now deprecated. Please use
the default quota class for default quota."
This commit resolves this issue by setting the default value for volumes,
snapshots and gigabytes in the quota_class table at migration time if there
is not already a class_name of 'default' in the quota_classes table.
The test "test_get_dss_rp" in test_vmware_vmdk.py is not testing
the positive case as intended. Rather, it tests the negative case
(no datastores) which is already covered by
"test_get_dss_rp_without_datastores".
Navneet Singh [Sun, 17 Nov 2013 21:08:07 +0000 (02:38 +0530)]
NetApp fix free space as zero during 1st vol stats update
NetApp clustered ontap drivers report space as zero
till first 60 seconds of driver start. This is causing
discomfort for some performance sensitive deployements.
This was due to async nature of the NetApp stats collection job.
Job is changed to sync at driver start to improve customer
experience.
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.
The current VMware driver supported only "sparse" and "preallocated"
vmware_disktype property set in a "vmdk" glance image. Both of these were just
copied over as *-flat.vmdk files into the vmfs or nfs file system of the
underlying datastore. This was used during copy_image_to_volume() api.
Unfortunately for a vsan datastore this work flow breaks since there is no
access to the flat vmdk file in the underlying datastore.
This patch introduces a new vmware_disktype for a glance image called
"streamOptimized". This is a format generated when a VM/vApp is exported using
the HttpNfc APIs. AS the name suggests this is a highly optimized format for
streaming in chunks and thus would result in much faster upload / download
speeds. The driver's copy_volume_to_image() implementation now always uploads
the vmdk contents using HttpNfc api so that the glance image ends up in the
"streamOptimized" disk type. Also the driver's copy_image_to_volume()
implementation now understands a "streamOptmized" disk type and uses HttpNfc to
import that vmdk into a backing VM.
Note that the same "streamOptmized" glance image format will also be supported
by VMware nova driver. This change is in a different patch -
https://review.openstack.org/#/c/53976/
Patch Set 4: Removing changes to requirements.txt that got in by mistake.
Patch Set 5: Fixing a small bug around progress updates.
Patch Set 6: Addressing comments from Avishay.
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