Victor Stinner [Tue, 24 Nov 2015 16:33:37 +0000 (17:33 +0100)]
Port zonemanager to Python 3
* Replace xrange() with six.moves.range()
* Replace filter() with list-comprehension to get a list on Python 3.
* get_formatted_wwn(): join byte strings with b':' instead of ':'
* ZoneManager: don't pass arguments to object.__new__()
* tests-py3.txt: add zonemanager tests
Michał Dulko [Tue, 24 Nov 2015 14:42:17 +0000 (15:42 +0100)]
Move oslo-incubator's scheduler module to cinder
oslo-incubator is ending its life and we should move remaining
dependencies from there to cinder namespace. This commit does so with
openstack.common.scheduler. Apart from that tests from oslo-incubator
repository are added.
vCenter supports different types of datastores such as
VMFS, NFS etc. Currently the VMDK driver supports only
vSAN, VMFS and NFS datastores for storing volume vmdks.
This patch adds a check to skip unsupported datastore
types during volume creation.
Victor Stinner [Sun, 8 Nov 2015 21:36:01 +0000 (22:36 +0100)]
Port IBM storewize_svc driver to Python 3
Change default preferred node in
StorwizeSVCDriver.initialize_connection(). For fiber channel without
multipath, pick the first node from the list of sorted nodes, to have
a determinist preferred node. The list of nodes is created indirectly
using list(set(nodes)) which doesn't have a determinist order. On
Python 3, the hash function is randomized, and so list(set()) has an
unknown order.
A similar change was done for volume throttling in the change
Icf7141f772397c7ac08f0f1e21ad74cb86a06351 to port the code
to Python 3.
Other changes:
* Use assertSetEqual() in test_storwize_svc to compare
initiator_target_map, because conn_wwpns has a random order on
Python 3.
* StorwizeSVCDriver._check_volume_copy_ops(): replace dict.items()
with list(dict.items()) to iterate on items. On Python 3,
dict.items() now returns a view instead of a copy. The loop
modifies the dictionary and a dict must not be modified while
iterating on it, we really need a copy of items.
* StorwizeHelpers: replace a/b with a//b to use integer division on
Python 3.
* tests-py3.txt: add cinder.tests.unit.test_storwize_svc
Shay Halsband [Sun, 15 Nov 2015 10:31:00 +0000 (12:31 +0200)]
XtremIO fix attach readonly bug
* Remove the access_mode from connection_info and let the manager decide
on the access mode.
* add a test to make sure access_mode won't be added in the future
The create method of consistency group API requires a list of
volume type ids; volumes belonging to only these types can be added
to the consistency group. The get method of the consistency group API
does not, however, return the volume type id information.
Horizon needs this value for its "Add volumes to consistency group"
panel so that it can filter the "available volumes" list to only
show volumes that match the volume type associated with the consistency
group.
This was fixed by propagating the volume type id information in
the api layer (this information is stored in the db, it just wasn't
being propagated).
APIImpact
The get method of the consistency group API now returns the volume
type ids information.
DocImpact
The screenshots in the admin guide (see
http://docs.openstack.org/admin-guide-cloud/blockstorage-consistency-groups.html)
should be updated to show this new field.
zhangsong [Mon, 9 Nov 2015 15:00:08 +0000 (23:00 +0800)]
Fix the bug of OSError when convert image
When I try to convert a image use image_utils.convert_image() method,
an error occurred like this :
'''
OSError: [Errno 2] No such file or directory:
'sheepdog:10.133.17.61:7000:volume-a0a70f9b-a50e-4369-885f-c41a894c9fe5'
'''
The reason is that in some cluster storage systems, like
ceph/sheepdog, QEMU can access an image directly via their private
protocol, and there’s no need to map an image as a block device on
the host. In this case, the qemu-img convert command may like:
#qemu-img convert -O raw sheepdog:Ip:port:image_name temp_file
#qemu-img convert -O raw rbd:pool_name/image_name temp_file
The source path may be 'sheepdog:Ip:port:image_name' or
'rbd:pool_name/image_name', it doesn't exist in OS. So, when it runs
the os.stat(source) in image_utils.convert_image(source,dest,out_format)
method, an OSError would be raised.
We can use qemu_img_info method instead to resolve this problem, because
the 'qemu-img info' command can always get the image size info which has
support qemu-img tool. Here we capture a ValueError just in case, but it
only need to give a warning message, because the image has been successfully
converted.
Michał Dulko [Mon, 23 Nov 2015 13:13:28 +0000 (14:13 +0100)]
Add guidelines for release notes to devref
Starting from this cycle (and stable Liberty) we're using reno for
release notes. This commit adds guidelines on when a release note is
required to be added.
Michał Dulko [Fri, 20 Nov 2015 11:36:22 +0000 (12:36 +0100)]
Eager load columns in volume_get_active_by_window
All other volume-related methods in db.sqlalchemy.api are eager loading
volume_metadata, volume_admin_metadata (if admin), volume_type,
volume_attachment and consistencygroup. volume_get_active_by_window
wasn't, causing fails because of SQLAlchemy Session being closed when
trying to lazy load volume_metadata. This commit adds missing
options(joinedload()) to this query.
Alex O'Rourke [Fri, 20 Nov 2015 19:25:19 +0000 (11:25 -0800)]
LeftHand: Remove self.db assignment
DB access was removed in a previous patch when it was no longer
needed at the driver level. The self.db assignment was overlooked
and not removed, even though it is no longer being used.
Ryan McNair [Thu, 12 Nov 2015 15:06:32 +0000 (15:06 +0000)]
Deprecate *_multipath_enabled flag for IBM drivers
Deprecate the *_multipath_enabled from the FlashSystem and
Storwize/SVC driver. When enabled, this flag was intended to create
a single mapping between the compute node and the storage device for
FC connections. However, all available storage WWNNs were still being
mapped to the compute node, and instead enabling this flag was
causing a terminate_connection to not cleanup all LUN mappings
(because Nova did not know of all the target_wwns that were actually
mapped). This can be seen by enabling the flag, connecting a volume,
disconnecting the volume and observing the stray LUN mappings under
'/dev/disk/by-path'.
Currently we do not have a way to limit the storage WWNNs which are
mapped during a FC connection, so we will ignore the config to fix
this broken behavior, and then remove the config next release.
Gorka Eguileor [Thu, 27 Aug 2015 23:14:02 +0000 (01:14 +0200)]
Move get_by_id to CinderObject
Currently each Versioned Object needs to implement its own get_by_id,
with this patch they don't need anymore, since it will be included in
the base class CinderObject and it will work for all the objects.
This will help for other things like having a refresh method or
conditional updates in the objects.
Ryan McNair [Thu, 19 Nov 2015 19:48:37 +0000 (19:48 +0000)]
Fix swap_volume for case without migration
Fix swap_volume so that even when a volume-migration does not
occur, the volumes don't get stuck in "attaching" and "detaching".
Previously the swap_volume was changed in
https://review.openstack.org/#/c/101932 and
https://review.openstack.org/#/c/101933 to move the final
attach and detach logic to Cinder, however those changes only fix
the migration path. This change calls Cinder's "attach" and "detach"
for the non-migration path to update the volumes' states.
Alex O'Rourke [Thu, 15 Oct 2015 21:49:07 +0000 (14:49 -0700)]
Remove db access from 3PAR and LH cg functions
The HP 3PAR and HP LeftHand drivers no longer need to access the db in
order to grab snapshots and volumes for the following functions:
* delete_consistencygroup
* create_cgsnapshot
* delete_cgsnapshot
This patch removes all db access at the driver level for both 3PAR and
LeftHand drivers.
Chris Morrell [Wed, 18 Nov 2015 22:14:15 +0000 (22:14 +0000)]
Additional VAG support for SolidFire
This patch removes volumes from volume access groups, and potentially volume
access groups, when a connection is terminated. When the previously added
'sf_enable_vag' option is enabled and a volume connection is terminated, if the
volume was part of a VAG then the volume is removed from the VAG. If the volume
is the only remaining volume in the VAG then the VAG is also removed.
Gaurang Tapase [Wed, 18 Nov 2015 10:56:39 +0000 (05:56 -0500)]
Fix metadata retrieval in GPFS driver
GPFS driver was using 'volume_metadata' to get the
volume metadata. With versionedobjects, it is to be
retrieved using 'metadata' from volume.
This patch fixes the issue. It first tries for 'volume_metadata'
in the volume object, if not present, it will try for 'metadata'
to get the metadata.
peter_wang [Tue, 17 Nov 2015 07:44:58 +0000 (02:44 -0500)]
VNX: Fix metadata get overriden issue
Cinder is using 'metadata' or 'volume_metadata' to return
volume metadata since versionedobjects is not fully merged,
so VNX could not get the correct existing
metadata, only append VNX specific metadata so existing
metadata get overridden.
In this fix, VNX will first try 'volume_metadata' if not exists,
try 'metadata' when getting metadata.
Chris Morrell [Mon, 16 Nov 2015 21:45:48 +0000 (21:45 +0000)]
Added VAG support to SolidFire
This patch adds VAG support to the SolidFire driver.
This includes a new config option 'sf_enable_vag'.
The driver creates a new VAG based on initiator name during
connection initialization.
By default VAG support is disabled. When enabled, the driver uses both
CHAP and VAG authentication.
Alon Marx [Thu, 12 Nov 2015 20:07:05 +0000 (22:07 +0200)]
Remove db access from XIV/DS8K CG functions
The XIV/DS8K driver no longer needs to access the db in order to
grab snapshots and volumes for the following functions:
* delete_consistencygroup
* create_cgsnapshot
* delete_cgsnapshot
A superclass exception (error) is being handled before
a sub class exception(SSLError) which is making the latter
exception clause unreachable. Corrected the order of these
exception clauses.
Victor Stinner [Thu, 5 Nov 2015 15:22:11 +0000 (16:22 +0100)]
Port HP 3PAR driver to Python 3
* Use oslo_serialization.base64.encode_as_text() to get Unicode on
Python 3.
* Replace sys.maxint with sys.maxsize, sys.maxint was removed in
Python 3.
* test_hpe3par: use list(set()) to get FCWWNs is the right order. On
Python 3, the hash function is randomized by default.
* test_hpe3par: fix client getWsApiVersion() to return a valid
version. Before, the comparison between mock.Mock and int raised a
TypeError.
* hpe_3par_common: set version to 3.0.2
* hpe_3par_iscsi: set version to 3.0.1
* tox.ini: add test_hpe3par to Python 3.4
This patch removes the deprecated HP Lefthand
CLIQ/SSH based driver. It also refactors the proxy
class, which was nothing but a wrapper for the 2
drivers. The LeftHand driver is now entirely based
off of the REST client.
Kendall Nelson [Wed, 7 Oct 2015 13:53:38 +0000 (08:53 -0500)]
Downstream Fix for Genconfig
This patch adds the opts.py file to the tree as a fix for deployers
that package cinder. The opts.py file is no longer being deleted right
away by generate_sample.sh after the cinder.sample.conf is being
generated.
This patch also introduces a pep8 check to make sure that the opts.py
file is up to date, so that it will catch when new opts get added to
Cinder without the opts.py being updated.
To support the ability to keep and check the opts file a number
of changes were needed in the check_uptodate.sh script as well as
the generate_sample.sh script:
- check_uptodate now takes --checkopts instead of --checkonly
When checkopts is used the opts.py file is generated using the
current code and the generated file is compared to the existing
file. The check fails if there are differences.
- generate_sample now has the --nosamplefile option.
When this option is used, only the opts.py file is generated.
The oslo-config-generator code is skipped so no sample file
is created.
- generate_sample also has some coding style consistency changes.
- Added the 'genopts' option to tox so users can generate
a fresh opts.py without a sample file when necessary.
Closes-Bug: 1501820
Co-Author: Jay Bryant <jsbryant@us.ibm.com>
When 3PAR iSCSI driver is configured for multipath, with multiple
ip addresses in hp3par_iscsi_ips, find_existing_vluns fails to return
more than 1 vlun. The problem with this is that every time
initialize_connection is called, the driver will not find the vlun it expects
to be there, and then it will create a new one.
This patch removes the break inside of find_existing_vluns, so that it
returns the entire list, not just the first vlun.