Mathieu Gagné [Mon, 13 May 2013 21:05:21 +0000 (17:05 -0400)]
solidfire: Add ability to override account prefix
The SolidFire account is created with a prefix based on the hostname
of the host running cinder-volume. This prevents cinder-volume from
being run in an active/active setup.
This patch introduces a new configuration option sf_account_prefix
to override the prefix used when a SolidFire account is created.
If sf_account_prefix is empty, no prefix will be added to
the SolidFire account name when created.
John Griffith [Wed, 8 May 2013 05:11:50 +0000 (23:11 -0600)]
Create an LVM utility to use for local storage.
This adds a simple LVM class for performing local
LVM operations. The idea is that an LVM object
is instantiated based on a volume group, init
can be used to instantiate and query an existing
volume group, or create a new one if given a list
of PV's to use in creation.
See BP for information on where this is going and
how it will be used in Cinder and hopefully other
projects.
Mark McLoughlin [Wed, 8 May 2013 12:52:51 +0000 (13:52 +0100)]
Add CINDER_LOCALEDIR env variable
Part of fixing bug #995287
Syncs these two commits from oslo-incubator:
Support overriding oslo localedir too
Add a gettextutils.install() helper function
to get a new gettextutils.install() function which allows the default
localedir to be overwritten via an environment variable.
Note that gettextutils.install() must be called before any other cinder
modules are imported since some modules attempt to translate strings
at import time (e.g. in cinder.flags). This is broken and inefficient,
but fixing it involves adding something like sphinx's l_() function and
would be very invaisve.
Mark McLoughlin [Wed, 8 May 2013 12:52:42 +0000 (13:52 +0100)]
Remove gettext.install() from cinder/__init__.py
The gettext.install() function installs a builtin _() function which
translates a string in the translation domain supplied to the install()
function. If gettext.install() is called multiple times, it's the last
call to the function which wins and the last supplied translation domain
which is used e.g.
Usually this function is called early on in a toplevel script and we
assume that no other code will call it and override the installed _().
However, in Cinder, we have taken a shortcut to avoid having to call it
explicitly from each script and instead call it from cinder/__init__.py.
This shortcut would be perfectly fine if we were absolutely sure that
nova modules would never be imported from another program. It's probably
quite incorrect for a program to use cinder code (indeed, if we wanted
to support this, Cinder code shouldn't use the default _() function) but
nevertheless there are some corner cases where it happens. For example,
the keystoneclient auth_token middleware tries to import cfg from
cinder.openstack and this in turn causes gettext.install('cinder') in
other projects like glance or quantum.
To avoid any doubt here, let's just rip out the shortcut and always
call gettext.install() from the top-level script.
However, there's a bit of an annoying detail here - by default,
nosetests starts in the current directly and tries to import all modules
it finds to look for tests. Without the _() builtin installed, importing
some modules like cinder.flags will fail.
Since it only ever makes sense to load tests from the cinder/tests dir,
we can ask nose to do that by using the --tests argument via setup.cfg.
This patch fixes the ability to set the volume_backend_name
for each driver. The original bug was filed against LeftHand
and 3PAR, but several drivers exhibited a fixed backend name.
Dermot Tynan [Thu, 2 May 2013 10:02:05 +0000 (11:02 +0100)]
Check that volume is at least minDisk size.
The Image service (such as Glance) provides a minDisk parameter to
indicate the minimum required disk size for the image. This change
ensures that the guidance is followed in the case of bootable
volumes.
John Griffith [Wed, 1 May 2013 17:26:18 +0000 (11:26 -0600)]
Remove old_name from kwargs when using IET helper.
The IET driver passes the input kwargs from export
directly to the IET driver, but one of the keys here
is specifically for migration and a bug associated with
going from nova-vol to cinder-uuid's.
This patch just checks in the IET code if we have the key set
and if so pops it out before passing through to iet.
Mark McLoughlin [Thu, 2 May 2013 09:22:26 +0000 (10:22 +0100)]
Copy the RHEL6 eventlet workaround from Oslo
Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.
John Griffith [Tue, 30 Apr 2013 19:05:40 +0000 (13:05 -0600)]
Fix LHN driver to allow backend name configuration
The LHN driver wasn't allowing custom volume_backend_name to be set
via multi-backend configuration input. In addition there were some
issues with the updating that are also addressed in this patch.
There are other drivers that are going to need updated/fixed for
this same problem, but those will be addressed in a separate patch/bug.
Michael Kerrin [Wed, 17 Apr 2013 15:36:28 +0000 (15:36 +0000)]
Deleting a backup removed the backup record from database
Instead we should be marking the backup as deleted so that we have an audit
of all the backups. Backups are now marked deleted in the way that volumes
are.
This method is buggy because it works only on host machine with english language, and
apparently this method is also useless because we don't need to check if a path exist if
we can use command option -p for "mkdir" command and option -f for "rm" command.
If the CinderVolume service is restarted while an image-copy is
happening, the volume gets left in a 'downloading' state and
cannot be used or deleted. This fix adds code to init_host to
look for volumes (on this host) in such a state, and move them
to an error state. It also calls clear_download in the driver
in case the driver needs to perform an action, such as
detaching the volume.
Jay S. Bryant [Wed, 24 Apr 2013 17:56:03 +0000 (12:56 -0500)]
Avoid using whitespace in test_safe_parse_xml.
Updates the test_safe_parse_xml test case in
cinder.tests.test_utils.GenericUtilsTestCase to avoid using
whitespaces and to ignore extraneous newlines returned in the
parsed XML. This is required to work around differences in
the output from minidom in python 2.6.
John Griffith [Fri, 12 Apr 2013 17:11:38 +0000 (11:11 -0600)]
Add stats reporting to Nexenta Driver
Nexenta driver was never updated to report stats.
This change doesn't include support for backend_name assignment
via configs, there's some other work that will need to be
done to enable that.
Joseph Glanville [Wed, 10 Apr 2013 23:02:42 +0000 (16:02 -0700)]
iscsi: Add ability to specify or autodetect block vs fileio
When using block devices to back iSCSI logical units it is
advantageous to use blockio as it decreases latency and
increases throughput, effect is especially pronounced with
faster backing storage devices.
test_get_method_unknown_controller_action was defined twice,
checking however for different things. Rename the 2nd instance
to test_get_method_undefined_controller_action instead, otherwise
it gets overwritten later and not run. Increases test coverage
Michael Kerrin [Tue, 16 Apr 2013 08:09:35 +0000 (08:09 +0000)]
Cinder wasn't filtering the backups returned to backup list API
This has the side effect of return all backups in the system (regardless of
who created them) to the user. You should only see the backups created in your
current active project.
Yang Yu [Wed, 17 Apr 2013 08:00:07 +0000 (16:00 +0800)]
cinder volume service keeps retrying even code exception
Make sure that ProcessLauncher does not try to restart the failed
service. And make sure the ProcessLauncher exits, when the number
of the failed services equal the number of total services.
John Griffith [Fri, 12 Apr 2013 02:05:01 +0000 (20:05 -0600)]
Add capabilities reporting to ThinLVM driver
ThinLVM driver was missing the newly required capabilities reporting
and inheritance from the parent LVM driver doesn't work because the
capacity reporting methods between regular LVM and Thin LVM are not
compatible.
This patch add the basic requirements needed in the capabilities reporting
to make it usable by the filter scheduler.
The tests were failing due to an upgrade in the testing framework
(possibly due to upgrade of nose package from 1.2.1 to 1.3.0).
The actual reason was a bug in the suds client. A simple
workaround is utilised here, which sets the logging level of a
suds file to INFO instead of DEBUG.
Some 'FutureWarning' warnings from the test output were also
fixed.
John Griffith [Wed, 10 Apr 2013 05:07:52 +0000 (23:07 -0600)]
Add parsing to extra-specs key check
When using the filter scheduler which is now the default,
we can no longer pass in extra-specs like: {minIOPS:500, ....},
because the capabilities filter will reject this because there is
no host reporting minIOPS:500 capabilities.
We now need to scope the keys (ie qos:minIOPS:500....), but
that unfortunately requires a fix to the SolidFire driver.
This change add a check for the ':' in the key, and parses
on it if it's there.
Also fixes backend_name and uses VERSION var instead of
generating string in stats reporting.
Use a SSH pool to hold all SSH clients.It allows 4 SSH clients
at most to connect to the SSH server at the same time.
This patchset also enables every SSH client connect to the other
controller when they failed to connect to the current controller.
For example,failed to A,then to B,or,failed to B,then to A.
John Griffith [Fri, 12 Apr 2013 00:42:59 +0000 (18:42 -0600)]
Remove Flags usage from cinder.volume.driver
cinder.volume.driver was using a mix of FLAGS and the
new conf options for multi-backend. The result was failure
of multi-backend configrations to set the iscsi_helper
option.
This updates the driver.py file to use the OSLO.cfg and fixes the
check for iscsi_helper check in the initialize_connection call,
which was undefined.
Inconsistencies in the command line syntax between Storwize/SVC
models and firmware versions caused driver failures. This patch
makes commands compatible to fix driver crashes on the V3700 and
controllers with firmware version 6.3.
ID was being printed as %d instead of %s, causing tests to fail. This
error was previously undetected.
In addition, NetApp tests are failing due to a bug in the suds
package, which is no longer actively maintained. This patch adds skips
to the problematic tests, which should be removed once the issue is
resolved.
The code tested by test_preattach_status_volume was moved, and the
test no longer tested anything relevant (i.e., instead of checking
that the volume is 'attached', the test was changed to test for
'available' since the attach code was moved). This patch, therefore,
deletes that test.
Further, test_run_attach_detach_volume called database functions for
attaching and detaching. This patch changes those calls to call
higher-level functions which in turn call the database functions. This
gives better code coverage and gives the tests more meaning.