Description of problem:
Failed to open LUKS encrypted disk on rhel9
Version-Release number of selected component (if applicable):
virt-v2v-1.45.1-1.el9.1.x86_64
libguestfs-1.45.6-7.el9.x86_64
qemu-kvm-6.0.0-6.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Convert a guest which has luks encryption disks.
# virt-v2v -i libvirt -ic vpx://root.x.x/data/x.x.x.x/?no_verify=1 -o null esx6.7-rhel7.8-swap_luks-non_os_3luks-xxx -it vddk -io vddk-libdir=/root/vddk_libdir/latest -io vddk-thumbprint=xxx -ip /root/v2v_vpx_passwd
2. Type correct password.
Actual results:
libguestfs: trace: v2v: luks_uuid "/dev/sda3"
command: blkid returned 0^M
command: blkid: stdout:^M
crypto_LUKS^M
guestfsd: => vfs_type (0xc6) took 0.01 secs^M
guestfsd: <= luks_uuid (0x1fb) request length 56 bytes^M
commandrvf: stdout=n stderr=y flags=0x0^M
commandrvf: udevadm --debug settle -E /dev/sda3^M
SELinux enabled state cached to: disabled^M
No filesystem is currently mounted on /sys/fs/cgroup.^M
Failed to determine unit we run in, ignoring: No data available^M
commandrvf: stdout=y stderr=y flags=0x0^M
commandrvf: cryptsetup luksUUID /dev/sda3^M
libguestfs: trace: v2v: luks_uuid = "37990053-c744-4f9e-ba7b-1944d18ac3db"
libguestfs: trace: v2v: cryptsetup_open "/dev/sda3" "***" "cryptsda3"
guestfsd: => luks_uuid (0x1fb) took 0.01 secs^M
guestfsd: <= cryptsetup_open (0x1fc) request length 96 bytes^M
commandrvf: stdout=n stderr=y flags=0x0^M
commandrvf: udevadm --debug settle -E /dev/sda3^M
SELinux enabled state cached to: disabled^M
No filesystem is currently mounted on /sys/fs/cgroup.^M
Failed to determine unit we run in, ignoring: No data available^M
command: blkid '-c' '/dev/null' '-o' 'value' '-s' 'TYPE' '/dev/sda3'^M
command: blkid returned 0^M
command: blkid: stdout:^M
crypto_LUKS^M
command: cryptsetup '-d' '/tmp/crypt9878fa.key' 'open' '/dev/sda3' 'cryptsda3' '--type' 'luks'^M
command: cryptsetup returned 1^M
command: cryptsetup: stderr:^M
Cannot open keyslot (using hash sha256).^M
ocaml_exn: 'cryptsetup_open' raised 'Failure' exception^M
guestfsd: error: cryptsetup exited with status 1: Cannot open keyslot (using hash sha256).^M
guestfsd: => cryptsetup_open (0x1fc) took 0.02 secs^M
libguestfs: trace: v2v: cryptsetup_open = -1 (error)
/usr/bin/virt-v2v: could not find key to open LUKS encrypted /dev/sda3.
Try using --key on the command line.
Original error: cryptsetup_open: cryptsetup exited with status 1: Cannot open keyslot (using hash sha256). (0)
Expected results:
v2v should run success.
Additional info:
The issue cannot be reproduced by libguestfs-1.45.6-6.el9.x86_64
Comment 1Richard W.M. Jones
2021-06-29 14:44:36 UTC