NFS: revert to snapshot not working

Bug #1946059 reported by Rajat Dhasmana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Rajat Dhasmana

Bug Description

When reverting to a snapshot, incase of NFS driver, the following error trace is observed

ERROR oslo_messaging.rpc.server Traceback (most recent call last):
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1187, in revert_to_snapshot
ERROR oslo_messaging.rpc.server LOG.exception(msg, msg_args)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1157, in revert_to_snapshot
ERROR oslo_messaging.rpc.server self._revert_to_snapshot(context, volume, snapshot)
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1099, in _revert_to_snapshot
ERROR oslo_messaging.rpc.server self._revert_to_snapshot_generic(context, volume, snapshot)
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1089, in _revert_to_snapshot_generic
ERROR oslo_messaging.rpc.server temp_vol.destroy()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1072, in _revert_to_snapshot_generic
ERROR oslo_messaging.rpc.server self.message_api.create_from_request_context(
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1068, in _revert_to_snapshot_generic
ERROR oslo_messaging.rpc.server temp_vol = self.driver._create_temp_volume_from_snapshot(
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/driver.py", line 1376, in _create_temp_volume_from_snapshot
ERROR oslo_messaging.rpc.server temp_vol_ref.destroy()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1072, in _revert_to_snapshot_generic
ERROR oslo_messaging.rpc.server self.message_api.create_from_request_context(
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/manager.py", line 1068, in _revert_to_snapshot_generic
ERROR oslo_messaging.rpc.server temp_vol = self.driver._create_temp_volume_from_snapshot(
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/driver.py", line 1376, in _create_temp_volume_from_snapshot
ERROR oslo_messaging.rpc.server temp_vol_ref.destroy()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
ERROR oslo_messaging.rpc.server self.force_reraise()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
ERROR oslo_messaging.rpc.server raise self.value
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/driver.py", line 1370, in _create_temp_volume_from_snapshot
ERROR oslo_messaging.rpc.server model_update = self.create_volume_from_snapshot(temp_vol_ref,
ERROR oslo_messaging.rpc.server File "<decorator-gen-767>", line 2, in create_volume_from_snapshot
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/coordination.py", line 186, in _synchronized
ERROR oslo_messaging.rpc.server return f(*a, **k)
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/drivers/remotefs.py", line 1912, in create_volume_from_snapshot
ERROR oslo_messaging.rpc.server return self._create_volume_from_snapshot(volume, snapshot)
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/drivers/remotefs.py", line 1397, in _create_volume_from_snapshot
ERROR oslo_messaging.rpc.server self._validate_state(status, acceptable_states,
ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/volume/drivers/remotefs.py", line 266, in _validate_state
ERROR oslo_messaging.rpc.server raise invalid_exc(
ERROR oslo_messaging.rpc.server cinder.exception.InvalidSnapshot: Invalid snapshot state. Acceptable states for this operation: ['available', 'backing-up']. Current snapshot state: restoring.
ERROR oslo_messaging.rpc.server

summary: - revert to snapshot not working in nfs driver
+ NFS: revert to snapshot not working
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Changed in cinder:
importance: Undecided → Medium
tags: added: generic-nfs nfs snapshot
Changed in cinder:
importance: Medium → High
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :

Should we enable volume-revert-to-snapshot NFS tests https://review.opendev.org/c/openstack/devstack-plugin-nfs/+/812716

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/812429
Committed: https://opendev.org/openstack/cinder/commit/862edca0deb366ea980485359216fea020a03c9e
Submitter: "Zuul (22348)"
Branch: master

commit 862edca0deb366ea980485359216fea020a03c9e
Author: whoami-rajat <email address hidden>
Date: Tue Oct 5 01:43:18 2021 -0400

    NFS: Fix generic revert to snapshot flow

    While reverting to a snapshot with generic flow, we create a
    temporary volume from snapshot and copy data from temporary to the
    original volume.
    While creating this temporary volume, the snapshot is in 'restoring'
    state whereas the remotefs driver only accepts 'available' and
    'backing-up' states for this operation.
    This patch adds the 'restoring' state to the list of acceptable states.

    Closes-Bug: 1946059

    Change-Id: Id1e40fd42b88c63dbbba2aaae77c40660ddac4c7

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 21.0.0.0rc1

This issue was fixed in the openstack/cinder 21.0.0.0rc1 release candidate.

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

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/cinder/+/859839

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/cinder/+/859840

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/cinder/+/859841

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/859839
Committed: https://opendev.org/openstack/cinder/commit/a3c8857ee30205a2f0d0302728b3bcd4db8419fc
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit a3c8857ee30205a2f0d0302728b3bcd4db8419fc
Author: whoami-rajat <email address hidden>
Date: Tue Oct 5 01:43:18 2021 -0400

    NFS: Fix generic revert to snapshot flow

    While reverting to a snapshot with generic flow, we create a
    temporary volume from snapshot and copy data from temporary to the
    original volume.
    While creating this temporary volume, the snapshot is in 'restoring'
    state whereas the remotefs driver only accepts 'available' and
    'backing-up' states for this operation.
    This patch adds the 'restoring' state to the list of acceptable states.

    Closes-Bug: 1946059

    Change-Id: Id1e40fd42b88c63dbbba2aaae77c40660ddac4c7
    (cherry picked from commit 862edca0deb366ea980485359216fea020a03c9e)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/859840
Committed: https://opendev.org/openstack/cinder/commit/d941ad28f5834bdb3c1413ca03046ac7bcf2c5fd
Submitter: "Zuul (22348)"
Branch: stable/xena

commit d941ad28f5834bdb3c1413ca03046ac7bcf2c5fd
Author: whoami-rajat <email address hidden>
Date: Tue Oct 5 01:43:18 2021 -0400

    NFS: Fix generic revert to snapshot flow

    While reverting to a snapshot with generic flow, we create a
    temporary volume from snapshot and copy data from temporary to the
    original volume.
    While creating this temporary volume, the snapshot is in 'restoring'
    state whereas the remotefs driver only accepts 'available' and
    'backing-up' states for this operation.
    This patch adds the 'restoring' state to the list of acceptable states.

    Closes-Bug: 1946059

    Change-Id: Id1e40fd42b88c63dbbba2aaae77c40660ddac4c7
    (cherry picked from commit 862edca0deb366ea980485359216fea020a03c9e)
    (cherry picked from commit 1dc950b826acdab740cbcfbe119c0c31a9833a07)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/859841
Committed: https://opendev.org/openstack/cinder/commit/ebc27d371450dccbba49443ab9094484a4f9905c
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit ebc27d371450dccbba49443ab9094484a4f9905c
Author: whoami-rajat <email address hidden>
Date: Tue Oct 5 01:43:18 2021 -0400

    NFS: Fix generic revert to snapshot flow

    While reverting to a snapshot with generic flow, we create a
    temporary volume from snapshot and copy data from temporary to the
    original volume.
    While creating this temporary volume, the snapshot is in 'restoring'
    state whereas the remotefs driver only accepts 'available' and
    'backing-up' states for this operation.
    This patch adds the 'restoring' state to the list of acceptable states.

    Closes-Bug: 1946059

    Change-Id: Id1e40fd42b88c63dbbba2aaae77c40660ddac4c7
    (cherry picked from commit 862edca0deb366ea980485359216fea020a03c9e)
    (cherry picked from commit 1dc950b826acdab740cbcfbe119c0c31a9833a07)
    (cherry picked from commit d941ad28f5834bdb3c1413ca03046ac7bcf2c5fd)

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

This issue was fixed in the openstack/cinder 18.2.1 release.

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

This issue was fixed in the openstack/cinder 19.2.0 release.

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

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