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.
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.
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: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.
Avoid OSError in get_blkdev_major_minor with network filesystems
To avoid OSError (File not found) thrown for volumes on network filesystems
during volume copy with CONF.volume_copy_bps_limit, this patch adds a check
of whether the specified file is on the local block devices to
get_blkdev_major_minor().
It also adds a testcase for get_blkdev_major_minor with a file on nfs and
fixes it with a regular file.
VMware:Support for create disk and disk descriptor
This change adds utility methods for creating a virtual disk and virtual
disk descriptor. Currently volume creation from preallocated 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 require support for the
above mentioned methods.
Geraint North [Mon, 21 Jul 2014 20:14:45 +0000 (21:14 +0100)]
Implements new 'bootable' option for manage existing volume.
A 'bootable' option (defaults to False) can be passed as part of
the HTTP POST request to manage an existing volume. This is
passed into the database when the volume is created.
Also changes all drivers to use the more agnostic keys
'source-name' or 'source-id' when specifying
which existing volume to manage. This change is to support the
cinderclient change in https://review.openstack.org/#/c/76216/
to make it easier for CLI users to manage existing volumes
without having to know the implementation-specifics of the driver.
There is no test for cinder/hacking/check.py, the patch add test
for it. Also update the location in check.py to reference the
right path to add test cases.
Due to fact that when uploading a volume to an image the file is
opened in text mode and the different line endings style on
windows glance client won't be able to upload the desired file.
The solutions is to simply open the file in binary mode when
performing this action.
Geraint North [Mon, 21 Jul 2014 21:23:48 +0000 (22:23 +0100)]
Adds storwize_svc_npiv_compatibility_mode flag to Storwize/SVC driver
This configuration option allows the driver to function in an
environment where an attach operation occurs before the virtual FC
ports are logged into the fabric.
Today's behaviour (which is maintained as default behaviour) is to
only build the initiator_target_map for initiator ports that are
logged into the fabric, and error if there are no such ports.
If this new flag is set to True, then if no initiator ports are
found on the fabric, ALL initiator ports are placed into the
initiator_target_map, rather than none, which is the case today.
Jay S. Bryant [Mon, 21 Jul 2014 01:14:27 +0000 (20:14 -0500)]
Add additional explicit imports of _ where needed
It appears that I missed some of the needed explicit
imports of _. I have now run through all the /bin/cinder-*
functions and ensured that they can be properly started.
This patch adds additional imports of _ and also changes
cinder-rtstool to use the 'cinder' domain as was suggested by
Duncan Thomas in the first review cycle.
Fix failure of source volume deletion in migrate_volume_completion
In VolumeManager.migrate_volume_completion(), when volume_status is not
'retyping', status_update is not set. However, status_update is always
referenced as dictionary on volume deletion path, so it fails to delete
migration source volume. This patch fixes the issue.
The following commit 4fdcbff96790753a4c1a508600e5d78b2c3b7172
introduced a few hard coded references to
'/home/jsbryant/cinder-dev/gettextutilsSync/' in
cinder/openstack/common/gettextutils.py. This patch will
removed those references.
Jay S. Bryant [Tue, 8 Jul 2014 19:04:56 +0000 (14:04 -0500)]
Enable lazy translation for Cinder
This patch is the final step for getting lazy translation
re-enabled for Cinder. It removes the use of gettextutils.install()
which is no longer needed with the addition of the explicit import
of _() in all of Cinder's files. The configuration of 'cinder' catalog
is handled by gettextutils.
The install() function is replaced by gettextutils.enable_lazy() which
properly enables lazy translation when _() or _LX() is used.
Jay S. Bryant [Thu, 26 Jun 2014 21:22:17 +0000 (16:22 -0500)]
Explicitly import _() in Cinder code
To ensure that logs are properly translated and logged to
the Cinder log files (using the Cinder message catalogs)
we need to explicitly import _() in any python files that
use the _() function.
Angela Smith [Wed, 4 Jun 2014 19:12:15 +0000 (12:12 -0700)]
Fix performance issues with brocade zone driver.
Removed firmware checks from common path as the ssh invoke_shell
was taking 5 seconds to complete for each firmware check.
Refactored to only do cfgsave in non-activate case.
Removed extra calls to switch to get the active zoneset.
John Griffith [Wed, 16 Jul 2014 14:49:37 +0000 (08:49 -0600)]
Don't leave snapshots on the floor
The current cloning process in the LVM
driver uses a snapshot to do the data
copy in the background. Trouble here
is that if the creation or activation
of the new volume fails, we don't
cleanup the snapshot we created.
Just move the create_volume and activate
calls down into the try block so the finally
clause can do the cleanup for us.
John Griffith [Wed, 16 Jul 2014 13:34:16 +0000 (13:34 +0000)]
Add some log info for NoValidHost
Currently when a create call fails due to a
misconfiguration on the backend, or a problem
with satisfying the extra-specs from the filter
scheduler, the only thing you get in the logs is
a "No valid host".
This patch just adds a tiny bit more info to give us
a better idea where we're at.
First the exception shouldn't be setup with "reason=""",
so at least add "reason=no weighed hosts found".
Second, add a warning message prior to getting to that
point when we fail to find a host that satisfies the
{extra/qos}-specs that were requested, and include what
was being requested.