To be able to point the taskflow logging at a task log
we need to be able to separate the logs coming from cinder
from the logs coming from taskflow (as well as the listener
that acts as the intermediary between both projects).
To start the process of having a detailed task log
location, add-in a new log setting that can be used for just
this purpose.
This is not the most ideal way of doing this, since it just
provides a sample logging configuration adjustment, but there
does not appear to be a better way (due to how
cinder/openstack/common/logging.py can't be modified or adjusted
with a better option).
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.
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.
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.
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.
John Griffith [Tue, 15 Jul 2014 17:45:17 +0000 (11:45 -0600)]
Update cinder generate_sample script
Cinder's generate sample script has fallen a
bit out of date and was no longer working properly
in local venv.
This patch updates it with a working version that
reads the rc file and makes some other updates.
Even better, we'll update the tox.ini file here so
that it actually works, and finally add some more
info to the error message when update check fails
to make is obvious how to run these appropriately.
Zhiteng Huang [Tue, 28 Jan 2014 06:23:04 +0000 (14:23 +0800)]
Add affinity/anti-affinity filters
Cinder has done a good job hiding the details of storage backends from end
users by using volume types. However there are use cases where users who
build their application on top of volumes would like to be able to 'choose'
where a volume be created on. How can Cinder provide such capability without
hurting the simplicity we have been keeping? Affinity/anti-affinity is one
of the flexibility we can provide without exposing details to backends.
The term affinity/anti-affinity here is to to describe the relationship
between two sets of volumes in terms of location. To limit the scope, we
describe one volume is affinity with the other one only when they reside in
the same volume back-end (this notion can be extended to volume pools if
volume pool support lands in Cinder); on the contrary, 'anti-affinity'
relation between two sets of volumes simply implies they are on different
Cinder back-ends (pools).
This affinity/anti-affinity filter filters Cinder backend based on hint
specified by end user. The hint expresses the affinity or anti-affinity
relation between new volumes and existing volume(s). This allows end
users to provide hints like 'please put this volume to a place that is
different from where Volume-XYZ resides in'.
This change adds two new filters to Cinder - SameBackendFilter and
DifferentBackendFilter. These two filters will look at the scheduler hint
provided by end users (via scheduler hint extension) and filter backends by
checking the 'host' of old and new volumes see if a backend meets the
requirement (being on the same backend as existing volume or not being on
the same backend(s) as existing volume(s)).
For example:
Volume A is on 'backend 1', to create Volume B on the same backend as A,
use:
cinder create --hint same_host=VolA-UUID SIZE
To create Volume C on different backend than that of A, use:
cinder create --hint different_host=VolA-UUID SIZE
Now, to create Volume D on different backend other than those of A and C,
use:
cinder create --hint different_host=VolA-UUID --hint
different_host=VolC-UUID SIZE
or:
cinder create --hint different_host="[VolA-UUID, VolC-UUID]" SIZE
liuqing [Mon, 30 Jun 2014 15:18:05 +0000 (23:18 +0800)]
Fix the section name in CONTRIBUTING.rst
The name of the section "If you're developer, start here"
has changed in the wiki, now is "If you're a developer".
This commit updates it to correctly refer to the
proper section.
After adding reset method when SIGHUP signal is sent to
wsgi service parent process,then it sends SIGHUP signal
to all of its child processes. Each child process handles
SIGHUP signal by first stopping the service and then calls
service start method again. When it stops the service, it
kills the eventlet thread, which internally closes the wsgi
server socket object. This server socket object is now not
usable again and it throws following error, while restarting
the service:
error: [Errno 9] Bad file descriptor
To resolve 'Bad file descriptor' error, creating duplicate
socket object, every time service starts.
John Griffith [Wed, 9 Jul 2014 21:34:50 +0000 (21:34 +0000)]
Clean up base Volume Driver
This is a preliminary cleanup of the base
Volume Driver to prepare for adding new
architecture which keeps the Control calls
and connection portions of the drivers
seperated from each other.
This doesn't break existing compatability or drivers
but just makes some of the necessary tweaks and additions
to enable implementation of decoupled Control and Data
sides of the Volume drivers.
POC for this proposal is here:
https://review.openstack.org/#/c/104701/
FYI check-up2-date is going to be the death of us all!
rajinir [Fri, 27 Jun 2014 19:53:07 +0000 (14:53 -0500)]
Fixes EqualLogic volume live migration.
Fixes the issue by enabling the multihost flag for the volume and also
discovering the correct access record to delete when terminating
the connection from the source vm and then deleting the record.
Jay S. Bryant [Mon, 7 Jul 2014 20:21:58 +0000 (15:21 -0500)]
Sync gettextutils.py from oslo-incubator
This pulls in the latest gettextutils.py from oslo-incubator.
The primary reason for this sync is to get commit 3d90045d2d1ce1df89f75937f415e3982e111063 which backports a
change from the new i18n library to check lazy enablement
at runtime. Adding this change makes it possible to remove
the global enablement of lazy translation through
gettextutils.install(). Instead we will use gettextutils.enable_lazy()
with explicit imports of _() in each file where _() is used.
The change to remove gettextutils.install() and to add the
explicit _() imports will come in a dependent patch.
Current HEAD in OSLO:
--------------------
Merge: 3d90045d2d1ce1df89f75937f415e3982e111063
Date: Mon, 07 Jul 2014 17:55:18 +0000
Merge "Backport code for i18n to check lazy at runtime"
--------------------
Additional changes being merged (newest to oldest):
-------------------- de4adbc4 - pep8: fixed multiple violations 9912e5df - Add API for creating translation functions 6cc96d05 - Fix test_gettextutils on Python 3
--------------------
related - blueprint: i18n-enablement
Change-Id: I4706b89b0b64c5816a1a022b6cd1dfa01b29b5dc
Cory Stone [Tue, 8 Jul 2014 20:01:04 +0000 (15:01 -0500)]
Remove $sqlite_db from default database connection
sqlite_db used to be a config option in the DEFAULT section. This
allowed it to be used in config template substitution. Now that it is in
the database section, the template substitution fails with a
NoSuchOptError.
The quick fix is to just hardcode the default connection option to refer
directly to 'cinder.sqlite' instead.
33afb20 Fix broken formatting of processutils.execute log statement 5e3d3a5 Mask passwords included without quotes at the ends of commands 6751b30 Remove extra whitespace
The most important part is '33afb20' which was broken cinder debug logging
on running commands after last oslo sync.
Cinder LVMiSCSI driver is using default value of write-cache parameter
of tgtd iscsi driver. In this setting, write I/O from guest instance is
cached on dirty cache of a host.(write-back mode)
In this case, data lost may be occurred if the host crashes before
flushing dirty cache. This may cause a lot of instances to lose
their data.
In order to avoid this issue, it is better to turn off the write cache.
(write-through mode)
This patch adds "iscsi_write_cache" parameter to configure a behavior of
write cache. The default value is "iscsi_write_cache=on".(write-back mode)
Tom Fifield [Tue, 24 Jun 2014 13:59:20 +0000 (21:59 +0800)]
Enhance docstring for iscsi_helper
The helptext for the iscsi_helper option did not mention the
potential to use lioadm (or fake). This patch simply amends
the text so this functionality is more discoverable.
This patch ensures that the FC ZoneManager
is called during for all cases in Cinder
that does a volume attach/detach for FC
enabled drivers.
The problem was that we had code in the volume
manager that manually called the ZoneManager,
after initialize_connection and terminate_connection,
but other places in Cinder were not calling the
ZoneManager.
This patch creates 2 new decorators that can
be used for any driver's initialize_connection
and terminate_connection call. The decorator
checks to make sure that the return value is for
a fibre_channel attachment and then calls the
ZoneManager's add_connection or delete_connection.
Change-Id: Ie3ae70785f500a140003ad3a8495e0ddc3516ea8
Closes-Bug: 1321798
Tom Cammann [Fri, 4 Jul 2014 08:22:46 +0000 (09:22 +0100)]
sync periodic_task fix from incubator
Set the value of time the periodic task was last run to a multiple of
the spacing value rather than the actual last time run. This ensures
tasks runs regularly but avoids synchronizing that interval with other
nodes.
This patch also removes the coalescing of tasks which are _nearby_ (0.2
seconds away).
Changes:
periodic_task
------------- 4dbd3aa Make periodic tasks run on regular spacing interval 21249f1 Fix parenthesis typo misunderstanding in periodic_task