Bug 1931621 - Cinder retype (with migration) from Ceph-encrypted to Ceph-unencrypted using generic migration code in RBD backend fails
Summary: Cinder retype (with migration) from Ceph-encrypted to Ceph-unencrypted using ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Cinder Bugs List
QA Contact: Evelina Shames
Andy Stillman
URL:
Whiteboard:
Depends On: 1794249
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-22 19:52 UTC by Sofia Enriquez
Modified: 2023-07-29 08:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-2172 0 None None None 2022-06-23 09:47:04 UTC

Description Sofia Enriquez 2021-02-22 19:52:58 UTC
Description of problem:
Cinder tries to migrate the volume in a generic way and it fails because it doesn't know how to handle RBD Objects.
A new implementation should be added to the RBD driver to handle this scenario and avoid using the generic driver
by default.

Version-Release number of selected component (if applicable):
RHOSP 13.0
RHOSP 16.0
RHOSP 16.1
RHOSP 16.2

How reproducible:
Always

Steps to Reproduce:

1. openstack volume type create --encryption-provider nova.volume.encryptors.luks.LuksEncryptor --encryption-cipher aes-xts-plain64 --encryption-key-size 256 --encryption-control-location front-end LuksEncryptor-Template-256
2. cinder create 1 --name encrypt-vol --volume-type LuksEncryptor-Template-256 
3. cinder retype encrypt-vol ceph --migration-policy on-demand

Actual results:

feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     volume.save()
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self.force_reraise()
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     raise self.value
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2535, in migrate_volume
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self._migrate_volume_generic(ctxt, volume, host, new_type_id)
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2296, in _migrate_volume_generic
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self._clean_temporary_volume(ctxt, volume,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self.force_reraise()
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     raise self.value
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2275, in _migrate_volume_generic
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self._copy_volume_data(ctxt, volume, new_volume, remote='dest')
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2166, in _copy_volume_data
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self._detach_volume(ctxt, dest_attach_info, dest_vol,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self.force_reraise()
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     raise self.value
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2159, in _copy_volume_data
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     src_attach_info = self._attach_volume(
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2098, in _attach_volume
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self._detach_volume(ctxt, attach_info, volume, properties,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self.force_reraise()
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     raise self.value
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/manager.py", line 2091, in _attach_volume
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     volume_utils.brick_attach_volume_encryptor(ctxt,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/volume_utils.py", line 1360, in brick_attach_volume_encryptor
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     encryptor = brick_get_encryptor(connection_info,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/cinder/cinder/volume/volume_utils.py", line 1350, in brick_get_encryptor
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     return encryptors.get_volume_encryptor(root_helper=root_helper,
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/os-brick/os_brick/encryptors/__init__.py", line 87, in get_volume_encryptor
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     encryptor = importutils.import_object(
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python3.8/dist-packages/oslo_utils/importutils.py", line 44, in import_object
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     return import_class(import_str)(*args, **kwargs)
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/os-brick/os_brick/encryptors/luks.py", line 56, in __init__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     super(LuksEncryptor, self).__init__(
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/opt/stack/os-brick/os_brick/encryptors/cryptsetup.py", line 61, in __init__
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     self.dev_name = 'crypt-%s' % os.path.basename(self.symlink_path)
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server   File "/usr/lib/python3.8/posixpath.py", line 142, in basename
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server     p = os.fspath(p)
feb 19 23:35:54 devstack cinder-volume[127895]: ERROR oslo_messaging.rpc.server TypeError: expected str, bytes or os.PathLike object, not RBDVolumeIOWrapper

Expected results:
Volume type should be Ceph

Additional info:
As far as I understand this will be fixed when implementing https://bugzilla.redhat.com/show_bug.cgi?id=1794249


Note You need to log in before you can comment on or make changes to this bug.