Unable to restore encrypted volume - restored with the wrong volume type

Bug #1567263 reported by Benny Kopilov
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Medium
Yao wang

Bug Description

Hi,
Setup : debian with devstack installation .
Description: The setup is configured with local lvm backend for cinder.
[lvmdriver-1]
lvm_type = default
iscsi_helper = tgtadm
volume_group = stack-volumes-lvmdriver-1
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name = lvmdriver-1

When we create an encrypted volume-type , the volume backup action done successfully but restore fails.
The reason is that restore action done on the wrong volume type ( default LVM and not encrypted type)

stack@debian:~$ cinder type-list
+--------------------------------------+--------------------------------------------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+--------------------------------------------+-------------+-----------+
| 73dba26b-9e1a-4203-a622-4fd5527ac704 | lvmdriver-1 | - | True |
| abf68fd7-6f29-49f1-810a-f5179dfe5c41 | tempest-scenario-type-cryptsetup-766034649 | - | True |
+--------------------------------------+--------------------------------------------+-------------+-----------+

stack@debian:~$ cinder type-show tempest-scenario-type-cryptsetup-766034649
+---------------------------------+--------------------------------------------+
| Property | Value |
+---------------------------------+--------------------------------------------+
| description | None |
| extra_specs | {} |
| id | abf68fd7-6f29-49f1-810a-f5179dfe5c41 |
| is_public | True |
| name | tempest-scenario-type-cryptsetup-766034649 |
| os-volume-type-access:is_public | True |
| qos_specs_id | None |
+---------------------------------+--------------------------------------------+

stack@debian:~$ cinder show 212cf84a-81c0-41bf-967a-13f62d20870b
+--------------------------------+----------------------------------------------+
| Property | Value |
+--------------------------------+----------------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2016-04-07T07:22:10.000000 |
| description | None |
| encrypted | True |
| id | 212cf84a-81c0-41bf-967a-13f62d20870b |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | tempest-TestEncryptedCinderVolumes-743000316 |
| os-vol-host-attr:host | debian.example.com@lvmdriver-1#lvmdriver-1 |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | b15fbad351a54d12b03ce67608c2d545 |
| replication_status | disabled |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2016-04-07T07:29:39.000000 |
| user_id | e247edd4759345ab900ece2f2285c7ca |
| volume_type | tempest-scenario-type-cryptsetup-766034649 |
+--------------------------------+----------------------------------------------+

stack@debian:~$ cinder backup-show 22d47be8-f151-461a-be90-e33553ccf711
+-----------------------+----------------------------------------+
| Property | Value |
+-----------------------+----------------------------------------+
| availability_zone | nova |
| container | volumebackups |
| created_at | 2016-04-07T07:28:54.000000 |
| data_timestamp | 2016-04-07T07:28:54.000000 |
| description | None |
| fail_reason | None |
| has_dependent_backups | False |
| id | 22d47be8-f151-461a-be90-e33553ccf711 |
| is_incremental | False |
| name | tempest-scenario-type-backup-513595382 |
| object_count | 22 |
| size | 1 |
| snapshot_id | None |
| status | available |
| updated_at | 2016-04-07T07:29:39.000000 |
| volume_id | 212cf84a-81c0-41bf-967a-13f62d20870b |
+-----------------------+----------------------------------------+

stack@debian:~$ cinder list --all-tenants
+--------------------------------------+----------------------------------+-----------------+-----------------------------------------------------+------+--------------------------------------------+----------+-------------+
| ID | Tenant ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------------------------------+-----------------+-----------------------------------------------------+------+--------------------------------------------+----------+-------------+
| 212cf84a-81c0-41bf-967a-13f62d20870b | b15fbad351a54d12b03ce67608c2d545 | available | tempest-TestEncryptedCinderVolumes-743000316 | 1 | tempest-scenario-type-cryptsetup-766034649 | false | |
| b3ae2e35-180d-4181-8662-e33a08ce2532 | 833254ee96fc43b79dd9d17441b78c40 | error_restoring | restore_backup_22d47be8-f151-461a-be90-e33553ccf711 | 1 | lvmdriver-1 | false | |
+--------------------------------------+----------------------------------+-----------------+-----------------------------------------------------+------+--------------------------------------------+----------+-------------+

Thanks,
Benny

Revision history for this message
Benny Kopilov (bkopilov) wrote :
Revision history for this message
Benny Kopilov (bkopilov) wrote :

The problem caused when we have existing type and its the main backend , restore wont work for encrypted volumes.
Once we delete volume-type , restore works !
Why ?

Benny

Revision history for this message
Benny Kopilov (bkopilov) wrote :

Example:
After devstack install we have a default volume-type
stack@debian:~$ cinder type-list
+--------------------------------------+-------------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+-------------+-------------+-----------+
| 73dba26b-9e1a-4203-a622-4fd5527ac704 | lvmdriver-1 | - | True |
+--------------------------------------+-------------+-------------+-----------+

-----> in this case restore encrypted volume wont work.
Once we delete the volume-type and create encrypted volume type - restore backup works

Cao ShuFeng (caosf-fnst)
Changed in cinder:
assignee: nobody → Cao ShuFeng (caosf-fnst)
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/303709

Changed in cinder:
status: New → In Progress
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Sean McGinnis (<email address hidden>) on branch: master
Review: https://review.openstack.org/303709
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Eric Harney (eharney)
Changed in cinder:
status: In Progress → New
Jay Bryant (jsbryant)
tags: added: bugsmash
Revision history for this message
Brianna Poulos (brianna-poulos) wrote :
Download full text (4.2 KiB)

If a volume is created with the correct, encrypted volume type, and the backup is restored to the new volume, the restore succeeds.

For example:
openstack volume create --size 1 --type LUKS 'encrypted volume'
openstack volume backup restore aeb48e31-6476-454f-8faf-17e7bf803987 'encrypted volume'

However, it's still the case that doing a plain backup-restore without defining a destination volume will fail.

For example:
cinder backup-restore aeb48e31-6476-454f-8faf-17e7bf803987

This has the following stack trace:
ERROR oslo_messaging.rpc.server [None req-a257a2d9-b9d8-414b-a50c-7bc6c2ad2be6 demo None] Exception during message handling: EncryptedBackupOperationFailed: The source volume type '42544a34-db4a-4e41-94cd-7f7d7509537c' is different than the destination volume type '600773cf-d16d-4dd0-9168-7163f3ea6ec8'.
cinder-backup[3740]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
cinder-backup[3740]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch
cinder-backup[3740]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch
cinder-backup[3740]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 513, in restore_backup
cinder-backup[3740]: ERROR oslo_messaging.rpc.server backup.save()
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
cinder-backup[3740]: ERROR oslo_messaging.rpc.server self.force_reraise()
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
cinder-backup[3740]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 507, in restore_backup
cinder-backup[3740]: ERROR oslo_messaging.rpc.server self._run_restore(context, backup, volume)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 542, in _run_restore
cinder-backup[3740]: ERROR oslo_messaging.rpc.server device_file)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/chunkeddriver.py", line 703, in restore
cinder-backup[3740]: ERROR oslo_messaging.rpc.server self.put_metadata(volume_id, volume_meta)
cinder-backup[3740]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/driver.py", line 363, in put_metadata
cinder-backup[3740]: ERRO...

Read more...

Eric Harney (eharney)
Changed in cinder:
assignee: Cao ShuFeng (caosf-fnst) → Eric Harney (eharney)
Changed in cinder:
assignee: Eric Harney (eharney) → Yao wang (wangyao18322710251)
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.