create volume from snapshot using horizon error

Bug #1447288 reported by Alexey Khodos
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Masco
Kilo
Fix Released
Undecided
Unassigned

Bug Description

When I try to create a volume from snapshot using the OpenStack UI it creates a new raw volume with correct size, but it's not created from a snapshot.

$ cinder show 9d5d0ca1-3dd0-47b4-b9f4-86f97d65724e
+---------------------------------------+--------------------------------------+
| Property | Value |
+---------------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2015-04-22T18:08:53.000000 |
| description | None |
| encrypted | False |
| id | 9d5d0ca1-3dd0-47b4-b9f4-86f97d65724e |
| metadata | {} |
| multiattach | False |
| name | v2s2 |
| os-vol-host-attr:host | ubuntu@ns_nfs-1#nfs |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 4968203f183641b283e111a2f2d3333b |
| os-volume-replication:driver_data | None |
| os-volume-replication:extended_status | None |
| replication_status | disabled |
| size | 2 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| user_id | c8163c5313504306b40377a0775e9ffa |
| volume_type | None |
+---------------------------------------+--------------------------------------+

But when I use cinder command line everything seems to be fine.

$ cinder create --snapshot-id 382a0e1d-168b-4cf6-a9ff-715d8ad385eb 1
+---------------------------------------+--------------------------------------+
| Property | Value |
+---------------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2015-04-22T18:15:08.000000 |
| description | None |
| encrypted | False |
| id | b33ec1ef-9d29-4231-8d15-8cf22ca3c502 |
| metadata | {} |
| multiattach | False |
| name | None |
| os-vol-host-attr:host | ubuntu@ns_nfs-1#nfs |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 4968203f183641b283e111a2f2d3333b |
| os-volume-replication:driver_data | None |
| os-volume-replication:extended_status | None |
| replication_status | disabled |
| size | 1 |
| snapshot_id | 382a0e1d-168b-4cf6-a9ff-715d8ad385eb |
| source_volid | None |
| status | creating |
| user_id | c8163c5313504306b40377a0775e9ffa |
| volume_type | None |
+---------------------------------------+--------------------------------------+

So it looks like it uses different flows via UI and via command line for some reason.

Revision history for this message
John Griffith (john-griffith) wrote :

Turns out this is worse than I thought at first glance. So it appears that running from Horizon isn't honoring create from snap, it's also not honoring bootable settings.

What's worse however is that at first check it appears that it's not actually creating from snap at all. To test I created a bootable volume, booted it up, wrote some stuff. Shutdown the instance, created a snapshot, created a volume from snapshot. Attached the new volume and inspected it, turns out it's an empty/raw volume with nothing on it.

Given this still seems to work from cinder side, I think this is a Horizon specific bug but haven't verified/triaged.

Changed in cinder:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
John Griffith (john-griffith) wrote :

Verified using cinderclient for these ops works as expected. No idea what Horizon is calling/doing here. Removing Cinder for now, we can readd if there's infact something weird on our side.

no longer affects: cinder
Revision history for this message
John Griffith (john-griffith) wrote :

Turns out that with create from snapshot and others, none of the additional parameters are actually set in the horizon call. If for example you run "create from snapshot" using horizon and check the body of the request as it enters Cinders API (v2/volumes.py) you'll notice there are no parameters provided:

{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'fromsnap1', u'metadata': {}, u'consistencygroup_id': None, u'volume_type': u'lvmdriver-1', u'snapshot_id': None, u'project_id': None, u'source_replica': None, u'size': 1}}

Changed in horizon:
status: New → Confirmed
Masco (masco)
Changed in horizon:
assignee: nobody → Masco Kaliyamoorthy (masco)
Matthias Runge (mrunge)
Changed in horizon:
importance: Undecided → Critical
tags: added: kilo-rc-potential
Masco (masco)
Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
assignee: Masco Kaliyamoorthy (masco) → Lin Hua Cheng (lin-hua-cheng)
Changed in horizon:
assignee: Lin Hua Cheng (lin-hua-cheng) → Masco Kaliyamoorthy (masco)
milestone: none → liberty-1
Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/177689
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=690e56e5cfc96540d01d5632fe9264dd6dec7ead
Submitter: Jenkins
Branch: master

commit 690e56e5cfc96540d01d5632fe9264dd6dec7ead
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

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/191187

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

Reviewed: https://review.openstack.org/191187
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=2fc3fcd88eb09f140a246e782b3cde6b9aecb144
Submitter: Jenkins
Branch: stable/kilo

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)

tags: added: in-stable-kilo
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-1 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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