Mitsuhiro Tanino [Wed, 13 May 2015 15:59:13 +0000 (11:59 -0400)]
LVM: Pass volume size in MiB to copy_volume() during volume migration
Currently migrate_volume() in lvm.py does not pass volume size in
MiB but passes volume size in GiB to copy_volume(). The size argument
of copy_volume() requires MiB value. As a result, if the volume size
is 1GiB, copy_volume() copies only 1MiB head of 1GiB volume to the
destination volume, and then the volume data is corrupted.
This patch fixes to pass volume size in MiB.
Tom Swanson [Thu, 7 May 2015 21:39:26 +0000 (16:39 -0500)]
Dell: Added support for update_migrated_volume
Added support for updated_migrated_volume to common driver.
Added rename_volume to dell_storagecenter_api to support it.
Added tests to test_dellsc.py and test_dellapi.py.
The only thing we do in this rename the newly migrated volume
destination volume on the Dell Storage center to be the same
as the original volume ID. Since we identify the volumes
by volume ID this prevents them from being lost.
When attach is called twice for the same volume and instance the
attach_volume checks if the attachment already exists and returns.
This leaves the volume in 'Attaching' state. The volume status should
be reset to 'in-use' if we see the attachment already exists.
John Griffith [Thu, 23 Apr 2015 18:07:12 +0000 (12:07 -0600)]
Add external genconfig calls
After moving to oslo.config we still were using
incubator config generator. This was ok, but the
problem is we haven't been pulling config options
from the oslo libs.
This is a hack that just appends external lib calls
and appends those options to the sample file being built.
service.py had some code where the child process would catch the
SIGTERM from the parent just so it could exit with 1 status rather
than with an indication that it exited due to SIGTERM. When
shutting down the parent doesn't care in what way the child ended,
only that they're all gone, so this code is unnecessary.
Also, for some reason this caused the child to never exit while
there was an open connection from a client. Probably something
with eventlet and signal handling.
Lucian Petrut [Fri, 27 Mar 2015 12:15:25 +0000 (14:15 +0200)]
Windows SMBFS: fix volume extend
The Windows SMBFS driver inherits the Linux SMBFS driver,
overriding Windows specific methods.
This commit Ic89cffc93940b7b119cfcde3362f304c9f2875df added the
volume name as an extra argument to the _do_extend_volume in order
to check if differencing images are pointing to backing files other
than the according volume disks.
Although this is not required on Windows, this method should accept
this extra argument in order to have the same signature as the
method it overrides. At the moment, this raises the following
exception:
ankitagrawal [Tue, 17 Mar 2015 09:08:12 +0000 (02:08 -0700)]
Verify all quotas before updating the database
Update quota multi-value in one request is not an atomic operation, so
even if a quota is invalid (e.g., volumes has a non-integer value),
some values may change but the response code is 400.
This patch will make sure the quota limits are of integer type for all
the requested quota keys before updating the database.
Jon Bernard [Tue, 7 Apr 2015 17:57:36 +0000 (13:57 -0400)]
Include boot properties from glance v2 images
In order for users to take advantage of COW volumes created from
a glance image, Cinder must be configured to use Glance API version
2 (default is 1). In version 2, the required boot metadata (kernel_id
and ramdisk_id) are no long stored in the 'properties' dict, but as
standalone fields in the GET response from glance. The existing cinder
parser for the glance request is not aware of this and the volume
created form a v2 image will lack this required metadata.
This was causing the recent Ceph CI gate failures for
test_volume_boot_pattern.
Vincent Hou [Tue, 3 Mar 2015 08:04:41 +0000 (16:04 +0800)]
Delete the temporary volume if migration fails
Issues resolved in this patch include the following changes:
* A temporary volume is created on the destination host before migrating
the data from the source. However, if the creation of this volume fails,
its record will be left in the database as redundant information. This
patch will remove the database record if the creation fails.
* If attaching the remote dest volme fails at initialize_connection
due to timeout, we need to terminate the connection. Otherwise, the dest
volume will not be released and successfully deleted.
Jay S. Bryant [Mon, 6 Apr 2015 19:02:31 +0000 (14:02 -0500)]
Correct cinder hacking check numbering
We have a couple of hacking checks that are specific to
Cinder that were written a while back. Unfortunately, when
they were written the numbering scheme for hacking checks was
not understood. We used N3xx when we should have used C3xx.
Jay S. Bryant [Mon, 6 Apr 2015 16:22:09 +0000 (11:22 -0500)]
Add hacking check for print() statements
We are frequently having to -1 patches because people
forget print() statements that were used for debug in
their development. Can save everyone time and trouble by
adding this simple hacking check.
The check excluded the cinder/cmd directory as the files in there
legitimately need to use the print() command. Also wsgi.py and
the test_hds_nas_backend.py files make use of print, so I have
excluded those from checking as well.
wuyuting [Fri, 20 Mar 2015 10:41:11 +0000 (18:41 +0800)]
Rbd update volume stats in wrong way
Cinder volume uses a RADOS pool to store volumes and
update storage stats periodically. However, rbd driver
reports the whole cluster stats but not the pool's. This
is wrong. The right way is to report the pool stats but
not the whole cluster.
Xing Yang [Sat, 4 Apr 2015 22:25:48 +0000 (18:25 -0400)]
Create initiator id if not exist in VMAX driver
This problem was discovered in a customer's environment. If the
initiator id (hardware id SMI-S instance) does not exist on the
array, the attach volume operation will fail. In this patch,
the initiator id will be created if it doesn't exist.
Anthony Lee [Fri, 3 Apr 2015 05:07:27 +0000 (22:07 -0700)]
Fixed encrypted property for 3PAR FC and iSCSI drivers
3PAR FC and iSCSI drivers were not returning the 'encrypted'
property when initialize_connection was called. This patch
adds that property to the returned info.
Jay S. Bryant [Fri, 3 Apr 2015 19:19:28 +0000 (14:19 -0500)]
Mock wait_for_volume_removal in test_brick_connector
Systems where /dev/disk/by-path did exist were failing unit
test for test_connect_volume, test_connect_volume_with_alternative_targets
and test_connect_volume_with_alternative_targets_primary_error in
cinder.tests.test_brick_connector . The problem was that the test
cases were mocking out os.path to return exists. This resulted in
the new code from commit 43029941219505bc3861dd285e3393e08c76b433
never being able to exit the wait_for_volume_removal loop.
To avoid this problem I am mocking out wait_for_volume_removal for these
test cases. wait_for_volume_removal is tested elsewhere and not relevant
for these test cases.
Tom Swanson [Thu, 2 Apr 2015 22:55:44 +0000 (17:55 -0500)]
Dell SC driver has insufficient iscsi logging
In the case where a volume was mapped but the server could not
locate the volume not enough information was being logged to
sort out the failure. Added logging to Dell SC ISCSI driver.
Now returns much more connection information on trying to map
a volume. Also tries to return iscsi properties associated with
the controller on which the volume in question is active.
Copying preallocated image to volume involves creating
a virtual disk using the image. The virtual disk has a
descriptor and an extent. The preallocated image is used
as the flat extent to create the virtual disk.
To create virtual disk from preallocated image, we first
create a temporary virtual disk (with a descriptor and
flat extent), then replace its flat extent with the
downloaded image. Since vSAN datastores do not support
flat extent, the above operation fails if such a datastore
is selected for virtual disk creation. This patch fixes
the problem by not selecting vSAN datastores for temporary
virtual disk creation.
Anton Arefiev [Thu, 2 Apr 2015 16:12:52 +0000 (19:12 +0300)]
Enable H238 hacking rule
Hacking 0.10 introduces new hacking rule H238 - old style classes
are deprecated (they are converted to new style classes - inherit
from `object`). In order to avoid any unwanted side effects all
classes should be declared using new style.
See reference on the differences:
https://www.python.org/download/releases/2.2.3/descrintro/
Fix ISCSIDriver initialized connection volume type
ISCSIDriver initialize connection is a duplicated function
left in kilo to serve drivers that don't use the new targets model.
In Kilo there is a new parameter of iscsi_protocol, that is set to
iscsi by default and can be changed to iser in order to enable RDMA.
In order support RDMA in drivers that still inherit from ISCSIDriver,
driver_volume_type should be set to iscsi_protocol parameter value
instead of a hard coded value until this function duplication will be solved.
Lee Yarwood [Thu, 2 Apr 2015 14:46:38 +0000 (15:46 +0100)]
Fix multipath device discovery when UFN is enabled.
This currently returns an invalid path of `/dev/mapper/${WWID}`
when UFN is enabled leading to failures later on when we attempt to
use the device.
The output of `multipath -l ${path}` or `multipath -l ${wwid}`
should always list the correct device identifier to use with this
path as the first word on the first line.
Ray Chen [Thu, 10 Jul 2014 15:01:17 +0000 (23:01 +0800)]
Fix missing clone_image API support for sheepdog driver.
If image is backend by sheepdog, it will use create_cloned_volume
function to help to clone this image. Normally sheepdog can clone
only from snapshot.
This patch set is derived from abandoned change:
Ibd355082e7c3215c00f6576404566577f7a2601c
Jeegn Chen [Tue, 10 Feb 2015 03:26:24 +0000 (11:26 +0800)]
More error handling on EMC VNX migration failure
If a LUN migration session is stopped or faulted after started,
current implementation of VNX Cinder Driver only wait for timeout
and no logic will clean up the broken migration session.
This patch adds logic to detect and clean up the stopped/faulted
migration session.
Vincent Hou [Tue, 24 Mar 2015 08:30:13 +0000 (16:30 +0800)]
Set volume_attachment to [] for the temporary volume creation
A new table volume_attachment has been added recently. During the
creation of the temporary volume in migration, the attribute
volume_attachment is not empty if an attached volume is going to be
migrated, because all the properties are simply copied.
This non-empty attribute volume_attachment leads to the failure of
the volume creation. This patch removes this attribute before the
temporary volume creation.
Besides, detach the volume should consider multi-attach as well by
adding the attachment id parameter.
Tom Barron [Wed, 25 Mar 2015 15:28:08 +0000 (11:28 -0400)]
Only use operational LIFs for iscsi target details
When Nova invokes our cDOT driver's initialize_connection() method
in order to attach an iSCSI volume to an instance, we have been
returning the first target from the list of targets returned from
the filer API call to get iscsi target details. In failover mode,
this may be a target with a LIF that is down, causing the attach
attempt to fail in Nova.
This commit fixes that issue so that attaches still work in
failover by returning the first target with an *operational* LIF.
Michal Dulko [Wed, 1 Apr 2015 11:28:34 +0000 (13:28 +0200)]
Catch more general exception in manager's create_volume
When fixing issues with inaccurate allocated_capacity tracking when
create_volume flow fails (Icd6b04ac60c17cbda225d3be8bcc4435ea0cd7a8)
it was ignored that drivers may raise all kinds of exceptions and these
aren't repacked into CinderException in the flow. This commit broadens
except clause to catch Exception when deciding if rescheduling
occurred while creating a volume. Also regression unit test is added.