wangxiyuan [Thu, 3 Mar 2016 03:37:25 +0000 (11:37 +0800)]
Make query to quota usage table order preserved
Currently, the query to quota usage table is not order
preserved. This might cause deadlock in large-scale
deployment: different calls may lock rows in different
order, and deadlock will happen.
This patch adds order_by to the query and make the query
to the table order preserved.
Gorka Eguileor [Wed, 2 Mar 2016 13:21:31 +0000 (14:21 +0100)]
Fix test_create_volume_flow test issue
One of the tests in
cinder/tests/unit/volume/flows/test_create_volume_flow.py incorrectly
mocks time.time function which means that when there's a call to
time.time() it will raise an error because real time function doesn't
expect any arguments but the mock method does expect self as an
argument.
For some reason time.time function does not get called on every test
run, but when it does get called it will fail.
This patch fixes this by binding the mock method to the current self
instance.
Gorka Eguileor [Wed, 2 Mar 2016 12:23:31 +0000 (13:23 +0100)]
Fix test isolation issues related to versions
In cinder.rpc.RPCAPI methods _determine_rpc_version_cap and
_determine_obj_version_cap use global variables LAST_RPC_VERSIONS and
LAST_OBJ_VERSIONS to cache version values so we need to clear these
values between tests so one test values don't get passed to the next
test.
This was problematic for example when running some
cinder.tests.unit.api.contrib tests in a specific order:
Wilson Liu [Wed, 17 Feb 2016 04:48:17 +0000 (12:48 +0800)]
Huawei: Manage volume fails due to lower array version
When we try to import an existing volume to cinder, we try
to find whether the volume already exists in a hypermetro.
But if the array version is lower than V3R3, the request
to find the hypermetro info will fail because array version
lower than V3R3 does not support hypermetro.
LisaLi [Mon, 29 Feb 2016 07:12:18 +0000 (15:12 +0800)]
Fix exception during service update
The function objects.Service.get_by_args raises HostBinaryNotFound
exception, but in service update function, it catches ServiceNotFound
exception by mistake.
This patch is to remove HostBinaryNotFound and use ServiceNotFound to make
things simple and consistent.
Patrick East [Fri, 5 Feb 2016 23:52:31 +0000 (15:52 -0800)]
Update Pure replication to cheesecake
Migration to cheesecake replication. This basically
modifies any of the existing replication code to work on the whole
backend instead of the specified volume.
It also completes the transition to allow swapping the underlying array
being managed by cinder upon failover. In the v2 implementation it was
conditional on some operations where things *could* be on the other
array. Now it is all driver operations.
This also switches the target_device_id to backend_id in the config for
replication devices.
Szymon Borkowski [Tue, 12 Jan 2016 10:32:22 +0000 (11:32 +0100)]
Fixed logging for oslo versioned objects
Earlier, when we wanted to log a message with an object as a parameter,
obj_attr_is_set method used to check name parameter, which was a wrong
approach. The reason was, that the oslo logger, when received a
versioned object as a resource parameter, is trying to get the 'name'
parameter, which is a property, so the obj_attr_is_set method will
return False and the logger will try to get the 'type' parameter, which
does not exist in some versioned objects (please take a look at
oslo.logging code [1]).
Now, when the parameter's name is present in obj_extra_fields
dict, we avoid calling obj_attr_is_set and simply get() it.
The other cause was a difference between fields names: size (in volume
object) and volume_size (in snapshot object), and inproper condition
statement in lvm driver.
Tom Barron [Sun, 21 Feb 2016 12:00:54 +0000 (07:00 -0500)]
Trim 50s from huawei ISCSIDriver unit tests
The HuaweiISCSIDriver unit tests take almost a minute to run
on my machine because several negative test cases wait for
timeouts.
This commit leverages the utility method introduced in [1]
as well as the ZeroIntervalLoopingCall for mocks in the Huawei
unit tests to reduce total execution time for this set of
tests from about a minute to under 10s
Surya Ghatty [Fri, 26 Feb 2016 19:49:24 +0000 (19:49 +0000)]
Fix sshpool.remove code
Currently, sshpool.remove function under cinder/ssh_utils.py
is broken. The function tries to locate the passed in
sshclient object inside sshpool.free_items.
However, since the sshclient object is set to “None” at the
beginning, it never finds the object and ends up decrementing
the current size, without actually removing the object.
Made the following changes to fix:
1. Removed reset to ‘None’ so that the attempt to locate object
goes through.
2. Fixed the code to use free_items.remove(ssh) to remove the ssh
object identified instead of free_items.pop(ssh)
3. Also updated the code to decrement current size only if a match
is found in free_items.
4. Added test case to test remove() of an ssh client that is in the
free_items
5. Added test case to test that remove code does not inadvertently
remove an object from the pool if no match is found.
Matt Riedemann [Mon, 29 Feb 2016 17:31:22 +0000 (12:31 -0500)]
Copy StandardLogging fixture from Nova
This code was originally written for Nova by Joe Gordon
<joe.gordon0@gmail.com> and Sean Dague <sean@dague.net>.
This enables debug logging that is exercised by unit test
runs to be handled and detect formatting errors. The debug
logging does not actually go to the console unless the
OS_DEBUG environment variable is set.
As a result, a few formatting errors are detected and
cleaned up with this change.
This also fixes a problem where debug logging from stevedore
is dumped to the console every time an extension is loaded,
which in a gate-cinder-python27 job is 65K+ times.
John Griffith [Fri, 26 Feb 2016 01:09:21 +0000 (01:09 +0000)]
Add ability to failback for replication V2.1
Initially we had setup replication V2.1 (Cheesecake) to NOT
do fail-back at least in the initial version.
It turns out that fail-back in the Cinder code is rather easy,
we just enable calling failover-host on a host that's already
failed-over and use the *special* keyword of "default" as the
backend_id argument which signifies we want to switch back to
whatever is configured as the default in the cinder.conf file.
To do this we just add some logic that checks the secondary_backend_id
param in volume.manager:failover_host and set service fields
appropriately. Note that we're sending the call to the driver
first and giving it a chance to raise an exception if it can't
satisfy the request at the current time.
We also needed to modify the volume.api:failover_host to allow
failed-over as a valid transition state, and again update the
Service query to include disabled services.
It's up to drivers to figure out if they want to require some
extra admin steps and document exactly how this works. It's also
possible that during an initial failover that you might want to
return a status update for all volumes NOT replicated and mark
their volume-status to "error".
Expected behavior is depicted in the service output here:
http://paste.openstack.org/show/488294/
Jacob Gregor [Wed, 24 Feb 2016 17:06:32 +0000 (11:06 -0600)]
Storwize SVC multiple management IPs
Right now Storwize SVC does not support multiple management IPs.
This patch adds this feature so that if the primary IP fails, it
will switch to the secondary IP that the user sets.
Eric Harney [Thu, 25 Feb 2016 17:13:11 +0000 (12:13 -0500)]
Capture warnings into logs
Modules that issue warnings via the python
warnings module result in messages printed
to stderr.
This change results in them being captured
into Cinder logs instead. This means that
logs from production environments contain
all of the relevant info for debugging
issues.
Xiaoqin Li [Thu, 25 Feb 2016 08:36:11 +0000 (00:36 -0800)]
IBM Storwize with pool-aware-cinder-scheduler
Storwize cinder driver only supports config one pool
within one backend right now. This change adds support
for multi-pools aware for scheduler.
storwize_svc_volpool_name accepts a list of pools
separated by comma in cinder.conf now.
User-Visible Change
-------------------
DocImpact
The configuration flag storwize_svc_volpool_name
should be updated to a ListOpt.
Implements: bp Storwize-pool-aware-support
Change-Id: If6f1decf4d6244b1e04b05b8662d891fb16c6790
Angela Smith [Wed, 24 Feb 2016 19:18:42 +0000 (11:18 -0800)]
Fix HTTP sessions left open in Brocade zone driver
Add missing call to logout html page on FC switch to close the HTTP
session on the FC switch in HTTP connector. Also, move the session
cleanup calls in the zone driver so that it is invoked for all code
paths.
Michał Dulko [Mon, 29 Feb 2016 13:25:54 +0000 (14:25 +0100)]
Clean up replication v2.1 (Cheesecake) RPC API
We've merged replication v2.1 (Cheesecake) code with two little issues
in RPC API layer:
* volume.rcpapi have list_replication_targets method, which is unused
and not handled by volume.manager.
* There are no tests for new methods in test_volume_rpcapi module.
Andreas Jaeger [Fri, 26 Feb 2016 18:44:07 +0000 (19:44 +0100)]
always use pip constraints
This flips the tox.ini to always use constraints installation for
all targets. It drops the extra -constraints targets in the process.
This makes it so there is no developer change required to operate in our
new world order.
Michał Dulko [Tue, 16 Feb 2016 14:16:02 +0000 (15:16 +0100)]
Remove unused columns from Service ORM model
rpc_available_version and object_available_version columns were part of
previous design of our RPC API compatibility layer. We've decided to go
in a little different direction so these two are currently unused.
With our live-schema-upgrades guidelines (related to rolling upgrades
support) it's a lot easier to readd something to the DB than to drop it.
Let's take the chance to actually drop these unused DB columns in early
Newton. To do that we need to remove them from the SQLAlchemy model in
Mitaka and this commit does so.
Chuck Fouts [Sat, 27 Feb 2016 18:46:59 +0000 (13:46 -0500)]
NetApp: Fix SSH Client File Creation in Unit Test
A bug was introduced where ssh_known_hosts file is created when the unit
tests in test_netapp.py are run. This patch adds mocks to the ssh init
calls to prevent this file creation.
Tom Barron [Sat, 27 Feb 2016 10:20:18 +0000 (05:20 -0500)]
Trim 12s from disco unit tests
The unit tests under cinder/tests/unit/volume/drivers/disco
contain three "timeout" tests, each of which runs more than 4s
while waiting for timeouts to expire.
This commit mocks time.time() in those tests using a utility
method that ensures an immediate timeout.
Helen Walsh [Mon, 16 Nov 2015 20:31:53 +0000 (20:31 +0000)]
EMC VMAX - get iscsi ip from port in existing MV
This patch fixes bug in getting the iscsi ip address from
an existing masking view. In this scenario we must query
the port(s) in the portgroup belonging to the masking view
and not the random port group from the xml file.
Evgeny Antyshev [Sat, 27 Feb 2016 12:14:37 +0000 (12:14 +0000)]
Misprint in policy.json
Erroneous space in "rule: admin_api" was introduced in change Ibbd6f47c370d8f10c08cba358574b55e3059dcd1
oslo_policy regards space as a separator,
and fails to parse this rule: http://paste.openstack.org/show/488452/
Ryan McNair [Tue, 16 Feb 2016 17:12:53 +0000 (17:12 +0000)]
Re-enable -1 child limits for nested quotas
Add back support for -1 limits of child projects. The way that we
support the -1 child limits requires the following changes:
* Continue quota validation up the hierarchy if the current limit is
-1 until we hit a hard limit or no more parents, and update the
any relevant parents' allocated value along the way
* When updating limits, special care needs to be taken when updating
child limit to be -1, or when changing from a -1 limit
* Enable support for creating reservations for "allocated" values
to support the scenario that:
- a volume is created on a project with a limit of -1
- the parent's allocated value has been updated appropriately
- the volume create fails and the child's in_use quota rolls back
- now we must also rollback the parent's allocated value
NOTE: There is a race condition between validation the NestedQuotas
and when the driver may be switched into use, and if -1 quotas are used
the validation could be out of date. Will look into better support for
switching on of NestedQuotas on live deployment with -1 limits, which
would likely leverage the "allocated" reservation system.