Eric Harney [Mon, 27 Jan 2014 23:46:26 +0000 (18:46 -0500)]
Add create_iscsi_target stub to TargetAdmin
This should be defined in TargetAdmin, as it is assumed to be
present in all subclasses by callers.
IetAdm and LioAdm may need additional work to behave as desired
in all circumstances (such as volume extend), but this should
at least stabilize things in the meantime.
This patch validates the keys of the extra specs
before setting them.
This will make possible to remove those keys.
It allows alphanumeric characters, underscores,
periods, colons and hyphens.
Zhiteng Huang [Thu, 9 Jan 2014 06:54:22 +0000 (14:54 +0800)]
Make sure report_interval is less than service_down_time
Services that inherit service.py/Service class would register
themselves to DB and then update stats periodically (every
report_interval second). The consumer of this kind of information,
like scheduler or 'os-service' API extension, will consider a service
is 'up' (active) if last update from that service is not longer than
'service_down_time' ago.
The problem is if 'report_interval' was configured/provided greater
than 'service_down_time' by mistake, services would then be always
considered in 'down' state, which can result in unsuccesful placement
of volume create request for example. This is what Bug #1255685 is
about.
In previous fix: https://review.openstack.org/#/c/60760/, a
configuration check helper function basic_config_check() was added
*wrongly* to WSGIService class instead of Service class. This patch
moves the configuration check helper function and the check to the
right place to make sure 'report_interval' is less then
'service_down_time'.
john-griffith [Sat, 25 Jan 2014 02:12:01 +0000 (19:12 -0700)]
Fix up the way we do iqn variable in unit test
A recent bug was reported when a developer was trying to work
with the iscsi target unit tests. There were two problems discovered,
one of which has been addressed by the dependent patch of this commit
(https://review.openstack.org/#/c/68223/) which fixed the inconsistencies
in the string we used for iqn's in our test.
This patch addresses another issue that's somewhat related and was
exposed when the developer tried to use the "self.target_name" variable
instead of hard-coding the iqn's in the tests.
The problem is that the target_name variable uses an invalid format
for the iqn based on cinder-defaults. It neglected to use the
volume_name prefix (in this case: "volume-").
This patch modifies the self.target_name variable to be more accurate
with what we would see in real usage, it also modifies the test to just
use this variable rather than hard coding it and running the risk of
having mismatches again in the future.
John Griffith [Fri, 24 Jan 2014 21:51:21 +0000 (14:51 -0700)]
Catch new iscsi exception
A while back we fixed up a target create/update error
that was identified in the gating tests:
https://review.openstack.org/#/c/47513/
Since then a new patch was introduced to to the update and separate
it so that it could easily be used in other places.
https://review.openstack.org/#/c/58599/
The problem is this added a new exception "TargetUpdate" and
didn't add this to the except block that we have.
This patch changes the catch block to handle the new exception and
do the retry, thereby putting the original fix back in place.
ling-yun [Mon, 20 Jan 2014 10:48:43 +0000 (18:48 +0800)]
Delete volume transfer in volume_destroy function
Doing volume force delete operation on volume-A will change volume-A's
status to 'deleted', so all related data about volume-A should be deleted.
Now current version's volume_destroy function doesn't delete related data
of volume transfer. If there is volume transfer about volume-A, first do
force delete operation on volume A, and thus the volume-A's transfer data
would be residual. So remove the related data of volume transfer in
volume_destroy function.
Zhiteng Huang [Wed, 8 Jan 2014 06:50:29 +0000 (14:50 +0800)]
Enable multi-process for API service
Due to the limit of Python interpreter, API service of Cinder can't
really utilize underlying multi-core architecture even libraries
like eventlet has been used. To make API service much more scalable,
we'd adopt multi-process (worker) mode that has been used for long
in Glance/Swift/Nova.
The default behavior isn't changed with this patch, Cinder API
service will still run in one process (default value of
osapi_volume_workers is None).
Implementation wise, a good portion of cinder/service.py has been
removed because those content has been merged in Oslo version of
service module. cinder/wsgi.py is also updated to adopt the change
for multiple WSGI servers running in separate processes.
Implement bp: multi-process-api-service
DocImpact: 'New config option osapi_volume_workers is used to specify
number of API service workers (OS processes) to launch for Cinder
API service. Setting this config option to a proper value (e.g.
osapi_volume_workers = # of CPU cores/threads of the machine) can
greatly improve the total throughput of API service [# of API
requests can be handled per second].'
Also removed out-dated comments in bin/cinder-api due to the fact
that this bug [1] has been fixed in eventlet 0.9.13
Eric Harney [Thu, 16 Jan 2014 19:08:53 +0000 (14:08 -0500)]
Sync common modules from Oslo
Identified as dependencies for RPC sync by update.py
Contains code from: 12bcdb7 Remove vim header e6494c2 Use six.iteritems to make dict work on Python2/3 6d0a6c3 Correct invalid docstrings fe18bfa Remove keystone from default_log_levels default 0228b81 Logging excepthook: print exception info if debug=True 8b2b0b7 Use hacking import_exceptions for gettextutils._ 6d0a6c3 Correct invalid docstrings fe18bfa Remove keystone from default_log_levels default 13eb01c Adding domain to context and log 27b21bc Unify different names between Python2/3 with six.moves a6f40ac Don't log to stdout when log_dir is set 4c22556 Use py3kcompat urlutils functions instead of urlparse 0bf03b7 Add network_utils.urlsplit e456727 Remove useless logging in networks_utils 8b2b0b7 Use hacking import_exceptions for gettextutils._ 37e46bb disable SIGHUP restart behavior in foreground f08f6ba service: replace eventlet event by threading 32cd4c0 Allow configurable ProcessLauncher liveness check 25ff65e Make wait & stop methods work on all threads 7013471 Fix typo in parameter documentation (timeutils) ae931a9 Avoid TypeError in is_older_than, is_newer_than ad17a69 Fix filter() usage due to python 3 compability
Oslo version: 7a51572 Merge "Implement cache abstraction layer"
Date: Wed Jan 15 19:31:16 2014 +0000
Eric Harney [Thu, 16 Jan 2014 18:25:33 +0000 (13:25 -0500)]
Sync py3kcompat, sslutils, versionutils from Oslo
Dependencies identified by update.py for RPC update.
py3kcompat: 12d3bbc Add method quote_plus in module py3kcompat.urlutils 8575d87 Removed copyright from empty files 0d8f18b Use urlutils functions instead of urllib/urllib2 12bcdb7 Remove vim header 4c22556 Use py3kcompat urlutils functions instead of urlparse 71743d9 Add urlopen/URLError/pathname2url in urlutils 0f2906f py3kcompat: Add unquote eaec23b py3kcompat: Add urljoin compatibility 35c317b Fix capitalization, it's OpenStack 4d12ad1 python3: Import translation layer
sslutils: 8b2b0b7 Use hacking import_exceptions for gettextutils._ 12bcdb7 Remove vim header 1a2df89 Enable H302 hacking check 99b7c35 Convert kombu SSL version string into integer b0b37ce Fix IBM copyright strings f63ea05 Use oslo-config-2013.1b3 e50b68c Support for SSL in wsgi.Service
versionutils: 8b2b0b7 Use hacking import_exceptions for gettextutils._ a5ae087 fixed typos 45658e2 Fix violations of H302:import only modules 37ea814 Adds decorator to deprecate functions and methods 12bcdb7 Remove vim header d7d74a7 Add `versionutils` for version compatibility checks
Oslo version: 7a51572 Merge "Implement cache abstraction layer"
Date: Wed Jan 15 19:31:16 2014 +0000
Eric Harney [Thu, 16 Jan 2014 18:09:05 +0000 (13:09 -0500)]
Sync gettextutils from Oslo
Update gettextutils as a dependency for RPC updates
Requires changes within Cinder as well for
"get_localized_message" -> "translate" method rename.
221c37d Allow the Message class to have non-English default locales 0e1af5b Implementation of translation log handler f5686b1 Merge "Translation Message improvements" 8b2b0b7 Use hacking import_exceptions for gettextutils._ 2cfc1a7 Translation Message improvements 45658e2 Fix violations of H302:import only modules 12bcdb7 Remove vim header
Oslo version: 7a51572 Merge "Implement cache abstraction layer"
Date: Wed Jan 15 19:31:16 2014 +0000
Avishay Traeger [Wed, 22 Jan 2014 12:27:39 +0000 (14:27 +0200)]
Storwize driver cleanup
1. Moved Storwize driver into 'ibm' directory and refactored into
separate files to improve readability and debug-ability. Other IBM
drivers will be moved into this directory in a separate patch.
2. Errors coming from storage now raise VolumeBackendAPIException,
and those coming from the driver raise VolumeDriverException.
3. Fixed many pylint errors.
4. Removed any usage of mox from unit tests in favor of mock.
Li Min Liu [Thu, 9 Jan 2014 06:54:09 +0000 (14:54 +0800)]
Add support for retype in Storwize/SVC driver
In Storwize/SVC, retype can be handled by a few cases:
1. The change may just require setting an option on the volume
2. The change may require moving the data in the same pool (e.g.,
compression)
3. The scheduler may have chosen a different pool virtualized by the
same Storwize or SVC, in which case we move the data as in #2
Brick's TargetAdmin classes have a
default value set in __init__ for
iscsi_target_prefix. The unit test was changing
the value returned for the internal _get_target,
but wasn't changing the CONF.iscsi_target_prefix to
match. So the default value in the __init__ was
being used and hence the differences.
This patch sets the configuration's iscsi_target_prefix
which alters the values passed into the driver. This
also makes the tests consistent between the iqn of the volume
at create time and delete time.
KIYOHIRO ADACHI [Fri, 10 Jan 2014 09:22:36 +0000 (18:22 +0900)]
Remove unused exceptions
The following exceptions are not used.
class MigrationNotFound(NotFound):
class BadDriverResponseStatus(VolumeDriverException):
class InstanceNotFound(NotFound):
class VolumeRetypeFailed(CinderException):
class DuplicateSolidFireVolumeNames(SolidFireDriverException):
Fix up calculating space info for mirrored volumes
The status reporting in the lvm driver for cinder volume incorrectly
reports free capacity. This is due to a couple of issues:
a) the number of mirrors isn't taken into account
b) there are some pathological cases where a
simple division by total mirrors isn't sufficient
because all mirrors must be on separate physical volumes.
This commit is the first step of creating packages structure for
flows. This change is required to preserve git history of renamed files
for change I63473f549f0c501fe0f373830bc1080239d01892
Dirk Mueller [Thu, 16 Jan 2014 21:59:41 +0000 (22:59 +0100)]
Remove env from rootwrap filter
Allowing 'env' as a CommandFilter is similar to
allowing '/bin/bash', which makes all of rootwrap pointless.
Use EnvFilter instead. Change corresponding commands
that use env for setting C locale and adjust rootwrap
filters accordingly.
Several commands that output information that is
parsed as input by cinder change their behavior
based on the environment locale, which is depending
on local system settings. The code is however only
able to parse in C locale, so enforce that one.
Ollie Leahy [Thu, 12 Dec 2013 11:01:34 +0000 (11:01 +0000)]
Allow user to specify audit period.
The script 'cinder-volume-usage-audit' is generally run by cron to
generate volume and snapshot exists audit notifications that can be
consumed by ceilometer or other auditing systems. In this mode it sends
notifications for volumes that existed in the 'last completed audit
period' as calculated by cinder.utils.last_completed_audit_period()
However, it may sometimes be necessary to be able to send notifications
for audit periods other than than the last completed audit period. For
example if the host running the audit script was down for a period.
This patch provides three optional command line parameters to the script
cinder-volume-usage-audit. If no parameters are provided then the
operation of the script is unchanged. If parameters are provided then
they have the following effects:
--start_time specifies a date and time that is used in place of the
start of the last completed audit period.
--end_time specifies a date and time that is used in place of the end of
the last completed audit period.
--send_actions As well as sending exits notifications the script will
send any create or delete notifications that would have been sent during
the specified audit period.
Joel Friedly [Fri, 17 Jan 2014 01:19:26 +0000 (17:19 -0800)]
Use a mirrored mirror log
By default, LVM will sync the two mirrors of a logical volume on
creation. This is I/O intensive and it takes a long time though, so we
tell it not to with --nosync. The next default behavior is to create a
mirror log which says what portions of the mirrors are in sync. But
then if a disk backing a mirror log fails, we have to deal with
resyncing the mirrors at each reboot.
This commit tells LVM to use a mirrored mirror log, which will use
approximately 4MB of extra space, but means we'll never have to
sync mirrors, ever.
The base class FibreChannelDriver was
missing the new accept_transfer method.
This was caught while running the devstack
driver certification tests again the
3PAR FC driver.
This patch adds the missing method to the
base VolumeDriver.
Catch OSError(s) from os.getlogin() and fall back to looking at
environment variables to figure out the user's name. The OSError
is thrown where there is no tty for the python process when
os.getlogin() is called.
Swapnil Kulkarni [Thu, 16 Jan 2014 07:58:31 +0000 (13:28 +0530)]
Updates for version list to show correct references
Updated views to consider version while creating href.
Updated fakes to consider version while creating fake href.
Updated some test cases in v2 api which were using v1 as
expected output
Zhiteng Huang [Thu, 2 Jan 2014 06:16:18 +0000 (14:16 +0800)]
Pull Bug #1263122 fix for service module from Oslo
Get latest service module from Oslo mainly to avoid the impact of
bug #1263122 when multi-process API service is enabled.
Follow commits are included in this change:
* 8b2b0b7 2013-12-20 | Use hacking import_exceptions for gettextutils._
* 37e46bb 2013-12-20 | disable SIGHUP restart behavior in foreground
* 12bcdb7 2013-10-11 | Remove vim header
Zhiteng Huang [Thu, 2 Jan 2014 01:31:24 +0000 (09:31 +0800)]
Pull latest scheduler change from Oslo
The RetryFilter is now part of Oslo, although it's been renamed to
IgnoreAttemptedFilter. Thanks to entry_point, we are able to maintain
backwards compatibility after pulling that commit from Oslo.
Commits in this change:
* 66fe978 2013-12-10 | Change IgnoreAttemptedHostFilter to expect 'retry' key (attempt-retry)
* 135dd00 2013-12-10 | Remove start index 0 in range()
* 45658e2 2013-12-09 | Fix violations of H302:import only modules
* 70004c6 2013-12-04 | Add IgnoreAttemptedHostsFilter to oslo
* 880acf7 2013-11-14 | Change capabilities filters to use resource type (capfilter_message)
* 06e9d98 2013-11-10 | Add some log messages to capabilities_filter.py
* 3970d46 2013-11-02 | Fix typos in oslo
* 8718763 2013-08-19 | Replace list with dict in AvailabilityZoneFilter.host_passes
* c0d052a 2013-07-12 | python3: Add basic compatibility support.
* e3545f8 2013-06-02 | Enable hacking H402 test
* 484a1df 2013-05-30 | Enable hacking H403 test
* 35660da 2013-05-30 | Enable hacking H401 test
* 5dcc43b 2013-05-05 | Break out common functionality for filters and weights
* 1f2aba5 2013-05-03 | Renames filter to base_filter and weight to base_weight