Navneet Singh [Thu, 1 Aug 2013 01:17:48 +0000 (06:47 +0530)]
NetApp fix clone image compatibility issue with ssc
It makes clone image functionality compatible
with the ssc feature. Hence it makes clone
image sensitive to volume type and provision
on the right share matching volume type
extra specs.
This is part 1 of the work needed to
remove CONF from the brick subproject.
This patch removes the CONF usage
completely from the initiator portion of brick.
Doug Hellmann [Tue, 1 Oct 2013 22:01:59 +0000 (18:01 -0400)]
Disable lazy translation
Late in the Havana cycle bug 1225099 was found in the lazy
translation code, and to be safe it was decided to disable lazy
translation for Havana. This change does that.
The backup service now keeps a dictionary of managers
for each type of volume backend. If multi backend is
not in use (and volume_type is None) the current
volume_driver is used.
John Griffith [Mon, 30 Sep 2013 14:45:52 +0000 (08:45 -0600)]
Dont retry if target creation succeeds
The target creation retry loop was not breaking when
the target was succesfully created. This is "sometimes" ok,
however in other cases this will actually cause a failure in
the second create and the backing Lun will be deleted and not
created again succesfully due most likely to a busy status on the
target.
VMware: Usng RetrvProprtisEx & does multi ESX scan
The existing code uses deprecated API RetrieveProperties for querying through
property collector. The public doc asks to use RetrievePropertiesEx instead.
RetrievePropertiesEx works by retrieving results in serveral batches rather than
retrieval in a single API call. This works well in environments containing
large number of VMs or ESX hosts.
There are three steps involved 1. Get first batch 2. Continue retrieving using
a token 3. Cancel retrieval when not needed
Batch size is user configurable, default is 100 results per batch.
The review also fixes a careless programming error leading to scanning only
1 ESX host under the vCenter server for datastores.
This patch fixes XML serializer for QoS Specs exension calls like
list(), show(), associations(). Note that using XML as input for
create(), update() doesn't support yet.
John Griffith [Sun, 29 Sep 2013 16:01:58 +0000 (10:01 -0600)]
Add debug logging for targets
Seems we may be failing target create silently,
the situation appears to be that the actual device
lun is not created. This has been appearing in the
gates on create from snapshot.
This change adds some logging that will help us determine
if it's the actual create, or if it's the attempted update
while the dd process is possibly holding the volume in a busy
state causing the target update to add lun 1 to fail.
Bill Owen [Fri, 27 Sep 2013 18:22:57 +0000 (11:22 -0700)]
Set vol driver initialized before deleting volumes
Move the call to set_initialized before calling delete_volume in
init_host. The delete_volume method has a precondition that the
driver be initialized.
Log some errors to avoid losing the exception messages.
HVS driver do repeated judgements for JSON results, here add error
logs and replace these judgement codes with a assertion function.
Luis A. Garcia [Tue, 24 Sep 2013 22:07:55 +0000 (22:07 +0000)]
Fix translation of CinderExceptions in REST API
When creating a Fault from a CinderException wrapped in an
HTTPException, we were converting the inner explanation to unicode
before it was able to reach the Fault's call() method which is where
translation occurs, and unicode objects can't be translated.
This patch preserves the CinderException's Message object and puts it in
another Message object as the explanation to the HTTPException so it can
be translated.
Eric Harney [Wed, 25 Sep 2013 19:43:32 +0000 (15:43 -0400)]
Allow upgrade from Grizzly with ThinLVMVolumeDriver
In Grizzly, LVM thin provisioning was used by setting
volume_driver=...ThinLVMVolumeDriver. In Havana this
functionality has moved under the standard LVM driver
with the option "lvm_type=thin" used to enable it.
We should account for the old volume_driver class path
so that the volume service behaves as expected for users
upgrading from Grizzly ThinLVM configurations.
Calls to create_volume (both volume_rpcapi and scheduler_rpcapi) pass
mandatory args as optional and reverse. This patch fixes the calls to be
according to the function definition.
Also, fix the call to create_volume in the migration code where
allow_reschedule defaults to True, but we don't pass request_spec so it
prints a warning and disables it.
Mike Perez [Wed, 25 Sep 2013 03:55:04 +0000 (20:55 -0700)]
Pass correct args to vol_rpc create_volume calls
In the chance and simple scheduler, create volume was originally using
snapshot_id and image_id for request_spec and filter_properties. This
corrects that by passing the correct arguments and keyword arguments to
create_volume.
Eric Harney [Fri, 13 Sep 2013 20:56:44 +0000 (16:56 -0400)]
LVM volume_clear: error on unexpected inputs
Currently if a user configures
volume_clear='non_existent_volume_clearer' in cinder.conf,
the LVM driver will silently delete a volume and not wipe it.
Instead, the delete operation should fail, leaving the volume
in the 'error_deleting' state.
Also fail if the volume reference does not contain either a
'size' or 'volume_size' field.
Roman Podolyaka [Mon, 23 Sep 2013 14:58:54 +0000 (17:58 +0300)]
Fix finish_volume_migration() on SQLAlchemy 0.8.x
In SQAlchemy 0.8.x "Unconsumed column names" warning became
an exception, so refering to a non-existent column in insert()
or update() call raises an error.
finish_volume_migration() calls Session.update() method passing
values of two non-existent columns as arguments (volume_metadata,
volume_admin_metadata, volume_type). These two are not table columns
at all, but rather SQLAlchemy models relationships.
As SQLAlchemy ORM implements Unity of Work pattern, we should not
really track changes to a model instance manually at all, because
Session class already does it for us. finish_volume_migration()
is refactored to take benefit of this fact.
Add a specific filter for /usr/local/bin/hus-cmd, rather than adding
/usr/local/bin to the list of exec_path in rootwrap.conf. This allows to
sync rootwrap directly from oslo-incubator without having to edit the
default value for exec_dirs.
Allow v2 Volume API to create volume with type name
v2 API only accepts volume type ID when creating volume, while v1
API allows both volume type name and ID (volume type name is unique
in Cinder). This patch enables v2 API to accept volume type name
as create() parameter. Aslo volume type validation code block
in v1 API create() is refactored to a slimmer version.
Change the chance and simple schedulers to pass the snapshot_id and
image_id parameters correctly volume_rpcapi, so that their values reach
cinder-volume.
Eric Harney [Tue, 3 Sep 2013 18:52:03 +0000 (14:52 -0400)]
Require assisted_volume_snapshots from novaclient
The "QEMU-assisted-snapshots for GlusterFS volumes" patch currently
does a try/except ImportError for the new assisted_volume_snapshots
extension in novaclient. That functionality is now in novaclient
2.15.0, so Cinder should consider this a hard requirement rather
than allowing it to be absent.
John Griffith [Fri, 20 Sep 2013 20:55:46 +0000 (20:55 +0000)]
Fix issues with failed lvremove
There are some race conditions that
can cause problems with lvremove commands. In
most cases these seem to recover nicely just
with a simple retry of the lvremove. Adding
a udev settle seems to elimate the rest of them.
This is a difficult issue to reproduce, and there's
a suspiscion that it relates to failed target
creeates.
The patch adds a catch on the lvremove failure,
followed by a udevadm settle and a retry of the
lvremove. With the setup that I've been able
to reproduce this issue these changes have eliminated
any force delete failures.
The other option that had been proposed was using dmsetup remove
but there are concerns that this may cause problems.
Eric Harney [Mon, 9 Sep 2013 22:47:00 +0000 (18:47 -0400)]
GlusterFS: Copy snap from correct source file
The GlusterFS driver's copy_volume_from_snapshot was previously
not parsing the snapshot information to determine which backing
file to copy from, instead copying from the active file at all
times. This would result in the wrong data being supplied when
a volume is cloned from a snapshot.
Add a test for the copy_volume_from_snapshot method.