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.
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.
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.
Eric Harney [Sun, 8 Sep 2013 14:18:18 +0000 (10:18 -0400)]
GlusterFS: Use image_utils for qemu-img calls
Code added for GlusterFS snapshot support in Havana included
new code to parse qemu-img output. This removes this code
and uses image_utils qemu_img_info instead.
Add test to image_utils for parsing a different style of
qemu-img info output.
Improve GlusterFS driver test coverage with tests for cloning,
create from snapshot, and initialize_connection.
John Griffith [Fri, 20 Sep 2013 02:47:22 +0000 (20:47 -0600)]
Add a retry to create_iscsi_target for LVM
There's a bug in the tgt driver where under certain
conditions where a race condition is present that can
result in tgtadm attempting re-use a target ID.
Testing this it seems that a retry will address this nicely
and cause tgtd to grab a new target ID and things are ok.
This patch adds a simple check/retry mechanism around the
iscsi_target_create in the LVM driver to catch this issue and
deal with it.
There are a number of bugs that it appears can be attributed to
this, but this patch is associated with the most predominant
clear cut version.
Jim Branen [Fri, 20 Sep 2013 15:41:44 +0000 (08:41 -0700)]
Fix HP3PAR iSCSI path connection
The iSCSI paths are not correctly identified as ‘active’
when port information is requested from the hp3parclient
because the ‘active’ value is a Boolean not the string
‘true’.
Mike Perez [Tue, 17 Sep 2013 09:41:59 +0000 (02:41 -0700)]
Add volume metadata to v2
This exposes volume metadata in the Cinder v2 API. This already exists
in v1 and was originally suppose to exist back with Grizzly, but appears
to have slipped.
This updates the volume manager and the
backup manager to enforce that the driver
has been initialized.
The managers call the driver in many places
without ensuring that the driver has been
properly initialized. When the driver fails
inside of do_setup(), the managers shouldn't
call the driver's set_initialized() method.
The managers now dump out the exception, and
exit the init_host, leaving the driver in
an uninitialized state.
John Griffith [Thu, 19 Sep 2013 19:05:05 +0000 (13:05 -0600)]
Fix type change in bootable setting of volume view
Change Idd47a0a8069ee905b81c7aae562b82767ad91930 fixed a db
query issue, by removing the image_metadata querie in the get/show
methods.
The problem however is that we just passed the setting from the volume
object directly in the summary view builder. This results in changing
the type of the value from a string "true/false" to a bool True/False
which is no good.
This patch converts the object member back to a string like it used to
be so we don't break any compat or expectations in API behavior.
Bill Owen [Wed, 18 Sep 2013 21:30:07 +0000 (14:30 -0700)]
GPFS Driver missing clone depth limit for snapshots
GPFS driver is fixed to handle snapshot clones correctly. Previously,
these were allowed to grow without respecting limit defined in config
flag gpfs_max_clone_depth. This change adds the depth check operation
in create_snapshot.
To ensure that all clone files are cleaned up, the delete_snapshot
method now marks snapshots to be deleted with ts file extension
and attempts to delete the snapshot. If the snapshot cannot be
deleted because it has clone children, it will be deleted when the
child is deleted.
VolumeNotFoundForInstance class is used only in test_xiv_ds8k.py. I
think the exception class that is used only in test code should not be
defined in cinder/exception.py.