Andrew Kerr [Tue, 18 Feb 2014 22:38:12 +0000 (17:38 -0500)]
Ensures NetApp iSCSI driver correctly compares int values for size
The NetApp iSCSI driver needs to verify that the new size requested
during an extend operation does not exceed the max_resize of the
lun. However, the driver was doing a >= compare against str values
of the sizes rather than the int values. This caused the incorrect
code path to be used in certain situations.
This commit adds a new versioned api to the backup driver base
class which all backup driver implementations should use in order
to support backing up volume metadata as well as data. The general
rule here is that we backup all metadata from a set of db tables
and can then be selective about what we restore.
As part of this commit, Ceph backup driver implements the new api
to backup volume metadata (including glance metadata) thus
supporting restoring volumes as bootable.
It is expected that the other backup driver implementations will
follow suit and adopt this approach.
Xing Yang [Tue, 11 Feb 2014 05:00:53 +0000 (00:00 -0500)]
Add EMC SMI-S FC Driver in Cinder
Add an EMC SMI-S FC Driver in Cinder. It supports all required
driver features.
Also made enhancements to the existing SMI-S iSCSI Driver
(performance enhancement, multiple pool support and thick/thin
provisioning, extend volume).
emc_smis_common.py is the common code used by both iSCSI driver
(emc_smis_iscsi.py) and FC driver (emc_smis_fc.py).
john-griffith [Mon, 10 Feb 2014 21:42:43 +0000 (14:42 -0700)]
Check type argument on create from source and snap
Currently the create from snap and create from source
options will set the volume-type when specified in the
create call.
This is actually wrong, because clone and create from snap
MUST be performed on the same backend as the parent volume. The
result is that if the specified type doesn't match the specs for
it's parent, and actually needs to be on a different backend
the new volume will "appear" to have the correct type, but it's
actually invalid.
The --volume-type argument should be rejected when --source-volid
or --snapshot-id are used, and the parent type-id just picked up
and used. Then the user can retype if desired.
Auto failing this strictly causes backward compatability issues though
so we'll just check for a mismatch and raise an exception in that case.
This way if the user knows what they're doing and they're explicit
in the command we still allow it and things are fine.
ling-yun [Wed, 12 Feb 2014 02:02:54 +0000 (10:02 +0800)]
Removed unused context in _extend_snapshot method
Input parameter 'context' of _extend_snapshot method in
cinder/api/extended_snapshot_attributes.py is not being used, so remove
this 'context' parameter.
Avishay Traeger [Tue, 11 Feb 2014 20:34:24 +0000 (22:34 +0200)]
Storwize/SVC: Check wwpn not None
If the storage doesn't have WWPN information for a host but gets it in
the connector, initialize_connection can fail because it does
wwpn.lower(), and wwpn can be None. Make sure it isn't before calling
lower().
Glenn M. Gobeli [Tue, 11 Feb 2014 18:03:13 +0000 (13:03 -0500)]
Changes to cast variable as integer as XML API fails.
Code change to ensure that the type of the size variable is correct
when cinder is invoked through XML API. The extend volume code path
differs from volume create where the flow portion verifies that the
size variable is an integer; for extend the earliest place to cast
the size variable is in volume_actions.py.
Ann Kamyshnikova [Tue, 27 Aug 2013 12:17:25 +0000 (16:17 +0400)]
Move create_, remove_ and ensure_export from drivers
create_export, remove_export, ensure_export are almost the same in
LVM and BlockDevice drivers. So they should be moved to
a common cinder.volume.iscsi module.
Jim Branen [Tue, 7 Jan 2014 00:14:35 +0000 (16:14 -0800)]
New HP LeftHand array iSCSI driver
This driver is intended to replace the current OpenStack Block
Storage HP LeftHand (LH) StoreVirtual iSCSI Driver,
(cinder.volume.drivers.san.HpSanISCSIDriver), by moving the
existing SSH interface into the new driver to maintain backwards
compatibility, and add the new LH REST interface for new driver
features.
We have the driver broken into 3 files:
hp_lefthand_iscis.py (common interface)
hp_lefthand_cliq_proxy.py (old SSH interface)
hp_lefthand_rest_proxy.py (new REST interface)
The reason we are doing this is because the SSH interface on LH
array has connections and performance limitations. These problems
will be resolved by moving to the new LH OS REST interface. Also,
new LeftHand array capabilities will only be supported in the
REST(hplefthandclient) interface.
To support new driver capabilities (create cloned volume), the
python REST client (hplefthandclient) is required and can be
downloaded from the pypi repository:
http://pypi.python.org/pypi/hplefthandclient.
This REST client requires LeftHand firmware version 11.5 or
greater.
Florent Flament [Fri, 17 Jan 2014 10:54:27 +0000 (10:54 +0000)]
Allow operators to customize max header size
HTTP messages max header line size has been increased from 8K to 16K
by default to allow using tokens including up to 14-15 catalog
entries. The same issue
(https://bugs.launchpad.net/swift/+bug/1190149) may occur again in
the future, if keystone's catalog grows further.
Allowing operators to customize the max header size, will allow them
to have Cinder working whatever the size of the catalog (if the option
is properly set).
It appears that there are certain cases where a detach
and a delete call can overlap causing a race in the
remove_iscsi_target method. The result is that when
the slower method gets around to the final removal of
the persistence file it's no longer there, so we
hit an unhandled exception.
This patch does two things:
1. It adds the volume lock to the detach_volume
method in the manager (already in place for delete).
This should mitigate the race and allow us to avoid it.
2. In the iscsi_remove_target method check if the
persist file has already been removed when we get
to the last check. The fact is that if it was somehow
removed before we got here we don't really care, we're
just going to delete it anyway.
Jeremy Stanley [Mon, 10 Feb 2014 02:57:24 +0000 (02:57 +0000)]
Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.
Avishay Traeger [Sat, 8 Feb 2014 20:59:58 +0000 (22:59 +0200)]
Storwize/SVC: Fix races in host-related functions
In the Storwize/SVC driver, initialize_connection checks if a host
object exists on the storage, and if not, creates one. Similarly,
terminate_connection checks if there are any more mappings for this
host, and deletes the host object if there are none. Consequently, there
exist races between two initialize_connection calls, two
terminate_connection calls, or one and one.
The easy solution here is to use locks. Because locks are files on the
local machine, this implies that all cinder-volume processes managing a
given Storwize/SVC contoller run on the same machine.
john-griffith [Sat, 8 Feb 2014 04:55:22 +0000 (21:55 -0700)]
Dont set error_extending status on API extend call
Recent change (Ifd523ac5e9039861cf87711dc5c4842b5cb524c2)
moved the quota check on extend_volume to the API layer
in order to provide feedback to caller if the quota check
failed.
The problem is that change still sets the volume status to
error_extending if the quota check fails. There's no reason
to do this if we're now giving immediate feedback that the call
failed.
I'm also unclear on what the purpose of adding the reservations
to the rpc call are, but I'll double check on that before changing.
This patch leaves most of the previous change in place but
removes the setting of error_extending to the volumes status
on the quota fail.
Jeff Applewhite [Thu, 30 Jan 2014 19:11:08 +0000 (14:11 -0500)]
Fixes cinder failed to create/restore a backup with NFS driver
The action cinder backup-create fails when trying to backup a newly
created volume when using cinder.volume.drivers.nfs.NfsDriver. This
patch removes not implemented stubs for backup_volume and
restore_volume. The inherited methods in cinder/volume/driver.py
succeed in creating a backup and in restoring it. After manual
testing of this change backups/restores succeed without the not
implemented stubs. This change also adds the not implemented
stubs to the glusterfs driver until a fix is submitted.
Eric Harney [Wed, 29 Jan 2014 15:45:03 +0000 (10:45 -0500)]
Rename self.tgtadm to self.target_helper
Using "tgtadm" for this member variable is confusing because it
actually represents tgt, IET, and LIO. Rename to a more generic
term to make things more readable.
Also remove "tgtadm" from method names and references in tests
where it is not tgtadm-specific.
I'm choosing the name "target_helper" because "tgtadm" = tgtd,
and "iscsi_helper" doesn't fit when using RDMA in ISERDriver.
There was a race condition between the two Event() objects being
created within loopingcall and Retry in api module. Did away with
the Event object in Retry and used loopingcall the right way.
This commit brings the implementation of the test_rbd and
test_backup_ceph unit tests more inline and tries to ensure
that no mock is set without being unset so as not to tread
on the toes of any other tests.
Brianna Poulos [Mon, 18 Nov 2013 23:04:15 +0000 (18:04 -0500)]
Add update support to volume type encryption
This patch adds update support to the Volume Type Encryption API
Extension. It allows the updating of volume type encryption for
a given volume type as long as no volumes are currently in use
with that volume type.
John Griffith [Fri, 31 Jan 2014 03:53:37 +0000 (03:53 +0000)]
Remove create_export from volume create
Currently the LVM driver creates iscsi targets on
volume creation, even though it's only used at
attach time. This isn't necessary and in fact
causes issues if a volume is extended because the
target information isn't currently updated after the
extend. In addition a number of other drivers inclduing
the LIO iscsi driver require the target be created with
initiator info, so the tgt that's created initially
again isn't valid.
This change removes the create_export call from the
volume create process and makes it part of the
managers intialize_connection routine which is
more appropriate.
This change also removes the target on detach since
it's not used any longer and again as the volume may
be modified or extended.
Time unit is missing in the description of vmdk driver option
"vmware_task_poll_interval". Due to this, the vmdk driver config
reference document doesn't have the timeunit in its description
column. This fix adds the missing time unit (seconds) in the
driver option.