Thang Pham [Fri, 20 Jun 2014 04:30:36 +0000 (00:30 -0400)]
Use pbr entry_points to setup the cinder scripts
The following patch changes how cinder scripts are
installed and unit tested. This patch moves all the
cinder scripts from bin into cinder/cmd and creates
entry_points for those scripts in setup.cfg. When
cinder is installed, these scripts will be installed
under /usr/local/bin by pbr.
DocImpact: 'host' config option for multiple-storage backends
in cinder.conf is renamed to 'backend_host' in order to avoid
a naming conflict with the 'host' to locate redis
Change-Id: If82cf0c58d765bf79dbf721ca95c10a468940cab
Implements: blueprint unit-test-cases-for-cinder-scripts
John Griffith [Fri, 5 Dec 2014 04:03:04 +0000 (21:03 -0700)]
Remove the cinder.conf.sample file
We removed the conf_uptodate checks however we didn't
remove the cinder.conf.sample file, but we should.
Now that we're not checking it, it's guaranteed that it will
most certainly be "wrong". So, this patch removes it, we'll
update the README.conf.sample file if/when we have an auto
published version available.
That change modified the methods to create/delete hosts in purity. The
REST API url was incorrectly pointing to /host/<host_name>/volume
instead of /host/<host_name>
This commit fixes the url and adds in unit tests to prevent this type of
regression in the future.
Xing Yang [Fri, 5 Dec 2014 22:55:28 +0000 (17:55 -0500)]
Fix a clone volume problem in VMAX driver
If the source volume contains meta members of different sizes,
create cloned volume will fail with error "ERROR_FAMILY_NOT_SUPPORTED".
This patched fixed this problem.
Zhiteng Huang [Fri, 5 Dec 2014 10:01:53 +0000 (18:01 +0800)]
Allow HostState to handle empty capabilities
In some cases, where the capabilities reported from driver is
emtpy, scheduler would raise exception thus unable to correctly
handle scheduling request even when other backend candidates are
able to fulfill the request. This change does some modifications
to HostState so that it is able to handle empty capabilities.
Eric Harney [Thu, 9 Oct 2014 20:26:18 +0000 (16:26 -0400)]
Remove lio_initiator_iqns
This is a holdover from the initial LIO implementation
which did not manage ACLs sufficiently. This is
unneeded now and handled by: 67dd248 LIO iSCSI initiator ACL auto-config
Jay S. Bryant [Wed, 3 Dec 2014 18:20:05 +0000 (12:20 -0600)]
Bring cinder up-to-date with new oslo libraries
New versions of the oslo libraries have been released and
this has broken Cinder in the gate. The first issue is
causing all unit tests to fail with the message:
"NoSuchOptError: no such option: fake_rabbit"
This was due to commit bcb3b23b8f6e7d01e38fdc031982558711bb7586
removing that option from oslo/messaging/_drivers/impl_rabbit.py .
We were trying to set that option in cinder/tests/conf_fixture.py .
I have removed that code.
Second, the update has made etc/cinder.conf.sample go out of date
again. I am merging the changes to bring it back up to date.
This change also disables execution of check_uptodate.sh execution
from the gate.
If a storage profile is part of a volume type, it should be used as a
requirement for datastore selection-- only datastores which satisfy the
storage profile should be used for backing VM creation. Currently in
retype API, if storage profiles in old and new volume types are same,
it is not passed as a requirement. Hence, the backing VM corresponding
to the volume might end up in a datastore which doesn't satisfy the
storage profile. This patch fixes the problem.
The change is being reverted as it broke the Brocade FC SAN lookup
functionality. The change uses configuration options from
ssh_utils that are not initialized when the Brocade driver is
run causing an exception to be thrown complaining that
CONF.ssh_hosts_key_file is used before it is initialized.
The right solution is to change the Brocade driver to use ssh_utils to
make SSH connections.
amoturi [Wed, 8 Oct 2014 04:32:28 +0000 (00:32 -0400)]
Add ability to zfssa driver to create multiple initiator groups
Currently the zfssa driver only support one initiator group. This
is causing broken scsi devices when detaching volumes from instances.
This fix adds support for configuring multiple initiator groups.
Mehdi Abaakouk [Tue, 2 Dec 2014 09:04:54 +0000 (10:04 +0100)]
Fix rpc initialization of cinder-manager volume
VolumeCommands.rpc_client is a property, so when the oslo.config argparser
introspect the class VolumeCommands at module loading time, it launch the
method. But the method depends on a initialized oslo.config.cfg.CONF object,
but this one is not yet initialized.
So don't use python property, to initialize the rpc_client correctly.
Kurt Martin [Tue, 2 Dec 2014 00:13:18 +0000 (16:13 -0800)]
Fix 3PAR drivers attempt to locate existing host
This patch fixes the current 3PAR drivers around attempting to locate
3PAR host that might already have volumes attached. The FC driver is
using the correct REST based queryHost but is not specifying the
parameters wwns=wwns when calling it. This was accidentally merged
during the removal on the local file locks.
The iSCSI driver was actually calling a SSH based findHost command
instead of the REST based queryHost based on iqns. The SSH based
command was failing with a session key error after a long idle time
between attaches.
Closes-Bug: 1398206
Mathieu Gagné [Thu, 26 Jun 2014 00:22:12 +0000 (20:22 -0400)]
Volume type access extension
This extension adds the ability to manage volume type access:
* Volume types are public by default
* Private volume types can be created by setting
the is_public boolean field to False at creation time.
* Access to a private volume type can be controlled
by adding or removing a project from it.
* Private volume types without projects are only visible
by users with the admin role/context.
Implementation details and unit tests were mostly adapted
from Nova flavor access extension.
DocImpact: New volume type access extension
Implements: blueprint private-volume-types
Change-Id: I8faf1d8097bf8412d4e169ec3503821351795561
John Griffith [Mon, 1 Dec 2014 21:01:26 +0000 (14:01 -0700)]
Don't use _execute directly in brick/iscsi
The brick/iscsi module has a run helper that
should be used for executing commands. There
are a number of inconsistencies where _execute
is called directly.
This patch moves everythign to use the run method
to keep things consistent and also to fix up some
potential issues with variables becoming corrupt
under heavy load.
John Griffith [Mon, 1 Dec 2014 20:29:02 +0000 (13:29 -0700)]
Deal with tgt already exists errors
This patch intends to provide a clear marker for
ER in the case that create export fails due to the
target entry already existing.
Also this patch will enable us to go ahead and just use
the existing target rather than bomb out and fail everything.
Root cause of why we're getting a second create is still
unknown and needs addressed, but this might help in getting
more info as well as keeping things stable until we address
the root issue.
Mathieu Gagné [Mon, 1 Dec 2014 20:13:28 +0000 (15:13 -0500)]
Fix find_autodoc_modules.sh to support OSX
When running 'find cinder/' on OSX platforms, all returned paths
will have 2 slashes (//). Because the script only strips
the first slash as per the CINDER_DIR value, we end up
with module names such as "cinder..db.api" in the documentation.
This change trims the leading dot if found to avoid this situation.
Bob Callaway [Tue, 21 Oct 2014 19:23:51 +0000 (15:23 -0400)]
Raise exception if invalid IP is specified
This patch ensures that all values specified for the configuration
option netapp_controller_ips are valid, rather than logging and
continuing with only the valid addresses.
git-harry [Mon, 1 Dec 2014 13:26:40 +0000 (13:26 +0000)]
Fix check_ssh_injection in cinder/utils
check_ssh_injection is used to prevent commands being modified using
specially constructed strings containing special characters.
The function includes a loop over the special characters to compare
them against each arg. If the special character is the same as the arg
it gets ignored.
This commit modifies this part of the function so that args that are
exactly equal to one of the special characters will cause an exception
to be raised.
git-harry [Tue, 25 Nov 2014 22:40:37 +0000 (22:40 +0000)]
Remove Python 2.6 backwards compatibility code
Python 2.6 is no longer supported in cinder as of kilo. The code in the
project that is specifically for compatibility with 2.6 is therefore no
longer required.
This commit removes code referenced as being required specifically for
compatibility with Python 2.6.
This commit removes:
- total_seconds from cinder/utils.py
- TestCase.assertGreater from cinder/test.py
- TestCase.assertGreaterEqual from cinder/test.py
- StorwizeSVCDriverTestCase.assertLessEqual from
cinder/tests/test_storwize_svc.py
Arne Wiebalck [Thu, 20 Nov 2014 07:36:34 +0000 (08:36 +0100)]
Add limited retype support for rbd
This patch enables limited retype support for rbd. In addition to
basic retyping between volume types that only differ in their name,
retyping between volume types that imply a change of the qos_specs
are supported. This hence allows to adapt the quality-of-service
settings of a volume after its creation.
All other changes, such as host migration, change of encryption or
changes of settings as defined by the extra_specs are not supported
by this commit and left for later patches.
John Griffith [Wed, 29 Oct 2014 19:34:54 +0000 (13:34 -0600)]
Add iSCSI Target objects as independent objects
This patch is a step in decoupling the target
methods and the Volume Driver's Control methods.
This adds the targets directory and the new target objects
that we use with the exception of IET (follow up for that later).
TgtAdm and LIO drivers have been tested with the new LVM object.
All existing drivers are still able to be specified and use the
same objects and code-path they were using previously. New
connector objects are only used when specifying the new driver.
Next step will be mapping current ref LVM driver to the new
LVM object and target model and continued work on the unit-tests.
After that mark the "old" methods and objects as deprecated
and we can then begin working on some other improvements.
Mike Mason [Tue, 25 Nov 2014 15:57:24 +0000 (15:57 +0000)]
Implementing the use of _L’x’/i18n markers
Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
git-harry [Tue, 25 Nov 2014 14:20:26 +0000 (14:20 +0000)]
Match mock.patch decorator with appropriate param
mock.patch and mock.patch.object can be used as decorators for mocking
within the scope of the function they decorate. When there are multiple
decorators it is important the function parameters relate to the
corresponding patch objects i.e. that the parameter order matches the
decorator order.
It is easiest to explain this with an example:
So the decorator closest to the function definition must correspond to
the first (left-most) patch parameter. Note, if the decorator is given a
third argument, the kwarg new, then the decorated function is not
passed an extra argument by that decorator.
Eric Harney [Fri, 21 Nov 2014 16:50:48 +0000 (11:50 -0500)]
Brick LVM: LV not found logging and error handling
Fix up two things in get_lv_info/get_volume:
1. ProcessExecutionError should be handled where we call the
command. We can just return an empty list for this case
which makes things simple for callers and consistent with
querying a VG.
2. Not found errors should be logged as info and not warning
since this is generally not actionable by the admin (and not
a problem).
Fix typo in lvm command output for not found test.
ChangBo Guo(gcb) [Mon, 24 Nov 2014 06:13:01 +0000 (14:13 +0800)]
Don't use module importutils from oslo-incubator
* Syncs latest module service
Removes its dependency for oslo-incubator module importutils.
Removes code which was never executed after switched to oslo.messaging.
Include changes: 5d40e14 Remove code that moved to oslo.i18n 6ede600 rpc, notifier: remove deprecated modules
* config.genrator has been removed from oslo-incubator, so update
config.generator to use importutils from oslo.utils directly.
Anthony Lee [Wed, 15 Oct 2014 21:16:32 +0000 (14:16 -0700)]
Removing locks from 3PAR FC and iSCSI drivers
Removed locks from the 3PAR FC and iSCSI drivers. In high load
environments where many simultaneous volume creations/deletions
and attaches/detaches are happening errors occur periodically.
By changing the drivers to create a new connection to the 3PAR
backend whenever a volume request is made the errors are avoided
and performance is improved.
git-harry [Sat, 22 Nov 2014 10:16:22 +0000 (10:16 +0000)]
Fix calls to assert_called_once in unit tests
Mock has a method called assert_called_once_with to check that a mock
was called and the arguments it took were as expected. Mock does not
have a method called assert_called_once and calling it just creates a
mock bound to that name. This means that not only is nothing tested
when assert_called_once is used, the tests also don't warn about this.
This commit attempts to address this in two ways:
- all occurrences of assert_called_once are replaced with a real
assertion.
- the hacking check that nova uses to guard against this has been
copied to cinder's local hacking checks.
Fixing the assert_called_once issues also highlighted other mistakes
in certain tests which were addressed to make the tests pass.
Due to the nature of mock, this issue is also possible if a method is
misspelt or just mistakenly used and so the hacking check is only
addressing one very specific case. That said, it does appear to be a
common mistake and so is worth singling out.
Clinton Knight [Wed, 17 Sep 2014 00:23:52 +0000 (20:23 -0400)]
Refactoring to allow addition of NetApp FibreChannel drivers
NetApp's five Cinder drivers have been in continuous development
for nearly 3 years, and it is now necessary to do some house-
cleaning. This commit splits long files that contain multiple
classes, fixes the class hierarchies to enable subclassing
different driver classes (ISCSIDriver, FibreChannelDriver),
and renames classes. It also begins the process of moving
unit test files into a matching hierarchy in the "tests" tree.
Sean McGinnis [Tue, 4 Nov 2014 11:15:26 +0000 (12:15 +0100)]
Add ability to create volume from image by image name.
Some cli commands allow specifying an image by either
its name or its ID. Creating a volume from an image
currently requires knowing the image ID. The request
was made to add the ability to create a volume using
the image name instead.
This patch adds the ability to accept either name or ID.
It will attempt to locate the image based on this input
and fail if neither can be matched. If found by name, it
will also verify there are not multiple images of the
same name. If this is the case it will require using the
ID to be explicit.
Will update python-cinderclient in a separate patch once
this has been merged to allow ID or name.
Eduardo Costa [Sun, 2 Nov 2014 15:06:12 +0000 (16:06 +0100)]
Fix exception message formatting
If the exception class made a reference to the "message" field in
its format string, it would be overriden with the value of the
"message" argument itself. It is now possible to use the "message"
field and preserve the desired message formatting. Test cases
provided.
The backing VM corresponding to a volume is cloned during create volume
from another volume, snapshot or image. The backing VM is also cloned
during retype and backup restore. Currently, the target ESX host is
unset while calling vCenter CloneVM_Task API and hence the source ESX
host is used as the target. If the destination datastore returned by
the datastore selection logic is not accessible to the source host,
clone fails. This patch fixes the problem by setting the target ESX
host (returned by datastore selection logic) while invoking clone.