abhiram moturi [Sat, 19 Dec 2015 17:31:10 +0000 (17:31 +0000)]
Fix bugs caused by porting to python3
In previous python version base64.encodestring() adds '\n'.
at the end. This is removed when we use oslo encode_as_text()
This causes a regression as we manually removed the last
character earlier. This fix removes manually deleting the
last character.
Kurt Martin [Wed, 16 Dec 2015 23:37:45 +0000 (15:37 -0800)]
Disable capabilities based on 3PAR licenses
The 3PAR firmware is now reporting which licenses are enabled on the
storage array. The 3PAR drivers will now use this information to
enable/disable standard stat reporting for thin provisioning,
QoS support and replication
The root cause is that these test cases try to use 8776 port,
but the port is used by c-api if the service exists.
This patch override default port number to avoid the error.
Anthony Lee [Sat, 5 Dec 2015 00:27:14 +0000 (16:27 -0800)]
3PAR: Implement un/manage snapshot support
Implements support for managing and unmanaging snapshots to
the HPE 3PAR FC and iSCSI drivers.
This patch now allows snapshots to be removed from OpenStack
management but still left on the 3PAR backend. Snapshots on
the 3PAR backend can also be managed by OpenStack.
Alex O'Rourke [Thu, 29 Oct 2015 22:04:32 +0000 (15:04 -0700)]
3PAR: Implement v2 replication (unmanaged)
This patch implements the unmanaged side of v2 replication in the HPE
3PAR driver.
Both sync and periodic replication modes are supported. Each
replication_device entry should have a replication_mode value set
to sync|periodic.
A volume type extra_spec value of replication:mode
should also be set. If replication:mode is periodic,
replication:sync_period should be set as well. Which replication_device
entry(s) are used is determined by the value of replication:mode set for
each volume type.
cinder.conf should have the replication config group:
vCenter 6.0 added support for a new type of datastore called VVOL
datastore. A VVOL datastore represents a storage container which
is a logical grouping of virtual volumes in an array that supports
VVOL. A virtual disk in a VVOL datastore corresponds to a virtual
volume in the array. Since VVOL datastores are treated like VMFS
or NFS datastores by vCenter APIs, the changes in the VMDK driver
to support VVOL datastores are minimal.
This patch adds the following changes in the VMDK driver to support
VVOL datastores:
* Add VVOL datastore type to the list of allowed datastore types
* Skip VVOL datastore while creating a volume from a preallocated
glance image because it involves replacing the data file of a
temporary virtual disk with the downloaded preallocated image
which VVOL cannot support.
Samuel Matzek [Wed, 18 Nov 2015 19:40:42 +0000 (13:40 -0600)]
Preserve request id in Cinder logs
Several Cinder volume drivers make calls to get the admin context.
When the admin context is retrieved the user context and its request
ID is lost and all subsequent log entries have different request IDs.
The fix is to pass the overwrite parameter in Cinder's RequestContext
__init__ method to the parent oslo class.
Michał Dulko [Wed, 16 Dec 2015 15:19:42 +0000 (16:19 +0100)]
Add volume_extensions:quotas:delete to policy.json
Aformentioned entry was missing from default policy.json file, so the
call wasn't blocked for non-admin user. It was failing on Keystone
connection and resulted in 500 HTTP error. This addition fixes the
issue.
Michał Dulko [Wed, 16 Dec 2015 12:08:01 +0000 (13:08 +0100)]
Pass volume_id in request_spec for manage_existing
In order to _set_volume_state_and_notify in scheduler.manager to work
correctly and error out volume on failure we need to pass volume_id in
the request_spec from c-api to c-sch. This commit implements that and
adds check for it in the unit tests for manage_existing flow.
Apart from that it removes unnecessary test that was setting volume to
MagicMock(return_value=None), which isn't actually testing anything
(volume() will return None, but we're never doing calls on volume
object).
peter_wang [Mon, 14 Dec 2015 03:37:41 +0000 (22:37 -0500)]
Skip check whether volume is local if it's None
When force deleting a consistency group containing volumes,
manager.py tries to extract host field to check whether the volume
is local to this cinder node before deleting the volume.
Above logic is invalid if host field of faulted volume is None.
This fix will bypass above check to allow deletion of the volume.
Thang Pham [Tue, 24 Nov 2015 04:12:03 +0000 (20:12 -0800)]
Implement refresh() for cinder objects
The following patch implements the refresh functionality
in cinder objects. Instead of calling get_by_id() to get
the latest object attributes, refresh() can be called.
With this change, delete_volume() was updated to use
volume.refresh().
Helen Walsh [Tue, 1 Dec 2015 22:38:33 +0000 (22:38 +0000)]
EMC VMAX - get_short_host_name not called in find_device_number
The get_short_host_name needs to be called in find_device_number.
There are 2 reasons for this:
1. Sometimes the full host name is contained in the
connector['host'] object.
2. When the short host name still exceeds 38 characters,
it must be truncated, in order to guarantee a "contains string"
match between the host and the masking view name.
Gorka Eguileor [Mon, 14 Dec 2015 15:02:20 +0000 (16:02 +0100)]
Refactor cinder.utils.is_valid_boolstr
Method is_valid_boolstr is currently doing 8 different checks against
the same variable. This patch refactors this method to be more pythonic
by using the in operator.
Yuriy Nesenenko [Thu, 3 Dec 2015 14:28:31 +0000 (16:28 +0200)]
Add synchronization in Block Device driver
Multiple calls can get the same device. This patch adds synchronization
to create_volume, delete_volume and create_cloned_volume to avoid race
conditions. The delete_volume method is modified to avoid code duplication
in the implementation of delete_snapshot method for snapshot in the next
patch. Also it adds update provider_location and host to mark device as
used to avoid race with other threads. It uses object notation instead
of dict notation to a volume and snapshot.
Vincent Hou [Mon, 14 Dec 2015 06:08:54 +0000 (22:08 -0800)]
Volume migration: add 'name_id' as valid skippable field
New Versioned Objects expect 'name_id' as a valid input, which
is able to change '_name_id' as well, so this patch adds
'name_id' into the fields, which are going to skip for the
creation of the target volume during migration.
John Griffith [Sat, 12 Dec 2015 18:32:57 +0000 (18:32 +0000)]
Fix invalid cache image-volume creation
During the volume ref creation in clone_image_volume
we were including a _name_id attribute which is invalid
in the base olso object. The result is silent failure
for a key error. Note that the comments for the column
in the db specifcally state "do not call directly".
The variable is also denoted as private by the _ prefix.
Fix this by just popping the "_name_id' attribute.
In addition there were a number of things that needed
some cleanup:
1. Don't iterate over list of tuples to get K/V for dict
Just use Dict(xxxx)
2. Don't use delete dict.key
This isn't safe, because if the key DNE you'll get a key exception
Instead use pop which is safe if key DNE
3. Add an error message when this fails, because currently the logs
don't give an operation a chance of knowing it failed, let alone
an opportunity to debug it
Finally the cache volume creation is still calling the db
directly and doing a resource create as opposed to
using the new volume object create handler. I went ahead
and converted this to use objects, however that resulted in
breaking two of the volume-->image unit tests that use cinder
as a glance backend.
I've opened bug 1525773 for those issues and added a skip
to the tests in question.
Marian Horban [Wed, 2 Sep 2015 12:35:50 +0000 (08:35 -0400)]
Remove eventlet WSGI functionality
This commit removes eventlet WSGI server and starts using
generic eventlet WSGI server from oslo.service library.
The change where the wsgi functionality was added to
oslo.service can be referenced here:
If8840168f10cc3561f4f01e6d456d6b4fd1de8b5.
Michał Dulko [Thu, 19 Nov 2015 16:50:20 +0000 (17:50 +0100)]
Recognize extra fields in CinderObjectDictCompat
We're still in the process of transitioning to the object notation in a
lot of places and that's why we've decided to keep specialized get in
CinderObjectDictCompat. This one wasn't looking at aliases (properties)
from obj_extra_fields. This commit fixes that and adds a unit test for
this method.
We should eventually stop using it, but for Mitaka this will make a lot
of things easier.
peter_wang [Tue, 8 Dec 2015 08:18:31 +0000 (03:18 -0500)]
VNX: Fix issue in deleting cg/cgsnapshot
If user deletes a cg/cgsnapshot quickly after its creation,
driver would report 'not found' warning, and return success
for the deletion, but actually, the object underlying the VNX
is not deleted.
This fix tries to wait the cg and cg snapshot to be available
to make sure it's eligible for deletion.
During copy_volume_to_image(), this tries to return
volume['volume_type'] attribute in a volume object, but
if the volume does not have a volume type, this would
trigger a db call which raise an 404 not found error.
Volume object should check volume_type_id at first and
then decide whether returning volume_type or None to
avoid VolumeTypeNotFound exception.
Also this change includes LOG.info messages fix to show
right behavior of copy_volume_to_image().
apoorvad [Wed, 9 Dec 2015 17:42:21 +0000 (09:42 -0800)]
Retype functionality in Tintri driver
At this point default retype behavior is as follows. If a volume changes
type on the same backend then that volume will be migrated. Since Tintri
VMstore does not differentiate between volume types, we can avoid this
migration by implementing retype functionality.
Ryan McNair [Wed, 9 Dec 2015 15:29:27 +0000 (15:29 +0000)]
Fix non-migration swap with error
The fix I242c2c7c4a7197bbce04d0b3d75688f989ea1fd5 for non-migration
swap volume caused drivers which don't support volume swapping,
e.g. Ceph, to put the volumes in an incorrect state (additional
details can be found in bug #1489744 report). This patch adds an
additional check to ensure no errors occurred during the swap before
it completes the volume status updates, as well a test-case for
the non-migration swap scenario.
Dave McCowan [Mon, 7 Dec 2015 19:25:24 +0000 (14:25 -0500)]
Check context before returning cached value
The key manager caches the value of barbican client to be reused,
saving an extra call to keystone. The cached value is only
applicable to the current context, so the context must be checked
before returning the cached value.
Alex O'Rourke [Thu, 29 Oct 2015 22:04:32 +0000 (15:04 -0700)]
3PAR: Implement v2 replication (managed)
This patch implements the managed side of v2 replication in the HPE
3PAR driver.
Both sync and periodic replication modes are supported. Each
replication_device entry should have a replication_mode value set
to sync|periodic.
A volume type extra_spec value of replication:mode
should also be set. If replication:mode is periodic,
replication:sync_period should be set as well. Which replication_device
entry(s) are used is determined by the value of replication:mode set for
each volume type.
cinder.conf should have the replication config group (3parfcrep)
and at least one other target group (3parfc) as such:
Nate Potter [Tue, 17 Nov 2015 16:50:24 +0000 (16:50 +0000)]
Check backup service before backup delete
Right now, if a user tries to delete a backup and the cinder-backup
service is down, the backup status will be error and no message will
be provided to the user. This patch will add a check to see that the
service is running before issuing the rpcapi cast to delete the backup,
and inform the user that the service is down if the check fails. However,
it is still possible with this fix for the service to go down during the
time between the check and when the backup is actually deleted.
Most changes in this patch:
- make sure that Request.body is set to bytes;
- replace jsonutils.dumps with jsonutils.dump_as_bytes;
- replace json.loads with oslo_serialization.jsonutils.loads;
- replace dict.iteritems with dict.items.
Helen Walsh [Sun, 8 Nov 2015 20:38:34 +0000 (20:38 +0000)]
EMC VMAX - Fix for randomly selecting a portgroup
Before now the utils function was always returning the first
portgroup in the list. This fix ensures a port group is
randomly selected from the list, where more than one value
is in the list.
Shay Halsband [Thu, 19 Nov 2015 14:42:46 +0000 (16:42 +0200)]
XtremIO: fix iscsi chap discovery bug
* The set and get parameters for discovery auth have different
names and caused a confusion that led to a bug, fixed in this
commit.
* Add unit test to make sure the right parameters are used
Sean McGinnis [Sat, 5 Dec 2015 18:19:52 +0000 (12:19 -0600)]
Fix StrOpts with integer defaults
A couple config options sneaked in defined as strings but
really expecting integer values. This causes errors with the
latest oslo.config that expects the appropriate type.
This patch changes these instances to be the expected IntOpt.