VNX: metadata get overrided if driver return metadata

Bug #1516903 reported by Peter Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Michal Dulko

Bug Description

In VNX cinder driver, we use volume['volume_metadata'] to get volume metadata

Now, after cinder begins to use cinder objects after the following patch was merged, the related key has been changed to 'metadata'.

https://review.openstack.org/#/c/240735/

2309 (Pdb) print volume
2310 Volume(_name_id=None,admin_metadata={},attach_status='detached',availability_zone='nova',bootable=False,consistencygroup_id=None,created_at=2015-11-17T01:53:08Z,deleted=False,deleted_at=None,display_description=None,display_name='peter4',ec2_id=None,encryption_key_i d=None,host='ubuntu14@pool_backend_1#Pool_1',id=5db57536-5346-467a-b045-3066171d0861,launched_at=None,metadata={test='work'},migratio n_status=None,multiattach=False,previous_status=None,project_id=80cb188ebf8a46ba837392acc3f3704f,provider_auth=None,provider_geometry =None,provider_id=None,provider_location=None,replication_driver_data=None,replication_extended_status=None,replication_status='disab led',scheduled_at=2015-11-17T01:53:08Z,size=1,snapshot_id=None,source_volid=None,status='creating',terminated_at=None,updated_at=2015 -11-17T01:53:08Z,user_id=a63e97c42c024ecfbdd08f5c507372e7,volume_attachment=<?>,volume_type=<?>,volume_type_id=None)

VNX drivers needs to update code accordingly.

Thanks
Peter

Tags: drivers emc vnx
Peter Wang (peter.wang)
summary: - VNX: Use 'metadata' when get volume meta data info
+ VNX: metadata get overrided if driver return metadata
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/246238

Changed in cinder:
assignee: nobody → Peter Wang (peter.wang)
status: New → In Progress
Xing Yang (xing-yang)
Changed in cinder:
importance: Undecided → High
milestone: none → mitaka-1
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/247762

Changed in cinder:
assignee: Peter Wang (peter.wang) → Michal Dulko (michal-dulko-f)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/247763

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/246238
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e32aaf82a37ac09c3180dbe7476287db24237452
Submitter: Jenkins
Branch: master

commit e32aaf82a37ac09c3180dbe7476287db24237452
Author: peter_wang <email address hidden>
Date: Tue Nov 17 02:44:58 2015 -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.

    Change-Id: I1215883a6076e9b15b1ced19aa40aae43c66a00c
    Closes-bug: 1516903

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (master)

Reviewed: https://review.openstack.org/247762
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=1145a9899de4efeda3eb53c1be709584ccf5f39b
Submitter: Jenkins
Branch: master

commit 1145a9899de4efeda3eb53c1be709584ccf5f39b
Author: Michał Dulko <email address hidden>
Date: Thu Nov 19 17:50:20 2015 +0100

    Recognize extra fields in CinderObjectDictCompat

    We're still in the process of transitioning to the object notation in a
    lot of places and that's why we've decided to keep specialized get in
    CinderObjectDictCompat. This one wasn't looking at aliases (properties)
    from obj_extra_fields. This commit fixes that and adds a unit test for
    this method.

    We should eventually stop using it, but for Mitaka this will make a lot
    of things easier.

    Change-Id: I1df610bedffdeae56444ce0a40f8fb48216e91b7
    Related-Bug: 1516903

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/247763
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e31e31689073323ceba2bb4c993af73df8274121
Submitter: Jenkins
Branch: master

commit e31e31689073323ceba2bb4c993af73df8274121
Author: Michał Dulko <email address hidden>
Date: Thu Nov 19 19:36:27 2015 +0100

    Add metadata aliases to Volume object

    When writing Volume object we've renamed some fields from SQLAlchemy
    model. This included volume_metadata (renamed to metadata) and
    volume_admin_metadata (renamed to admin_metadata) and
    volume_glance_metadata (recently added as glance_metadata). Some code
    were relying on old names. As right now we're in the transitional phase
    it's hard to tell if driver method will get versioned object or old
    SQLAlchemy object.

    To mitigate that and mimic old SQLAlchemy object behavior on versioned
    object we should add properties to serve as aliases for older names.

    This commit also fixes the tests for EMC VNX that were blocking the
    patch. Tests were setting volume_metadata property on volume object,
    which actually had no effect without this patch.

    Another thing done is moving overriding __contains__ from
    CinderObjectDictCompat to CinderObject class to solve MRO issue because
    both of these classes were defining __contains__ method.

    Change-Id: I79e24c5ad20f17bb6b21b2d47f955afde47d9794
    Closes-Bug: 1529877
    Related-Bug: 1516903

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.