Bug 2162093

Summary: [RBD] Image encryption - RFE - Error message improvement needed as we see the same error message for incorrect encryption format/passphrase
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Preethi <pnataraj>
Component: RBDAssignee: Ilya Dryomov <idryomov>
Status: NEW --- QA Contact: Preethi <pnataraj>
Severity: low Docs Contact:
Priority: high    
Version: 6.0CC: ceph-eng-bugs, cephqe-warriors
Target Milestone: ---   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Preethi 2023-01-18 18:49:02 UTC
Description of problem:[RBD] Image encryption - RFE - Error message improvement needed as we see the same error message for incorrect encryption format/passphrase

Ceph version-
ceph version 17.2.5-58.el9cp (16442de8e6d5a0e3579858f2df1407d21043bc4b) quincy (stable)


How reproducible:


Steps to Reproduce:
1)Create RBD image1 
2)Apply encryption format LUKS1/LUKS2 to the RBD image1 [root@magna021 ubuntu]# rbd encryption format mypool/myimage6 luks2 passphrase.bin

3)load encryption

4) create file system and mount the device 
5)Run IOs

6) Create a clone  i.e RBD image2, from the snapshot of RBD image1 

7) Encrypt the image with LUKS2 and different passphrase -In this steps Pass incorrect formats and passphrase keys

Actual result-  below output when incorrect format is provided for
example LUKS1 instead of LUKS2 to the clone and image vice versa insted we expect the error message to tell us that format given to the clone/image is incorrect so that users can easily identify the mistake

[root@magna021 ubuntu]# rbd device map -t nbd -o encryption-format=luks2,encryption-passphrase-file=passphrase.bin mypool/myclone2
rbd-nbd: failed to load encryption: 2023-01-17T05:43:05.233+0000 7fe5077fe640 -1 librbd::crypto::LoadRequest: 0x56393dcd5980 handle_load: failed to load encryption. image name: myclone2
(22) Invalid argument
rbd: rbd-nbd failed with error: /usr/bin/rbd-nbd: exit status: 1


when incorrect passphrase supplied to the clone image we get the below error- we expect the error message to throw if clone or image of the passphrase is incorrect  
here, below i have provided passphrase only for the image but not passing for clone image - there was no error message to tell us that we should pass clone format and encryption prior to the image format and passphrase 

[root@magna021 ubuntu]# rbd device map -t nbd -o encryption-format=luks1,encryption-passphrase-file=passphrase.bin mypool/myclone2
rbd-nbd: failed to load encryption: 2023-01-17T05:43:17.380+0000 7f04daffd640 -1 librbd::crypto::LoadRequest: 0x56504bcb5e50 handle_load: failed to load encryption. image name: myclone2
(1) Operation not permitted
rbd: rbd-nbd failed with error: /usr/bin/rbd-nbd: exit status: 1
[root@magna021 ubuntu]#  
 




Actual results:


Expected results:


Additional info: