Jay S. Bryant [Fri, 1 Aug 2014 20:43:51 +0000 (15:43 -0500)]
Add hacking check for use of LOG.audit
Commit 4dc37abc removes the few instances of LOG.audit that
were in Cinder. Given that the plan is to remove LOG.audit messages
from OpenStack, I am adding this hacking check to ensure that such
messages do not sneak their way back into Cinder.
Anthony Lee [Tue, 22 Jul 2014 18:40:21 +0000 (11:40 -0700)]
Add CHAP support for 3PAR ISCSI
Adds CHAP support to 3PAR ISCSI. Volume metadata will store
CHAP credentials to allow volumes to be attached to hosts on
a 3PAR backend. Credentials are generated when the first volume
is attached. Subsequent volumes lookup the CHAP credentials
from an existing volume already attached to the host.
Jeegn Chen [Fri, 8 Aug 2014 08:27:38 +0000 (16:27 +0800)]
EMC: Fix minor issue in VNX driver and unit tests
There were some minor issues in initial commit of VNX Direct Driver
Juno Update (https://review.openstack.org/#/c/104413/), such as typo,
unclear config option help message and missing period.
Anthony Lee [Thu, 7 Aug 2014 20:58:34 +0000 (13:58 -0700)]
Fixing LeftHand live migration error
Fixed a bug in the LeftHand driver that was causing an error to occur during
live migration of an instance that is attached to a volume. The solution was
to make sure server access is only requested for a volume if the iSCSI
session doesn't already have access enabled on the LeftHand backend.
Jay S. Bryant [Sat, 2 Aug 2014 23:06:38 +0000 (18:06 -0500)]
Improve regex for _ import hacking check
Commit 3e2b1117 added a check to make sure that the _
function was being explicitly imported so that translation would
work properly.
I have discovered that those regexes/code would not work in some cases.
Particularly if the import line imported multiple things from
gettextutils or i18n. Also the check being used to find lines using
the _ function was not right.
This commit fixes the issues and adds appropriate tests. It also
adds the hacking check to HACKING.rst which should have been done the
first time around.
Wu Wenxiang [Sun, 2 Mar 2014 14:20:49 +0000 (22:20 +0800)]
General cleanup of unused objects
* Remove unused function fake_get_remote_image_service
* Remove unused local function fake_execute2
* stub_out_key_pair_funcs() does nothing, remove it.
* Removed usage of enumerate()
All *Command classes are instantiating for each cinder-manage command
execution. RPC client should be initialized for VolumeCommands usage.
Some custom RPC clients (oslo.messaging backends) could init RPC
connection after client initialization so it is no need to create RPC
client for every cinder-manage command invoke.
When doing backup-restore operation, it needs volume's size is not less
than backup's size.
But in backup-restore routine, when volume's size is bigger than backup's
size, it logs the the info of volume's size and backup's size to warn
level, which I think it should log the info to info level.
This bug fix it.
John Griffith [Fri, 1 Aug 2014 23:10:55 +0000 (17:10 -0600)]
Add retry_on_deadlock to db update methods
There's some known races that have been addressed in
Nova via a retry_on_deadlock deocrator. Some known
cases in Cinder exist as well when dealing with updates
to quotas and reservations_expire.
This patch introduces the decorator to Cinder and hits
the methods known to be susceptible to deadlock as well
as some others that seem as though they'd fall into the
same category.
Li Min Liu [Tue, 5 Aug 2014 03:39:09 +0000 (11:39 +0800)]
Change the exception type for Storwize/SVC driver
When create a volume from snapshot or clone a volume,
Storwize/SVC require the same size for the source volume
and target, if not, will raise VolumeDriverException.
Zhiteng Huang [Fri, 1 Aug 2014 17:50:47 +0000 (01:50 +0800)]
Fix solidfire accept_transfer
Previous fix has a mistake which makes the situation worse. This change
fix volume['project_id'] and volume['user_id'] and adds unit test for
accept_transfer.
Volume creation from non-streamOptimized images (preallocated/thin/sparse)
has following problems:
1) Sparse vmdk image is not converted to appropriate virtual disk type
suitable for attaching to a nova instance.
2) The adapter type in image meta-data is ignored while creating volumes.
3) The vmware:vmdk_type extra_spec property is ignored.
4) Virtual disk extent operation is called with a wrong parameter which
might result in unwanted disk provisioning type conversion.
This patch fixes the first 3 problems using the following workflow:
a) Create a disk-less backing.
b) Create a virtual disk (single flat extent) from the non-streamOptimized
image
c) Attach the virtual disk to the backing
d) Clone the backing (if needed) to perform disk provisioning type conversion
* E711 comparison to None should be 'if cond is None:'
* E712 comparison to True should be 'if cond is True:' or 'if cond:'
* E713 test for membership should be 'not in'
This patch adds support for converting virtual disk provisioning
type during clone backing operation. Currently volume creation from
preallocated/sparse image doesn't honour the disk type property in
the volume extra spec. The workflow to address this issue requires
disk provisioning type conversion during clone.
This change adds support for attaching a virtual disk to an existing
backing VM. Currently volume creation from preallocated/sparse image doesn't
honour the disk type in the volume extra spec and adapter type in the image
meta-data. The workflow to address these issues requires the above mentioned
method. This change also sets the disk size of backing to at least 1MB which
is the minimum required by VIM APIs.
VNX Direct Driver has been contributed to Icehouse release.
This patch refactors driver and adds the following new features
* Array-based Backend Support
* FC Basic Support
* Target Port Selection for MPIO
* Initiator Auto Registration
* Storage Group Auto Deletion
* Multiple Authentication Type Support
* Storage-Assisted Volume Migration
* SP Toggle for HA
* Security File Support
* Advance LUN Features
# Compression Support
# Deduplication Support
# FAST VP Support
# FAST Cache Support
* Storage-assisted Retype
* External Volume Management
* Read-only Volume
* FC Auto Zoning
Certificate Test Results
https://bugs.launchpad.net/cinder/+bug/1336640
John Griffith [Wed, 30 Jul 2014 02:20:31 +0000 (20:20 -0600)]
Skip incompatible test on OSX
Can't seem to get the test:
cinder.tests.test_volume.VolumeTestCase.test_delete_no_dev_fails
to run right, tried macports and homebrew versions of fileutils
but still get makedir failures. Give up and just detect if OSX
and skip.
John Griffith [Tue, 29 Jul 2014 15:59:33 +0000 (09:59 -0600)]
Update ref used for notifications
When we update a snapshot status in the db, we need to
use the newly updated snapshot-ref object in the following
notification method call. Otherwise we're sending a
notifciation message with the old/outdated status
information.
NOTE: This also fixes the unit test that was written to
pass with the bug that existed in the notification.
John Griffith [Tue, 29 Jul 2014 15:41:06 +0000 (09:41 -0600)]
Add return of updated object on update from DB
There are a number of update methods in db/sqla/api
that update objects but no longer return the updated
reference for said object.
This patch adds the missing returns which are already
expected in the calling cidner/db/api wrapper. At some
point a close look at usage in callers
(ie cinder/volume/manager) should be done to make sure
we're being efficient here and not doing another get after
every update.
fixing the iSER transport protocol when using LVMISERDriver
ISER capabilities were broken in icehouse when trying to remove
duplication between ISCSIDriver and ISERDriver.
this fix does minimal changes in the code in order to fix
the capability.
the fix is basically re-adding the ISERTgtAdm and re-adding
the support in LVMISERDriver: change target_lun based on
iseradm.
Jay S. Bryant [Tue, 29 Jul 2014 03:03:42 +0000 (22:03 -0500)]
Add hacking check for vim headers
We have a number of commits that have removed the vim
headers from openstack/common components as well as
commits to remove the headers from drivers. We, however,
haven't put a hacking check in to make sure that they don't
sneak back into the code as is evidenced by the fact that some
files failed the check.
This commit adds in the check, the associated test cases and
fixes the couple of files that had a vim header again.
John Griffith [Mon, 28 Jul 2014 17:35:54 +0000 (11:35 -0600)]
Get updated model info on volume transfer
On some drivers CHAP credentials are tied to accounts
which may be unique for each OS and/or backend Tenant.
For example:
Volume is created with project_id xyz
Backend creates an account for xyz with specific CHAP
Volume is transferred to project_id abc
Currently we don't update the model_info, so even though
on the backend we updated the owner and CHAP settings we
never propogated that back up to the DB object so the volume
can't be used by the new owner.
This patch just adds an option to return model_update
on the accept_transfer call to the driver and updates
the db accordingly.
Also adds a call in the SF driver to actually get the
new model info to be fed back to the manager.
Matt Riedemann [Mon, 28 Jul 2014 13:19:23 +0000 (06:19 -0700)]
Sync log from oslo-incubator for isEnabledFor fix
Sync log.py to get commit:
726d00a Adjust oslo logging to provide adapter is enabled for
Which is needed to fix an issue with logging in flow_utils
when using python 2.6.
This also brings in dependencies.
Changes:
jsonutils
--------- ef37e03 Added missing jsonutils.dump() function
log
--- 726d00a Adjust oslo logging to provide adapter is enabled for 433fa0b Make logging_context_format_string optional in log.set_defaults ac92c06 Add default log level for websocket 5fd77eb Ability to customize default_log_levels for each project 4d9328c Python 3: enable tests/unit/test_log.py cb5a804 Move `mask_password` to strutils 3310d8d update new requests logger to default WARN
strutils
-------- cb5a804 Move `mask_password` to strutils
cinder-clear-rabbit-queues should be removed because it does not
appear to be widely used and there is no user documentation for
it. Also, RabbitMQ now includes a management plugin and CLI,
rabbitmqadmin, that allows you to delete queues and exchanges.
This script was also removed in nova as part of
https://review.openstack.org/#/c/40355/.
DocImpact: The RabbitMQ management plugin ships with rabbitmqadmin.
It supports RabbitMQ version 2.8.x and above.
Closes-Bug: #1348859
The reattach function in cinder-manage depends on
db.instance_get, which is not available in cinder db.
db.instance_get is only available in nova db. Hence, the
reattach function should be removed from cinder-manage.
Clark Boylan [Fri, 25 Jul 2014 21:33:10 +0000 (14:33 -0700)]
Set python hash seed to 0 in tox.ini
New tox (>=1.7.0) sets a random python hash seed by default. This is
generally good for testing because it will help keep projects working
regardless of the hash seed, but cinder unittests don't currently pass
with a random hash seed so set it to the python default seed.
This change will allow us to use new tox again and remove the
restriction on tox<=1.6.1 to run unittests.
Redundant setenvs for specific test envs are removed to prevent them
from overriding the PYTHONHASHSEED value.
Note this change will need to be backported to the stable branches to
keep unittests there working with new tox as well.
Mark Sturdevant [Fri, 4 Jul 2014 00:34:46 +0000 (17:34 -0700)]
HP 3PAR retype implementation
Add retype support to the HP 3PAR driver. The driver will modify the
volume's current userCPG, snapCPG provisioningType, and QOS settings, as
needed, to make the volume behave appropriately for the new type. The
existing retype framework handles what to do if the driver cannot retype
(when it returns False or raises an exception).
The combination of optional type-specified VV set, old-style scoped
extra-specs and QOS-specs will be resolved using existing code. So no
new interpretation of a mixed-up type specifications will be introduced
(no need to re-document these driver caveats).
Other than the usual validity checking, the 3PAR retype will have one
limitation. Retype will not be allowed if the volume has snapshots and
the retype would require modifying/tuning the snapCPG or userCPG.
the query for expire_reservations currently does a full table scan.
This adds an index so frequent invocations of expire does not bog
down the database.
Remove Hyper-V dependency in the Windows Cinder Volume Driver
Currently, the Windows Cinder Volume driver depends on the Hyper-V
feature in order to be able to access the WMI namespaces that
are used for some of the volume related operations.
Those WMI calls must be urgently replaced with Win32 calls in order
to provide CI tests performed on Windows Storage Server edition.
Jay S. Bryant [Thu, 24 Jul 2014 20:05:33 +0000 (15:05 -0500)]
Add hacking check for explicit import of _
Unit tests are not guaranteed to discover whether
the _() function has been explicitly imported to a file.
To ensure that people do not add messages with _() translations
without importing the function, I am adding this hacking check
to enforce the import of _ when it is needed.
The commit includes fixes for offenders found by the new
check.