Patrick East [Fri, 11 Mar 2016 23:28:27 +0000 (15:28 -0800)]
Fixup stats key for replication in init_host_with_pc
We were looking for just ‘replication’ in stats, but that key isn’t
used by anyone and would always be false. We instead want to be keying
off of just replication_enabled.
Doug Hellmann [Fri, 11 Mar 2016 21:06:11 +0000 (16:06 -0500)]
register the config generator default hook with the right name
No config generator hooks should ever be registered with a name that
belongs to another project. In this case, using oslo.middleware.cors
means that *every other project* that loads the middleware gets this
application's defaults when the generator is run on a system with
everything installed (such as a dev box with devstack). Use the name
of the app instead, to ensure that the defaults are only set when this
app's sample config and documentation are being generated.
Patrick East [Fri, 11 Mar 2016 18:27:50 +0000 (10:27 -0800)]
Fix for Pure drivers not checking full client version
We were only looking at major and minor versions… we needed to be
looking at the whole thing. This change allows for checking against
all three version parts, and for even differing schemes as time goes on.
Patrick East [Fri, 11 Mar 2016 17:59:56 +0000 (09:59 -0800)]
Fixup for Pure drivers cheesecake replication setup
We had a remnant of the past replication design left behind in the setup
methods which was causing the arrays to be setup with bi-directional
replication. With the switch to cheesecake we do not need the secondary
arrays to be replicating to the primary. This change removes the step
which would configure that.
Ivan Kolodyazhny [Fri, 11 Mar 2016 16:14:06 +0000 (18:14 +0200)]
Remove empty directories and unused files from unit tests
1. Files from cinder/tests/unit/var are not used anywhere
2. cinder/tests/unit/wsgi/ and cinder/tests/unit/xenapi/ contain only
empty __init__.py files
Alex O'Rourke [Fri, 11 Mar 2016 00:09:01 +0000 (16:09 -0800)]
Cleanup 3PAR/LeftHand failover_host exceptions
The 3PAR and LeftHand drivers were raising the wrong exception,
VolumeBackendAPIException, instead of InvalidReplicationTarget,
which was putting the host in an unrecoverable state,
Dinesh Bhor [Tue, 9 Feb 2016 11:20:26 +0000 (03:20 -0800)]
Fix 500 error if 'offset' is out of range
If large value is passed as offset to snapshots, volumes,
backups, consistencygroups and qos_specs list api then it
throws 500 internal server error.
Moved existing validate_integer() method from
cinder.api.openstack.wsgi.Controller to cinder.utils so
that it can also be used for validating offset param for
integer value in _get_offset_param() method and return 400
error if value is out of range.
Alex O'Rourke [Thu, 10 Mar 2016 21:33:20 +0000 (13:33 -0800)]
Fix up failover_host exceptions to preserve states
UnableToFailOver and InvalidReplicationTarget do not save the state
of replication_status currently. This patch adds host.save() in
order to write the change to the db.
In addition, the manager should honor the current replication state
of the host when InvalidReplicationTarget is raised instead of forcing
it into 'enabled' state.
Helen Walsh [Sat, 13 Feb 2016 12:12:47 +0000 (12:12 +0000)]
EMC VMAX - SnapVX and other snapshot improvements
Using snapVX VMAX3 for creating snapshot and volume from
snapshot. Improvements in wait_for_sync to determine when
the max number of retries has been reached.
John Griffith [Wed, 9 Mar 2016 23:43:14 +0000 (16:43 -0700)]
Move replication_status update to init_with_rpc
We were using host_init to read replication_status from the
driver and update the service entry in the DB. It turns out
that on a fresh install this doesn't actually work, because
while we have multiple init methods for the backend, the
Service entry isn't actually created in a fresh deploy until
AFTER init_host. The result was that in some cases we were
trying to update a column on a non-existent Service in the
DataBase.
This patch moves the replication_status updates for the
service into the init_with_rpc method. That method was
just a noop stub in the parent manager class, so we just
implement it in cinder.volume.manager and do what we need
with the replication update info.
In order to allow a cloud operator to use the policy based
user access control for these operations, a context during
these operations should be elevated before db operations.
After applying this change, the cloud operator can manage
policy for volume type operations like this.
1. To permit volume type operations for specific user,
add "storage_type_admin" role.
2. Add "admin_or_storage_type_admin" rule to policy.json.
"admin_or_storage_type_admin":
"is_admin:True or role:storage_type_admin",
3. Modify rule for types_manage.
"volume_extension:types_manage":
"rule:admin_or_storage_type_admin",
Michał Dulko [Wed, 9 Mar 2016 15:04:20 +0000 (16:04 +0100)]
Add volume_type to volume object expected_attrs
We haven't had volume_type in expected_attrs for volume objects lists.
This resulted in situation in which although we were joining the
volume_type explicitely in DB API, the object just dropped the data.
Volume type was then lazy loaded when needed, so every "cinder list"
call was making additional DB queries per returned volume, causing
massive performance drop.
Actually there were two unnecessary DB calls per volume, because not
only volume_type was fetched, but also volume_type.extra_specs as a result
of passing 'extra_specs' in expected_attrs when calling
VolumeType._from_db_volume in Volume._from_db_volume (wow, that's
complicated…).
This commit sorts this out by adding volume_type to expected_attrs to
match what we join in the DB. Please note that I'm not adding
consistencygroup and volume_attachment on purpose - addition causes some
unit tests failure and that late in the release it seems risky to try
fixing that. The changes also required minor rework of expected_attrs
infrastructure in the o.vo layer to be able to pass different values
when we query for just a single volume and when we fetch whole list (as
we're doing different joins in the DB layer in both cases).
Joshua Huber [Thu, 10 Mar 2016 01:15:36 +0000 (20:15 -0500)]
Pass new volume size when cloning (blockbridge)
When creating a cloned volume (using the Blockbridge driver), pass the
new volume capacity to the backend. After a successful clone, the
backend extends the new volume to the requested size.
Update unit test to ensure capacity param is supplied to the backend
API.
Vincent Hou [Tue, 1 Mar 2016 19:26:52 +0000 (14:26 -0500)]
Storwize: Update replication to v2.1
This patch updates replication to match the v2.1 spec. This makes
it possible to replicate an entire backend, and upon failover, all
replicated volumes will be failed over together.
cinder.conf should have the replication config group:
The replication can be configured via either multi-backend on one
cinder volume node, or on separate cinder volume nodes.
Options to be put in cinder.conf, where the primary back-end is
located:
Patrick East [Wed, 9 Mar 2016 19:08:27 +0000 (11:08 -0800)]
Switch failover-host from rpc call to cast
There is some concern that with large numbers of volumes it will be
difficult for drivers to failover the host before the rpc timeout hits.
To avoid asking admins to bump the timeout just for these cases we can
switch it to do a non-blocking cast instead of call. The difference now
being that the active_backend_id is not returned from the API call to
failover-host. An admin will have to look at the service-list output
to see when it has changed states from ‘failing-over’ and then check
what its active_backend_id is at that time.
Nate Potter [Wed, 4 Nov 2015 15:45:11 +0000 (15:45 +0000)]
Show qos_specs_id based on policy
Right now qos_specs_id is only shown to an admin user
when showing a volume type. This patch changes that to
be based on policy to allow for more flexibility. It
also adds unit tests for showing a volume type
with policy permissions for qos_specs_id as well as
extra_specs.
Danny Al-Gaaf [Tue, 8 Mar 2016 15:43:15 +0000 (16:43 +0100)]
Pass RBD order to clone call
For cloning of a RBD the rbd_store_chunk_size information from
the cinder.conf should be used to calculate and pass the correct
order information to the clone() call of the rbd library.
Added new test to check for correctly from rbd_store_chunk_size
calculated order while cloning.
Change-Id: Ic5714d3e0d6961bce6ff588006661618130dca07 Co-Authored-By: Logan V <logan2211@gmail.com> Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Wilson Liu [Mon, 22 Feb 2016 05:03:26 +0000 (13:03 +0800)]
Huawei: Check before delete host
Currently we delete the host without checking
whether the host already belongs to a host
group. If a host already belongs to a hostgroup,
an error will occur. So we should do the check
before delete it.
Danny Al-Gaaf [Mon, 7 Mar 2016 15:25:09 +0000 (16:25 +0100)]
rbd: Change capacity calculation from integer to float
The current capacity calculation in the rbd driver use old
c-style integer calculation while e.g. the scheduler
_weigh_object function uses float, therefore calculate
capacity information in float with 2 digits precision for
Gb sizes.
Michal Jura [Mon, 7 Mar 2016 10:29:32 +0000 (11:29 +0100)]
Fix failure with rbd on slow ceph clusters
Make rados connection interval and retries configurable
for _try_remove_volume() function
Otherwise on slow ceph clusters, we can get following problem:
"ImageBusy error raised while deleting rbd volume. This may have been
caused by a connection from a client that has crashed and, if so,
may be resolved by retrying the delete after 30 seconds has elapsed."
Javeme [Wed, 18 Nov 2015 08:26:08 +0000 (16:26 +0800)]
Remove those unnecessary statements "return True"
The reasons to remove them:
* These asynchronous API is not necessary to return a value.
* We do not see the purpose of the statements, because it always
returns true regardless of success or failure.
These statements are unnecessary and misleading, this commit we will
remove these "return True" (Or just remove "True" if it's not at the
end of a function, in order not to change the execution path).
LisaLi [Fri, 4 Mar 2016 07:02:30 +0000 (15:02 +0800)]
Report versions in cinder-manager service list
We set rpc_current_version and object_current_version
in Mitaka.
This patch is to show these two fields in command
'cinder-manage service list' to help admin know the
versions of each service. It helps during upgrade.
Tom Swanson [Mon, 22 Feb 2016 20:56:39 +0000 (14:56 -0600)]
Dell SC: Incorrect values in REST API Login call
The Dell SC REST API driver (dell_storagecenter_api.py) could
specify the wrong api version header. On connection failure
the driver needs to parse the failure text to see if it is
the wrong value and try a second time.
Added the apiversion variable to the StorageCenterApiHelper
class so that this value only needs to be discovered once.
Moved CORS middleware configuration into oslo-config-generator
The default values needed for cinder's implementation of cors
middleware have been moved from paste.ini into the configuration
hooks provided by oslo.config. Furthermore, these values have been
added to cinder's default configuration parsing. This ensures
that if a value remains unset in cinder.conf, it will be set
to use sane defaults, and that an operator modifying the
configuration file will be presented with a default set of
necessary sane headers.
Michael Rowden [Tue, 2 Feb 2016 19:55:15 +0000 (13:55 -0600)]
Correcting thin provisioning behavior
Currently, if thin provisioning is enabled and
max_over_subscription_ratio <= 1, the code will not go through the
thin-provisioning aware code, thereby ignoring any limits from
max_over_subscription_ratio. The intended behavior of setting
max_over_subscription_ratio = 1 is to disable over-provisioning.
Fixed help string to state minimum of 1.0 for
max_over_subscription_ratio.
Clinton Knight [Fri, 26 Feb 2016 21:21:59 +0000 (16:21 -0500)]
NetApp: volume resize using clone fails with QoS
Data ONTAP cannot resize a LUN past the geometry established
when the LUN was created. So to resize past that limit, the
DOT drivers create a new LUN of the needed size and clone
the original LUN into it. This process doesn't always work
if a QoS policy is in place, and the fix is to not pass the
QoS policy to the clone operation.
The fix is trivial, and I improved the surrounding code a
little, but there was no unit test coverage for the method
in question, so this commit also adds full coverage for the
LUN clone method.
stack [Fri, 4 Mar 2016 09:13:06 +0000 (04:13 -0500)]
Fixes creating volume issue for multiple management IPs
Currently there is an issue with the multiple management IPs in
Storwize SVC where volume creation would fail when
storwize_san_sencondory_ip switch to san_ip.
This patch adds a condition to check the sshpool.ip, if the
sshpool.ip equals to storwize_san_sencondory_ip, switch it back
to san_ip.