nova instance snapshot does not wait for volume snaps

Bug #1980657 reported by Vladislav Belogrudov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Vladislav Belogrudov

Bug Description

Currently when snapping a boot-from-volume instance nova immediately returns success and glance reports active image. Snapping of disks can take some time and if we try to launch a new instance from that image as soon as we get active image state we get error. Nova should wait until all snaps are ready before returning success.

relevant code lines:
https://github.com/openstack/nova/blob/512fbdfa9933f2e9b48bcded537ffb394979b24b/nova/compute/api.py#L3445

because in my backend setup snaps are somewhat long I always fail multiattach tempest test:

{0} tearDownClass (tempest.api.compute.volumes.test_attach_volume.AttachVolumeMultiAttachTest) [0.000000s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/opt/stack/tempest/tempest/test.py", line 220, in tearDownClass
    raise value.with_traceback(trace)

      File "/opt/stack/tempest/tempest/test.py", line 192, in tearDownClass
    teardown()

      File "/opt/stack/tempest/tempest/test.py", line 602, in resource_cleanup
    raise testtools.MultipleExceptions(*cleanup_errors)

    testtools.runtest.MultipleExceptions: (<class 'tempest.lib.exceptions.BadRequest'>, Bad request
Details: {'code': 400, 'message': 'Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots, awaiting a transfer, or be disassociated from snapshots after volume transfer.'}, <traceback object at 0x7f622cbbdc80>)

This happens because we try to delete boot volume and snap while snap is not ready. Also this trace is while trying to create a new instance from 'active' image:

юл 04 11:13:10 openstack-dev-00 nova-compute[1034924]: ERROR nova.compute.manager [None req-8122e11f-b490-4c68-b447-e35c3ad21cdf demo admin] [instance: 10cefe2f-ac44-4cb8-9006-28443481ba9d] Build of instance 10cefe2f-ac44-4cb8-9006-28443481ba9d aborted: Invalid input received: Invalid snapshot: Originating snapshot status must be one of 'available' values (HTTP 400) (Request-ID: req-32350814-f125-448f-a620-dc8526e6256b): nova.exception.BuildAbortException: Build of instance 10cefe2f-ac44-4cb8-9006-28443481ba9d aborted: Invalid input received: Invalid snapshot: Originating snapshot status must be one of 'available' values (HTTP 400) (Request-ID: req-32350814-f125-448f-a620-dc8526e6256b)

Changed in nova:
assignee: nobody → Vladislav Belogrudov (vlad-belogrudov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
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.