RBD: Add missing Ceph customized cluster name support
It turns out '--cluster' is also needed when RBD driver talks to
ceph cluster using 'ceph' command (not via librados). This change
appends RBDDriver._ceph_args with '--cluster' when 'rbd_cluster_name'
config option is not None.
John Griffith [Fri, 17 Apr 2015 20:51:06 +0000 (20:51 +0000)]
Standardize logging in volume.api.py
We now have resource tag support in oslo logging,
and our logging is pretty inconsistent and down right
ugly in places. Let's clean things up based on the
standard logging guidelines and use the fancy new
resource tag.
This patch starts with the volume.api file as that's
'easy', so we can enforce things going forward and start
working out other files in future patches.
To use set the following in cinder.conf:
logging_context_format_string = \
%(asctime)s.%(msecs)03d %(levelname)s %(name)s [%(request_id)s \
%(project_name)s] %(resource)s%(message)s
VolMgr: reschedule only when filter_properties has retry
In the task flow for volume manager, create_volume tasks, volume gets
reschedule even when scheduler doesn't indicate so. The problem is
the flow should not only check 'allow_reschedule' and 'request_specs',
but also (more importantly) filter_properties['retry'], which is
populated by scheduler if schedule_max_attempts is set to > 1. This
checks was there before taskflow was introduced, but somehow the
migration missed the check for filter_properties['retry'].
This change adds back the check, so scheduler_max_attempts won't be
treated like scheduler_max_attempts = infinite.
This patch adds the fix that exists in the nova
libvirt volume code to use oslo_utils strutils
to mask passwords that might show up in debug log
messages.
Current RBD driver assumes ceph cluster name to be 'ceph', for
cluster has a different name, the driver won't be able to connect
to the cluster. This change add a new config option
'rbd_cluster_name' to address this issue.
This allows operations that do not conflict with each
other (i.e. are on different volumes) to run concurrently.
The prior locking scheme was too coarse and essentially
made the driver single-threaded.
This patch moves the implementation of the GlusterFS driver locking
scheme to the RemoteFS base driver so that other similar volume
drivers can use it.
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:
Tom Swanson [Thu, 9 Apr 2015 20:24:27 +0000 (15:24 -0500)]
Reworked Dell SC iSCSI target portal return
On initialize_connection the code to determine the portal, lun and
iqn info to return could skip ports and potentially not return the
best portal choice. In the case of multipath being enabled not all
ports would be returned.
Also changed a LOG.debug to a LOG.info in initialize_connection.
Navneet Singh [Wed, 1 Oct 2014 18:31:41 +0000 (00:01 +0530)]
Fix LUN misalignment issue with NetApp iSCSI drivers
This patch fixes LUN misalignment issues that can be
experienced when provisioning Cinder volumes with the iSCSI
protocol. In the fix, two new SAN options for configuring
LUN OS and initiator OS used while attaching volume can be
specified. This gives the admin flexibility to configure
backends correctly for multiple hypervisor and guest OS
platforms.
VNX Cinder Driver should report 0 free_capacity_gb in some scenarios
When the storage pool is Initializing, Offline or Deleting, no more LUNs
can be created before the pool gets out of the state.
So when a pool is in the 3 states, its free capacity is de facto 0.
This patch is to add logic to report 0 free capacity accordingly.
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.
Sean McGinnis [Thu, 9 Apr 2015 15:32:03 +0000 (10:32 -0500)]
Logging not using oslo.i18n guidelines (brick)
Multi-patch set for easier chunks. This one addresses
the backup and common cinder directories.
Updates have already been made to the os-brick project.
There have been quite a few instances found where the
i18n guidelines are not being followed. I believe this
has helped lead to some of the confusion around how to
correctly do this. Other developers see this code and
assume it is an example of the correct usage.
This patch attempts to clean up most of those violations
in the existing codebase to hopefully help avoid some of
that confusion in reviews.
Some issues address:
* Correct log translation markers for different log levels
* Passing format values as arguments to call, not preformatting
* Not forcing translation via six.text_type and others
Guidelines can be found here:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Hacking checks will not be able to identify all violations of
the guidelines, but it could be useful for catching obvious ones
such as LOG.info("No markers!").
Removed sleep before 'YES' is sent to confim an operation
Removed sleep between the time a command is sent
and 'YES' is sent to confim the operation. We have
discussed this internally and have concluded that
the sleep was mistakenly added in the initial coding
from an example of the SSH code. We have done full
functionality testing of the zoning operations on
Brocade switches with the sleep removed and have
found no side effects from the removal
Additionally, no other Brocade management
applications which perform zoning on our switches
require sleep intervals between execution of
commands. We are confident that the sleep is not
necessary and can be removed
Update openstack-common reference in openstack/common/README
The README file under the openstack/common directory references to
openstack-common, but the link points to oslo-incubator (which is
correct). Update the file, so that it makes use of oslo-incubator
instead of openstack-common.
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.