cinder/cinder/objects
Alan Bishop bec756e040 Fix how backups handle encryption key IDs
As described in the launchpad bug [1], backup operations must take care
to ensure encryption key ID resources aren't lost, and that restored
volumes always have a unique encryption key ID.

[1] https://bugs.launchpad.net/cinder/+bug/1745180

This patch adds an 'encryption_key_id' column to the backups table. Now,
when a backup is created and the source volume's encryption key is
cloned, the cloned key ID is stored in the table. This makes it possible
to delete the cloned key ID when the backup is deleted. The code that
clones the volume's encryption key has been relocated from the common
backup driver layer to the backup manager. The backup manager now has
full responsibility for managing encryption key IDs.

When restoring a backup of an encrypted volume, the backup manager now
does this:
1) If the restored volume's encryption key ID has changed, delete the
   key ID it had prior to the restore operation. This ensures no key IDs
   are leaked.
2) If the 'encryption_key_id' field in the backup table is empty, glean
   the backup's cloned key ID from the backup's "volume base metadata."
   This helps populate the 'encryption_key_id' column for backup table
   entries created prior to when the column existed.
3) Re-clone the backup's key ID to ensure the restored volume's key ID
   is always unique.

Closes-Bug: #1745180
Change-Id: I6cadcbf839d146b2fd57d7019f73dce303f9e10b
2018-01-30 22:12:49 +00:00
..
__init__.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
backup.py Fix how backups handle encryption key IDs 2018-01-30 22:12:49 +00:00
base.py Fix how backups handle encryption key IDs 2018-01-30 22:12:49 +00:00
cgsnapshot.py Fix replication freeze mechanism 2017-01-19 10:42:24 +01:00
cleanable.py Trivial fix PEP 8 coding style violation and typo 2017-05-03 19:47:22 +07:00
cleanup_request.py Add cleanable base object and cleanup request VO 2016-10-04 15:17:31 +02:00
cluster.py Make Replication support Active-Active 2017-01-19 10:42:18 +01:00
consistencygroup.py CG API changes for migrating CGs 2016-11-22 19:08:20 -05:00
dynamic_log.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
fields.py Merge "Fix connection_info field in VolumeAttachment object" 2017-06-27 10:27:50 +00:00
group.py Add group to cluster when init host 2017-07-12 14:08:43 +08:00
group_snapshot.py OVO: Remove child_versions from list classes 2017-05-25 13:00:13 +02:00
group_type.py OVO: Remove child_versions from list classes 2017-05-25 13:00:13 +02:00
manageableresources.py Switch ManageableSnaphots & ManageableVolumes list to OVO 2017-01-25 00:41:30 +00:00
qos_specs.py OVO: Remove child_versions from list classes 2017-05-25 13:00:13 +02:00
request_spec.py Support create volume from backup 2017-11-28 09:16:59 +08:00
service.py Make service object UUID not nullable 2017-10-26 10:17:50 -06:00
snapshot.py Validate volume status again when snapshot created 2017-12-29 02:56:44 +00:00
volume.py Add shared_targets flag to Volumes 2017-11-28 13:55:23 -07:00
volume_attachment.py Add online data migration routine for attachment_specs 2017-12-19 16:42:08 -05:00
volume_type.py Add is_replicated() to Volume and VolumeType OVOs 2017-05-30 10:16:05 +02:00