create snapshot failed

Bug #1739995 reported by TommyLike
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
TommyLike

Bug Description

When creating snapshot, we could delete the volume right after the creation of snapshot record in database, that means the cinder-volume service could not really create snapshot at backend and the snapshot can never be deletable again.

ERROR log:
```
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/objects/cleanable.py", line 207, in wrapper
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1067, in create_snapshot
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server snapshot.save()
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server self.force_reraise()
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1059, in create_snapshot
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server model_update = self.driver.create_snapshot(snapshot)
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 470, in create_snapshot
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server snapshot['volume_name'],
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 774, in __getit
Dec 25 14:25:02 SZX1000299228 cinder-volume[30425]: ERROR oslo_messaging.rpc.server return getattr(self, name)

```

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

Reviewed: https://review.openstack.org/529993
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7ccfb2c8d94824321d4bfca7266c5d72674c061f
Submitter: Zuul
Branch: master

commit 7ccfb2c8d94824321d4bfca7266c5d72674c061f
Author: TommyLike <email address hidden>
Date: Mon Dec 25 09:19:20 2017 +0800

    Validate volume status again when snapshot created

    In a multitask environment, the volume can be deleted
    after the snapshot record is created. Add the validation
    right after the creation to avoid undeletable snapshot.

    Closes-Bug: #1739995

    Change-Id: Icbe86473243871996483fdc96c079b8861bac2e5

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/530964

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

Reviewed: https://review.openstack.org/530964
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=78cd77edef1a08f0472b8df0409adebb9b12e865
Submitter: Zuul
Branch: stable/pike

commit 78cd77edef1a08f0472b8df0409adebb9b12e865
Author: TommyLike <email address hidden>
Date: Mon Dec 25 09:19:20 2017 +0800

    Validate volume status again when snapshot created

    In a multitask environment, the volume can be deleted
    after the snapshot record is created. Add the validation
    right after the creation to avoid undeletable snapshot.

    Closes-Bug: #1739995

    Change-Id: Icbe86473243871996483fdc96c079b8861bac2e5
    (cherry picked from commit 7ccfb2c8d94824321d4bfca7266c5d72674c061f)
    Conflicts:
     cinder/tests/unit/api/v3/test_snapshots.py
     cinder/tests/unit/volume/test_volume.py

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0b3

This issue was fixed in the openstack/cinder 12.0.0.0b3 development milestone.

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

This issue was fixed in the openstack/cinder 11.1.0 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.