create a volume from image snapshot can not work

Bug #1560867 reported by YaoZheng_ZTE
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
TommyLike

Bug Description

Reproducing method as following:
1、create a volume from image.
2、boot a vm from the volume.
3、snapshot the vm.
4、After third steps, you will find that you have a new image in glance.
5、We're supposed to call it “instance_image”.
6、Then, I create a new volume from the new image “instance_image”.
7、Boot a new vm from the new volume, but create the vm failed.

Changed in cinder:
assignee: nobody → YaoZheng_ZTE (zheng-yao1)
Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

The reason for this problem is:
The step 6, create the volume from the image “instance_image”, the volume is empty.
because the image file is empty, so create volume from the image , the volume is null.
The image was created from instance snapshot, as the instance boot from volume,
so the image is just a link to the volume snapshot.

Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

I think, if the user create volume from the snapshot image, We should implement the process of creating a volume from the volume snapshot.

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

I think steps mentioned above are wrong.

If you want to boot from snapshot image(=“instance_image”) which has a boot volume, you should do ''nova boot --flavor m1.tiny --image <snap-img-id> <vm-name>" command. This creates a new instance with a new volume which is created from snapshot volume in Cinder.

Or you can create a new volume from snapshot volume in Cinder, and then specify the volume when booting a new instance.

Ether way is fine.

Changed in cinder:
status: New → Invalid
Revision history for this message
Xuepeng Ji (ji-xuepeng) wrote :

Yes you are right. But as a user, I can do such steps mentioned above. We can't prohibit the user to do so.

I think we should support "creating volume from the snapshot image" correctly in cinder , or return error to indicate that does not support this use case.

Changed in cinder:
status: Invalid → New
Revision history for this message
Bin Zhou (binzhou) wrote :

I quite agree with Xuepeng Ji, cause you can't stop customer doing all these operations, especially when all these scenarioes are provided for all customers, we should fix this bug.

Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

Hi Mitsuhiro :
    I agree with you. Maybe as a professional user, the user will be in strict
accordance with the operation. But, I think we should consider from the
function is easy to use, we should restrict the user in function and to
the user return failure. Or to do more perfectly, we are in the process
of intelligent support for this kind of operation, and this modification
 is very simple.

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

I understand your expectation. Changed the status to new again. Thanks.

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

Anyone working on this?

Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

Hi Mitsuhiro:
    I'm working on this. I will change the status as in-progress. Thanks!

Changed in cinder:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
YaoZheng_ZTE (zheng-yao1) wrote :

Hi Mitsuhiro:
There are two solutions:
1.When the user create volume from the snapshot image, raise “not support”Exception.
2.When the user create volume from the snapshot image, we create volume from
the volume snapshot. Therefore users can successfully create a new volume.
Do you think Which solution is better?
Thanks!

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

I think No.2 would be better for usability.

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Sean McGinnis (<email address hidden>) on branch: master
Review: https://review.openstack.org/314944
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: YaoZheng_ZTE (zheng-yao1) → nobody
Changed in cinder:
status: In Progress → New
Changed in cinder:
assignee: nobody → TommyLike (hu-husheng)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/314944
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=25dd8109df4425e7f470429956d093bf59fcf669
Submitter: Zuul
Branch: master

commit 25dd8109df4425e7f470429956d093bf59fcf669
Author: zhengyao1 <email address hidden>
Date: Mon Jun 20 17:06:12 2016 +0800

    Support create a volume from image snapshot

    The instance boot from volume, snapshot the instance will create
    a image in glance. The image size is 0, it just a link to the
    volume snapshot. When the user create volume from the snapshot
    image, in the current version, it will create a blank volume. so
    the user is troubled. This patch fix it.

    The scheme: when the user create volume from snapshot image, the
    api create interface will parse out the snapshot image corresponds
    to the volume snapshot id. Then create a volume from the volume
    snapshot. So, the user can use this way to restore the instance's
    bootable volume.

    Change-Id: Ic44dfae8bb187a5aa9c2c1f50f7b5dc0ef0f28f8
    Closes-Bug: #1560867

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.

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.