manage_existing breaks with storage pools

Bug #1724958 reported by Goutham Pacha Ravi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Goutham Pacha Ravi

Bug Description

Steps to reproduce:
====================

Test setup:
-----------
* Manage is an administrator operation, so source administrator creds
* Run cinder with a backend that supports multiple storage pools, ex: NetApp ONTAP NFS
* Create a cinder volume, note its name and the host so we can "manage" this volume. See steps here: https://netapp-openstack-dev.github.io/openstack-docs/draft/cinder/examples/openstack_command_line/section_cinder-cli.html#cinder-manage-usage
* Unmanage the volume

Triggering the bug:
-------------------
* Manage the volume
* List the new volume, there is a good chance that this volume's "os-vol-host-attr:host" is set to the wrong pool, though belonging to the same backend

* Observe the host field in the cinder-api service, and the scheduler:
The API sets this host field as "service.host": https://github.com/openstack/cinder/blob/a9e0750/cinder/volume/api.py#L1684
* The "host" attribute of the service object doesn't have pool information
* Any pool in this 'host' may hence pass filtering logic in the scheduler: https://github.com/openstack/cinder/blob/ce3830a/cinder/scheduler/manager.py#L310, and the first pool that passes gets assigned as the "os-vol-host-attr:host" attribute, and this may well be wrong.

Sequence of events in cinder logs:
==================================

The Manage request/response from the API:
-----------------------------------------

2017-10-18 22:53:43,623 3365 INFO [tempest.lib.common.rest_client] Request (NetAppCDOTManageUnmanageTest:test_tc300_qos_applied_on_manage_with_no_preexisting_qos_iops): 202 POST http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/os-volume-manage 0.227s
2017-10-18 22:53:43,624 3365 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'X-Auth-Token': '<omitted>', 'Accept': 'application/json', 'Content-Type': 'application/json'}
        Body: {"volume": {"ref": {"source-name": "10.250.119.54:/vol_d4bce8bb_002/volume-bf131ede-cd98-4255-adce-f330f5bfec6e"}, "volume_type": "tempest-type-401201460", "host": "devstack-xenial-cdot-nfs-provider-43-57506@netappcmodenfsd4bce8bb#10.250.119.54:/vol_d4bce8bb_002", "source_name": "10.250.119.54:/vol_d4bce8bb_002/volume-bf131ede-cd98-4255-adce-f330f5bfec6e"}}
    Response - Headers: {u'date': 'Wed, 18 Oct 2017 22:53:43 GMT', u'server': 'Apache/2.4.18 (Ubuntu)', u'content-length': '821', 'status': '202', 'content-location': 'http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/os-volume-manage', u'x-compute-request-id': 'req-11caca68-112a-46a0-a927-89ed814bee1b', u'x-openstack-request-id': 'req-11caca68-112a-46a0-a927-89ed814bee1b', u'connection': 'close', u'content-type': 'application/json'}
        Body: {"volume": {"status": "creating", "migration_status": null, "user_id": "a4cf00b817a84dc694ddcb277e868b08", "attachments": [], "links": [{"href": "http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263", "rel": "self"}, {"href": "http://192.168.100.126/volume/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263", "rel": "bookmark"}], "availability_zone": "nova", "bootable": "false", "encrypted": false, "created_at": "2017-10-18T22:53:43.470183", "description": null, "updated_at": null, "volume_type": "tempest-type-401201460", "name": null, "replication_status": null, "consistencygroup_id": null, "source_volid": null, "snapshot_id": null, "multiattach": false, "metadata": {}, "id": "02320df7-70fe-4f5c-a157-6074a25a4263", "size": 0}}

Observe the requested host: "devstack-xenial-cdot-nfs-provider-43-57506@netappcmodenfsd4bce8bb#10.250.119.54:/vol_d4bce8bb_002"

Requesting the volume information right after:
-----------------------------------------------

2017-10-18 22:53:43.720 3365 INFO tempest.lib.common.rest_client [req-419f774b-4e65-409e-ad20-f5f86fa4f16f ] Request (NetAppCDOTManageUnmanageTest:test_tc300_qos_applied_on_manage_with_no_preexisting_qos_iops): 200 GET http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263 0.095s
2017-10-18 22:53:43.720 3365 DEBUG tempest.lib.common.rest_client [req-419f774b-4e65-409e-ad20-f5f86fa4f16f ] Request - Headers: {'X-Auth-Token': '<omitted>', 'Accept': 'application/json', 'Content-Type': 'application/json'}
        Body: None
    Response - Headers: {u'date': 'Wed, 18 Oct 2017 22:53:43 GMT', u'server': 'Apache/2.4.18 (Ubuntu)', u'content-length': '1119', 'status': '200', 'content-location': 'http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263', u'x-compute-request-id': 'req-419f774b-4e65-409e-ad20-f5f86fa4f16f', u'x-openstack-request-id': 'req-419f774b-4e65-409e-ad20-f5f86fa4f16f', u'connection': 'close', u'content-type': 'application/json'}
        Body: {"volume": {"migration_status": null, "attachments": [], "links": [{"href": "http://192.168.100.126/volume/v2/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263", "rel": "self"}, {"href": "http://192.168.100.126/volume/9d054670fb2a4d06ac4f17962afe2de1/volumes/02320df7-70fe-4f5c-a157-6074a25a4263", "rel": "bookmark"}], "availability_zone": "nova", "os-vol-host-attr:host": "devstack-xenial-cdot-nfs-provider-43-57506@netappcmodenfsd4bce8bb#10.250.119.54:/vol_d4bce8bb_000", "encrypted": false, "updated_at": "2017-10-18T22:53:44.000000", "replication_status": null, "snapshot_id": null, "id": "02320df7-70fe-4f5c-a157-6074a25a4263", "size": 0, "user_id": "a4cf00b817a84dc694ddcb277e868b08", "os-vol-tenant-attr:tenant_id": "9d054670fb2a4d06ac4f17962afe2de1", "os-vol-mig-status-attr:migstat": null, "metadata": {}, "status": "creating", "description": null, "multiattach": false, "source_volid": null, "consistencygroup_id": null, "os-vol-mig-status-attr:name_id": null, "name": null, "bootable": "false", "created_at": "2017-10-18T22:53:43.000000", "volume_type": "tempest-type-401201460"}} _log_request_full tempest/lib/common/rest_client.py:434

Observe the assigned/scheduled host: "os-vol-host-attr:host": "devstack-xenial-cdot-nfs-provider-43-57506@netappcmodenfsd4bce8bb#10.250.119.54:/vol_d4bce8bb_000"

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

Changed in cinder:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/514802
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=3c7f1762959d53c05f6d37c66908a78e3b822535
Submitter: Zuul
Branch: master

commit 3c7f1762959d53c05f6d37c66908a78e3b822535
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Oct 18 22:20:23 2017 -0400

    Fix manage_existing API behaving wrongly with storage pools

    When the requested host specifies a pool, Cinder needs to
    validate that specified pool in the scheduler
    and assign the 'host' attribute appropriately.

    Closes-Bug: 1724958
    Change-Id: Ia0261e83171a1a13374b447303e3a61863fa22c2

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0b2

This issue was fixed in the openstack/cinder 12.0.0.0b2 development milestone.

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/532781

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

Reviewed: https://review.openstack.org/532781
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=a91fad79608da9c43cbf0cd662fb0b3565f4432a
Submitter: Zuul
Branch: stable/pike

commit a91fad79608da9c43cbf0cd662fb0b3565f4432a
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Oct 18 22:20:23 2017 -0400

    Fix manage_existing API behaving wrongly with storage pools

    When the requested host specifies a pool, Cinder needs to
    validate that specified pool in the scheduler
    and assign the 'host' attribute appropriately.

    Closes-Bug: 1724958
    Change-Id: Ia0261e83171a1a13374b447303e3a61863fa22c2
    (cherry picked from commit 3c7f1762959d53c05f6d37c66908a78e3b822535)

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

This issue was fixed in the openstack/cinder 11.1.0 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.