This patch adds the connector object as a parameter
to all driver create_export calls. This will enable
drivers to actually use create_export method for doing
what they are now doing inside of initialize_connection.
James Carey [Wed, 29 Jul 2015 22:55:03 +0000 (22:55 +0000)]
Sync scheduler module from oslo-incubator
The scheduler and scheduler.weights modules have not been
updated since early in the Icehouse release cycle. This
patch brings the version in Cinder up to date with what is in
oslo-incubator.
Current HEAD in OSLO:
---------------------
commit 20d7dc57819a70abdff967299542068946d75ac1
Date: Wed Jul 29 03:49:46 2015 +0000
Updated from global requirements
Patches included with sync by file:
---------------------
base_filter.py
- 2fbf5065 - Remove oslo.log code and clean up versionutils API
- 5d40e143 - Remove code that moved to oslo.i18n
- 2af88ece - Use _LI instead of _ for info message translation
- 4a47188e - Allow filters to only run once per request if their data is static
- fcf517d7 - Update oslo log messages with translation domains
- cae33101 - Stop looping all filters if no objects return
base_handler.py
- 6fa29aee - Trivial: Make vertical white space after license header consistent
- 35660dac7 - Enable hacking H401 test
- 5dcc43b1 - Break out common functionality for filters and weights
base_weight.py
- 825cb870 - Upgrade to hacking 0.10
- a2fa4878 - Fix common.scheduler.base_weight.BaseWeigher to be Python3 compat
- e47bc70e - Normalize Scheduler Weights
Note: Key changes were made that impact cinder:
(1) The weigher base class changed the name of _weight_mulitipler() to
weight_multiplier() which impacted cinder/scheduler/weights/capacity.py
and cinder/scheduler/weights/volume_number.py.
(2) Application of the weight multiplier was moved from the weigher to the
handler and normalization of the weights prior to applying the weight
multiplier was added. This impacted cinder weigher test cases which
were checking for non-normalized weights.
(3) The normalization does not support the use of infinite weights which
are used by the cinder capacity weigher. When an infinite value is
used, it is not known what the other weights will be, so this adds an
override to CapacityWeigher for the weigh_objects() method that wraps
the parent method to use the returned complete set of weights to
replace any infinite weights with values that are much larger than
the largest non-infinite weight.
This patch refactors api.v2.volumes unit tests to use helper
methods added in commit I7c4225de5d32ecd0ad78fc7c0ff847a8bee7b7da.
It also fixes the order of assertEquals in refactored tests.
Sean McGinnis [Mon, 27 Jul 2015 14:18:44 +0000 (09:18 -0500)]
Dell SC: Add check of current value on retype
The recently merged retype code for the Dell Storage
Center driver does not check if the new Storage Profile
value is different than the currently set value. While
this is mostly harmless since there isn't a lot of overhead
to setting the Storage Profile to its existing value, it
is still extra overhead and API calls that need to be
performed to complete the operation.
This adds a simple check to compare the current value against
the requested value to decide whether or not to perform the
retype operation. We only support retyping of the Storage
Profile, so if they are the same, just return true to
prevent a migration from happening.
Lin Yang [Mon, 3 Aug 2015 07:28:15 +0000 (15:28 +0800)]
Fix status comparison for attached volume backup
1) When do backup for an attached volume, its previous_status should be
'in-use' instead of 'in_use'.
2) Added more assertions in corresponding unittest case for this function
to make sure it enter this if-block. Previous test case was passed even
with the incorrect status.
John Griffith [Thu, 30 Jul 2015 17:43:00 +0000 (11:43 -0600)]
Use prefix for SolidFire template account
The SolidFire template account was not using the
account_prefix setting when the account was created.
This means that if a deployment is configured to use
the prefix, that calls to make the actual clone will fail
because the clone routine prepends the prefix from the
config settings on every lookup.
This patch just adds the same account adjustment that
we use in our regular account creation routines.
Transient DB errors should not kill the thread for FixedIntervalLoopingCall.
This was noticed and fixed for the DBError case in Bug#1466991, but the
exception from sqlalchemy is not handled. Basically, self.model_disconnected
should be set to True, but the looping thread should carry on regardless of
the error.
The VMDK driver reports the protocol as 'LSI Logic SCSI' in
backend stats. This patch changes the protocol to 'vmdk'
which is in sync with driver support matrix at:
https://wiki.openstack.org/wiki/CinderSupportMatrix
It might happen that multiple cinder nodes/backends are trying to add
volumes to the same target. In this situation, the driver can get an
error trying to add a volume to a hlun just taken by other instance.
This patch fix this avoiding concurrency using mutual exclusion and adds
retries to the failed attempts to cover scenarios where multiple cinder
hosts are used.
When getting the default quota value for a project, the DBQuotaDriver
is just checking if the default_quota_class CONF is set to True.
But this conf should not be considered when getting default quota
values for subprojects.
Previously, when we asked for the default quota values of a
subproject, the default quota values of the root project was returned.
Extending a linear LVM volume that has a snapshot requires
that the LV be deactivated explicitly prior to extending.
This adds a deactivate_lv method and calls it prior to
issuing the extend call. If auto_activation_volume_list
is not defined lvm.conf, then volumes will be reactivated
automatically after the extend. If auto_activation_volume_list
is defined, then volumes that should be automatically
reactivated should be added to the auto_activation_volume_list
or they won't be activated automatically.
NOTE: This doesn't apply to thin provisioned LVs as they don't
require the deactivation step.
DocImpact: When a user extends LVM Volumes with a snapshot, the
volumes will be deactivated. Their re-activation is automatic,
unless auto_activation_volume_list is defined in lvm.conf.
See lvm.conf for more info. Thin provisioned LVM Volumes
will not be deactivated as they don't require it.
Co-Authored-By: John Griffith <john.griffith8@gmail.com>
Change-Id: If746625cfe658c3528525dc7f4bf869f1c9704dc
Closes-Bug: #1470558
Fix exception on uploading a volume to image with glance v2 API
This fixes an exception on uploading a volume to image when
the glance v2 api is enabled. Also, this adds the unit tests
for updating metadata and data both with glance API v1 and v2.
The Nimble driver does not set the VERSION variable
causing its version to be logged as N/A. This patch
updates that variable so that the correct version
number is reflected in the log.
Eric Harney [Mon, 27 Jul 2015 17:24:36 +0000 (13:24 -0400)]
Log which service is down
This changes the message "Manager for service cinder-volume
is reporting problems..." to
"Manager for service cinder-volume myhost@backend1 is
reporting problems..."
This makes it more clear in the log file which backend this
message is referring to.
The update_migrated_volume() function on volume/manager.py
calls the update_migrated_volume() from the driver. If the
driver does not implement the function, the manager falls
back (by catching the NotImplementedError exception) and
implements a default behavior, not renaming the volume. If
the driver does not have the function implemented, the
migration will fail as in this case, an AttributeError
exception can be raised.
We fix this by implementing the method
update_migrate_volume() in the BaseVD driver so all drivers
now throw the proper exception.
Jon Bernard [Thu, 23 Jul 2015 17:47:03 +0000 (13:47 -0400)]
RBD: use user-configured value for max_clone_depth
This patch allows the user to override the default max-clone-depth in
cinder.conf. Without this, the driver will ignore the user setting and
always use the default.
Tom Barron [Sat, 25 Jul 2015 21:11:29 +0000 (17:11 -0400)]
Fix cleanup_temp_volume_snapshots for missing vol
The cleanup_temp_volume_snapshots method raises an exception that
causes the backup service to exit if there is a backup without a
corresponding volume.
This commit catches these exceptions so that the backup service is
not prevented from starting in this circumstance.
This change helps create cinder volumes on a GPFS cluster,
when the cinder services are not running directly on one of
the GPFS nodes.
The NFS export created on GPFS cluster will be locally mounted
on a node running the cinder service. The cinder volume service
will communicate with GPFS nodes over SSH to execute CLIs remotely.
This change also ports the GPFSDriver to ABC driver model.
Implements : blueprint ibm-gpfs-nfs-support
DocImpact
Needs an update in gpfs driver documentation, as this patch
adds an NFS based access for GPFS cinder driver.
Mike Perez [Mon, 27 Jul 2015 05:46:17 +0000 (22:46 -0700)]
Remove deprecated SimpleScheduler
This has been deprecated for three releases now. It's time! By default
it was already having Cinder use the FilterScheduler with certain
weighers and filters to continue the chance behavior, so definitely not
scary!
Shay Halsband [Mon, 8 Jun 2015 16:08:46 +0000 (19:08 +0300)]
XtremIO support for iscsi discovery auth
- Discover existing Initiator Groups (a grouping object for initiators)
from connection information.
- add unit tests for better code coverage.
- handle 'system is busy' array error.
Eric Brown [Sat, 2 May 2015 07:13:06 +0000 (00:13 -0700)]
Add bandit for security static analysis testing
This change adds a basic bandit config for Cinder. It can be invoked
by running the tox environment for bandit;
tox -e bandit
This is intended as a starting point for using bandit with Cinder
and it should be revisited to improve the testing as more is learned
about the specific needs of the Cinder code base.
Tox is configured to only show results for high and medium severity
results.