This commit broke the ability to create Iscsi targets w/
cinder-rtstool. Everything seems to be working fine except there
are issues with regards to how rtstool output is parsed in that
any output (regardless of exit status) causes the command
to be marked as failed.
Suggesting this as a quick revert until we can investigate
the proper fix for error handling with cinder-rtstool.
John Griffith [Fri, 19 Dec 2014 19:25:30 +0000 (19:25 +0000)]
Fix format errors in brick/iscsi LOG messages
Currently in cinder.brick.iscsi.iscs:LioADM.create_iscsi_target
The Log message for the exception is:
LOG.error("%s" % e),
This rightfully results in:
*** UnicodeError: UnicodeError(u'Message objects
do not support str() because they may contain
non-ascii characters. Please use unicode() or
translate() instead.',)
In some cases this causes the Volume service to stop and
doesn't help a ton with debug. While looking at this also
noticed a number of other similar cases where invalid LOG
messages were set up. Following the i8n guidelines here:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Went ahead and cleaned the bulk of the LOG messages in this
file up to adhere to the guidelines as well as fixing the
UnicodeError described in the bug.
John Griffith [Sat, 20 Dec 2014 00:45:16 +0000 (17:45 -0700)]
Set iet_conf to nonexistent file in unit test
The Iet test in test_iscsi isn't setup to deal with
an actual iet.conf file. The result is that if you happen
to be on a system that has an iet.conf file the test will fail
when it gets to the os.stat check.
This patch just uses a tempdir with a bogus file name that is
set as the iet_conf option to make sure the test never runs into
a situation where the file is actually there.
John Griffith [Fri, 19 Dec 2014 22:14:22 +0000 (15:14 -0700)]
Add a provider_id column to Volumes and Snapshots
There are a number of cases where there's some really ugly mapping
work in drivers to try and map the backend device-id to the
Cinder ID of a Volume or Snapshot. Most drivers seem to work around this in
their own creative ways using their own mechanisms (metadata,
naming schemes etc).
It seems like it would be useful for a number of reasons however to
go ahead and add a simple column to the Volumes table that could be
used for storing a backend ID for the Volume and Snapshot.
Mike Perez [Fri, 19 Dec 2014 23:44:04 +0000 (15:44 -0800)]
Mock leaked _execute() calls in driver tests
Some drivers have _execute() calls being linked, causing tests to prompt
for password and eventual fail for time out. This prevents those
_execute calls from happening.
Jay S. Bryant [Fri, 19 Dec 2014 23:24:58 +0000 (17:24 -0600)]
Sync request_utils module from oslo-incubator
The request_utils module hasn't had a sync done since shortly
after the module was added. This patch brings us up to date
with the latest oslo-incubator code.
This sync is needed to enable removal of the old gettextutils
and i18n code.
Current HEAD in OSLO:
---------------------
commit 36b0e8570b449129d6d474c03b02ceb62edb78df
Date: Thu Dec 11 11:27:08 2014 +0100
We shouldn't replace `oslo-incubator` in comments
Changes being merged with this patch:
--------------------- 5d40e143 - Remove code that moved to oslo.i18n 39625e18 - Set pbr 'warnerrors' option for doc build
Mitsuhiro Tanino [Thu, 18 Dec 2014 14:07:24 +0000 (09:07 -0500)]
LVM: Volume is deleted unexpectedly during volume migration
When using LVMISCSIDriver, a volume is unexpectedly deleted during
volume migration operation. This problem only occurs when the
volume_group of backend A and backend B is same value such as
misconfiguration. Even if the configuration is wrong, cinder should
not delete the volume unexpectedly for user.
Jay S. Bryant [Fri, 19 Dec 2014 20:37:45 +0000 (14:37 -0600)]
Sync install_venv_common from oslo-incubator
The install_venv_common modules hasn't had a sync done
since early in the icehouse release. This sync brings
Cinder's version up to date with the latest code.
Current HEAD in OSLO:
---------------------
commit 36b0e8570b449129d6d474c03b02ceb62edb78df
Date: Thu Dec 11 11:27:08 2014 +0100
We shouldn't replace `oslo-incubator` in comments
Change being merged with this patch:
--------------------- fe3389e5 - Improve help strings
John Griffith [Fri, 19 Dec 2014 19:32:02 +0000 (19:32 +0000)]
rtstool on Ubuntu installs in /usr/local/bin
The cinder-rtstool which is required to use LIO iscsi_helper
installs in /usr/local/bin on Ubuntu and /usr/bin on RHEL
variants. Currently the rootwrap.conf only has /usr/bin
configured, as a result LIO can't be used on Ubuntu without
modifying the rootwrap file.
This patch just adds /usr/local/bin to the rootwrap.conf; Honestly
I'm not sure if this is good, bad or doesn't matter. May be able
to address this via documentation, or upstream in the packaging of
cinder-rtstool instead? Not sure what's preferred.
Tom Barron [Tue, 9 Dec 2014 09:46:29 +0000 (04:46 -0500)]
Mock calls to rpm and dpkg from NetApp unit tests
This patch fixes an issue wherein several NetApp unit tests ran
OS rpm or dpkg commands because the callouts to these commands
were not mocked out during driver initialization.
It also replaces 'rpm -qa' with 'rpm -q' when that command is
invoked since the latter also works and is faster.
Jay S. Bryant [Fri, 19 Dec 2014 15:37:19 +0000 (09:37 -0600)]
Fix files in Cinder with execute bit set
I noticed there were a number of files in the cinder/volume
directory tree that have the execute bit set for no apparent
reason. I think in all cases it was because that was just
they way the permissions on the file were originally set based
on the user's umask settings.
This patch changes the permissions to be consistent with the other
python files in the cinder/volume directory.
Daniel Wilson [Wed, 17 Dec 2014 20:05:44 +0000 (12:05 -0800)]
Add error handling to _connect function in PureISCSIDriver
The driver was throwing an exception when trying to connect a volume
to a host when they were already connected. This change catches the
exception and looks up the existing connection information to use as
a return value.
John Griffith [Thu, 18 Dec 2014 16:26:12 +0000 (09:26 -0700)]
Remove redundant args for clone_image method
The clone_image method takes both image_id and image_meta
as arguments. No big deal, except the image id is included
in the image_meta; so there's really no reason to have both.
This patch removes the image_id argument and updates those
drivers that implement clone_image to extract the image ID
from the provided image_metadata.
kedar-vidvans [Tue, 9 Dec 2014 19:48:08 +0000 (14:48 -0500)]
Add Oracle ZFSSA NFS Cinder Driver Support
This change will add a new Oracle ZFSSA NFS Driver to Cinder.
This driver supports all minimum features required by a driver for the kilo release.
This driver uses the base nfs driver methods for creating and deleting volumes.
Certification test results: https://bugs.launchpad.net/cinder/+bug/1400406
Erlon R. Cruz [Thu, 27 Nov 2014 18:45:10 +0000 (16:45 -0200)]
Fix HNAS driver initialization
In iSCSI driver, when CHAP authentication is enabled, the driver would throw
an error message in the attempt to create the first volume after the driver
initialization. This is fixed by passing the right value to set_targetsecret.
Jay S. Bryant [Wed, 26 Nov 2014 00:10:15 +0000 (18:10 -0600)]
Make GPFS driver compliant with logging standards
This patch adds the log level markers (_LI, _LE or _LW) where they
were missing. It also changes the use of '%' to ',' for inserting
variables into log messages. These changes are made based on the
guidelines in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Xing Yang [Sun, 7 Dec 2014 19:57:27 +0000 (14:57 -0500)]
Fixed wait for job completion in VMAX driver
The VMAX driver used non-thread-safe variables in the wait for job
completion routines, resulting in failures or timeouts during concurrent
operations. This patch fixed the problem.
Patrick East [Fri, 5 Dec 2014 18:18:46 +0000 (10:18 -0800)]
Add support for Purity Protection Groups to PureISCSIDriver
We will be needing access to the Protection Group features of Purity to
enable features like Replication and Consistency Groups. To do this we
need to add new helpers for the FlashArray object for the required REST
API methods.
DocImpact: To bring in pgroup support we will need to bump up the
required REST API version to 1.2+ and remove support for 1.0 and 1.1
Jordan Tardif [Mon, 15 Sep 2014 21:59:06 +0000 (17:59 -0400)]
Catch ImageNotFound exception when deleting rbd volume
When deleting a rbd volume it is possible for remove() to
throw a ImageNotFound exception. In this case we should
catch the exception, so the volume delete can continue.
John Griffith [Mon, 15 Dec 2014 22:59:12 +0000 (22:59 +0000)]
Isolate Cinder Attach and Connect in Base Driver
The base Cinder Driver combines the Attach process and the
actual Connect process all under the Attach method. This makes
sense, but the method can be split between the parts that perform
things like DB updates and RPC calls and those that just take iqn
info and actually make connections to the Cinder Volume Node.
This would allow Drivers to utilize the connector portion of the
code to add enhancements of their own.
Gary W. Smith [Mon, 15 Dec 2014 22:38:26 +0000 (14:38 -0800)]
Uncouple scheduler stats from volume creation
Capture and report scheduler stats independently from volume creation.
Without this scheduler stats were not reported until the first volume
creation and were subsequently only updated each time a volume was
created.
David Pineau [Mon, 1 Dec 2014 11:21:35 +0000 (12:21 +0100)]
Add Scality SRB driver
This patch implements the `srb-driver` blueprint. It uses a similar
approach as Ceph's RBD in the way it exposes a block device to the
system.
The driver controls the SRB Linux kernel driver through a sysfs
interface and leverages LVM for snapshot management. The native block
driver talks to Scality's storage system (or any other vendor exposing
a compatible CDMI interface) through a HTTP-based RESTful protocol.
Bob-OpenStack [Mon, 24 Nov 2014 02:11:22 +0000 (18:11 -0800)]
Update volume driver for Huawei storage system
This driver is similar to the previous one, but contains
the following differences:
1. Remove smart tier support because that our product does not
support smart tier any more. 18000 does not support smart
tier, so this has no problem with 18000 series.
2. Update qos support implementation.
3. Add synchronization because that our tests show that when we
create volumes or snapshots in batch in a shell script with cli
command, our array may occur error.
Certification test result for Huawei storage drivers:
https://bugs.launchpad.net/cinder/+bug/1399038
zhangni [Thu, 4 Dec 2014 08:38:18 +0000 (16:38 +0800)]
Implement Huawei SDSHypervisor connector
Huawei SDSHypervisor uses a private key-value data protocal,
so we add a new connector inherited from InitiatorConnector
and implement connect_volume and disconnect_volume.
The connector uses sds_cli cmd to implement attach/detach/querydev vol,
sds_cli will be put to a specific dir and the path is registered as a
system environment variable when sds is installed.
Gloria Gu [Fri, 5 Dec 2014 01:59:10 +0000 (17:59 -0800)]
Added volume type description for volume type API
- Added the following APIs and tests for volume type
* update volume type
PUT http://<openstackhost>:8776/v2/${tenant_id}/types/${vol_type_id}
body
{
"volume_type": {
"description":"updated_desc"
}
}
** user can update description.
** if update description, descripiton can be empty spaces.
** description can not be None
** only admin can access this API
*get default volume type
GET http://<openstackhost>:8776/v2/${tenant_id}/types/default
** if default_volume_type is specified in cinder.conf and is valid,
the default volume type will be returned.
** if default_volume_type is not specified in cinder.conf or is not
valid, it will return 404 with a message saying default volume type
can not be found.
- Updated the following APIs and tests for volume type
* create volume type should take description as an option.
* list volume types or get one volume type will include description for
volume type if the description is not None.
- Upgraded the database cinder on table volume_types to include
the description. database upgrade/downgrade scripts and tests
are added.
- update API should send a notification to the message bus when
updating succeeds or fails.
- as of 12/5/2014, had to rebase with master which has volume type
access change, I also fixed the tests in that area in order to get
the unit tests pass.
Kurt Martin [Mon, 15 Dec 2014 23:14:42 +0000 (15:14 -0800)]
Fix 3PAR driver hang on SSH calls
In removing the 3PAR driver local file locks, part of the fix included
making a new SSH connection for each call in the hp3parclient as
oppose to leaving a connection open. Older hp3parclients(3.1.1 and
later) will result in the SSH calls hanging at driver initilization time.
This patch will now check against the correct minimum hp3parclient version
and remove the need for checking of the SSH args version since the minimum
hp3parclient is now greater than 3.1.1
Closes-Bug: #1402115
Anton Arefiev [Mon, 15 Dec 2014 10:33:38 +0000 (12:33 +0200)]
Delete default volume size 100M in drivers
There is check: if volume size == 0 we set default value to 100M,
it uses only in tests and it's little bit confusing.Use code only
for tests in drivers is bad practice.
Also the create volume flow already won't let user to create
a volume with size 0. So it was decided to remove this check.
Peter Pentchev [Wed, 3 Dec 2014 12:49:23 +0000 (14:49 +0200)]
Add the StorPool block storage driver.
StorPool is distributed data storage software running on standard x86
servers. StorPool aggregates the performance and capacity of all drives
into a shared pool of storage distributed among the servers. Within
this storage pool the user creates thin-provisioned volumes that are
exposed to the clients as block devices. StorPool consists of two parts
wrapped in one package - a server and a client. The StorPool server
allows a hypervisor to act as a storage node, while the StorPool client
allows a hypervisor node to access the storage pool and act as a compute
node. In OpenStack terms the StorPool solution allows each hypervisor
node to be both a storage and a compute node simultaneously.
To make full use of StorPool's native network communication protocol,
the Nova compute nodes will need to use the StorPool libvirt volume
attachment driver, nova.virt.libvirt.storpool.LibvirtStorPoolVolumeDriver.
Erlon R. Cruz [Thu, 11 Dec 2014 10:46:31 +0000 (08:46 -0200)]
Fix HNAS driver confusing error message
The error message shown when the parser finds a parser error
says, 'file not found' which causes confusion on the user when
he/she needs to debug the real cause o the problem. This patch fix
this by testing first if the file exist and then throwing a
proper error message.
John Griffith [Sun, 14 Dec 2014 19:02:30 +0000 (12:02 -0700)]
Remove iscsi_helper calls from base iscsi driver
There are a number of drivers that inherit from the base
iscsi driver, using the base implementation of initialize_connection
and terminate_connection. These drivers also don't have iscsi_helper
defined.
We've kept all iscsi_helper specific code in the tgt helpers
themselves, or in the various versions of the LVM driver
which is where they belong.
Over time however there have been some iscsi_helper specific
calls that have crept in to the base volume.driver:ISCSIDriver
class. These were LIO specific calls and as a result when a
configuration is set with multi-backend to use lioadm as the
target helper, or even if it's not used but the default iscsi_helper
is set to lioadm the initialize_connection and terminate_connection
calls will try and access the LIO specific calls and raise because
the drivers inheriting from this class don't have target_helper
members.
This went unnoticed mostly because there's no significant LIO testing
in place and there were no distros setting LIO as the default iscsi_helper,
it appears that this has changed however.
This patch moves the LIO specific calls back where they belong
and keeps the base ISCSIDriver generic. I've also added a test
case for this in the SolidFire driver because it's impacted by
this.
Tom Swanson [Wed, 3 Dec 2014 19:24:39 +0000 (13:24 -0600)]
Add Support for Dell Storage Center
This driver implements cinder FC and iSCSI volume drivers.
The file dell_storagecenter_api.py is called to interface with the
Dell Storage Center backend via a REST interface.
Dell_storagecenter_common.py is the base class implementation with
dell_storagecenter_fc.py and dell_storagecenter_iscsi.py being providing
fc and iscsi specific support respectivly.
Rushil Chugh [Tue, 18 Nov 2014 19:37:17 +0000 (14:37 -0500)]
Ensure that lun_id is an int for NetApp Drivers
Various NetApp drivers were treating the lun_id as a string
rather than an int. This was causing attempts to mount NetApp
volumes to Hyper-V nodes to fail as they were checking an integer
type against a unicode type which would fail.
This change casts result_lun to an integer after the value has
gone through the ssh injection attack check. This way Hyper-V
is able to verify if the found LUN is the target LUN, enabling
mounting of NetApp volumes to Hyper-V.
This change also refactors initialize_connection into some helper
methods so as to enable simpler unit testing of the patchset.