Tom Barron [Wed, 3 Feb 2016 22:14:23 +0000 (17:14 -0500)]
mock time.sleep in Broadcom unit test
TestBrcdHttpFCZoneClient.test_post_zone_data() invokes
BrcdHTTPFCZoneClient.post_zone_data(), which in turn
has a loop around its connect() method inside which there
is a sleep(). Without time.sleep() mocked out, the test
runs 7s on my laptop.
This change mocks out time.sleep() in the test so that
it now runs in .6s.
Accela Zhao [Wed, 3 Feb 2016 07:19:45 +0000 (23:19 -0800)]
Don't create cgsnapshot if cg is empty
If we create cgsnapshot from an empty consistencygroup, it fails
with "Consistency group is empty. No cgsnapshot will be created".
However, a cgsnapshot object is still created in DB.
This is because in cinder/consistencygroup/api.py::_create_cgsnapshot,
we create cgsnapshot object before we test whether the corresponding
consistencygroup is empy.
This patch fixes this problem by moving the creation of cgsnapshot
object to after the test of whether consistencygroup is empty.
This patch fixes the problem with the 3PAR not
working with the generic image cache.
In order to do the image cache, the 3PAR has to create a
temporary snapshot of the volume being cloned. Then the
background cloning is against the temporary snapshot.
The problem is, the temporary snapshot stays around.
We try to account for this temporary snapshot in
the delete volume action.
We also bump the minimum required python-3parclient
version to 4.1.0, which has the new getVolumeSnapshots
API call required to make this all work.
Currently the volume manager doesn't log the instance ID during
volume detach. This is missing in cinder-api log as well. This
patch adds a log statement to print a message with volume ID and
instance ID before calling driver detach.
Helen Walsh [Wed, 11 Nov 2015 22:09:59 +0000 (22:09 +0000)]
EMC VMAX - Fix for last volume in VMAX3 storage group
This patch fixes bug in the deletion the last volume in a
storage group for the VMAX3. If a masking view did not exist
we tried to get an instance of it which threw an exception.
Now we handle both scenarios correctly.
Michał Dulko [Thu, 14 Jan 2016 19:57:12 +0000 (20:57 +0100)]
Pin RPC and object version to lowest running
This commit adds detection and pinning to lowest RPC API version to all
rpcapi modules. The version pin is determined by a DB call done once per
service lifetime thanks to caching. Handling the compatibility is
guaranteed by oslo.messaging and our shims in rpcapi modules.
To achieve o.vo compatibility, a similar approach is implemented. Custom
oslo.messaging serializer is implemented that backports objects to the
lowest running version on sending.
During the process of upgrade it may happen that manager receives an
object in the version lower than current one. Handling of such
situations is up to the manager and it should do that explicitely by
checking obj.VERSION.
The patch also adds required methods to db.api and Service object.
Michał Dulko [Thu, 14 Jan 2016 18:37:18 +0000 (19:37 +0100)]
Report RPC and objects versions
While doing a rolling upgrade we will have services running in various
versions. In order to determine how to downgrade the RPC request and
payload (objects) to the lowest common version we need to actually
report versions of RPC servers (managers).
This commit implements such reporting in generic cinder.service module.
It is using DB columns that were merged in Liberty to save this
information.
To have a single version string identify a set of o.vo versions we need
to have dictionary with objects versions history. In that purpose a
dict-like CinderObjectVersionsHistory class and OBJ_VERSIONS instance of
it is added to cinder.objects.base. A unit test enforcing bumping the
versions is also included with the patch.
Michał Dulko [Wed, 13 Jan 2016 15:18:45 +0000 (16:18 +0100)]
Add missing RPC calls versions to rpcapi modules
Some RPC calls in rpcapi modules are not passing version indicators to
the RPC client. The RPC call version should be indicated explicitely
because otherwise it gets defaulted to the latest one or '1.0'. This
creates a set of problem in maintaining RPC API backward compatibility.
This commit changes these calls to point to the right versions according
to git history and version comments in rpcapi files.
Wilson Liu [Thu, 24 Dec 2015 04:57:56 +0000 (12:57 +0800)]
Huawei: Balanced FC port selection when zoning
Currently we always select the first two FC ports
from every controller when zoning, the rest FC ports
of the controller will never be selected. This patch
will calculate each port's load and select the first
two smallest load ports.
replication_device describes the target array for replication. This can
be either another managed cinder backend or one not managed by cinder.
The above settings will cause a protection group to be created between
the two flash arrays. It will replicate any volumes placed in it with
settings that cause a volume to be replicated every 15 mins (900s). All
snapshots will be kept for 4 hours (14400s). Then 3 snapshots per day
will be kept for 7 days.
Note that replication-failover is supported from primary to any of
multiple secondary arrays, but subsequent replication-failover is
only supported back to the original primary.
DocImpact
Implements: bp pure-v2-replication
Change-Id: I69e567143b65e92f89969ff5036c4f242c17a1dd
Tom Barron [Tue, 19 Jan 2016 13:56:51 +0000 (08:56 -0500)]
Remove deprecated options from NFS driver
In the Liberty release, the NFS driver deprecated the 'nfs_used_ratio'
and 'nfs_oversubscription_ratio' configuration options since equivalent
common functionality is now provided across drivers by the scheduler-aware
'reserved_percentage' and 'max_over_sucscription_ratio' configuration
options.
This commit removes these deprecated options, tests for same, and
some Liberty code that proviced backwards compatibility with respect to
these options.
Erlon R. Cruz [Tue, 17 Nov 2015 17:43:01 +0000 (15:43 -0200)]
Fixing HNAS XML parser
HNAS XML parser does not handles situations where the user
could accidentally insert a blank space in the parameter value
breaking the driver in execution time. With this fix, an
error is raised in the driver setup.
Angela Smith [Mon, 9 Nov 2015 18:14:35 +0000 (10:14 -0800)]
Adds friendly zone name support
Added user friendly names for zones to include host and storage
names along with ids to easily identify the host and storage port
details.
This is done by extracting the host and storage name from connection
info object in the zone manager. The host and storage names are passed
to the zone drivers to form a friendly name. The method signature has
been changed which accepts host and storage name, with default as None.
Also added test cases to test this support. Changes have been made to
zone manager test code to accommodate the change in signature of some
methods.
Moved get_friendly_zone_name method to utils.py so that it can be used
by both cisco and brocade drivers
Changed cisco driver to accommodate host_name and storage_system
parameters in add/delete connection.
Eric Harney [Mon, 4 Jan 2016 19:35:29 +0000 (14:35 -0500)]
Tests: Strengthen assertFalse assertions
These are all cases where we test with assertFalse,
but the call returns something more specific than False
which we should be checking for, such as None or [].
Test for the specific expected return value rather than
anything which will pass assertFalse.
Tom Barron [Thu, 21 Jan 2016 03:44:48 +0000 (22:44 -0500)]
Fix laggard cisco FC zone client unit tests
The test_cisco_fc_zone_client_cli.py unit module tests methods
decorated by utils.retry, which does retries with exponential
backoffs, without mocking out time.sleep(). One test in this
suite takes about 10% of the total time to run all cinder unit
tests.
This commit mocks time.sleep() in two critical tests in this
module, yielding a 30x speedup in run-time for the module.
Tom Barron [Thu, 21 Jan 2016 18:17:59 +0000 (13:17 -0500)]
Fix torpid coordinator unit tests
The test_coordination.py unit module tests a _reconnect() method
which does a randomly seeded exponential retry backoff. This
retry/backoff mechanism introduces needless delay in unit test
runs.
This commit mocks out random.uniform, improving run time by about
a factor of nine, as documented in the accompanying bug.
Gorka Eguileor [Thu, 21 Jan 2016 13:12:56 +0000 (14:12 +0100)]
Run flake8 also on cinder/common
Even though testenvs pep8 and pep8-constraints included cinder/common
directory to be processed by flake8, global configuration in flake8
secion was excluding common glob preventing the directory from being
checked.
This patch removes glob from flake8 exclude section, unnecessary
cinder/common inclusion when running flake8, and fixes
cinder/common/config.py.
If we had a common directory in our code root and wanted to exclude it,
glob should be ./common instead of just common like we had now.
wanghao [Wed, 30 Dec 2015 06:18:09 +0000 (14:18 +0800)]
Add pagination support to consistency group
In liberty release, we have added pagination to backups
and snapshots. There are still some work that hasn't been
done yet.
This patch adds pagination support to consistency groups.
APIImpact
Add pagination args like limit, marker, sort to query
consistency group.
Sheel Rana [Fri, 15 Jan 2016 20:23:49 +0000 (01:53 +0530)]
Added 'bootable volume' filter for non-admin user
During launch instance from Horizon, if non-admin
user selects volume as source for launching
instance, drop down list for volumes will also
show non-bootable volumes. It is wrong behaviour.
To fix this, 'bootable volume' search filter is
enabled so that only bootable volumes get
displayed in drop down list of volume.
APIImpact
DocImpact:Need to add bootable against
query_volume_filters in OpenStack Configuration
Reference
Eric Harney [Wed, 13 Jan 2016 15:29:50 +0000 (10:29 -0500)]
Set LVM driver default overprovisioning ratio to 1.0
This introduces a config option, 'lvm_max_over_subscription_ratio',
which allows overriding the global max_over_subscription_ratio.
This is needed because the way we handle configuration with
multi-backend does not allow setting a value which will be applied
to each LVM backend without manually setting it in each backend,
and it would be better to default to a safe overprovisioning
ratio for the LVM driver. It is often used in smaller deployments
and POCs which may not have all of the capacity monitoring
infrastructure used with other drivers, so overprovisioning should
be an opt-in capability rather than opt-out.
Partial-Bug: #1472803
DocImpact: new config option lvm_max_over_subscription_ratio