Revert image status to queued if image conversion fails

Bug #2072483 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Abhishek Kekane

Bug Description

When glance has enabled import plugin `image_conversion` and if this plugin fails to convert the image to its desired format then image remains in `importing` state forever and also image data remains in staging area unless you delete that image.

Ideally image data should be deleted from the staging area and image state should be rolled back to `queued so that user can rectify the error in previous attempt and import image again.

Environment settings:
Ensure you have glance-direct,web-download method enabled in your glance-api.conf
Ensure you have image_conversion plugin enabled in glance-image-import.conf

How to reproduce:
1. Create bad image file with below command
   qemu-img create -f qcow2 -o data_file=abcdefghigh,data_file_raw=on disk.qcow2 1G
2. Use above file to create image using import workflow
   glance image-create-via-import --disk-format qcow2 --container-format bare --import-method glance-direct --file disk.qcow2 --name test-glance-direct-conversion_1

Expected result:
    Operation should fail, image should be in queued state and image data should be deleted from staging area

Actual result:
    Operation fails, image remains in importing state and image data remains in staging area

Changed in glance:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/glance/+/923624

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/c/openstack/glance/+/923624
Committed: https://opendev.org/openstack/glance/commit/ea131dd1442861cb5884f99b6bb9e47e397605ce
Submitter: "Zuul (22348)"
Branch: master

commit ea131dd1442861cb5884f99b6bb9e47e397605ce
Author: Abhishek Kekane <email address hidden>
Date: Mon Jul 8 09:49:55 2024 +0000

    Revert image state to queued if conversion fails

    Made changes to revert image state to `queued` and deleting image data
    from staging area if image conversion fails. If image is importing to
    multiple stores at a time then resetting the image properties
    `os_glance_importing_to_stores` and `os_glance_failed_imports` to
    reflect the actual result of the operation.

    Closes-Bug: 2072483
    Change-Id: I373dde3a07332184c43d9605bad7a59c70241a71

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

Fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/glance/+/925687

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

Reviewed: https://review.opendev.org/c/openstack/glance/+/925687
Committed: https://opendev.org/openstack/glance/commit/633e85c9c07f85de36677137ea15bc3a7f4feb04
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 633e85c9c07f85de36677137ea15bc3a7f4feb04
Author: Abhishek Kekane <email address hidden>
Date: Mon Jul 8 09:49:55 2024 +0000

    Revert image state to queued if conversion fails

    Made changes to revert image state to `queued` and deleting image data
    from staging area if image conversion fails. If image is importing to
    multiple stores at a time then resetting the image properties
    `os_glance_importing_to_stores` and `os_glance_failed_imports` to
    reflect the actual result of the operation.

    Closes-Bug: 2072483
    Change-Id: I373dde3a07332184c43d9605bad7a59c70241a71
    (cherry picked from commit ea131dd1442861cb5884f99b6bb9e47e397605ce)

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

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/glance/+/925730

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

Reviewed: https://review.opendev.org/c/openstack/glance/+/925730
Committed: https://opendev.org/openstack/glance/commit/3b3141baa38a8dfbf37e7633cf9bd62898a545da
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 3b3141baa38a8dfbf37e7633cf9bd62898a545da
Author: Abhishek Kekane <email address hidden>
Date: Mon Jul 8 09:49:55 2024 +0000

    Revert image state to queued if conversion fails

    Made changes to revert image state to `queued` and deleting image data
    from staging area if image conversion fails. If image is importing to
    multiple stores at a time then resetting the image properties
    `os_glance_importing_to_stores` and `os_glance_failed_imports` to
    reflect the actual result of the operation.

    Closes-Bug: 2072483
    Change-Id: I373dde3a07332184c43d9605bad7a59c70241a71
    (cherry picked from commit ea131dd1442861cb5884f99b6bb9e47e397605ce)
    (cherry picked from commit 633e85c9c07f85de36677137ea15bc3a7f4feb04)

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

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/glance/+/925752

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

Reviewed: https://review.opendev.org/c/openstack/glance/+/925752
Committed: https://opendev.org/openstack/glance/commit/3f7f01bb0584289c933a0fae3f915afec41093c8
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 3f7f01bb0584289c933a0fae3f915afec41093c8
Author: Abhishek Kekane <email address hidden>
Date: Mon Jul 8 09:49:55 2024 +0000

    Revert image state to queued if conversion fails

    Made changes to revert image state to `queued` and deleting image data
    from staging area if image conversion fails. If image is importing to
    multiple stores at a time then resetting the image properties
    `os_glance_importing_to_stores` and `os_glance_failed_imports` to
    reflect the actual result of the operation.

    Closes-Bug: 2072483
    Change-Id: I373dde3a07332184c43d9605bad7a59c70241a71
    (cherry picked from commit ea131dd1442861cb5884f99b6bb9e47e397605ce)
    (cherry picked from commit 633e85c9c07f85de36677137ea15bc3a7f4feb04)
    (cherry picked from commit 3b3141baa38a8dfbf37e7633cf9bd62898a545da)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 29.0.0.0b3

This issue was fixed in the openstack/glance 29.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 2023.1-eom

This issue was fixed in the openstack/glance 2023.1-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 27.1.1

This issue was fixed in the openstack/glance 27.1.1 Bobcat release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 28.2.0

This issue was fixed in the openstack/glance 28.2.0 Caracal 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.