create volume from snapshot ,the request body is not correct

Bug #1477368 reported by YaoZheng_ZTE
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Unassigned

Bug Description

How to reproduce:
1. create a new blank volume
2. Snapshot volume which was created at step1
3. Into volume snapshots page, create another volume source from the snapshot which was created at step2.
4. open cinder-api debug log, you can find the horizon send the request message body:
 [root@compuer03 cinder]# cat cinder-api.log |grep "Create volume request body"
2015-07-22 10:32:22.093 29454 DEBUG cinder.api.v2.volumes [req-9598a2cc-5d9a-4399-99bb-477bef580dc4 150ca453945849e8b79643c1da0c6e97 51852671947346fead3cdc9ec5f69937 - - -] Create volume request body: {u'volume': {u'status': u'creating', u'user_id': None, u'description': u'', u'imageRef': None, u'availability_zone': None, 'scheduler_hints': {}, u'attach_status': u'detached', u'source_volid': None, u'name': u'3334444', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'FCsan', u'snapshot_id': None, u'project_id': None, u'source_replica': None, u'size': 1}}

so, you will find the "u'snapshot_id': None," , so the volume source snapshot_id was lost.
5. I reproduce this issue in K version.

Changed in horizon:
assignee: nobody → jelly (coding1314)
Revision history for this message
Kuo-tung Kao (jelly) (coding1314) wrote :

I didn't find the issue in stable/kilo. I tested it in devstack.

2015-07-27 16:25:51.747 DEBUG cinder.api.v2.volumes [req-f74e8a1e-1e05-45bc-a89b-a779e8af5697 admin] Create volume request body: {u'volume': {u'status': u'creating', u'user_id': None, u'description': u'', u'imageRef': None, u'availability_zone': None, 'scheduler_hints': {}, u'attach_status': u'detached', u'source_volid': None, u'name': u'aaa', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'lvm', u'snapshot_id': u'76209bfb-96f0-49c5-abca-ca5f162e4b9f', u'project_id': None, u'source_replica': None, u'size': 1}} create /opt/stack/cinder/cinder/api/v2/volumes.py:312
2015-07-27 16:27:13.328 DEBUG cinder.api.v2.volumes [req-1a46fc83-83c0-4fd8-bde9-d3548db16509 admin] Create volume request body: {u'volume': {u'status': u'creating', u'user_id': None, u'description': u'', u'imageRef': None, u'availability_zone': None, 'scheduler_hints': {}, u'attach_status': u'detached', u'source_volid': None, u'name': u'bbb', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'lvm', u'snapshot_id': u'76209bfb-96f0-49c5-abca-ca5f162e4b9f', u'project_id': None, u'source_replica': None, u'size': 1}} create /opt/stack/cinder/cinder/api/v2/volumes.py:312
2015-07-27 16:30:33.979 DEBUG cinder.api.v2.volumes [req-f221be26-1bc1-4204-9b79-3d3fb7617958 admin] Create volume request body: {u'volume': {u'status': u'creating', u'user_id': None, u'description': u'', u'imageRef': None, u'availability_zone': None, 'scheduler_hints': {}, u'attach_status': u'detached', u'source_volid': None, u'name': u'c', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'lvm', u'snapshot_id': u'76209bfb-96f0-49c5-abca-ca5f162e4b9f', u'project_id': None, u'source_replica': None, u'size': 1}} create /opt/stack/cinder/cinder/api/v2/volumes.py:312
2015-07-27 16:44:24.031 DEBUG cinder.api.v2.volumes [req-cddb536e-7e00-4a17-8dce-af621e01d57f admin] Create volume request body: {u'volume': {u'status': u'creating', u'user_id': None, u'description': u'', u'imageRef': None, u'availability_zone': None, 'scheduler_hints': {}, u'attach_status': u'detached', u'source_volid': None, u'name': u'e', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'lvm', u'snapshot_id': u'76209bfb-96f0-49c5-abca-ca5f162e4b9f', u'project_id': None, u'source_replica': None, u'size': 1}} create /opt/stack/cinder/cinder/api/v2/volumes.py:312

Changed in horizon:
status: New → Incomplete
Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

Hi jelly:
    I use Kilo_2015.1.0 version, this issue reproduce key is step 3, must be into volume snapshots page first, then kick "create volume" button. if you are not into volume snapshots page, or if you are into volume page, kick "create volume" button,then choose volume source from snapshot , then this issue will not be found.

Changed in horizon:
status: Incomplete → New
Revision history for this message
Kuo-tung Kao (jelly) (coding1314) wrote :

The bug existed in 2015.1.0. But it was fixed in the latest kilo version.

commit 2fc3fcd88eb09f140a246e782b3cde6b9aecb144
Author: Masco Kaliyamoorthy <email address hidden>
Date: Mon Apr 27 14:58:00 2015 +0530

    corrected the create volume from snapshot

    While creating the volume from snapshot via horizon UI, the volume
    is not created from snapshot. It is just creating a volume with
    same size of the snapshot.

    Fixed the condition used if snapshot_id should be passed when
    creating volume. The volume_source_type field is empty string if
    launched from Volume Snapshot panel.

    Co-Authored-By: Lin Hua Cheng <email address hidden>

    Change-Id: I19ddd572d1a7a028e3ae4dae412ffc54e730e50c
    Closes-Bug: #1447288
    (cherry picked from commit 690e56e5cfc96540d01d5632fe9264dd6dec7ead)

Changed in horizon:
assignee: jelly (coding1314) → nobody
Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

Closing per comments

Changed in horizon:
status: New → Fix Released
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → queens-1
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.