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.
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.
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.
Luis A. Garcia [Fri, 6 Sep 2013 21:24:33 +0000 (21:24 +0000)]
Sync gettextutils from oslo
Some Messages, such as those created from Invalid exceptions, use a
Message within a Message, and we were only translating the base Message
but not the Message substitution within.
When doing a volume restore with Ceph backend to a non-rbd volume
that is greater in size that the backup volume, we write zeroes
the extraneous extents but we are not zeroing the final few bytes
in the case where the destination volume is non-rbd.
Also fixed up internationalisation on a number of log messages.
A mapping key of 'netloc' is always ignored. Thus information in
'netloc' is lost. But because it is included in 'error_msg', I remove
'netloc=netloc'.
A mapping key of 'volume_id' is ignored when we use the non keyword
argument. Thus information in 'volume_id' is lost. Similarly, in the
case of exception.SnapshotNotFound, information in 'snapshot_id' is
lost.
Previously the row for the temporary migration volume was deleted from
the database, which caused a foreign key violation for its admin
metadata. Regardless, the volume should have been soft deleted from the
database anyway, and this patch takes care of that.
Victor Rodionov [Tue, 17 Sep 2013 21:22:05 +0000 (01:22 +0400)]
Fix __init__ methods of brick initiator connectors
Wrong order of positional arguments in RemoteFsConnector __init__ call.
This only in RemoteFsConnector.__init__, but I decide also update
__init__ methods of other connectors to avoid errors in future.
This change modifies the behaviour of the secure delete for thick
LVM snapshots to wipe the underlying COW of the snapshot LV
instead of the snapshot LV itself.
This change is necessary because the snapshot LV does not contain
exactly the same number of writable blocks as the original LV. The
COW includes header information per COW block that identifies the
device as a COW device as well as the source and destination blocks
for the changed item. The amount of metadata contained in the COW is
variable based on I/O performed on the snapshot.
This does not change the behavior of secure deletes on thin LVs
or secure deletes on the thick LV snapshot origin.
Replace "params[params.index('-lun')]" with
"params[params.index('-lun') + 1]" to get lun ID correctly.
Replace the invalid controller ID "N" with "B".
Dict CLONED_LUN_INFO has no key provider_location, delete it.
Moreover, simplify the "if..., elif..." module with "getattr"
method in fake recv function.
According to the comment in the source code, the snapshot-update of
v2 would be able to allow either "name" or "display_name" parameter.
And if both paramters are specified, "name" parameter is effective
over "display_name" like "description" parameter.
However "display_name" parameter is ignored now, because cinder writes
over empty dict(update_dict['display_name']).
Jay S. Bryant [Mon, 16 Sep 2013 18:21:34 +0000 (13:21 -0500)]
Set rootwrap_config path to rootwrap.conf
Other components set
rootwrap_config = /etc/<component>/rootwrap.conf by default.
This commit brings cinder up-to-date with what other
components are doing by setting
rootwrap_config = /etc/cinder/rootwrap.conf by default.
A couple of test cases needed to be updated to handle the change
from 'None'.
Not counting this as a documentation impact as the documentation I
can find already lists /etc/cinder/rootwrap.conf as the default.
Eric Harney [Sat, 7 Sep 2013 03:26:46 +0000 (23:26 -0400)]
Do not use qemu-img --backing-chain or --output=json
Initial code for GlusterFS snapshot support in Havana
used qemu-img arguments which are too new to run in many
environments. Run qemu-img using only arguments which
will exist on older platforms.
VMware driver: Fix for invalid datastore selection
Added filter to ignore datastores that are not mounted, in-accessible
and read-only for volume creation. Without this VMware's VC/ESX driver can
choose such datastore with higher invalid capacity value as returned by the
server for volume creation.
Also using parent's self.mox object in the test cases rather than creating
a new mox.Mox obj everytime.
Fixes ceph volume restore to larger image than source
If a backup is restored to a volume that is bigger than the
backup itself, which could be the case if --volume-id is
supplied, we need the option to set extraneous extents to zero
i.e. set extents after those from the backup to zero.
Huawei driver failed to parse ssh result when firstly logging
in storage system on paramiko 1.8.0. The update of paramiko
make the order of ssh returns changed. This patch improves
the parsing way of ssh returns.
This patch also does some changes for log punctuations.
Fixes the use of exception.InvalidInput with the wrong arguments
A mapping key of 'message' in exception.InvalidInput is 'reason'.
cinder/volume/drivers/netapp/iscsi.py and
cinder/volume/drivers/netapp/utils.py had used 'data'.
Michael Kerrin [Mon, 9 Sep 2013 08:12:27 +0000 (08:12 +0000)]
Add default_availability_zone configuration option to cinder
This option is used to specify the default AZ for the whole service. So when
creating a new volume this value is used to specify the AZ of a volume.
Previously we were overloading the use of the storage_availability_zone option
which is also used to specify what AZ a service belongs to. We still fail back
on the storage_availability_zone when creating a new volume if the
default_availability_zone is not set.
Zhi Yan Liu [Tue, 3 Sep 2013 14:40:49 +0000 (22:40 +0800)]
Turn db model object into a primitive object to avoid error
In volume API controller we need turn db model object into a primitive
object to avoid error when it adding visible administrator metadata to
volume's metadata dict.
When the driver copy_image_to_volume fails it can
at the current time raise more than just CinderException
as its root exception type. This causes rescheduling due
to the blacklisted exception list that is used to determine
if a exception is 'bad enough' to trigger rescheduling or
should the volume creation action just set the volume to
error state.
To avoid the situation where this would cause a rescheduling
we should make sure (for now) that any exception that is
emitted on copying an image to a volume is translated
into a image copy failure and reraised.
This modification adds delete support to the volume type
encryption API extension. The delete operation is not
permitted when the encrypted volume type is in use by an
existing volume.