Revert to snapshot fails with mounted share in LVM driver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
High
|
Ben Swartzlander |
Bug Description
I'm currently trying to use the new feature "revert to snapshot" in Manila LVM driver following these steps:
1 - created a share "lvm_share1" in lvm backend;
2 - added rules to use this share and added files to it;
3 - created a snapshot "snap1";
4 - modified files in share;
5 - tried to revert to snap1:
$ manila revert-to-snapshot snap1
This operation fails and share status became reverting_error. Traceback in log:
2017-01-20 13:04:46.380 DEBUG oslo_concurrenc
2017-01-20 13:04:46.517 ERROR oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
2017-01-20 13:04:46.517 TRACE oslo_messaging.
After this error, the snapshot is in merging state, and other lvm operations fails. Like delete:
$ manila snapshot-delete snap1
2017-01-20 13:09:17.893 DEBUG oslo_concurrenc
2017-01-20 13:09:17.895 TRACE manila.share.driver Traceback (most recent call last):
2017-01-20 13:09:17.895 TRACE manila.share.driver File "/opt/stack/
2017-01-20 13:09:17.895 TRACE manila.share.driver self._execute(
2017-01-20 13:09:17.895 TRACE manila.share.driver File "/opt/stack/
2017-01-20 13:09:17.895 TRACE manila.share.driver return processutils.
2017-01-20 13:09:17.895 TRACE manila.share.driver File "/usr/local/
2017-01-20 13:09:17.895 TRACE manila.share.driver cmd=sanitized_cmd)
2017-01-20 13:09:17.895 TRACE manila.share.driver ProcessExecutio
2017-01-20 13:09:17.895 TRACE manila.share.driver Command: sudo manila-rootwrap /etc/manila/
2017-01-20 13:09:17.895 TRACE manila.share.driver Exit code: 5
2017-01-20 13:09:17.895 TRACE manila.share.driver Stdout: u''
2017-01-20 13:09:17.895 TRACE manila.share.driver Stderr: u' Can\'t remove merging snapshot logical volume "share-
As a workaround, I have to remove all rules from lvm share before using revert-to-snapshot, then it works.
Changed in manila: | |
importance: | Undecided → High |
Changed in manila: | |
assignee: | nobody → Ben Swartzlander (bswartz) |
Changed in manila: | |
status: | New → Confirmed |
Changed in manila: | |
milestone: | none → ocata-rc1 |
I've confirmed that the correct fix here is to remove all access during the revert and reapply the access afterwards. My concern is the access code itself. It appears to be written in a way that makes all access rules volatile which would cause a different bug.
Fixing that bug will involve a lot of code change, and it will overlap with the fix for this bug so I'm not sure it makes sense to try to fix this first.