Huawei driver creates volume from image failed while using non-admin user

Bug #1699109 reported by Yingzhe Zeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Yingzhe Zeng

Bug Description

Huawei driver creates volume from image failed, by a non-admin user,
because Huawei driver returns admin_metadata to update to volume DB,
but admin_metadata can only be updated by admin user, a exception
would occur at this situation.

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/475774

Changed in cinder:
assignee: nobody → Yingzhe Zeng (zengyingzhe)
status: New → In Progress
Revision history for this message
TommyLike (hu-husheng) wrote :
Download full text (4.6 KiB)

Added the console log:
```
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager Traceback (most recent call last):
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager result = task.execute(**arguments)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 902, in execute
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager **volume_spec)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 849, in _create_from_image
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager image_service)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "<decorator-gen-236>", line 2, in _create_from_image_cache_or_download
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/coordination.py", line 301, in _synchronized
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager return f(*a, **k)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 768, in _create_from_image_cache_or_download
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager image_service
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 668, in _create_from_image_download
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager volume.save()
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/objects/volume.py", line 382, in save
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager db.volume_update(self._context, self.id, updates)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/db/api.py", line 315, in volume_update
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager return IMPL.volume_update(context, volume_id, values)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/db/sqlalchemy/api.py", line 251, in wrapper
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager return f(*args, **kwargs)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/db/sqlalchemy/api.py", line 196, in wrapper
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager return f(*args, **kwargs)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/cinder/db/sqlalchemy/api.py", line 2430, in volume_update
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager result = query.filter_by(id=volume_id).update(values)
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 3176, in update
2017-06-29 18:13:33.433 9861 ERROR cinder.volume.manager update_op.exec_()
2017-06-29 18:13:33....

Read more...

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

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

Changed in cinder:
assignee: Yingzhe Zeng (zengyingzhe) → TommyLike (hu-husheng)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by TommyLike (<email address hidden>) on branch: master
Review: https://review.openstack.org/478751
Reason: Use 'provider-location' to avoid misusing admin-metadata

Changed in cinder:
assignee: TommyLike (hu-husheng) → Yingzhe Zeng (zengyingzhe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit 2d6ac671f2a47ed06d8eb288b86760ffccfd1e52
Author: zengyingzhe <email address hidden>
Date: Tue Jun 20 20:41:29 2017 +0800

    Change Huawei driver's private data storing place

    This patch is to fix issues at two circumstances:
    1. Create volume from image by non-admin user, this operation
    will fail because Huawei driver tries to record LUN WWN at admin
    metadata, however non-admin user doesn't have the admin metadata
    access right, so exception is raised.
    2. Restore volume backup to 3rd volume, this operation will also
    restore backup volume's metadata to the 3rd volume, but the data
    recorded in metadata is strong correlative to the corresponding
    LUN at backend storage, so this will break the one-to-one
    relationship between the restored volume and the LUN at storage.

    To fix the issues above, we moved all LUN private data to
    provider_location, stored as a dict string, not use admin
    metadata or metadata to store LUN private data.

    Change-Id: Id18622935ecaa1715491b4ede48c7b627e43d3fa
    Closes-Bug: #1699109

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/486025

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

Reviewed: https://review.openstack.org/486025
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=10032adc6b6d2571a61af6e64985b892de8f06cd
Submitter: Jenkins
Branch: stable/ocata

commit 10032adc6b6d2571a61af6e64985b892de8f06cd
Author: zengyingzhe <email address hidden>
Date: Tue Jun 20 20:41:29 2017 +0800

    Change Huawei driver's private data storing place

    This patch is to fix issues at two circumstances:
    1. Create volume from image by non-admin user, this operation
    will fail because Huawei driver tries to record LUN WWN at admin
    metadata, however non-admin user doesn't have the admin metadata
    access right, so exception is raised.
    2. Restore volume backup to 3rd volume, this operation will also
    restore backup volume's metadata to the 3rd volume, but the data
    recorded in metadata is strong correlative to the corresponding
    LUN at backend storage, so this will break the one-to-one
    relationship between the restored volume and the LUN at storage.

    To fix the issues above, we moved all LUN private data to
    provider_location, stored as a dict string, not use admin
    metadata or metadata to store LUN private data.

    Change-Id: Id18622935ecaa1715491b4ede48c7b627e43d3fa
    Closes-Bug: #1699109
    (cherry picked from commit 2d6ac671f2a47ed06d8eb288b86760ffccfd1e52)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.0.0.0b3

This issue was fixed in the openstack/cinder 11.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (driverfixes/newton)

Fix proposed to branch: driverfixes/newton
Review: https://review.openstack.org/490263

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (driverfixes/mitaka)

Fix proposed to branch: driverfixes/mitaka
Review: https://review.openstack.org/490426

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

Reviewed: https://review.openstack.org/490263
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=903f4c8c7ba62b34fca29e767c3463d4db74bfca
Submitter: Jenkins
Branch: driverfixes/newton

commit 903f4c8c7ba62b34fca29e767c3463d4db74bfca
Author: zengyingzhe <email address hidden>
Date: Tue Jun 20 20:41:29 2017 +0800

    Change Huawei driver's private data storing place

    This patch is to fix issues at two circumstances:
    1. Create volume from image by non-admin user, this operation
    will fail because Huawei driver tries to record LUN WWN at admin
    metadata, however non-admin user doesn't have the admin metadata
    access right, so exception is raised.
    2. Restore volume backup to 3rd volume, this operation will also
    restore backup volume's metadata to the 3rd volume, but the data
    recorded in metadata is strong correlative to the corresponding
    LUN at backend storage, so this will break the one-to-one
    relationship between the restored volume and the LUN at storage.

    To fix the issues above, we moved all LUN private data to
    provider_location, stored as a dict string, not use admin
    metadata or metadata to store LUN private data.

    Change-Id: Id18622935ecaa1715491b4ede48c7b627e43d3fa
    Closes-Bug: #1699109
    (cherry picked from commit 2d6ac671f2a47ed06d8eb288b86760ffccfd1e52)
    (cherry picked from commit 10032adc6b6d2571a61af6e64985b892de8f06cd)

tags: added: in-driverfixes-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (driverfixes/mitaka)

Reviewed: https://review.openstack.org/490426
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=08e6177521d62dd5e7194f5b93f3b15d0c41035b
Submitter: Jenkins
Branch: driverfixes/mitaka

commit 08e6177521d62dd5e7194f5b93f3b15d0c41035b
Author: zengyingzhe <email address hidden>
Date: Tue Jun 20 20:41:29 2017 +0800

    Change Huawei driver's private data storing place

    This patch is to fix issues at two circumstances:
    1. Create volume from image by non-admin user, this operation
    will fail because Huawei driver tries to record LUN WWN at admin
    metadata, however non-admin user doesn't have the admin metadata
    access right, so exception is raised.
    2. Restore volume backup to 3rd volume, this operation will also
    restore backup volume's metadata to the 3rd volume, but the data
    recorded in metadata is strong correlative to the corresponding
    LUN at backend storage, so this will break the one-to-one
    relationship between the restored volume and the LUN at storage.

    To fix the issues above, we moved all LUN private data to
    provider_location, stored as a dict string, not use admin
    metadata or metadata to store LUN private data.

    Change-Id: Id18622935ecaa1715491b4ede48c7b627e43d3fa
    Closes-Bug: #1699109
    (cherry picked from commit 2d6ac671f2a47ed06d8eb288b86760ffccfd1e52)

tags: added: in-driverfixes-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 10.0.5

This issue was fixed in the openstack/cinder 10.0.5 release.

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.