volume from snapshot fails with thin-provisioning

Bug #1702322 reported by Thomas Bechtold
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Thomas Bechtold

Bug Description

Since commit Ia47ca585985917f998e0a3d4cec36912ce57f579, creating a volume from a snapshot fails with:

1',volume_attachment=<?>,volume_type=<?>,volume_type_id=None)}
           |__Flow 'volume_create_manager': ProcessExecutionError: Unexpected error while running command.
Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf dd if=/dev/mapper/cinder--volumes-_snapshot--900d921d--01a4--459a--8aa7--f68b971f5647 of=/dev/mapper/cinder--volumes-volume--72c8563a--575e--4f6a--889f--4bd1ed7f1502 count=1073741824 bs=1M iflag=count_bytes conv=sparse
Exit code: 1
Stdout: u''
Stderr: u"/bin/dd: failed to open '/dev/mapper/cinder--volumes-_snapshot--900d921d--01a4--459a--8aa7--f68b971f5647': No such file or directory\n"
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager Traceback (most recent call last):
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager result = task.execute(**arguments)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 906, in execute
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager **volume_spec)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 450, in _create_from_snapshot
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager snapshot)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 423, in create_volume_from_snapshot
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager sparse=self._sparse_copy_volume)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py", line 585, in copy_volume
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager sparse=sparse)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/utils.py", line 469, in _copy_volume_with_path
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager execute(*cmd, run_as_root=True)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 123, in execute
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager return processutils.execute(*cmd, **kwargs)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 400, in execute
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager cmd=sanitized_cmd)
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager ProcessExecutionError: Unexpected error while running command.
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf dd if=/dev/mapper/cinder--volumes-_snapshot--900d921d--01a4--459a--8aa7--f68b971f5647 of=/dev/mapper/cinder--volumes-volume--72c8563a--575e--4f6a--889f--4bd1ed7f1502 count=1073741824 bs=1M iflag=count_bytes conv=sparse
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager Exit code: 1
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager Stdout: u''
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager Stderr: u"/bin/dd: failed to open '/dev/mapper/cinder--volumes-_snapshot--900d921d--01a4--459a--8aa7--f68b971f5647': No such file or directory\n"
2017-07-04 13:30:23.990 23460 ERROR cinder.volume.manager
2017-07-04 13:30:23.993 23460 DEBUG cinder.volume.manager [req-c7a9c5bf-0a1a-43b7-9e28-ce0bce38421d 9d55465e413a4e2395c7c08ef9a8b161 6f18670a69ea463b951fc61aa01b7605 - default default] Task 'cinder.volume.flows.manager.create_volume.CreateVolumeFromSpecTask;volume:create' (a88ec93a-1683-4716-b74e-1272d8f92a1d) transitioned into state 'REVERTING' from state 'FAILURE' _task_receiver /usr/lib/python2.7/site-packages/taskflow/listeners/logging.py:194

The problem is, that the LV is not active and because of that, there is no device node (that's why it fails with "No such file or directory")

Steps to reproduce:
1) make sure the provision type for the enabled backend is "lvm_type=thin"
2a) Run tempest test ^tempest.scenario.test_volume_boot_pattern.TestVolumeBootPatternV2.test_volume_boot_pattern
or 2b) call the following commands to trigger the bug:
3) cinder create 1
4) cinder snapshot-create --name snap1 $VOLUME_UUID
5) cinder create --snapshot-id $SNAPSHOT_UUID 1 --name from-snap1

description: updated
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/480226

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

Reviewed: https://review.openstack.org/480226
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e8f1b419a4c28c87911063956053fae60c0f9a65
Submitter: Jenkins
Branch: master

commit e8f1b419a4c28c87911063956053fae60c0f9a65
Author: Thomas Bechtold <email address hidden>
Date: Tue Jul 4 15:16:10 2017 +0000

    Revert "Don't use ignoreskipactivation for thin LVM"

    Commit 8f5e10d7ed8eead221cccb6a0ccf1afea310b0a9 wrongly assumed that
    the "ignoreskipactivation" flag is not needed when using thin LVM
    provisioning. This is wrong.
    Using thin LVM leads now to an error when the content will be copied:

    ERROR cinder.volume.manager Command: sudo cinder-rootwrap /etc/cinder/
          rootwrap.conf dd if=/dev/mapper/cinder--volumes-_snapshot--UUID
          of=/dev/mapper/cinder--volumes-volume--UUID
          count=1073741824 bs=1M iflag=count_bytes conv=sparse

    The reason is that the the snapshot is not activated and due to that,
    no device node is available under /dev/mapper .

    This reverts commit 8f5e10d7ed8eead221cccb6a0ccf1afea310b0a9 and makes
    thin provisioning for LVM working again.

    Change-Id: I788b297af92e11063b18c05a415b6f4d4d4bcd2c
    Closes-Bug: #1702322
    Related-Bug: #1701545

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

This issue was fixed in the openstack/os-brick 1.15.0 release.

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

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.