Moved to using brick to get connector info and fixed a small bug to get
tests working on real storage again. Also fixed up simulator to handle
the multihostmap case properly.
There are several copy-pastes of running dd, so moved the most
correct one (LVM) to volume/utils.py, and also updated
BlockDeviceDriver to use it. Other drivers (e.g., NFS, GPFS, Scality)
should be updated as well. Volume migration for detached volumes
is a future use case.
When a volume is deleted all rows in the volume_metadata table for that
volume are deleted as part of the database operation. This patch updates
the snapshot delete operation to delete corresponding rows in the
snapshot_metadata table.
If the async call to the manager/driver failed, the API still updated
the quota and volume size in the DB. Solution is to move these tasks
down to the manager, where we know if the extend succeeded.
Fixes race condition in LVMVolumeDriver create_cloned_volume method
When we create a clone volume, LVMVolumeDriver will firstly create a temp
snapshot for copying, the temp snapshot name is
"clone-snap-%s" % source_volume['id']. When we create multiple clone volumes
of the same volume simultaneously, which would trigger the race issuse.
I changes the temp snapshot name template to "clone-snap-%s" % volume['id'],
so temp snapshot name will be unique.
This patch adds the required code to do
Fibre Channel attach and detaches of volumes.
This code has been pulled over from Nova's
implementation of FC attach/detach.
Also adds a new driver config entry to enable
multipath support for iSCSI and FC attaches
during volume to image and image
to volume transfers.
John Griffith [Wed, 17 Jul 2013 00:27:19 +0000 (18:27 -0600)]
Increase timeout period for clone volume.
Current timeout value for clone volume in the
SolidFire driver is 20 seconds, this is fine
in many cases however there seems to be a
number of customers doing clones of
volumes >= 400G.
A populated 400G volume is taking upwards of
35 seconds to clone in some cases resulting in failure.
There's no reason not to bump this timeout value up
significantly to a worst case scenario (ie multi-terrabyte volume).
John Griffith [Fri, 12 Jul 2013 23:43:27 +0000 (17:43 -0600)]
Be sure to check deleted types on quota update.
If a volume-type is deleted, and later a volume
that's assigned that type is deleted the quota
update will fail and result in a trace for
VolumeTypeNotFound exception.
The volume is succesfully deleted, however the
quota information for the volume-type let alone
the other quota items for the volume are not
updated.
Jim Branen [Wed, 10 Jul 2013 19:34:09 +0000 (12:34 -0700)]
Adds multiple iSCSI port support to 3PAR
Added support to the 3PAR iSCSI OpenStack driver to provide the
ability to select the best fit target iSCSI port from a list of
candidate ports. The first time a volume is attached to a host,
all iSCSI ports configured for driver selection, are examined for
best fit. The port with the least active volumes attached will
then be selected as the path to the 3PAR array. Any subsequent
volume attach, to the same host, will use the established target
port.
In the swift driver the three methods prepare_nbackup, backup_chunk
and finalize_backup are used internally in the class only and are
not meant to be used from outside. Thus marked with prefix "_"
John Griffith [Mon, 15 Jul 2013 21:16:25 +0000 (15:16 -0600)]
Catch additional connect fail cases.
When fixing bug/1195910, some other failure
cases weren't considered (ie not authorized,
unreachable dest etc).
We should fix this up to handle the various
connection error states accordingly and also
add some hints to the log output to help
determine where to look in case of failure.
Jay S. Bryant [Wed, 19 Jun 2013 19:52:41 +0000 (14:52 -0500)]
Add flag argument to 'cinder-manage config list'
Unlike other cinder-manage 'list' commands the 'config list'
option doesn't allow users to specify a filter to limit
the output. This commit adds the ability to specify
the flag the user wishes to display.
If no flag is specified the default behavior is still to
display all the configured flags. If the flag requested
is not found, cinder-manage reports that the flag was not
found.
Mike Perez [Mon, 15 Jul 2013 01:48:54 +0000 (18:48 -0700)]
Use base ISCSI driver to fulfill some driver requirements
Cinder has a list of minimum features that must be implemented by each
driver. This uses the copy_volume_to_image and copy_image_to_volume
implementation from the base ISCSI class. Also use the base for raising
NotImplementedError. This touches the Nexenta and Zadara driver.
Joe Gordon [Fri, 12 Jul 2013 15:47:01 +0000 (16:47 +0100)]
Cleanup and make HACKING.rst DRYer
Reference the OpenStack hacking guide in HACKING.rst and remove
duplicate entries. Add placeholder section for cinder specific rules.
cinder specific rules can be created using hacking's local check
support.
Clone_image should return dict of vol properties, clone status.
The method will work fine in case of drivers not dependent
on volume properties like provider_location. It will fail to
restart in case of nfs drivers and also leave volume created as
result of clone_image functionality created in the
nfs share in dangling state after deletion as provider_location
is None. This fix requires dict of volume properties, cloned status
to be returned which facilitates passing back provider_location
in case of nfs drivers and hence resolves the issue.
Enable zero the snapshot when delete snapshot in LVMVolumeDriver
Because snapshot without 'size' field, So clear_volume method in
LVMVolumeDriver will skip secure deleting. Get the size of snapshot from
'volume_size' filed, So it can zero the snapshot.
Remove the 'size_in_g' parameter in _delete_volume method, because it never
used. Add a unittest for clear_volume method.
Errors raised by extend_volume aren't handled by the manager.
This means the volume status will not be updated to 'error_extending'
when an error is raised during the process.
* Handle such errors and update volume status accordingly
* Add logging for the extend volume process
Minor reorg for (array resource usage and backend options naming)
1. Use HUS target/initiator resources efficiently.
2. Command options aligned with openStack scheme of using dashes.
3. Self tests modified to accomodate #1 and #2.
In previous code we didn't check whether we have an enabled
backup service there before we send out the rpc request,
results that if no enabled backup service there,the volume will
stays in "backing-up" state and the backup will stays in "creating".
This patch fixed this issue, we exam whether at least an appropriate
(same host,az as the volume and is_alive) backup service available
before we do the rpc request.
Julia Varlamova [Fri, 5 Jul 2013 11:33:56 +0000 (15:33 +0400)]
Add tests for cinder/api/urlmap.py
Add tests for unquoting and parsing functions in
TestParseFunction class
Add tests for Accept class methods:
- TestAccept class - test cases for processing content types
- TestUrlMapFactory - test cases for urlmap factory
Add tests for URLMap class methods except __call__ method in TestURLMap
Kun Huang [Thu, 11 Jul 2013 04:04:52 +0000 (12:04 +0800)]
remove improper assert usage
There're many talks about it. An assert should be used for `never
happen` cases, not common paramaters validating.
With grep, we could many all assert statement used in none-test codes:
cinder/volume/drivers/san/solaris.py:110:
cinder/volume/drivers/san/solaris.py:116:
cinder/volume/drivers/san/solaris.py:161:
cinder/volume/drivers/san/solaris.py:162:
cinder/volume/drivers/san/solaris.py:163:
cinder/volume/drivers/san/solaris.py:164:
cinder/volume/drivers/san/solaris.py:170:
checking cmd output which should never changed, so leave it
cinder/db/sqlalchemy/migration.py:113:
ensure file existence from impossible cases, so leave it
cinder/utils.py:
used for functional flow, so use ValueError instead
John Griffith [Wed, 10 Jul 2013 21:34:26 +0000 (15:34 -0600)]
Enable setting blocksize on volumes.
Some back-ends support blocksizes other than the default 512 (like 4096),
this change adds a provider_geometry column to the volumes table,
format is "physical_block_size logical_block_size".
This can then be used by libvirt to determine if it should pass in
non-default block_size info, and there's a method for future
geometry/disk info that might be needed.